Doctor to only be able to delete their notes.
This commit is contained in:
@@ -188,6 +188,10 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void viewFilePopUp(String fileName, String filePath, int fileID, String url) {
|
void viewFilePopUp(String fileName, String filePath, int fileID, String url) {
|
||||||
|
bool hasAccessToDelete = false;
|
||||||
|
if (widget.type == "business") {
|
||||||
|
hasAccessToDelete = true;
|
||||||
|
}
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
@@ -206,7 +210,7 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
|||||||
],
|
],
|
||||||
windowTools: [
|
windowTools: [
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: widget.type == "business",
|
visible: hasAccessToDelete,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
deleteFilePopUp(filePath, fileID);
|
deleteFilePopUp(filePath, fileID);
|
||||||
|
|||||||
@@ -129,6 +129,11 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
|||||||
userNameController.text = selectednote.doctor;
|
userNameController.text = selectednote.doctor;
|
||||||
dateController.text = selectednote.insert_date;
|
dateController.text = selectednote.insert_date;
|
||||||
});
|
});
|
||||||
|
bool hasAccessToDelete = false;
|
||||||
|
if (widget.type == "business" &&
|
||||||
|
selectednote.doc_office == widget.business!.Name) {
|
||||||
|
hasAccessToDelete = true;
|
||||||
|
}
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
@@ -137,7 +142,7 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
|||||||
windowTitle: selectednote.note_name,
|
windowTitle: selectednote.note_name,
|
||||||
windowTools: [
|
windowTools: [
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: widget.type == "business",
|
visible: hasAccessToDelete,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
deletePatientPopUp(selectednote.idpatient_notes);
|
deletePatientPopUp(selectednote.idpatient_notes);
|
||||||
|
|||||||
Reference in New Issue
Block a user