Skip to content

Commit

Permalink
Issue #84 fix bug on Tourst_model.php get(), additional commenting to…
Browse files Browse the repository at this point in the history
… explain why tour counts on get are needed in person edit.
  • Loading branch information
generalludd committed Apr 14, 2021
1 parent 0cb0ead commit 50611b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions application/controllers/Person.php
Expand Up @@ -202,6 +202,7 @@ function edit() {
"value",
"name",
], TRUE);
// we get the tour count because if a person has not been on any tours, they can be deleted, otherwise they can only be marked as inactive.
$this->load->model("tourist_model", "tourist");
$data["tour_count"] = count($this->tourist->get($id));
$data["target"] = "person/edit";
Expand Down
2 changes: 1 addition & 1 deletion application/views/person/edit.php
Expand Up @@ -67,7 +67,7 @@ class="button delete delete-action"
data-controller="person"
data-form="person-editor"
title="This person has been on tours, they will be disabled instead of deleted"
value="Delete"/>
value="Disable"/>
<?php endif; ?>
<?php endif; ?>
</p>
Expand Down

0 comments on commit 50611b2

Please sign in to comment.