I've seen a few posts on this, but we really need it... so I built it. The idea is to create a filter which lets developers restrict which leads / entries are returned to the user through the back end.
It could be used to divide forms by department, allow back end separation by client, or by form... whatever the dev wants. Here are some sample topics:
http://www.gravityhelp.com/forums/topic/show-only-entries-from-a-field
http://www.gravityhelp.com/forums/topic/lead-generation-for-companies
http://www.gravityhelp.com/forums/topic/admin-entries-filters
Adding the filter is easy
forms_model.php line ~2386 (immediately before return of get_lead
$leads = apply_filters("gform_filter_leads", $leads);
forms_model.php line ~2488 (immediately before return of get_leads
$leads = apply_filters("gform_filter_leads", $leads);
Very easy change, very powerful results.
The only slight issue is that this will interfere with the counts (all/unread/starred/trashed/spam)
There are a couple ways to handle. You could put in a little more overhead and have the counts actually run the get_leads function. Or you could just remove the counts (this is what I did since I don't think they add any value).
entry_list.php line ~584
<ul class="subsubsub">
- <li><a class="<?php echo empty($filter) ? "current" : "" ?>" href="?page=gf_entries&view=entries&id=<?php echo $form_id ?>"><?php _e("All", "gravityforms"); ?> <span class="count">(<span id="all_count"><?php echo $active_lead_count ?></span>)</span></a> | </li>
- <li><a class="<?php echo $read !== null ? "current" : ""?>" href="?page=gf_entries&view=entries&id=<?php echo $form_id ?>&filter=unread"><?php _e("Unread", "gravityforms"); ?> <span class="count">(<span id="unread_count"><?php echo $unread_count ?></span>)</span></a> | </li>
- <li><a class="<?php echo $star !== null ? "current" : ""?>" href="?page=gf_entries&view=entries&id=<?php echo $form_id ?>&filter=star"><?php _e("Starred", "gravityforms"); ?> <span class="count">(<span id="star_count"><?php echo $starred_count ?></span>)</span></a> | </li>
+ <li><a class="<?php echo empty($filter) ? "current" : "" ?>" href="?page=gf_entries&view=entries&id=<?php echo $form_id ?>"><?php _e("All", "gravityforms"); ?></a> | </li>
+ <li><a class="<?php echo $read !== null ? "current" : ""?>" href="?page=gf_entries&view=entries&id=<?php echo $form_id ?>&filter=unread"><?php _e("Unread", "gravityforms"); ?></a> | </li>
+ <li><a class="<?php echo $star !== null ? "current" : ""?>" href="?page=gf_entries&view=entries&id=<?php echo $form_id ?>&filter=star"><?php _e("Starred", "gravityforms"); ?></a> | </li>
<?php
if(GFCommon::akismet_enabled($form_id)){
?>
- <li><a class="<?php echo $filter == "spam" ? "current" : ""?>" href="?page=gf_entries&view=entries&id=<?php echo $form_id ?>&filter=spam"><?php _e("Spam", "gravityforms"); ?> <span class="count">(<span id="spam_count"><?php echo $spam_count ?></span>)</span></a> | </li>
+ <li><a class="<?php echo $filter == "spam" ? "current" : ""?>" href="?page=gf_entries&view=entries&id=<?php echo $form_id ?>&filter=spam"><?php _e("Spam", "gravityforms"); ?></a> | </li>
<?php
}
?>
- <li><a class="<?php echo $filter == "trash" ? "current" : ""?>" href="?page=gf_entries&view=entries&id=<?php echo $form_id ?>&filter=trash"><?php _e("Trash", "gravityforms"); ?> <span class="count">(<span id="trash_count"><?php echo $trash_count ?></span>)</span></a></li>
+ <li><a class="<?php echo $filter == "trash" ? "current" : ""?>" href="?page=gf_entries&view=entries&id=<?php echo $form_id ?>&filter=trash"><?php _e("Trash", "gravityforms"); ?></a></li>
</ul>
I think this would be a great addition to the core and of course would save me from having to make the change on every update.