Files
fulpstation/SQL
Jordie 248a6fd50c Datum based poll creation and vote handling update (#50843)
An almost complete rework of how creating polls, their data and voting on them is handled.

Instead of repeatedly querying for poll data, running polls are loaded at runtime into poll_question and poll_option datums that stores all the needed variables for both. This datum is then used for creating, editing and accessing poll data. The database is only contacted when saving changes or votes.

Creating polls and options is now done with a html window instead of a series of popups akin to how the banning panel works. The form data is parsed and error-checked before passing to be saved.
This is done in two stages, first time a poll's details are entered and it must be initialized (created as a datum) before options can be added and all of both are saved to the database. Instructions about how this work are shown on the poll creation window.

A new field for polls has been added, subtitles, which is text only shown when a poll is opened by a player instead of on the list of polls. Intended so the actual question text can be kept to only a name and important information about a poll goes in a subtitle.
All polls can now have revoting enabled on them.
Polls can have a starting datetime specified, this can be in the past but why would you do that?
Polls and options can be edited once created, excluding the type of a poll. Doing so will by default clear all existing poll votes. Votes can also be cleared by a button.

The handling of how votes are processed has been adapted for the datum system but is on the whole not functionally that different aside from poll validation not being roughly copypasted across each poll type's vote proc

All poll tables now have a deleted column for retaining 'deleted' data.
poll_question has also gained the columns created_datetime, subtitle, allow_revoting, their function explained above, and a change of idx_pquest_time_admin to idx_pquest_time_deleted_id.

A stored procedure set_poll_deleted has been added. This is called when setting a poll as deleted to avoid needing 4 separate queries from the server or one fairly long 4-way joined 

Create Poll verb is renamed to Server Poll Management
2020-05-11 14:34:51 +12:00
..