The list of events returned by list-events was filtered (if the user was not administrator), so the displayed list is only those in the future. However the same function is used to check whether a venue can be deleted, so non-admin users who have edit rights could be allowed to delete venues referenced by events in the past.
Rather than passing the event date out of the function, which would have needed modifications to the array passed out, I have
given the function an extra parameter to say whether to apply filtering. For the checking of deletability, this param is false, and for display, the param is true.
The list of events returned by list-events was filtered (if the user was not administrator), so the displayed list is only those in the future. However the same function is used to check whether a venue can be deleted, so non-admin users who have edit rights could be allowed to delete venues referenced by events in the past.
Rather than passing the event date out of the function, which would have needed modifications to the array passed out, I have given the function an extra parameter to say whether to apply filtering. For the checking of deletability, this param is false, and for display, the param is true.