The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (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.31 (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.31 (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.31 (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.31 (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.31 (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.31 (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 array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Can I set client's account data as table fields? - 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: Can I set client's account data as table fields? (/showthread.php?tid=1575)



Can I set client's account data as table fields? - tinfire - Aug 30th, 2011

Hi everyone. I am now exploring Form Tools and I'm amazed how many aspects it takes into account to have a form running smooth. A wonderful piece of software!
This is a 'how' question. I have made an internal form with a couple of users (clients) and want to filter the submissions - each user edits its own. I guess this should be accomplished by preparing a separate view for each user and putting a client map filter in it. Unfortunately, I cannot find a way to match the filter "core fields" with some submissions table field - no client data there.

How can I set client's account data (username, etc.) as table fields?


RE: Can I set client's account data as table fields? - Ben - Aug 31st, 2011

Hi tinfire,

Welcome to the forums! Smile

haha, I never cease to be surprised at the ways in which this script is being used. What you described makes total sense, it's just that it wasn't expressly designed for it. But okay, let's try and figure it out.

Quote:I have made an internal form with a couple of users (clients) and want to filter the submissions - each user edits its own.... How can I set client's account data (username, etc.) as table fields?

So yes, the Client Map functionality is usually what you'll need to look at. Ordinarily, people use that in conjunction with an External form, then just include a hidden field containing a value that can be mapped to each client account when they log in, so each client sees different data depending on what info is in their account. This is cool because configuration is minimized: you need a single View, that's all.

But this obviously won't work in your case. So here's an alternative.

The Views now allow you to define default values for the submission field values. What you could do is create a new field in your form called "hidden_origin" or something like that. Create 2 Views, each defining a different value for that field: say, for client 1 have that field load up with "client1" and with client 2 have "client2". Don't bother adding that new field to a View - we don't want it to ever be editable - just initially set when the submission is first created.

So far so good: at this point, each submission will have one of those two values stored in the hidden_origin field depending on which View they were created with.

Next, map each View to a client so they can only see one or the other View.

Finally, create a Standard Filter to each View that limits the results to only show values with hidden_origin = "client1" or hidden_origin = "client2".

After all this is done, when each client logs in they'll see the same form but a different set of submissions. Anything one client creates will never be visible by the other.

Clear as mud?

- Ben


RE: Can I set client's account data as table fields? - tinfire - Aug 31st, 2011

Fast response! And is as clear as crystal, Ben! Thanks a lot.

I've tested your proposal for two clients and it works fine.

The solution for internal forms really needs separate view for each of the clients. I wondered how the external forms are OK with a single one (using the client's login procedure).

Quote:So yes, the Client Map functionality is usually what you'll need to look at. Ordinarily, people use that in conjunction with an External form, then just include a hidden field containing a value that can be mapped to each client account when they log in, so each client sees different data depending on what info is in their account. This is cool because configuration is minimized: you need a single View, that's all.

I'll try this later.
Thank you, Ben!