Skip to content

Commit

Permalink
fix update leaving resource
Browse files Browse the repository at this point in the history
  • Loading branch information
amma35 committed Oct 20, 2017
1 parent a014332 commit 3888bee
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions inc/resource.class.php
Expand Up @@ -767,6 +767,18 @@ function pre_updateInDB() {
$PluginResourcesChecklistconfig->addChecklistsFromRules($this,PluginResourcesChecklist::RESOURCES_CHECKLIST_OUT);
}
}
} else if (isset($this->input["is_leaving"])
&& $this->input["is_leaving"] == 0
&& in_array("is_leaving", $this->updates)) {
$this->fields["users_id_recipient_leaving"] = 0;
$this->fields["date_declaration_leaving"] = 'NULL';
$this->fields["date_end"] = 'NULL';
$this->fields["plugin_resources_leavingreasons_id"] = 0;
$this->updates[] = "users_id_recipient_leaving";
$this->updates[] = "date_declaration_leaving";
$this->updates[] = "plugin_resources_leavingreasons_id";
$this->updates[] = "date_end";

}

//if location field is updated
Expand Down

0 comments on commit 3888bee

Please sign in to comment.