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

Ensure current project is selected for new sprints #2794

Merged
merged 1 commit into from
Nov 18, 2024
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
63 changes: 63 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions app/Domain/Sprints/Templates/sprintdialog.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
<label><?= $tpl->__('label.sprint_name') ?></label>
<input type="text" name="name" value="<?php echo $currentSprint->name?>" placeholder="<?= $tpl->__('label.sprint_name') ?>"/><br />

<?php

function isSelected($projectId, $currentSprint, $currentProject) {
return (isset($currentSprint) && ($currentSprint->projectId == $projectId || $currentProject == $projectId)) ||
(!isset($currentSprint) && $currentProject == $projectId);
}

$currentProject = session('currentProject');
?>
<label><?= $tpl->__('label.project') ?></label>
<select name="projectId">
<?php foreach ($allAssignedprojects as $project) { ?>
<option value="<?= $project['id'] ?>"
<?php
if (isset($currentSprint)) {
if ($currentSprint->projectId == $project['id']) {
echo 'selected';
}
} elseif (session('currentProject') == $project['id']) {
echo 'selected';
}
?>
<option value="<?= $project['id'] ?>" <?= isSelected($project['id'], $currentSprint ?? null, $currentProject) ? 'selected' : '' ?>
><?= $tpl->escape($project['name']); ?></option>
<?php } ?>
</select><br />
Expand Down
Loading