ProjectManager
ProjectManager is a very powerful and customizable data management plugin. Originally it was designed to manage athlete profiles, but can be used for anything else that has recurrent types of datasets, e.g. dvd or book collection, simple tabular calendar, or architect projects.
- Easy dynamic adding of formfields to create data input formulars
- sorting of datasets by any formfield
- AJAX enabled editing of datasets
- hook one project into user profile for use as extended profile
- Wordpress category system for grouping of datasets
- simple search of any form field and category names
- import and export of datasets to/from CSV file
- fine grained capabilities to control access and compatibility with RoleManager
- template system to easily customize frontend output
Installation
This is easy. Simply extract the files to your plugins directory or, if you use Wordpress 2.7 you can use the integrated installation method. The management pages are found under Projects.
Shortcode Usage
The main shortcode is to display datasets of a project in a page or post. Since this shortcode has several optional attributes, the following shows only a minimal example. For details on all the possible parameters see the table below.
[ project id=ID template=X ]
| Parameter | Description | Possible values | Default | Optional |
|---|---|---|---|---|
| id | ID of project | integer | no | |
| template | template file used to display | table or gallery or template file without extension | table | yes |
| cat_id | Set this attribute to only display datasets of supplied category ID | integer | yes | |
| orderby | specify field datasets are ordered by | name, id, formfields-ID (replace ID with respective formfield ID) or rand (since 2.6). rand must be used together with results to limit number of random datasets | name | yes |
| order | ordering of datasets | ASC or DESC | ASC | yes |
| single | add link to single dataset or not | true or false | true | yes |
| selections | control display of selection forms for categories and dataset ordering | true or false | true | yes |
| results | limit number of datasets to display | integer | yes | |
| field_id | ID of formfield to filter datasets. Must be used together with field_value. | integer | yes | |
| field_value | value of formfield to filter datasets. Must be used together with field_id. | string | yes |
You can include a simple search form with the following code
[ project_search project_id=ID template=compact|extend ]
| Parameter | Description | Possible values | Default | Optional |
|---|---|---|---|---|
| project_id | ID of project | integer | no | |
| template | template to use | compact or extend | extend | yes |
To display a single dataset use the following code
[ dataset id=x ]
| Parameter | Description | Possible values | Default | Optional |
|---|---|---|---|---|
| id | ID of dataset | integer | no | |
| template | template to use | file without extension | yes |
Templates
Templates are special files that are used to display plugin data in the website frontend. The default templates are
WP_PLUGIN_DIR/projectmanager/view/table.php tabular display of datasets
WP_PLUGIN_DIR/projectmanager/view/gallery.php datasets as gallery
WP_PLUGIN_DIR/projectmanager/view/dataset.php single dataset
WP_PLUGIN_DIR/projectmanager/view/search-extend.php extended search form
WP_PLUGIN_DIR/projectmanager/view/search-compact.php compact search form
If you want to modify existing templates copy it to
your_theme_dir/projectmanager/
Further it is possible to design own templates. Assume you created a file sample1.php, to display datasets of a project. To use the template use the following tag:
[ project id=ID template=sample1 ]
For single datasets templates must be named dataset-X.php and searchform search-X.php. The files are then loaded with the following tags:
[ dataset id=ID template=X ]
[ project_search project_id=ID template=X ]
Access Control
ProjectManager has fine grained capabilities in order to control access to different areas of the administration panel.
edit_projects
- add and edit projects
delete_projects
- delete existing projects
projectmanager_settings
- Allows access to global settings of ProjectManager
edit_formfields
- Allows access to FormField Panel
edit_projects_settings
- Allows access to individual projects settings panel
import_datasets
- Allows access to import/export panel
edit_datasets
- Allows to add datasets and edit own datasets
edit_other_datasets
- Allows to add and edit all datasets
- Allows to add WP User as dataset
delete_datasets
- Allows to delete own datasets
delete_other_datasets
- Allows to delete any datasets
view_projects
- Allows to browse projects in Administration panel
projectmanager_user
- Allows usage of profile hook
Use as Extended Profile
Any Project can be hooked into any users profile with capability projectmanager_user. Since Version 2.5 datasets are automatically added for new users if the default role has above mentioned capability. To subsequently add a dataset that is meant as extended profile, use the Add WP User Button next to the name field in the dataset form. The user needs capability edit_other_datasets to perform this task.
Customization
Admin Menu Icons
If you want to use custom icons for the admin menu put them in
yourthemedirectory/projectmanager/icons/
Formfields
There are two special formfields that require a short statement: numeric and currency. The display of these two types varies among different countries. If the PHP Internationalization Functions, requires at least PHP 5.2 (recommended is 5.2.4+), are installed you are all set. Otherwise there are two filters that can be used to manually control the format
- projectmanager_numeric
- projectmanager_currency
Note that these filters are for some reasons not applied if you use the AJAX edit. After reloading the page the display is correct.
Add Formfields
You can also add custom Formfields via the filter projectmanager_formfields. First let us add the field.
add_filter( ‘projectmanager_formfields’, ‘my_formfields’);
function my_formfields( $formfields ) {
$formfields['myfield'] = array( ‘name’ => ‘My Field’, ‘callback’ => ‘get_myfield_data’, ‘args’ => array());
return $formfields;
}
The callback option is a function which gets the data for this field as it is not stored in the ProjectManager Database. args can be an optional assoziative array of arguments that are passed to the callback function. Finally we just need to get the data from somewhere.
function get_myfield_data( $dataset, $args ) {
// $dataset is an assoziative array with keys ‘id’ and ‘name that hold the dataset ID and name respectively
// do some stuff
}
Download
The plugin can be downloaded at Wordpress.org.
Donations
Developing and maintaining the plugin consumes a lot of my spare time. If you like my work and want to support me, I’m grateful for any donation.



