May 22nd, 2013, 9:03 AM
Version 2.2.5
We have created a field (Counsellor) created_by that used a hook to populate it with the user first and last name.
using
Rule Name: "Created By"
Priority: 50
Hook Type: Code Hook
Code Hook: ft_create_blank_submission, end
PHP Code:
PHP Code:
global $g_table_prefix;
$name = "{$_SESSION["ft"]["account"]["first_name"]} {$_SESSION["ft"]["account"]["last_name"]}";
$name = ft_sanitize($name);
mysql_query("UPDATE {$g_table_prefix}form_{$form_id} SET created_by = '$name' WHERE submission_id = $new_submission_id");
There is also a Client Map Filter on the form using:
Counsellor like last name
Counsellor like first name
to allow the Counsellor see only their own submissions.
Users have been allocated views.
When the counsellor logs in they can see the forms.
When clicking 'view' they get the 'Add' button which is silently adding records but they cant see a blank form.
If I remove the filter then all is well.
The question is, how do I use a client map filter but still allow a user to see a blank submission form.
We have created a field (Counsellor) created_by that used a hook to populate it with the user first and last name.
using
Rule Name: "Created By"
Priority: 50
Hook Type: Code Hook
Code Hook: ft_create_blank_submission, end
PHP Code:
PHP Code:
global $g_table_prefix;
$name = "{$_SESSION["ft"]["account"]["first_name"]} {$_SESSION["ft"]["account"]["last_name"]}";
$name = ft_sanitize($name);
mysql_query("UPDATE {$g_table_prefix}form_{$form_id} SET created_by = '$name' WHERE submission_id = $new_submission_id");
There is also a Client Map Filter on the form using:
Counsellor like last name
Counsellor like first name
to allow the Counsellor see only their own submissions.
Users have been allocated views.
When the counsellor logs in they can see the forms.
When clicking 'view' they get the 'Add' button which is silently adding records but they cant see a blank form.
If I remove the filter then all is well.
The question is, how do I use a client map filter but still allow a user to see a blank submission form.