diff --git a/app/config/Migrations/schema-dump-default.lock b/app/config/Migrations/schema-dump-default.lock index c94439fb..3b00c1ee 100644 Binary files a/app/config/Migrations/schema-dump-default.lock and b/app/config/Migrations/schema-dump-default.lock differ diff --git a/app/plugins/Awards/Assets/js/controllers/rec-quick-edit-controller.js b/app/plugins/Awards/Assets/js/controllers/rec-quick-edit-controller.js index 683891e3..43a59cbc 100644 --- a/app/plugins/Awards/Assets/js/controllers/rec-quick-edit-controller.js +++ b/app/plugins/Awards/Assets/js/controllers/rec-quick-edit-controller.js @@ -41,6 +41,7 @@ class AwardsRecommendationQuickEditForm extends Controller { submit(event) { + document.getElementById("recommendation_edit_close").click(); } setAward(event) { let awardId = event.target.dataset.awardId; diff --git a/app/plugins/Awards/src/Controller/RecommendationsController.php b/app/plugins/Awards/src/Controller/RecommendationsController.php index e8c9ec88..511b7aac 100644 --- a/app/plugins/Awards/src/Controller/RecommendationsController.php +++ b/app/plugins/Awards/src/Controller/RecommendationsController.php @@ -427,7 +427,9 @@ public function edit($id = null) $this->Recommendations->getConnection()->begin(); if (!$this->Recommendations->save($recommendation)) { $this->Recommendations->getConnection()->rollback(); - $this->Flash->error(__('The recommendation could not be saved. Please, try again.')); + if (!$this->request->getHeader('Turbo-Frame')) { + $this->Flash->error(__('The recommendation could not be saved. Please, try again.')); + } if ($this->request->getData("current_page")) { return $this->redirect($this->request->getData("current_page")); } @@ -442,7 +444,9 @@ public function edit($id = null) $newNote->author_id = $this->request->getAttribute("identity")->id; if (!$this->Recommendations->Notes->save($newNote)) { $this->Recommendations->getConnection()->rollback(); - $this->Flash->error(__('The note could not be saved. Please, try again.')); + if (!$this->request->getHeader('Turbo-Frame')) { + $this->Flash->error(__('The note could not be saved. Please, try again.')); + } if ($this->request->getData("current_page")) { return $this->redirect($this->request->getData("current_page")); } @@ -450,7 +454,9 @@ public function edit($id = null) } } $this->Recommendations->getConnection()->commit(); - $this->Flash->success(__('The recommendation has been saved.')); + if (!$this->request->getHeader('Turbo-Frame')) { + $this->Flash->success(__('The recommendation has been saved.')); + } } if ($this->request->getData("current_page")) { return $this->redirect($this->request->getData("current_page")); @@ -554,8 +560,9 @@ public function turboEditForm($id = null) ->contain(['Branches' => function ($q) { return $q->select(['id', 'name']); }]) - ->where(["start_date >" => DateTime::now(), 'OR' => ['closed' => false, 'closed IS' => null]]) + ->where(['OR' => ['closed' => false, 'closed IS' => null]]) ->select(['id', 'name', 'start_date', 'end_date', 'Branches.name']) + ->orderBy(['start_date' => 'ASC']) ->all(); $statusList = Recommendation::getStatuses(); foreach ($statusList as $key => $value) { @@ -594,8 +601,9 @@ public function turboQuickEditForm($id = null) ->contain(['Branches' => function ($q) { return $q->select(['id', 'name']); }]) - ->where(["start_date >" => DateTime::now(), 'OR' => ['closed' => false, 'closed IS' => null]]) + ->where(['OR' => ['closed' => false, 'closed IS' => null]]) ->select(['id', 'name', 'start_date', 'end_date', 'Branches.name']) + ->orderBy(['start_date' => 'ASC']) ->all(); $statusList = Recommendation::getStatuses(); foreach ($statusList as $key => $value) { diff --git a/app/plugins/Awards/templates/Recommendations/board.php b/app/plugins/Awards/templates/Recommendations/board.php index c48e17c5..2f2ec09a 100644 --- a/app/plugins/Awards/templates/Recommendations/board.php +++ b/app/plugins/Awards/templates/Recommendations/board.php @@ -5,24 +5,24 @@ if ($hiddenStates != ""): if (!$showHidden): ?> - = $this->Html->link( + = $this->Html->link( "Show $hiddenStates In last $range days", [$view, '?' => ['showHidden' => 'true']], ['class' => 'btn btn-primary btn-sm end m-3'] ) ?> - - = $this->Html->link( + + = $this->Html->link( "Hide $hiddenStates In last $range days", [$view], ['class' => 'btn btn-primary btn-sm end m-3'] ) ?> - +
= h($state) ?> | += h($state) ?> |
---|---|
+ |
-
-
-
+
+
-
-
- Last Modified: = $recommendation->modified->format('m/d/Y') ?> by
+ = $recommendation->ModifiedByMembers['sca_name'] ?>
+ stack_rank ?>"
+ data-rec-id="= $recommendation->id ?>" id="card_= $recommendation->id ?>"
+ data-kanban-target="card">
+
-
+
+ award->abbreviation;
if ($recommendation->specialty != null && $recommendation->specialty != "" && $recommendation->specialty != "No Specialty Selected") :
$awardTitle = $awardTitle . " (" . $recommendation->specialty . ")";
endif;
?>
- = $this->Html->link($awardTitle, ['action' => 'view', $recommendation->id]) ?>
-
-
- - = $recommendation->member_sca_name ?> --= $this->Text->autoParagraph( + = $this->Html->link($awardTitle, ['action' => 'view', $recommendation->id]) ?> + + + = $recommendation->member_sca_name ?> ++= $this->Text->autoParagraph( h($this->Text->truncate($recommendation->reason, 100)), ) ?> - Last Modified: = $recommendation->modified->format('m/d/Y') ?> by - = $recommendation->ModifiedByMembers['sca_name'] ?> - |
+