Bypass search Criteria screen on csv_directory.php

robeerski
Posts: 70
Member Since:
2008-01-30

I am using a couple of different CSV directories. One holds a set of pageing groups and another holds a set of voicemail blast groups. These CSV directories only have about 10 entries each. I have setup buttons to point to these different directories and since there are only about 10 entries in each list using a search seems a little pointless to me. I would like to see if there is a way to bypass the search criteria screen that gets displayed upon entering the csv_directory.php script. I would like to simply leave all criteria blank and go straight to the results screen found by pressing the lookup button.

I still like the ability to password protect these directorys. In password protecting the directory the script always reverts to letter entry instead of numbers. Is there a way to change this behavior to default to numbers instead?

I like the way the asterisk directory, directory.php, lists the results better so maybe there is a way to make that directory work for this purpose instead of the CSV directory.

In either case any help someone might have would be greatly appreciated.



aastra1
Posts: 287
Member Since:
2006-11-06
RE: CSV directory

I understand your request, unfortunately this is not really possible with the existing code which always starts with a lookup screen, what you could do is to call the script as if the user had entered empty search criteria and display the results but you would still have a "back" key to bring you back to the search screen which would be confusing for the user.

I will make the needed code change probably adding a launch parameter ("&mode=list" for instance) to properly handle this new behavior, it is pretty simple to implement, I might need to change the format of directory.conf though. I will post the availability of the new script as soon as it is available.

Actually you refer to the Asterisk wher I had the opposite request to add a "search" mode for large installations, I guess both modes are needed everywhere.

Stay tuned

Regards

--

---
aastra1
Aastra XML scripts 2.3.0 now available



robeerski
Posts: 70
Member Since:
2008-01-30
Thanks for the information

Hi Aastra1, I like your idea about calling the script as if the user had already entered empty search criteria as a temporary solution while I stay tuned for revised scripts. Is this easy to acomplish?

Thanks



TimMillerDyck
Posts: 7
Member Since:
2009-09-23
Aastra directory script change to automatically go to list mode

Hi robeersky,

I agree that for small offices (e.g. <10 extensions), it's faster simply to scroll through the directory list.

The following change alters the behaviour of the Directory application to go directly to the Directory listing screen.

* Back up the original file implementing the directory application for the Aastra 6731i phone (among others) -- if you have a different phone, check the directory_x.php files to find the right one.


cp -a /var/www/html/aastra/asterisk/directory_3.php /var/www/html/aastra/asterisk/directory_3.php.orig

* Edit the line setting the value of the variable "action"


vi /var/www/html/aastra/asterisk/directory_3.php


...
# Retrieve parameters
$user=Aastra_getvar_safe('user');
$page=Aastra_getvar_safe('page','1');
## Customization: make the default action on entering the Directory application to be a directory list instead of a directory search
##$action=Aastra_getvar_safe('action','search');
$action=Aastra_getvar_safe('action','list');
$selection=Aastra_getvar_safe('selection');
$origin=Aastra_getvar_safe('origin');
$lookup=Aastra_getvar_safe('lookup','');
...

A comment to Aastra folks:
* Making this a parameter would be handy (just "$action=Aastra_getvar_safe('action');" and add "&action=list" to the softkey definition?)
* The left arrow key does not act as a backspace in the directory application, which is the intuitive key to use. Requiring use of the separate Delete key (softkey 6) is less desirable, as it requires a second softkey for use with the directory application. It would be nice to be able to have left arrow act as a backspace key in the Directory application.

Thanks,
Tim



TimMillerDyck
Posts: 7
Member Since:
2009-09-23
Similar change for CSV directory application

The above change is for the Asterisk extension list directory application (titled "PBX Directory" by default). Here is the change to the .CSV directory to go directly to to the directory list, rather than requiring a search first. Note that the user can enter an empty search string at the “Letters name/company” or “Letters in name” prompt just pressing the down arrow key. But, if this is not desired, the following change alters the behaviour of the respective Directory application to go directly to the results list screen.

* Back up the original file implementing the .CSV directory application


cp -a /var/www/html/aastra/directory/csv_directory.php /var/www/html/aastra/directory/csv_directory.php.orig

* Edit the line setting the value of the variable "action"


vi /var/www/html/aastra/directory/csv_directory.php


...
#############################################################################
# Main code
#############################################################################
# Collect parameters
$user=Aastra_getvar_safe('user');
if($user=='')
{
$header=Aastra_decode_HTTP_header();
$user=$header['mac'];
}
## Customization: make the default action on entering the Directory application to be a directory list instead of a directory search
##$action=Aastra_getvar_safe('action','input');
$action=Aastra_getvar_safe('action','lookup');
$source=Aastra_getvar_safe('source');
...



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.