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
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
Filters question - 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: Filters question (/showthread.php?tid=830)



Filters question - PhoenixISP - Sep 1st, 2010

I am trying to set a filter so that certain clients can view only their form submissions. The people filling out the forms often make mistakes with the clients' names. What I would like to do is to filter so that the client can view submissions based on their "Name" or "Promotional Code" entered - but it appears that this system only allows "and" and not "or" when filtering.

Have I missed something? Can this be done?

Thanks in advance,

Sonny


RE: Filters question - Ben - Sep 3rd, 2010

Hi Sonny,

Thanks for the post!

The best way to do this is to replace the text field in your form with a dropdown of the client list. That would obviously prevent any typos or mistakes on the part of the user. But failing that, yes, you can still do it.

First off, to have a submission only show up for a particular client based on the value they entered in that field, you'd use a Client Map filter. Client Map filters let you create a single View that will behave differently for each client that logs into Form Tools. In your case, you'd define a rule like this:

Field: [the form field that contains the name of the client entered by the user]
Operator: LIKE
Client Field: Last Name

Then, after the View has been saved & assigned to all client accounts, each client that logs in would only ever see those submissions in which the user had entered their last name in that field.

(If you had a dropdown in your form for the client names, you could just make the values of each option the IDs of the client account, then set the Client Field to Account ID - that really would be a much better approach - it would ALWAYS work).

For the Promotional Code bit, would you want a View for this, or just allow the client to search by promotional code? That might be better.

But if you wanted to prevent any client from seeing any submissions except for those with a particular promotional code, then you'd probably just use a Standard Filter. You'd create multiple Views - each with a different Standard Filter, limiting the user accessing that View to only those submissions with a particular Promotional Code.

Reading over the above, it does sound a little complicated - so do let me know if you have any questions. Smile

- Ben


RE: Filters question - PhoenixISP - Sep 3rd, 2010

Hey Ben - thanks for the reply.

A drop down won't work as this site has several client companies, and they are all competitors. So when a "customer" comes onto the site they have been steered there by some sort of advertising campaign. Needless to say, the client doesn't want the customer to see any other company.

As I said, some customers put in partial names of the companies that draw them to the site, or mis-spell the names. The promo code is also part of the ad campaign. So while the customer may not remember the exact name of the company the promo code might stick in their head. I know this sounds like it's for dummies but I like to cover all bases.

So what I need is to have the client company defined by name OR promo code - which ever is entered properly. Is this possible by editing any of the php code in the script?

Thanks again Ben


RE: Filters question - Ben - Sep 3rd, 2010

Eesh, tricky!

For stuff like this, Views really aren't that great. They really require data to be well-formatted in one way or other, otherwise submissions that you want to show up aren't going to, and vice-versa...

In terms of the clients, would be a problem to just let them see all submissions, and just let them search the results by promo code / user? Guess so, huh...

Hmm... okay, how about this:
1. you could squish all the incoming data from those two fields (company name & promo code) into a single one. This would be a new field added in Form Tools & not actually in your form. [this step could be done very easily with the Submission Pre-Parser module]

2. Create a View for each client. Each View would have a Standard Filter that's been customized to that client. Namely:

Field: [your new squished field containing all info]
Operator: LIKE
Value(s): companyname|promocode

"companyname" would be their company name - or ideally a subset of the total string that is as unique as possible; promo code would be the promo code. The pipe symbol that separates them just tells Form Tools to look for either. So that View would match submissions that had either the company or promo code (or both).

It's not ideal, since you'd need to create a custom View for each client - but it's an option.

As I said - tricky problem!

- Ben


RE: Filters question - PhoenixISP - Sep 3rd, 2010

Ben - thanks man. I'm going to give this a try. I appreciate your input.