Skip to content
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
14 changes: 13 additions & 1 deletion pinc/ProjectState.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ProjectState
public readonly string $name,
public readonly string $medium_label,
public readonly string $label,
public readonly int $forum,
public readonly ?int $forum,
public readonly string $phase,
public readonly string $star_metal
) {
Expand Down Expand Up @@ -231,6 +231,18 @@ function declare_project_states(array $rounds, array $pools): void
''
));

// for "parking" a project

define("PROJ_PARKED", "project_parked");
ProjectStates::add_state(new ProjectState(
PROJ_PARKED,
_("Project Parked"),
_("Project Parked"),
SiteConfig::get()->parked_projects_forum_idx,
'PARKED',
''
));

// for the 'deletion' of a project

define("PROJ_DELETE", "project_delete");
Expand Down
24 changes: 24 additions & 0 deletions pinc/ProjectTransition.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,29 @@ function create_project_transitions(): array
]
);

// -----------------------------------------------------------------------------
// Transitions to PROJ_PARKED.

foreach (ProjectStates::get_states() as $from_state) {
if (in_array($from_state, [PROJ_NEW, PROJ_DELETE, PROJ_PARKED, PROJ_COMPLETE, PROJ_SUBMIT_PG_POSTED])) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line dictates the project states that cannot be parked.

continue;
}

$project_transitions[] = new ProjectTransition(
$from_state,
PROJ_PARKED,
'site_manager',
[
'project_restriction' => null,
'action_name' => _('Park Project'),
'confirmation_question' => _('Are you sure you want to park this project?'),
'detour' => null,
'settings_template' => "modifieddate='<TIMESTAMP>'",
'collateral_actions' => null,
]
);
}

// -----------------------------------------------------------------------------
// Transitions to PROJ_DELETE.

Expand Down Expand Up @@ -1189,6 +1212,7 @@ function create_project_transitions(): array
]
);
}

return $project_transitions;
}

Expand Down
1 change: 1 addition & 0 deletions pinc/SiteConfig.inc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class SiteConfig
public ?int $posted_projects_forum_idx;
public ?int $deleted_projects_forum_idx;
public ?int $completed_projects_forum_idx;
public ?int $parked_projects_forum_idx;
public ?int $post_processing_forum_idx;
public ?int $teams_forum_idx;

Expand Down