libretime/legacy/application
Scott McGrath 644d2b9ce5
fix(legacy): additional specifics added to CSVexport.js for RFC 4180 (#3131)
### Description

The existing implementation for exporting playout logs to a CSV file
incorporates a very simplified CSV format. Some aspects of the complete
[RFC](https://www.rfc-editor.org/rfc/rfc4180) are missing, such as
escaping of quotes, and quoting of fields that contain certain
characters. This is problematic for common office spreadsheet tools, and
practically, anything else. Many radio stations rely on this
functionality to work well for exporting playout data, for example, in
order to compile data for reporting requirements.

**This is a new feature**:

The changes in this PR add quoting of fields containing a comma, as well
as those containing a CR/LF. It also escapes quotes by doubling them.
I'm not sure it makes CSVexport.js completely RFC 4180 compliant, but it
is much closer than it was.

**I have updated the documentation to reflect these changes**:

I don't think there are any documentation changes necessary; this is
probably expected behavior for anyone trying to use the CSV exporter.

### Testing Notes

**What I did:**

To validate this, I did a clean install of Debian, cloned from the
official libretime repo, and applied the code as a patch to the
installer. I then proceeded with the install and then loaded a database
from a running system (so that I had some playout data to test with). I
then performed the playout history export and examined the resulting CSV
file and after seeing previously problematic fields properly quoted, was
convinced it looked the way I expected. I loaded the csv file into
Libreoffice Calc and did not see any errors.

**How you can replicate my testing:**

See "What I did" above, basically run the patch after cloning the
installer from the repo. You could also apply the changes to a running
system by applying the patch to the file:
/usr/share/libretime/legacy/public/js/libs/CSVexport.js
Be sure to clear your browser cache and do a hard reload of the web
interface, before re-testing.

### **Links**

Closes: #2477
2025-01-09 08:34:13 +00:00
..
auth/adapters feat(legacy): trused header sso auth (#3095) 2024-12-07 10:21:57 +00:00
common fix: intro/outro playlist unset was impossible (#3101) 2024-10-21 18:34:39 +01:00
configs feat(legacy): trused header sso auth (#3095) 2024-12-07 10:21:57 +00:00
controllers feat(legacy): trused header sso auth (#3095) 2024-12-07 10:21:57 +00:00
forms fix: intro/outro playlist unset was impossible (#3101) 2024-10-21 18:34:39 +01:00
layouts/scripts fix(legacy): add play button to stream player (#2190) 2022-09-27 08:14:53 +02:00
logging fix(deps): update dependency friendsofphp/php-cs-fixer to <3.53.1 (#2972) 2024-04-13 14:36:31 +02:00
models fix: intro/outro playlist unset was impossible (#3101) 2024-10-21 18:34:39 +01:00
modules/rest fix(deps): update dependency friendsofphp/php-cs-fixer to <3.53.1 (#2972) 2024-04-13 14:36:31 +02:00
services fix: intro/outro playlist unset was impossible (#3101) 2024-10-21 18:34:39 +01:00
validate Format code using php-cs-fixer 2021-10-12 11:07:56 +02:00
views feat: use custom intro/outro playlists per show (#2941) 2024-10-14 21:07:41 +01:00
Bootstrap.php feat(legacy): move session store to database (#2523) 2023-05-30 22:25:50 +02:00
airtime-boot.php chore: remove cloud storage remainings (#1934) 2022-07-04 22:09:14 +02:00
assets.json fix(legacy): additional specifics added to CSVexport.js for RFC 4180 (#3131) 2025-01-09 08:34:13 +00:00
check.php fix(deps): update dependency friendsofphp/php-cs-fixer to <3.46.1 (main) (#2868) 2024-01-07 13:59:02 +01:00
preload.php fix(legacy): log errors on connect check failure (#2317) 2022-12-16 19:38:33 +01:00