meeting-room-booking-system / mrbs-code

MRBS application code
Other
129 stars 64 forks source link

Judge whether there is a reservation currently and execute the corresponding script. #3713

Open flyxj opened 4 months ago

flyxj commented 4 months ago

Thank you very much for this open source project. I need some help with development.

I added a "secret" field to the database "mrbs_room" and assigned an initial value. When the start time of a reservation by an ordinary user of level 1 arrives, a shell script is executed. And after this user logs in within the reserved time range, he can see the value of the "secret" field corresponding to the room he reserved on a certain page. When the end time of the reservation arrives, another shell script is executed.

MRBS version:1.11.5

How should I do this? I hope you can give me some directions. Thank you very much.

campbell-m commented 4 months ago

Do you want to email the user when the start time arrives, or just change the visibility of the field? If you want to email the user you'll need a cron job running regularly checking for start times. If you just need to change the visibility of the field then you can do that by editing the MRBS code.

flyxj commented 4 months ago

Thank you for your reply.

It would be best to modify the visibility of the field, because I have other features that I want to implement based on this.

campbell-m commented 4 months ago

I'm not sure I can help you very much. You'll need to modify the MRBS code and make the field visible depending on the current time.

flyxj commented 4 months ago

Still thank you.

I'll go and check how to achieve it using the mail.

flyxj commented 4 months ago

Dear campbell-m

I have successfully configured the email service and received the email for the new appointment.

How can I use the crontab to detect whether there is an appointment at the current time every hour and send mail to booker.

I used MRBS docker-app for the deployment.

campbell-m commented 4 months ago

How can I use the crontab to detect whether there is an appointment at the current time every hour and send mail to booker.

You will have to write your own PHP script that queries the MRBS database for meetings that are about to start and then sends an email to the booker. You should also record in the database that an email has been sent in case the cronjob doesn't run.