The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(257) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/printthread.php(257) : eval()'d code 2 errorHandler->error
/printthread.php 257 eval
/printthread.php 117 printthread_multipage
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Client name field - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Client name field (/showthread.php?tid=1902)

Pages: 1 2


Client name field - kokorase - Feb 15th, 2012

Hi again Smile

Is there anyway to make a field that automatically add the currently logged on client name ?

And is there anyway to increase the font size of the text of the form ??

Thanks in advance


RE: Client name field - Ben - Feb 17th, 2012

Hi Kokorase,

Quote:Is there anyway to make a field that automatically add the currently logged on client name ?
How would you like this to work, exactly? So when a client account logs in and updates or adds a record, it would store their name?

Quote:And is there anyway to increase the font size of the text of the form ??
You can, but you'd need to edit the CSS for whatever theme you're using: or even develop your own theme to make those changes.

- Ben


RE: Client name field - kokorase - Feb 19th, 2012

Hi Ben,
Thanks alot for replying Smile

" How would you like this to work, exactly? So when a client account logs in and updates or adds a record, it would store their name? "

I want this to work when the client adds record .. I'm using the internal form .. so i make it shows the creation date and IP .. i want it to show the name of the client that added this record too .

And for enlarging font .... I'm using the default theme .. but i don't know which CSS file to edit .. can you tell me ..

Thanks alot


RE: Client name field - kokorase - Feb 23rd, 2012

Up .. still waiting for answer Smile


RE: Client name field - Ben - Feb 24th, 2012

Heya,

Sorry for the wait. Just travelling at the moment, and getting decent (and affordable) internet is surprising tricky.

For the font size, check out this file:
/themes/default/css/general.css - look at line 16 which defines the general styles for many elements, including the font size.

For the other thing, I'll take a look at this today. It'll take some custom code with the Submission Pre-Parser module to do it.

- Ben


RE: Client name field - Ben - Feb 24th, 2012

Hi kokorase,

Here's how to log the name of the client who created the submissions.

1. Install the Hooks Manager module:
http://modules.formtools.org/hooks_manager/

2. In your form, create a new field called something like "Created By"; set it to a textbox, with database size "Medium" (256 chars), and give it database column name "created_by". All this is done on the Edit Form -> Fields tab.

3. Go to the Hooks Manager module and create a new rule with the following info:

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"); 

And that's it! Now, whenever a client (or the admin, for that matter) creates a new submission through the Form Tools interface, it will pull the name of the account (first + last name) and store it in the new "created_by" database column.

To have that information show up in the interface, you'll need to add the field to one of your Views.

Hope this helps!

- Ben


RE: Client name field - kokorase - Feb 25th, 2012

Both solutions have worked out perfectly Big Grin

Thanks alot for your help Ben .. I won't be able to thank you enough for that .... you are truly a life savior Wink


RE: Client name field - renobird - Feb 25th, 2012

Nice! This looks like it will accomplish what I was after here:
http://forums.formtools.org/showthread.php?tid=1913

I can use the "created by" field to test against in the Client Map Filters.

I'll report back if that works as expected.


RE: Client name field - cvoliveira - Feb 28th, 2012

Hi Ben,

This is very usefull, however I would like to ask if it's possible to do the same with field 'company_name' that is located in a different table (account_settings). I tried to create a hook rule for that but doesn't work.

(Feb 24th, 2012, 6:40 PM)Ben Wrote: Hi kokorase,

Here's how to log the name of the client who created the submissions.

1. Install the Hooks Manager module:
http://modules.formtools.org/hooks_manager/

2. In your form, create a new field called something like "Created By"; set it to a textbox, with database size "Medium" (256 chars), and give it database column name "created_by". All this is done on the Edit Form -> Fields tab.

3. Go to the Hooks Manager module and create a new rule with the following info:

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"); 

And that's it! Now, whenever a client (or the admin, for that matter) creates a new submission through the Form Tools interface, it will pull the name of the account (first + last name) and store it in the new "created_by" database column.

To have that information show up in the interface, you'll need to add the field to one of your Views.

Hope this helps!

- Ben




RE: Client name field - andy_12-12 - Sep 24th, 2012

(Feb 24th, 2012, 6:40 PM)Ben Wrote: Hi kokorase,

Here's how to log the name of the client who created the submissions.

1. Install the Hooks Manager module:
http://modules.formtools.org/hooks_manager/

2. In your form, create a new field called something like "Created By"; set it to a textbox, with database size "Medium" (256 chars), and give it database column name "created_by". All this is done on the Edit Form -> Fields tab.

3. Go to the Hooks Manager module and create a new rule with the following info:

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"); 

And that's it! Now, whenever a client (or the admin, for that matter) creates a new submission through the Form Tools interface, it will pull the name of the account (first + last name) and store it in the new "created_by" database column.

To have that information show up in the interface, you'll need to add the field to one of your Views.

Hope this helps!

- Ben

Hi

I have tried this suggestion, and checked my implementation of it, and for me it doesn't work. Please could you suggest where I might be going wrong or how else I could store the username each time a new record gets created.