forked from pkp/omp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#7495 Separate OMP specific things to own controller, incl…
…uding SubmissonFilters form
- Loading branch information
1 parent
65858d7
commit abbc624
Showing
6 changed files
with
448 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* @file classes/components/form/dashboard/SubmissionFilters.php | ||
* | ||
* Copyright (c) 2014-2024 Simon Fraser University | ||
* Copyright (c) 2000-2024 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class SubmissionFilters | ||
* | ||
* @ingroup classes_controllers_form | ||
* | ||
* @brief A preset form to add and remove filters in the submissions dashboard | ||
*/ | ||
|
||
namespace APP\components\forms\dashboard; | ||
|
||
use Illuminate\Support\LazyCollection; | ||
use PKP\components\forms\dashboard\PKPSubmissionFilters; | ||
use PKP\context\Context; | ||
|
||
class SubmissionFilters extends PKPSubmissionFilters | ||
{ | ||
public function __construct( | ||
public Context $context, | ||
public array $userRoles, | ||
public LazyCollection $categories | ||
) { | ||
$this | ||
->addPage(['id' => 'default', 'submitButton' => null]) | ||
->addGroup(['id' => 'default', 'pageId' => 'default']) | ||
->addAssignedTo() | ||
->addCategories() | ||
->addDaysSinceLastActivity() | ||
; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
/** | ||
* @file pages/dashboard/DashboardHandlerNext.php | ||
* | ||
* Copyright (c) 2014-2021 Simon Fraser University | ||
* Copyright (c) 2003-2021 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class DashboardHandlerNext | ||
* | ||
* @ingroup pages_dashboard | ||
* | ||
* @brief Handle requests for user's dashboard. | ||
*/ | ||
|
||
namespace APP\pages\dashboard; | ||
|
||
use APP\components\forms\dashboard\SubmissionFilters; | ||
use APP\core\Request; | ||
use APP\facades\Repo; | ||
use APP\submission\Submission; | ||
use APP\template\TemplateManager; | ||
use PKP\decision\Decision; | ||
use PKP\pages\dashboard\PKPDashboardHandlerNext; | ||
use PKP\submissionFile\SubmissionFile; | ||
|
||
class DashboardHandlerNext extends PKPDashboardHandlerNext | ||
{ | ||
/** | ||
* Setup variables for the template | ||
* | ||
* @param Request $request | ||
*/ | ||
public function setupIndex($request) | ||
{ | ||
parent::setupIndex($request); | ||
|
||
$templateMgr = TemplateManager::getManager($request); | ||
|
||
$templateMgr->assign([ | ||
'pageComponent' => 'Page', | ||
]); | ||
|
||
$templateMgr->setConstants([ | ||
'DECISION_INTERNAL_REVIEW' => Decision::INTERNAL_REVIEW, | ||
'DECISION_RECOMMEND_EXTERNAL_REVIEW' => Decision::RECOMMEND_EXTERNAL_REVIEW, | ||
'DECISION_SKIP_INTERNAL_REVIEW' => Decision::SKIP_INTERNAL_REVIEW, | ||
'DECISION_ACCEPT_INTERNAL' => Decision::ACCEPT_INTERNAL, | ||
'DECISION_PENDING_REVISIONS_INTERNAL' => Decision::PENDING_REVISIONS_INTERNAL, | ||
'DECISION_RESUBMIT_INTERNAL' => Decision::RESUBMIT_INTERNAL, | ||
'DECISION_DECLINE_INTERNAL' => Decision::DECLINE_INTERNAL, | ||
'DECISION_RECOMMEND_ACCEPT_INTERNAL' => Decision::RECOMMEND_ACCEPT_INTERNAL, | ||
'DECISION_RECOMMEND_PENDING_REVISIONS_INTERNAL' => Decision::RECOMMEND_PENDING_REVISIONS_INTERNAL, | ||
'DECISION_RECOMMEND_RESUBMIT_INTERNAL' => Decision::RECOMMEND_RESUBMIT_INTERNAL, | ||
'DECISION_RECOMMEND_DECLINE_INTERNAL' => Decision::RECOMMEND_DECLINE_INTERNAL, | ||
'DECISION_REVERT_INTERNAL_DECLINE' => Decision::REVERT_INTERNAL_DECLINE, | ||
'DECISION_NEW_INTERNAL_ROUND' => Decision::NEW_INTERNAL_ROUND, | ||
'DECISION_CANCEL_INTERNAL_REVIEW_ROUND' => Decision::CANCEL_INTERNAL_REVIEW_ROUND, | ||
|
||
'SUBMISSION_FILE_INTERNAL_REVIEW_FILE' => SubmissionFile::SUBMISSION_FILE_INTERNAL_REVIEW_FILE, | ||
'SUBMISSION_FILE_INTERNAL_REVIEW_REVISION' => SubmissionFile::SUBMISSION_FILE_INTERNAL_REVIEW_REVISION, | ||
|
||
'WORK_TYPE_AUTHORED_WORK' => Submission::WORK_TYPE_AUTHORED_WORK, | ||
'WORK_TYPE_EDITED_VOLUME' => Submission::WORK_TYPE_EDITED_VOLUME, | ||
|
||
]); | ||
} | ||
|
||
|
||
protected function getSubmissionFiltersForm($userRoles, $context) | ||
{ | ||
$categories = Repo::category() | ||
->getCollector() | ||
->filterByContextIds([$context->getId()]) | ||
->getMany(); | ||
|
||
return new SubmissionFilters( | ||
$context, | ||
$userRoles, | ||
$categories | ||
); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* @defgroup pages_submissions Submissions editorial page | ||
*/ | ||
|
||
/** | ||
* @file lib/pkp/pages/dashboard/index.php | ||
* | ||
* Copyright (c) 2014-2021 Simon Fraser University | ||
* Copyright (c) 2003-2021 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @ingroup pages_submissions | ||
* | ||
* @brief Handle requests for submissions functions. | ||
* | ||
*/ | ||
|
||
|
||
switch ($op) { | ||
case 'index': | ||
case 'editorial': | ||
return new APP\pages\dashboard\DashboardHandlerNext(PKP\pages\dashboard\DashboardPage::EditorialDashboard); | ||
case 'mySubmissions': | ||
return new APP\pages\dashboard\DashboardHandlerNext(PKP\pages\dashboard\DashboardPage::MySubmissions); | ||
case 'reviewAssignments': | ||
return new APP\pages\dashboard\DashboardHandlerNext(PKP\pages\dashboard\DashboardPage::MyReviewAssignments); | ||
} |
Oops, something went wrong.