Menu

#808 CSV plugin

Parent Category:
DPCalendar
Category:
Calendar plugins
Last Updated:
Allon Moritz, Tuesday, 10 September 2024 06:31 (4 weeks ago.)
Created:
Thursday, 08 May 2014 15:26
Hits:
12258

This feature is part of the DPCalendar Standard subscription.
SubscribePHP 7.4PHP 8Joomla 3.10Joomla 4.4Joomla 5

Introduction

The CSV plugin creates out of a CSV file, events which can be displayed in DPCalendar. The file can be locally on your web server it can be a link to a website that automatically produces the proper formatted output.

It can also export events, bookings, tickets or locations, either from the front end lists or the back end administration tables.

File Format

The CSV plugin comes with an example file which has a structure that works out of the box. For every CSV calendar you can define a column name which is mapped to an event attribute. For example if the title of the event is in a column with the name csv_title then fill that value as option in the external calendar configuration.

The following example should give you a rough idea about the structure. The first row defines always the columns of the file.

"title","alias","rrule","start_date","end_date","all_day","location","color","url","description","show_end_time"
"Yearly recurring","yearly","FREQ=YEARLY;UNTIL=20220514T000000Z","2019-01-01 00:00:00","2019-12-31 23:59:59","0",,"27CC37",,"Sample description",1
"Single day","single-event",,"2019-12-29 22:00:00","2007-12-29 22:20:00","0",,"A32929",,,1
"All day","allday",,"2019-12-29 00:00:00","2017-12-30 00:00:00","1",,"A32929",,,1
"Weekly recurring","weekly","FREQ=WEEKLY;BYDAY=TU,TH,SA","2017-12-10 20:00:00","2017-12-10 22:30:00","0","New York",,"http://www.digital-peak.com","This event also ends at 22:30 but the show end time flag is set to false, so it is not shown.",0
"Dayli recurring","dayli","FREQ=DAILY","2017-12-11 20:00:00","2017-12-11 21:30:00","0","London",,"http://jooml.digital-peak.com","<p>Desc</p><ul><li>with HTML</li><li>content</li></ul><p><strong>Strong text</strong></p>",1

Remarks

The following list gives some practical hints about the data in the CSV file:

  • The date must be in ISO 8601 format
  • All day events must have the end date one day later as this is how ical data is represented.
  • The alias setting is only used during import
  • The timezones must be set correctly
  • The CSV structure must be readable by a CSV parser

Main options

  • Uri
    Per calendar there is a field which defines the uri of the file. If the file is on your server it must have proper permissions to access it. Make sure that the file is accessible to DPCalendar through your Joomla hosting server. If the file is not physically on your server you can define an url like http://example.com/data/test.csv. To get remote files the server must be able to open connections to the remote server. Ask your hosting company first if outbound connections are included in your hosting plan.
  • Timezone
    When the events in the CSV file are defined in a different timezone, it's possible to adjust that parameter here.
  • SSL Verification
    Ensures that the SSL connection (HTTPS) is a valid one. This requires a trusted certificate. If this is not the case, then the admin can disable the option. But it is a security issue as the connection can't be trusted anymore.

Libre Office, Openoffice or Excel

CSV files are easier to work with using Excel or Libre Office spreadsheets. In either case the file will be broken down into cells. Make sure to always save the file as a CSV (comma separated values) file. Not as a spreadsheet, xlsx or ods, file. These are binary files and can't be read by this plugin.

Export of DPCalendar data

The CSV plugin also supports the export of DPCalendar entities like events, locations, bookings or tickets in the back end and front end. When activated then an export button will appear in the respective lists.

While configuring the plugin, it is also possible to fine tune the export behavior. The site admin can define the separator, the fields with a custom ordering, if HTML tags should be stripped and configure the output of custom fields.

CSV export

DPCalendar Options

These settings are the same for every calendar configured in the plugin.

Uri [Type: Text]
An uri to an online file like http://www.example.com/files/data.csv or a local path like plugins/dpcalendar/csv/examples/example.csv. If the uri is a file and starts with a '/' DPCalendar will interpret it as an absolute path otherwise relative to the joomla installation folder.
Delimiter [Type: Text] [Default: ,]
The delimiter of the CSV file.
Enclosure [Type: Text] [Default: "]
The enclosure of the CSV file.
Has Header Row [Type: Radio] [Default: Yes]
Does the CSV file have a header row.
The following options are available:
  1. Yes
  2. No
Timezone [Type: Timezone] [Default: UTC]
The timezone of the events in the file.
The following options are available:
  1. UTC
Title Column [Type: Text] [Default: title]
The column for the title.
Start Date Column [Type: Text] [Default: start_date]
The column for the start date.
End Date Column [Type: Text] [Default: end_date]
The column for the end date.
All Day Column [Type: Text] [Default: all_day]
The column for the all day.
Show End Time Column [Type: Text] [Default: show_end_time]
The column for the show end time.
Description Column [Type: Text] [Default: description]
The column for the description.
RRule Column [Type: Text] [Default: rrule]
The column for the recurrence rule.
Location Column [Type: Text] [Default: location]
The column for the location.
Url Column [Type: Text] [Default: url]
The column for the url.
Alias Column [Type: Text] [Default: alias]
The column for the alias.
Colour Column [Type: Text] [Default: color]
The column for the colour.
SSL Verification [Type: Radio] [Default: Yes]
Is SSL verification activated? Disable only when you know what you are doing as it can cause security issues. When disabled the connection the remote host can't be trusted anymore.
The following options are available:
  1. Yes
  2. No

Plugin Options

Custom Field Value Type [Type: Radio] [Default: Value]
The value type of the custom field. Raw returns the stored value from database and value means the display value.
The following options are available:
  1. Value
  2. Raw Value
Strip HTML [Type: Radio] [Default: No]
Strip the HTML tags during export.
The following options are available:
  1. Yes
  2. No
Separator [Type: Text] [Default: ,]
Separator of the exported file.
Event Fields [Type: Subform] [Default: {"export_events_fields0":{"field":"id"},"export_events_fields1":{"field":"title"},"export_events_fields2":{"field":"catid"},"export_events_fields3":{"field":"color"},"export_events_fields4":{"field":"url"},"export_events_fields5":{"field":"start_date"},"export_events_fields6":{"field":"end_date"},"export_events_fields7":{"field":"all_day"},"export_events_fields8":{"field":"rrule"},"export_events_fields9":{"field":"description"},"export_events_fields10":{"field":"location_ids"},"export_events_fields11":{"field":"featured"},"export_events_fields12":{"field":"state"},"export_events_fields13":{"field":"access"},"export_events_fields14":{"field":"access_content"},"export_events_fields15":{"field":"language"},"export_events_fields16":{"field":"created"},"export_events_fields17":{"field":"created_by"},"export_events_fields18":{"field":"modified"},"export_events_fields19":{"field":"modified_by"},"export_events_fields20":{"field":"uid"},"export_events_fields21":{"field":"timezone"}}]
The fields to export in the given order.
Booking Fields [Type: Subform] [Default: {"export_bookings_fields0":{"field":"uid"},"export_bookings_fields1":{"field":"state"},"export_bookings_fields2":{"field":"name"},"export_bookings_fields3":{"field":"email"},"export_bookings_fields4":{"field":"telephone"},"export_bookings_fields5":{"field":"country"},"export_bookings_fields6":{"field":"province"},"export_bookings_fields7":{"field":"city"},"export_bookings_fields8":{"field":"zip"},"export_bookings_fields9":{"field":"street"},"export_bookings_fields10":{"field":"number"},"export_bookings_fields11":{"field":"price"},"export_bookings_fields12":{"field":"options"},"export_bookings_fields13":{"field":"net_amount"},"export_bookings_fields14":{"field":"processor"},"export_bookings_fields15":{"field":"user_id"},"export_bookings_fields16":{"field":"book_date"},"export_bookings_fields17":{"field":"event_id"},"export_bookings_fields18":{"field":"event_author"},"export_bookings_fields19":{"field":"event_calid"},"export_bookings_fields20":{"field":"timezone"}}]
The fields to export in the given order.
Ticket Fields [Type: Subform] [Default: {"export_tickets_fields0":{"field":"uid"},"export_tickets_fields1":{"field":"state"},"export_tickets_fields2":{"field":"name"},"export_tickets_fields3":{"field":"event_title"},"export_tickets_fields4":{"field":"start_date"},"export_tickets_fields5":{"field":"end_date"},"export_tickets_fields6":{"field":"email"},"export_tickets_fields7":{"field":"telephone"},"export_tickets_fields8":{"field":"country"},"export_tickets_fields9":{"field":"province"},"export_tickets_fields10":{"field":"city"},"export_tickets_fields11":{"field":"zip"},"export_tickets_fields12":{"field":"street"},"export_tickets_fields13":{"field":"number"},"export_tickets_fields14":{"field":"price"},"export_tickets_fields15":{"field":"user_id"},"export_tickets_fields16":{"field":"created"},"export_tickets_fields17":{"field":"type"},"export_tickets_fields18":{"field":"event_calid"},"export_tickets_fields19":{"field":"timezone"}}]
The fields to export in the given order.
Location Fields [Type: Subform] [Default: {"export_locations_fields0":{"field":"id"},"export_locations_fields1":{"field":"title"},"export_locations_fields2":{"field":"alias"},"export_locations_fields3":{"field":"country"},"export_locations_fields4":{"field":"province"},"export_locations_fields5":{"field":"city"},"export_locations_fields6":{"field":"zip"},"export_locations_fields7":{"field":"street"},"export_locations_fields8":{"field":"number"},"export_locations_fields9":{"field":"rooms"},"export_locations_fields10":{"field":"latitude"},"export_locations_fields11":{"field":"longitude"},"export_locations_fields12":{"field":"url"},"export_locations_fields13":{"field":"description"},"export_locations_fields14":{"field":"color"},"export_locations_fields15":{"field":"state"},"export_locations_fields16":{"field":"language"},"export_locations_fields17":{"field":"created"},"export_locations_fields18":{"field":"created_by"},"export_locations_fields19":{"field":"modified"},"export_locations_fields20":{"field":"modified_by"},"export_locations_fields21":{"field":"xreference"}}]
The fields to export in the given order.

Plugin Options

Caching [Type: List] [Default: Joomla]
Select whether to cache the calendar data.
The following options are available:
  1. Joomla
  2. Database
  3. Never
Cache Time [Type: Text] [Default: 900]
The time for the cache in sec.
Sync Start [Type: Text] [Default: -3 year]
The relative start date to sync from.
Sync End [Type: Text] [Default: +3 year]
The relative end date to sync from.
Sync Steps [Type: Text] [Default: 1 year]
The sync steps.

Comments (0)

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.