Documentation

Proper Job provides a block that you can add to a page. In the block edit dialog, you decide who can run the job, what job will be run, and a label to show on the button or link to run the job. 

Front end access

As a site administrator you can keep control of the dashboard and even the mode of pages, while allowing selected users to run selected jobs. From the block edit dialog you can configure availability of on-page job execution to any of:

  • The owner of the page
  • A single user
  • A group of users

For users who do not meet these criteria, the block containing the button or link is simply not shown!

Job to run

A dropdown select lists all installed jobs alphabetically.

Label (optional)

A text field to enter a label for the button or link. The label for the button or link will, by default, be the job name if this field is left empty. 

Block templates

The default block template uses the Bootstrap button and alert styles used in the concrete5 dashboard. Alternate block templates are provided for un-styled buttons and for plain text links.

The JavaScript that sits inside the block is designed to work completely from the block ID and a few marker classes. As long as you keep the marker classes, you can easily create new templates using pretty much whatever HTML elements that you like and whatever further CSS classes and styles you want to add.

Front end use

Job execution buttons and links (and the associated JavaScript) will only be added to pages for users who have access to them. 

When a button or link to run a job is clicked, the button or link will be replaced with the job result. This prevents multiple execution of jobs. To run a job again, users will need to refresh the page.

Caching

As with any other block that provides a context dependant view, you need to be careful about how you use it on pages where caching is enabled. If a block or page cache is filled in a context where a job execution button or link is shown to a user, then the cached page shown to other users, they could have access to job execution where you do not want them to!

Such issues are not usually of concern during development, but may become important if you have reason to use this block on a production site.

If you experience such issues, it is recommended you add a further level of security to control view access to this block through Advanced Permissions.

Origins of Proper Job

The expression "Proper Job" comes from English West Country dialect to describe a job well done. After use by a few notable television and radio personalities, the expression has now achieved much wider use.