You are here

README.txt in Availability Calendars 7.3

Same filename in this branch
  1. 7.3 README.txt
  2. 7.3 booking_formlet/README.txt
Same filename and directory in other branches
  1. 5 README.txt
  2. 6.2 README.txt
  3. 6 README.txt
  4. 7.5 README.txt
  5. 7.4 README.txt
/**
 * README for Availability Calendar module.
 *
 * @author Erwin Derksen (fietserwin: http://drupal.org/user/750928)
 * @link: http://drupal.org/project/availability_calendars (project page)
 *
 * Note that the module name is availability_calendar, thus without an s, though
 * the project page and the tar.gz do have an s. This is for historical reasons.
 */

The availability calendar module defines an availability calendar field. It is
a complete rewrite of version 7.x-2.x of the Availability Calendars module.
This version is based on the fields feature of D7.


Dependencies
------------
- The booking formlet display settings form uses OR #states which are available
  as of Drupal 7.14.
- The Views support part uses the format_string function that is available as of
  Drupal 7.9.
- The Views support part uses the date_popup if available, but this is no hard
  dependency.
- Date parsing based on (localizable) date types uses either the date_api module
  or PHP 5.3 functionality. Thus either you are on PHP 5.3 or higher, or you
  must install and enable the date_api module.


Issues in core and other modules you may run into
-------------------------------------------------
@todo: add explanation under which circumstances
- [#750928]
- [#838096]
- [#1342874]
- [#1580700]
- [#1592688]


Installing
----------
As usual. After enabling the module:
- Define the states you want to use on
  admin/config/content/availability-calendar/settings
- Define the basic styling, including the colors for the states, on
  admin/config/content/availability-calendar/styling
- Add availability calendar fields to the requested content types.
- Define the date formats you want to use on admin/config/regional/date-time.
  You can localize these formats in admin/config/regional/date-time/locale.


Upgrading from Availability Calendars 7.x-3.x
---------------------------------------------
Read the compatibility notes in the change log to see what you have to check and
test.


Upgrading from Availability Calendars 7.x-2.x or earlier
--------------------------------------------------------
To Drupal this is a different module from the already existing Availability
Calendars module. This makes upgrading via update.php a bit tricky. Therefore, a
separate update module has been created. This module can be found in the latest
7.x-2.x package. So install that version as well. The Availability Calendars
update module contains an UPGRADE.txt with more detailed information about
upgrading.


Styling
-------
The modules contains a style sheet with basic styling that should give you a
reasonable look & feel out of the box (availability_calendar.base.css).
Additionally, you can specify some styling via the admin user interface on
admin/config/content/availability-calendar/styling. This will generate a file
sites/default/files/availability_calendar/availability_calendar.css. Remaining
styling is to be defined in your theme. See availability_calendar.base.css for
how the calendar and key are rendered.


Views integration
-----------------
Views integration has been added. Note that although there is a separate filter
on the calendar option "enabled" in the views UI, if you define a view that
accesses information from one of the availability_calendar_* tables, an extra
join condition on enabled will be added automatically. So normally there is no
need to add this filter, except perhaps in some administrative edge use cases.


Search on availability
----------------------
Through the views integration it is now possible to search on availability. Just
add a filter "<field name> available". The end date that is filled in, probably
exposed to the visitor, is either inclusive (with the 'From begin up to and
including end' operator) or not inclusive (with the 'From arrival to departure'
operator).


Caching
-------
Caching pages with availability calendars is possible but keep in mind that the
calendars change just because the date changes, thus without anyone changing the
data that belongs to the calendar. This means that ideally you should set your
page caches to expire next midnight. However, most caching mechanisms, including
the standard one provided by Drupal, only allows you to set an offset to the
current time. So an offset up to half a day should not give you many problems.
Note that in a multilingual set-up with field syncing (i18n_sync module) field
syncing goes through node_save and thus invalidates the cache.


I18n
----
Availability calendar is (or strives to be) fully multilingual aware. Using the
standard translation model - several entities composing 1 translation set - the
calendars can be shared between translations by enabling field syncing for them.

The names of the states are considered hard coded texts and thus translated
using t() not i18n_string, even though they may be overridden via user entered
input. They should thus be entered in English.

The names of the calendars are field values and thus not translated. On syncing
they won't overwrite already existing names, but if no name exists in the target
language the name is copied.

form labels are passed through t() and thus can be translated. If you want to
change the labels completely because, e.g., the terms arrival and departure do
not fit well in your use case, you can use the String Overrides module
(http://drupal.org/project/stringoverrides). This might get changed in the
future by placing these texts in variables (that can be made multilingual aware
with i18n_variable).


API
---
All database access, querying as well as writing, is placed in separate
functions, thus never directly in form handling functions. So this functionality
is easily available to other modules. To make use of the API you have to include
the .inc file:
  module_load_include('inc', 'availability_calendar', 'availability_calendar');
This to prevent the API being loaded on every request.

File

README.txt
View source
  1. /**
  2. * README for Availability Calendar module.
  3. *
  4. * @author Erwin Derksen (fietserwin: http://drupal.org/user/750928)
  5. * @link: http://drupal.org/project/availability_calendars (project page)
  6. *
  7. * Note that the module name is availability_calendar, thus without an s, though
  8. * the project page and the tar.gz do have an s. This is for historical reasons.
  9. */
  10. The availability calendar module defines an availability calendar field. It is
  11. a complete rewrite of version 7.x-2.x of the Availability Calendars module.
  12. This version is based on the fields feature of D7.
  13. Dependencies
  14. ------------
  15. - The booking formlet display settings form uses OR #states which are available
  16. as of Drupal 7.14.
  17. - The Views support part uses the format_string function that is available as of
  18. Drupal 7.9.
  19. - The Views support part uses the date_popup if available, but this is no hard
  20. dependency.
  21. - Date parsing based on (localizable) date types uses either the date_api module
  22. or PHP 5.3 functionality. Thus either you are on PHP 5.3 or higher, or you
  23. must install and enable the date_api module.
  24. Issues in core and other modules you may run into
  25. -------------------------------------------------
  26. @todo: add explanation under which circumstances
  27. - [#750928]
  28. - [#838096]
  29. - [#1342874]
  30. - [#1580700]
  31. - [#1592688]
  32. Installing
  33. ----------
  34. As usual. After enabling the module:
  35. - Define the states you want to use on
  36. admin/config/content/availability-calendar/settings
  37. - Define the basic styling, including the colors for the states, on
  38. admin/config/content/availability-calendar/styling
  39. - Add availability calendar fields to the requested content types.
  40. - Define the date formats you want to use on admin/config/regional/date-time.
  41. You can localize these formats in admin/config/regional/date-time/locale.
  42. Upgrading from Availability Calendars 7.x-3.x
  43. ---------------------------------------------
  44. Read the compatibility notes in the change log to see what you have to check and
  45. test.
  46. Upgrading from Availability Calendars 7.x-2.x or earlier
  47. --------------------------------------------------------
  48. To Drupal this is a different module from the already existing Availability
  49. Calendars module. This makes upgrading via update.php a bit tricky. Therefore, a
  50. separate update module has been created. This module can be found in the latest
  51. 7.x-2.x package. So install that version as well. The Availability Calendars
  52. update module contains an UPGRADE.txt with more detailed information about
  53. upgrading.
  54. Styling
  55. -------
  56. The modules contains a style sheet with basic styling that should give you a
  57. reasonable look & feel out of the box (availability_calendar.base.css).
  58. Additionally, you can specify some styling via the admin user interface on
  59. admin/config/content/availability-calendar/styling. This will generate a file
  60. sites/default/files/availability_calendar/availability_calendar.css. Remaining
  61. styling is to be defined in your theme. See availability_calendar.base.css for
  62. how the calendar and key are rendered.
  63. Views integration
  64. -----------------
  65. Views integration has been added. Note that although there is a separate filter
  66. on the calendar option "enabled" in the views UI, if you define a view that
  67. accesses information from one of the availability_calendar_* tables, an extra
  68. join condition on enabled will be added automatically. So normally there is no
  69. need to add this filter, except perhaps in some administrative edge use cases.
  70. Search on availability
  71. ----------------------
  72. Through the views integration it is now possible to search on availability. Just
  73. add a filter " available". The end date that is filled in, probably
  74. exposed to the visitor, is either inclusive (with the 'From begin up to and
  75. including end' operator) or not inclusive (with the 'From arrival to departure'
  76. operator).
  77. Caching
  78. -------
  79. Caching pages with availability calendars is possible but keep in mind that the
  80. calendars change just because the date changes, thus without anyone changing the
  81. data that belongs to the calendar. This means that ideally you should set your
  82. page caches to expire next midnight. However, most caching mechanisms, including
  83. the standard one provided by Drupal, only allows you to set an offset to the
  84. current time. So an offset up to half a day should not give you many problems.
  85. Note that in a multilingual set-up with field syncing (i18n_sync module) field
  86. syncing goes through node_save and thus invalidates the cache.
  87. I18n
  88. ----
  89. Availability calendar is (or strives to be) fully multilingual aware. Using the
  90. standard translation model - several entities composing 1 translation set - the
  91. calendars can be shared between translations by enabling field syncing for them.
  92. The names of the states are considered hard coded texts and thus translated
  93. using t() not i18n_string, even though they may be overridden via user entered
  94. input. They should thus be entered in English.
  95. The names of the calendars are field values and thus not translated. On syncing
  96. they won't overwrite already existing names, but if no name exists in the target
  97. language the name is copied.
  98. form labels are passed through t() and thus can be translated. If you want to
  99. change the labels completely because, e.g., the terms arrival and departure do
  100. not fit well in your use case, you can use the String Overrides module
  101. (http://drupal.org/project/stringoverrides). This might get changed in the
  102. future by placing these texts in variables (that can be made multilingual aware
  103. with i18n_variable).
  104. API
  105. ---
  106. All database access, querying as well as writing, is placed in separate
  107. functions, thus never directly in form handling functions. So this functionality
  108. is easily available to other modules. To make use of the API you have to include
  109. the .inc file:
  110. module_load_include('inc', 'availability_calendar', 'availability_calendar');
  111. This to prevent the API being loaded on every request.