Ticket #2826 (closed Module Submissions: fixed)

Opened 6 months ago

Last modified 5 months ago

Bulk Extensions module to add, edit, delete extensions from a CSV file

Reported by: sasargen Assigned to:
Priority: minor Milestone: Cut Line
Component: Third Party Module Version: 2.4.0
Keywords: bulk extensions import load add edit delete csv Cc:
Confirmation: Unreviewed SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

This module is a replacement and upgrade for the importextensions module. After installation there will be a Bulk Extensions entry under Third Party Addon on the Tools tab on the left side menu. The Bulk Extensions page allows you to download a template CSV file. It also allows you to upload a CSV file for processing. Almost all the options shown on the FreePBX 2.4 Extensions interface can be specified in the CSV file. The template CSV file has examples of adding a new extension, editing an existing extension, and deleting an existing extension.

I have only tested this module with FreePBX 2.4, so I don't know if there is any backward compatibility.

Attachments

bulkextensions-0.1.tgz (4.4 kB) - added by sasargen on 05/22/08 06:43:38.
bulkextensions.0.1.1.tgz (4.4 kB) - added by sasargen on 06/03/08 14:58:21.
With bugfixes recommended by wiseoldowl
bulkextensions-0.1.1.tgz (4.4 kB) - added by sasargen on 06/03/08 15:16:52.
corrected file name to load correctly, added .htaccess file to always allow download of csv template

Change History

05/22/08 06:43:38 changed by sasargen

  • attachment bulkextensions-0.1.tgz added.

(in reply to: ↑ description ) 05/22/08 06:48:14 changed by sasargen

This ticket should be a Module Submission, not a Bug, but I can't find a way to change it.

05/22/08 09:56:10 changed by lazytt

  • type changed from Bugs to Module Submissions.

05/22/08 18:43:59 changed by wiseoldowl

Haven't been able to fully test it but in just giving it a cursory glance I think there may be a bad path in line 559 of bulkextension.php:

<p>Right click -> Save as : <a href="modules/importextensions/template.csv">Template CSV</a> (file includes examples of adding, editing and deleting extensions)<br><br>

Shouldn't importextensions be changed to bulkextensions?

Also, when I tried to initially upload the module, I got an error and wound up having to move the directory and change the ownership manually. The error I got was this:

The following error(s) occured processing the uploaded file:

    * File extracting to invalid location: ./
    * File extracting to invalid location: ./page.bulkextensions.php
    * File extracting to invalid location: ./functions.inc.php
    * File extracting to invalid location: ./module.xml
    * File extracting to invalid location: ./template.csv

You should fix the problem or select another file and try again.

06/03/08 14:57:29 changed by sasargen

wiseoldowl, thank you for the feedback. I fixed the path name for downloading the csv template file and created a new tgz file with the correct directory structure. Please let me know if you find any other bugs.

06/03/08 14:58:21 changed by sasargen

  • attachment bulkextensions.0.1.1.tgz added.

With bugfixes recommended by wiseoldowl

06/03/08 15:16:52 changed by sasargen

  • attachment bulkextensions-0.1.1.tgz added.

corrected file name to load correctly, added .htaccess file to always allow download of csv template

06/03/08 15:58:55 changed by wiseoldowl

sasargen - using bulkextensions-0.1.1.tgz I had no problem uploading and installing it, nor in downloading the sample .csv file. I still don't have a group of extensions to add so cannot test that, but it appears you've fixed the installation issues.

There are two things I am just wondering abuot:

First, in addition to exporting the sample template.csv file, would it be too difficult to actually have a way export all the existing extensions in the database. I can see this being useful in a few situations - for backup, obviously, or to aid in migration to a different system (if for some reason a standard FreePBX backup and restore fails). But also in situations where you may say, "I want to configure five new extensions exactly like extension 1234, but with different extensions numbers" - then you could just copy the row for extension 1234 and paste it as many times as you need it, and go from there.

The second thing is, would it be possible to have it check to see if any additional fields are in use and add them to the sample and/or exported .csv file? For example, if you are using the Custom Contexts module, it adds a field to each extension page called (appropriately) "Custom Context" which lets you place that extension in the desired context, and I assume that uses an added field in the extensions database. I would suppose it's possible that other modules may add fields as well. In any case, I'm just thinking that if it's not too much work, it would be good to poll the existing database to find what fields are actually in use, rather than using a static sample .csv file. This is just a suggestion, if you care to do any more development on this module.

06/03/08 16:26:11 changed by p_lindheimer

sasargen, two questions. Is this a replacement for importextensions or 'another module' Second question, do you want me to give you write access to the contributed module svn directory where you can place this module and maintain it. You can either replace importextensions with it (which is there) or we can create a place there as a new module if you consider it new. The original author has not, to my knowledge, done anything with the importextensions module that is there.

06/03/08 20:31:40 changed by sasargen

wiseoldowl, thanks for your testing.

First, I believe that FreePBX would be able to export a csv of existing extensions. It seems like the basic functionality is present in the Print Extensions module. It would definitely enhance this module to be able to export all existing extensions to csv. I'll take a look at it, but can't make any promises.

Second, I haven't seen a way to get FreePBX to "tell" me what fields it is using for extensions. Any working techniques for this would be very much appreciated. Also, this module is already handling more than 50 variables for each extension, so I had to draw the line somewhere. So far, I need to support options available from the standard Extensions page, but not any additional fields.

p_lindheimer, in my view, this is a replacement for importextensions. It includes the original functionality, adds support for voicemail configuration, and adds delete and edit functionality. I changed the name to indicate that it no longer just imports extensions. Please give me write access to the svn directory. I would like to replace importextensions with bulk extensions.

06/03/08 20:47:38 changed by p_lindheimer

sasargen, you should have access now using your freepbx.org credentials to the contributed_modules branch of the directory. I'll let you decide if it is better to just leave importextensions as is and add your new one, or change the name of yours to importextensions and evolve the old one to your - what ever you think makes most sense.

If you have issues writing or questions, look for one of us on #freepbx-dev on the irc.

06/04/08 11:22:39 changed by sasargen

This module has been added to the SVN under contributed_modules/modules/bulkextensions.

07/01/08 16:15:27 changed by lazytt

  • status changed from new to closed.
  • resolution set to fixed.

sasargen: in the future, please include the revision number of the check in when you announe (here) that you checked stuff in. Thanks!

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads