The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
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; HTHs someone! |