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 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
Customise List of Returned Subnissions - 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: Customise List of Returned Subnissions (/showthread.php?tid=2947)



Customise List of Returned Subnissions - grahame - Mar 11th, 2014

Hi

As you know, when a client-user clicks 'View' against a form on their Forms menu, a list of submissions is presented. This list can then be customised by use of the Search box whereby a field and a value for that field can be used to filter the list.

What I want to do is to automatically add a filter (on one column) to the list as it is presented (it will always be the same column-name for every form). I am guessing this should be quite easy to do programmatically?

I have looked in clients/forms/index.php and I see a

$forms = ft_search_forms($account_id, false, $search_criteria);

but where do I find the source for ft_search_forms please?

Thanks


RE: Customise List of Returned Subnissions - grahame - Mar 11th, 2014

Ah… I have found a hook instead in the hooks manager:

ft_search_submissions, end

just got to figure out how I grab the results, add my 'auto-filter' and substitute the filtered results?
Ok…

There is an override variable, $return_hash. Does this 'send' a list of the submissions to be displayed to the template?

I did an implode() on this but all I got was the bland "Array" in the 1st element … so I guess it's an array within an array? If that's the case does it contain all the submissions records?

Any help to sped this up appreciated… I hate PHP arrays :o)




RE: Customise List of Returned Subnissions - grahame - Mar 11th, 2014

Ah... I have sussed this ... $hash_return is a multidimensional array containing returned submission records.. Once I've written my hook to manipulate it I will post the code.....


RE: Customise List of Returned Subnissions - Joe - Mar 11th, 2014

Fantastic! Thanks!

Cheers,

Joe


RE: Customise List of Returned Subnissions - grahame - Mar 11th, 2014

OK … this seems to work for me…

Loop around the $return_hash array in the ft_search_submissions, end hook and remove whatever elements take your fancy!

As this is a multi-dimensional, associative array, my brain went into a loop of its own trying to code it… but try this… (p.s. don't forget to reduce the counters in $return_hash!)
Code:
$delete_count = 0;

foreach ($return_hash['search_rows'] as $index => $data) {
   if ($data['account_id'] <> $acc_id ) {   <= substitute your test here
      unset($return_hash['search_rows'][$index]);
      $delete_count = $delete_count + 1;
   }
}

$return_hash['search_num_results'] = ($return_hash['search_num_results'] - $delete_count);
$return_hash['view_num_results'] = ($return_hash['view_num_results'] - $delete_count);

HTHs someone!