Aug 23rd, 2011, 3:30 AM
(This post was last modified: Aug 23rd, 2011, 4:54 AM by russellfeeed.)
Hi
I'd like to create a client account using ft_api_create_client_account(), but then I'd like to give them their own view, with a filter specific to them.
Each client would be looking into the same form, but they can only see some submission, as specified by the filter.
I'm not sure how I'd go about creating the view and associating it with a client.
In global/code/views.php, there is
function ft_create_new_view($form_id, $create_from_view_id = "")
which looks like it will create the view base on another view, which is what I need, but this isn't exposed in the API.
Then function _ft_update_view_filter_settings($view_id, $info) looks like it'll be useful for setting my filter. I'd need to work out the format of $info but it looks like is should be something like...
$info["form_id"] = 27;
$info["standard_filter_1_field_id"] = 'myfieldname';
$info["standard_filter_1_operator"] = 'equals'
$info["standard_filter_1_filter_values"] = 'stringtomatch';
But again, this is not exposed in the API.
I've sort of reached a dead end with how to assign a view to a client.
Any pointers?
Thanks
Russell
I'd like to create a client account using ft_api_create_client_account(), but then I'd like to give them their own view, with a filter specific to them.
Each client would be looking into the same form, but they can only see some submission, as specified by the filter.
I'm not sure how I'd go about creating the view and associating it with a client.
In global/code/views.php, there is
function ft_create_new_view($form_id, $create_from_view_id = "")
which looks like it will create the view base on another view, which is what I need, but this isn't exposed in the API.
Then function _ft_update_view_filter_settings($view_id, $info) looks like it'll be useful for setting my filter. I'd need to work out the format of $info but it looks like is should be something like...
$info["form_id"] = 27;
$info["standard_filter_1_field_id"] = 'myfieldname';
$info["standard_filter_1_operator"] = 'equals'
$info["standard_filter_1_filter_values"] = 'stringtomatch';
But again, this is not exposed in the API.
I've sort of reached a dead end with how to assign a view to a client.
Any pointers?
Thanks
Russell