Hello everyone, first of all let me give some background info I am an IT manager at a resort in Kissimmee, FL and I am creating an intranet site that we will use to relay task and information throughout the property (medium to small size property only 247 rooms). So far I think Storm is great and is more than capable of providing exactly what we need, I have moderate knowledge in php I know my way around and understand what is going on for the most part. Here what I would like some help with, I have been able to modify the Task form according to our needs but my problem lies with getting the filter by attribute to work correctly. Here is an out line of where I am at.
I created a custom attribute domain named Rooms, then I created a key for each individual room on property under that domain.
Being that I want the option and filter to behave exactly like the Task Category, Task Priority and Task Status, where ever I found entries in the stormtask module for those attributes I emulated the code altering it accordingly.
So I have reached a point where I am not sure what to try next, I can see the option in the Task form for rooms and the option under the filter field but when I try to filter by room I get an empty list and if I try to filter by any other entry it always filters by room as well. When I leave the tasks list then navigate back it is always filtered by room, I have to reset the filter to see my tasks list. To make matters worse now when creating a new task it seems that none of the drop down fields are being stored properly, only the Title, CCK fields and the body are stored.
Any ideas or help would greatly be appreciated, I am usually a do it myself type of guy but my determination has not yielded the results I was hoping for this time so I am turning to you the Storm community in hopes you can guide me in the right direction.
I thank you in advance.
Comments
Solved
I solved my issue, I was able to add a custom filter based on room in my case. GREAT module, keep up the good work and let me know if I can be of help.
can you elaborate
Can you please elaborate on how you've managed to solve the issue?
I'm interested in adding some custom field to tasks and create a filter as well.
It takes some work and
It takes some work and depends on how you would like your field to display to your users, in my case I wanted to mimic the fields for Task Status and Task Category. I have a field that the user chooses when he/she creates a task specifically Room numbers (250+ rooms) from a drop down list (or by typing in an existing attribute), then I also added that field into the Storm Task List (url="... storm/tasks") along with the time and date the task was created,also displayed when looking at the task (node) itself. I also altered the Task Category/Status by replacing the attributes by some that would better reflect what it will be used for, but that was easy and just involves adding the attributes you need.
In order to add my field it required altering almost every file in the storm task module and a few in the storm attribute module to add and eliminate attributes according to my needs. So what I would suggest is that you go through the files and wherever you see code for status, priority or category replicate the code adjusting it according to your desired field. An example below of one of the functions related to filtering task by attribute located in stormtask.admin.inc
function stormtask_tasks_filter() {
$category_list = stormattribute_attributes_bydomain('Task category search');
$taskcategory = $_SESSION['stormtask_tasks_filter']['taskcategory'];
if (!$taskcategory) {
$taskcategory = $category_list['default'];
$_SESSION['stormtask_tasks_filter']['taskcategory'] = $taskcategory;
}
$status_list = stormattribute_attributes_bydomain('Task status search');
$taskstatus = $_SESSION['stormtask_tasks_filter']['taskstatus'];
if (!$taskstatus) {
$taskstatus = $status_list['default'];
$_SESSION['stormtask_tasks_filter']['taskstatus'] = $taskstatus;
}
$priority_list = stormattribute_attributes_bydomain('Task priority search');
$taskpriority = $_SESSION['stormtask_tasks_filter']['taskpriority'];
if (!$taskpriority) {
$taskpriority = $priority_list['default'];
$_SESSION['stormtask_tasks_filter']['taskpriority'] = $taskpriority;
}
$room_list = stormattribute_attributes_bydomain('Room search');
$room = $_SESSION['stormtask_tasks_filter']['room'];
if (!$room) {
$room = $room_list['default'];
$_SESSION['stormtask_tasks_filter']['room'] = $room;
} //Added this for my custom filter
$form = array();
$form['filter'] = array(
'#type' => 'fieldset',
'#title' => t('Filter'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['filter']['group1'] = array(
'#type' => 'markup',
'#theme' => 'storm_form_group',
);
$form['filter']['group1']['taskcategory'] = array(
'#type' => 'select',
'#title' => t('Category'),
'#default_value' => $taskcategory,
'#options' => $category_list['values'],
);
$form['filter']['group1']['taskstatus'] = array(
'#type' => 'select',
'#title' => t('Status'),
'#default_value' => $taskstatus,
'#options' => $status_list['values'],
);
$form['filter']['group1']['taskpriority'] = array(
'#type' => 'select',
'#title' => t('Priority'),
'#default_value' => $taskpriority,
'#options' => $priority_list['values'],
);
$form['filter']['group1']['room'] = array(
'#type' => 'select',
'#title' => t('Rooms'),
'#default_value' => $room,
'#options' => $room_list['values'],
); //Added this for my custom field
$form['filter']['group2'] = array(
'#type' => 'markup',
'#theme' => 'storm_form_group',
);
$form['filter']['group2']['submit'] = array(
'#type' => 'submit',
'#value' => t('Filter'),
'#submit' => array('stormtask_tasks_filter_filter'),
);
$form['filter']['group2']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset'),
'#submit' => array('stormtask_tasks_filter_reset'),
);
return $form;
}
It is important to note that this is just one of the many functions that need to be altered but for the most part with the exception of a few instances it's as simple as copying and pasting the entries and adjusting according to your needs. It takes a little work but afterwards it is well worth it as this module is so far the best task management suite I have used, below are a couple screen shots of how everything looks once you add your fields.
Thanks!
Thanks for the reply, your adjustment looks pretty much like what I need.
I'll make the changes, hope it will work as expected.