This patch only shows the calendar settings on the node edit page to users with the appropriate permissions

Comments

nicholas.alipaz’s picture

Status: Needs review » Postponed (maintainer needs more info)
fietserwin’s picture

Assigned: Unassigned » fietserwin
Status: Postponed (maintainer needs more info) » Active

I think my use case matches that of the OP. I will elaborate on it a bit, to clarify this issue.

Use case:
- Website offers AC to individual house owners.
- House owners may update their own calendar and their own page
- House owners may not alter the design, so settings 'show legend' and 'show teaser' belong to the site maintainer.
- To give visitors a recognisable calendar look, settings 'hide old', 'first day of the week' and 'only show first letter of day' may not be changed on a per page basis.
- A state 'non communicated' is added and is set as the default (#306461: Custom availability states and legend). This to reward house owners to keep their calender updated and to not misinform visitors. So setting the 'Default status for each day' may not be changed by house owners.

Problems with current version:
- site maintainers can not prevent individual house owners of changing these settings (if they have the right to edit their own pages.
- if site maintainers can only edit their calendar, not their "info page", site editors must set the settings again on each an every node.

Solution:
- Settings 'show legend', 'first day of the week' and 'only show first letter of day' are not available on the admin settings page. These should be added to that page.
- Add a setting 'allow per node overrides' on the admin settings page. Defaults to 'no', as I really think that this use case is the normal one, However, for updating sites this will be set to 'yes' via a hook_update_N (backwards compatible).
- If this setting is set to 'no' no per node settings will be available, nor stored.
- If this setting is set to 'yes' the node edit form for supported types will be altered as currently.
- If this setting is changed form 'yes' to 'no', all per node variables will be deleted. IMO using the variables for per node settings is kind of abusing the variable system. Note that all 5 settings for ALL nodes will be loaded for each and every request. On large sites this can lead to noticeable overhead in memory consumption.

I will implement this in the D7 port.

nicholas.alipaz’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

if this gets added it will be in 2.x branch

fietserwin’s picture

Status: Active » Fixed

I committed this to the 6.x-2.x branch.

Some notes:
- as already indicated in a previous comment: settings that were formerly not available on the admin screen, but only on the node edit form, are now also added to the admin screen.
- settings that were formerly only available on the admin screen, but not on the node edit form, are now added to the node edit form as well (month count, allow split day).
- reordered the settings to get the same order on both screens.

Subtle differences between the originally posted patch and the implementation as committed:
If you disallow per node override, all nodes will have the same settings. in the posted patch it was still possible to override per node settings for the administrator (or someone having the right permissions). This is not the case anymore.

If this is not what you wanted, please provide a (realistic) use case that is not covered by the committed solution.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.