Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted unnecessary code used for Calendar And Task Modules #113

Merged
merged 5 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions components/BaseContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,50 +296,6 @@ public function actionRemoveFile($id, $fileId)
}
}

/**********************************************************************************
* Helpers
*********************************************************************************
*
/*
* Prepare date formats for Calendar entries and Tasks
*
* @param array $requestParams
* @param string $formName
* @param string $modelName
* @return array
* @throws HttpException
*/
protected function prepareRequestParams(array $requestParams, string $formName, string $modelName): array
{
if ($this instanceof TasksController && empty($requestParams[$modelName]['scheduling'])) {
return $requestParams;
}

if (empty($requestParams[$formName]['start_date'])) {
throw new HttpException(400, 'Start date cannot be blank');
} else {
$requestParams[$modelName]['all_day'] = 0;
}

if (empty($requestParams[$formName]['end_date'])) {
throw new HttpException(400, 'End date cannot be blank');
} else {
$requestParams[$modelName]['all_day'] = 0;
}

if (!preg_match(DbDateValidator::REGEX_DBFORMAT_DATE, $requestParams[$formName]['start_date']) &&
!preg_match(DbDateValidator::REGEX_DBFORMAT_DATETIME, $requestParams[$formName]['start_date'])) {
throw new HttpException(400, 'Wrong start date format.');
}

if (!preg_match(DbDateValidator::REGEX_DBFORMAT_DATE, $requestParams[$formName]['end_date']) &&
!preg_match(DbDateValidator::REGEX_DBFORMAT_DATETIME, $requestParams[$formName]['end_date'])) {
throw new HttpException(400, 'Wrong end date format.');
}

return $requestParams;
}

protected function saveRecord(ContentActiveRecord $contentRecord): bool
{
$data = Yii::$app->request->getBodyParam('data', []);
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changelog
- Enh #106: Allow to set `authclient` and `authclient_id` on user creating and updating
- Enh #112: Added support of HttpBearer and QueryParam auth methods
- Enh #117: Added support of user Impersonate
- Enh #113: Deleted unnecessary code used for Calendar And Task Modules

0.8.0 (March 10, 2023)
----------------------
Expand Down