Changeset 10337

Show
Ignore:
Timestamp:
10/04/10 13:59:13 (3 years ago)
Author:
mickecarlsson
Message:

Close #4567 added fax settings to bulkextensions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • contributed_modules/modules/bulkextensions/CHANGES

    r9345 r10337  
    77   Note: Translate only the text, not labels. All labels in position 1 must remain as they are. 
    88Fixed bug when setting one entry in a field in the csv file all fields that where empty got an empty line in the config files 
    9     
    10     
    11     
     9Added import for fax settings. Note: This will only works for FreePBX 2.7 and above    
  • contributed_modules/modules/bulkextensions/functions.inc.php

    r10216 r10337  
    3232    include_once("modules/findmefollow/functions.inc.php"); // for using findmefollow functions to retreive follow me settings 
    3333    }; 
     34if (file_exists("modules/fax/functions.inc.php")) { 
     35    include_once("modules/fax/functions.inc.php");             // for using fax functions to retreive fax settings 
     36    }; 
    3437 
    3538/* Verify existence of voicemail, dictate, languages and findmefollow functions. */ 
     
    5356} else { 
    5457  $findme_exists  = FALSE; 
     58} 
     59if (function_exists("fax_get_user") && function_exists("fax_save_user") && function_exists("fax_delete_user")) { 
     60       $fax_exists     = TRUE; 
     61} else { 
     62       $fax_exists     = FALSE; 
    5563} 
    5664 
     
    6169  global $lang_exists; 
    6270  global $findme_exists; 
     71  global $fax_exists; 
    6372  $action   = "edit"; 
    6473  $fname    = "bulkext__" .  (string) time() . $_SERVER["SERVER_NAME"] . ".csv"; 
    65   $csv_header   = "action,extension,name,cid_masquerade,sipname,outboundcid,ringtimer,callwaiting,call_screen,pinless,password,emergency_cid,tech,hardware,devinfo_channel,devinfo_secret,devinfo_notransfer,devinfo_dtmfmode,devinfo_canreinvite,devinfo_context,devinfo_immediate,devinfo_signalling,devinfo_echocancel,devinfo_echocancelwhenbrdiged,devinfo_echotraining,devinfo_busydetect,devinfo_busycount,devinfo_callprogress,devinfo_host,devinfo_type,devinfo_nat,devinfo_port,devinfo_qualify,devinfo_callgroup,devinfo_pickupgroup,devinfo_disallow,devinfo_allow,devinfo_dial,devinfo_accountcode,devinfo_mailbox,devinfo_deny,devinfo_permit,devicetype,deviceid,deviceuser,description,dictenabled,dictformat,dictemail,langcode,record_in,record_out,vm,vmpwd,email,pager,attach,saycid,envelope,delete,options,vmcontext,vmx_state,vmx_unavail_enabled,vmx_busy_enabled,vmx_play_instructions,vmx_option_0_sytem_default,vmx_option_0_number,vmx_option_1_system_default,vmx_option_1_number,vmx_option_2_number,account,ddial,pre_ring,strategy,grptime,grplist,annmsg_id,ringing,grppre,dring,needsconf,remotealert_id,toolate_id,postdest\n"; 
     74  $csv_header   = "action,extension,name,cid_masquerade,sipname,outboundcid,ringtimer,callwaiting,call_screen,pinless,password,emergency_cid,tech,hardware,devinfo_channel,devinfo_secret,devinfo_notransfer,devinfo_dtmfmode,devinfo_canreinvite,devinfo_context,devinfo_immediate,devinfo_signalling,devinfo_echocancel,devinfo_echocancelwhenbrdiged,devinfo_echotraining,devinfo_busydetect,devinfo_busycount,devinfo_callprogress,devinfo_host,devinfo_type,devinfo_nat,devinfo_port,devinfo_qualify,devinfo_callgroup,devinfo_pickupgroup,devinfo_disallow,devinfo_allow,devinfo_dial,devinfo_accountcode,devinfo_mailbox,devinfo_deny,devinfo_permit,devicetype,deviceid,deviceuser,description,dictenabled,dictformat,dictemail,langcode,record_in,record_out,vm,vmpwd,email,pager,attach,saycid,envelope,delete,options,vmcontext,vmx_state,vmx_unavail_enabled,vmx_busy_enabled,vmx_play_instructions,vmx_option_0_sytem_default,vmx_option_0_number,vmx_option_1_system_default,vmx_option_1_number,vmx_option_2_number,account,ddial,pre_ring,strategy,grptime,grplist,annmsg_id,ringing,grppre,dring,needsconf,remotealert_id,toolate_id,postdest,faxenabled,faxemail\n"; 
    6675  $data     = $csv_header; 
    6776  $exts     = get_all_exts(); 
     
    161170      $ddial    = isset($followme_settings["ddial"])?$followme_settings["ddial"]:""; 
    162171    } 
     172 
     173    /* Obtain fax settings */ 
     174    if ($fax_exists) { 
     175        $fax_settings = fax_get_user($e); 
     176        } 
     177    if (isset($fax_settings)) { 
     178    $faxenabled     = isset($fax_settings["faxenabled"])?$fax_settings["faxenabled"]:""; 
     179    $faxemail       = isset($fax_settings["faxemail"])?$fax_settings["faxemail"]:""; 
     180    } 
     181 
    163182    $csv_line[0]  = $action; 
    164183    $csv_line[1]  = isset($u_info["extension"])?$u_info["extension"]:""; 
     
    250269    $csv_line[83] = isset($toolate_id)?$toolate_id:""; 
    251270    $csv_line[84] = isset($postdest)?$postdest:""; 
     271    $csv_line[85]   = isset($faxenabled)?$faxenabled:""; 
     272    $csv_line[86]   = isset($faxemail)?$faxemail:""; 
     273 
    252274    for ($i = 0; $i < count($csv_line); $i++) { 
    253275      /* If the string contains a comma, enclose it in double-quotes. */ 
  • contributed_modules/modules/bulkextensions/i18n/sv_SE/LC_MESSAGES/table.csv

    r10216 r10337  
    8686"toolate_id","blankt eller 0 (Standard)","nÃ¥gon inspelnings-id aktivt pÃ¥ systemet","För-sent meddelande: (Sidan Följ-mig)","Meddelande att spela upp för den UPPRINGDE, om samtalet redan har besvarats av annan part, innan denna uppringda har tryckt 1.<br><br>För att lÀgga till inspelningar vÀljer du "Systeminspelningar"i menyn till vÀnster" 
    8787"postdest",,"Text i formatet <b>context,exten,priority</b> som Àr en aktiv destination i nummerplanen pÃ¥ systemet","Destination vid inget svar: (Sidan Följ-mig)", 
     88"faxenabled",,"true eller tomt","Aktiverad","Aktiveras fax om instÀllningen sÀtts till <b>true</b>. Om detta fÀlt Àr tomt readeras faxinstÀllningen" 
     89"faxemail",,"Giltig e-postadress","E-post för fax","E-postadress dit mottagna fax skickas" 
  • contributed_modules/modules/bulkextensions/module.xml

    r10217 r10337  
    33  <name>Bulk Extensions</name> 
    44  <description>Bulk Extensions uses CSV files to import and export extensions.</description> 
    5   <version>2.5.0.7</version> 
     5  <version>2.7.0.0</version> 
    66  <type>tool</type> 
    77  <category>Third Party Addon</category> 
     
    1010  </menuitems> 
    1111  <depends> 
    12     <version>ge2.5</version> 
     12    <version>ge2.7</version> 
    1313  </depends> 
    14   <location>contributed_modules/release/bulkextensions-2.5.0.7.tgz</location> 
     14  <location>contributed_modules/release/bulkextensions-2.7.0.0.tgz</location> 
    1515  <info></info> 
    1616  <changelog> 
     17    *2.7.0.0* #4567 Add fax setting 
    1718    *2.6.0.7* #4495 
    1819    *2.5.0.6* #4150 
  • contributed_modules/modules/bulkextensions/page.bulkextensions.php

    r10216 r10337  
    155155      "remotealert_id" => array(false, -1), 
    156156      "toolate_id" => array(false, -1), 
    157       "postdest" => array(false, -1) 
     157      "postdest" => array(false, -1), 
     158      "faxenabled" => array(false, -1), 
     159      "faxemail" => array(false, -1) 
    158160      ); 
    159161 
     
    621623          $vars["postdest"] = trim($aInfo[$aFields["postdest"][1]]); 
    622624        } 
    623  
     625        if ($aFields["faxenabled"][0]) { 
     626        if (!isset($aInfo[$aFields["faxenabled"][1]]) || ($aInfo[$aFields["faxenabled"][1]] == "")){ 
     627        unset($vars["faxenabled"]); 
     628        } else { 
     629      $vars["faxenabled"] = trim($aInfo[$aFields["faxenabled"][1]]); 
     630      } 
     631        } 
     632        if ($aFields["faxemail"][0]) { 
     633        if (!isset($aInfo[$aFields["faxemail"][1]]) || ($aInfo[$aFields["faxemail"][1]] == "")){ 
     634        unset($vars["faxemail"]); 
     635        } else { 
     636      $vars["faxemail"] = trim($aInfo[$aFields["faxemail"][1]]); 
     637      } 
     638        } 
    624639          
    625640        /* Needed fields for creating a Follow Me are account (aka grpnum), strategy, grptime, */ 
     
    643658        } 
    644659 
     660 
     661 
    645662        if (!(isset($amp_conf["AMPEXTENSIONS"]) && ($amp_conf["AMPEXTENSIONS"] == "deviceanduser"))) { 
    646663          $vars["devicetype"]   = "fixed"; 
     
    695712            findmefollow_add($vars["account"], $vars["strategy"], $vars["grptime"], $vars["grplist"], $vars["postdest"], $vars["grppre"], $vars["annmsg_id"], $vars["dring"], $vars["needsconf"], $vars["remotealert_id"], $vars["toolate_id"], $vars["ringing"], $vars["pre_ring"], $vars["ddial"]); 
    696713          } 
     714          if ($fax_exists) { 
     715            fax_save_user($vars["extension"], $vars["faxenabled"], $vars["faxemail"]); 
     716          } 
     717 
    697718          // begin status output for this row 
    698719          $output .= "Row $k: Added: " . $vars["extension"]; 
     
    836857          $change = true; 
    837858        } 
     859                                if ($fax_exists) { 
     860                                // If there is no entry in faxenabled, then delete the user in the fax table 
     861                                    if (!isset($aInfo[$aFields["faxenabled"][1]]) || ($aInfo[$aFields["faxenabled"][1]] == "")){ 
     862                                        fax_delete_user($vars["extension"]); 
     863                                        } else { 
     864                                            fax_save_user($vars["extension"], $vars["faxenabled"], $vars["faxemail"]); 
     865                                            } 
     866                                    } 
     867 
    838868        $output .= "Row $k: Edited: " . $vars["extension"] . "<BR>"; 
    839869        break; 
     
    874904          voicemail_mailbox_del($vars["extension"]); 
    875905        } 
     906                                // Fax settings 
     907                                if ($fax_exists) { 
     908                                        fax_delete_user($vars["extension"]); 
     909                                } 
    876910        $output .= "Row $k: Deleted: " . $vars["extension"] . "<BR>"; 
    877911        break; 
  • contributed_modules/modules/bulkextensions/table.csv

    r10216 r10337  
    7676"grptime","20","0-60","Ring Time (max 60 sec) (Follow Me page)","Time in seconds that the phones will ring. For all hunt style ring strategies, this is the time for each iteration of phone(s) that are rung" 
    7777"grplist","User's own extension",List of extensions (hyphen separated),"Follow-Me List: (Follow Me page)","extension-extension-extension-... (extension is numeric; multiple extensions separated by '-')<br><br>You can include an extension on a remote system, or an external number by suffixing a number with a pound (#).  ex:  2448089# would dial 2448089 on the appropriate trunk (see Outbound Routing)." 
    78 "annmsg_id","blank or 0 (means None)","any recording id active on system","Announcement: (Follow Me page)","Message to be played to the caller before dialing this group.<br><br>To add additional recordings please use the "System Recordings" MENU to the left" 
     78"annmsg_id","blank or 0 (means None)","any recording id active on system","Announcement: (Follow Me page)","Message to be played to the caller before dialing this group.<br><br>To add additional recordings please use the 'System Recordings' MENU to the left" 
    7979"ringing","Ring","Ring, default, none, or any active Music On Hold class on the system","Play Music On Hold? (Follow Me page)","If you select a Music on Hold class to play, instead of 'Ring', they will hear that instead of Ringing while they are waiting for someone to pick up." 
    8080"grppre",,,"CID Name Prefix: (Follow Me page)","You can optionally prefix the Caller ID name when ringing extensions in this group. ie: If you prefix with 'Sales:', a call from John Doe would display as 'Sales:John Doe' on the extensions that ring." 
    8181"dring",,"Valid alert info text recognized by SIP phone","Alert Info: (Follow Me page)","You can optionally include an Alert Info which can create distinctive rings on SIP phones." 
    8282"needsconf",,"CHECKED or (blank)","Confirm Calls: (Follow Me page)","Enable this if you're calling external numbers that need confirmation - eg, a mobile phone may go to voicemail which will pick up the call. Enabling this requires the remote side push 1 on their phone before the call is put through. This feature only works with the ringall/ringall-prim  ring strategy" 
    83 "remotealert_id","blank or 0 (means Default)","any recording id active on the system","Remote Announce: (Follow Me page)","Message to be played to the person RECEIVING the call, if 'Confirm Calls' is enabled.<br><br>To add additional recordings use the "System Recordings" MENU to the left" 
    84 "toolate_id","blank or 0 (means Default)","any recording id active on the system","Too-Late Announce: (Follow Me page)","Message to be played to the person RECEIVING the call, if the call has already been accepted before they push 1.<br><br>To add additional recordings use the "System Recordings" MENU to the left" 
     83"remotealert_id","blank or 0 (means Default)","any recording id active on the system","Remote Announce: (Follow Me page)","Message to be played to the person RECEIVING the call, if 'Confirm Calls' is enabled.<br><br>To add additional recordings use the 'System Recordings' MENU to the left" 
     84"toolate_id","blank or 0 (means Default)","any recording id active on the system","Too-Late Announce: (Follow Me page)","Message to be played to the person RECEIVING the call, if the call has already been accepted before they push 1.<br><br>To add additional recordings use the 'System Recordings' MENU to the left" 
    8585"postdest",,"Text in the format <b>context,exten,priority</b> that is an active dialplan destination on the system","Destination if no answer: (Follow Me page)", 
     86"faxenabled",,"true or blank","Enabled","Enables fax if setting is set to <b>true</b>. If left blank fax settings are removed" 
     87"faxemail",,"Valid email address","Fax Email","Email address where fax should be emailed to" 
  • contributed_modules/modules/bulkextensions/template.csv

    r10216 r10337  
    11action,extension,name,cid_masquerade,sipname,outboundcid,ringtimer,callwaiting,call_screen,pinless,emergency_cid,tech,hardware,devinfo_channel,devinfo_secret,devinfo_notransfer,devinfo_dtmfmode,devinfo_canreinvite,devinfo_context,devinfo_immediate,devinfo_signalling,devinfo_echocancel,devinfo_echocancelwhenbrdiged,devinfo_echotraining,devinfo_busydetect,devinfo_busycount,devinfo_callprogress,devinfo_host,devinfo_type,devinfo_nat,devinfo_port,devinfo_qualify,devinfo_callgroup,devinfo_pickupgroup,devinfo_disallow,devinfo_allow,devinfo_dial,devinfo_accountcode,devinfo_mailbox,devinfo_deny,devinfo_permit,devicetype,deviceid,deviceuser,description,dictenabled,dictformat,dictemail,langcode,record_in,record_out,vm,vmpwd,email,pager,attach,saycid,envelope,delete,options,vmcontext,vmx_state,vmx_unavail_enabled,vmx_busy_enabled,vmx_play_instructions,vmx_option_0_sytem_default,vmx_option_0_number,vmx_option_1_system_default,vmx_option_1_number,vmx_option_2_number,account,ddial,pre_ring,strategy,grptime,grplist,annmsg_id,ringing,grppre,dring,needsconf,remotealert_id,toolate_id,postdest 
    22 
    3 edit,999999,John Doe,999999,,,0,enabled,0,,,sip,,,1234,,rfc2833,no,from-internal,,,,,,,,,dynamic,friend,yes,5060,yes,,,,,SIP/999999,,999999@device,,,fixed,,999999,John Doe,disabled,ogg,,,Adhoc,Adhoc,enabled,1234,j.doe@foo.bar,j.doe.pager@foo.bar,attach=no,saycid=no,envelope=no,delete=no,,default,,,,,checked,,,,,999999,CHECKED,0,ringallv2,20,999999-552244,2,Ring,TEST,,CHECKED,0,0,"ext-local,vmu552244,1
    4 edit,123456,Jane Doe,1234,"sipalias,man",SUPPORT <1234>,8,enabled,memory,,411,iax2,,,1234,yes,,,from-internal,,,,,,,,,dynamic,friend,,4569,yes,,,,,IAX2/123456,,123456@device,0.0.0.0/0.0.0.0,192.168.0.123,fixed,,123456,Jane Doe,disabled,ogg,,en,Adhoc,Adhoc,enabled,1234,j.doe@foo.bar,j.doe.pager@foo.bar,attach=yes,saycid=no,envelope=yes,delete=yes,review=yes,default,checked,checked,checked,checked,checked,,,27328,27329,,,,,,,,,,,,,, 
    5 edit,654321,Jorge Doe,654321,,,0,enabled,0,,,zap,,5001,,,,,from-internal,no,fxo_ks,yes,,800,no,7,no,,,,,,,,,,ZAP/5001,,654321@device,,,fixed,,654321,Jorge Doe,disabled,ogg,,,Adhoc,Adhoc,enabled,1234,,,attach=no,saycid=no,envelope=no,delete=no,,default,checked,,,,,70904,,,,654321,CHECKED,13,hunt,25,654321-27346-123456-999999,2,default,,,CHECKED,2,2,"app-blackhole,zapateller,1
     3edit,999999,John Doe,999999,,,0,enabled,0,,,sip,,,1234,,rfc2833,no,from-internal,,,,,,,,,dynamic,friend,yes,5060,yes,,,,,SIP/999999,,999999@device,,,fixed,,999999,John Doe,disabled,ogg,,,Adhoc,Adhoc,enabled,1234,j.doe@foo.bar,j.doe.pager@foo.bar,attach=no,saycid=no,envelope=no,delete=no,,default,,,,,checked,,,,,999999,CHECKED,0,ringallv2,20,999999-552244,2,Ring,TEST,,CHECKED,0,0,"ext-local,vmu552244,1,,
     4edit,123456,Jane Doe,1234,"sipalias,man",SUPPORT <1234>,8,enabled,memory,,411,iax2,,,1234,yes,,,from-internal,,,,,,,,,dynamic,friend,,4569,yes,,,,,IAX2/123456,,123456@device,0.0.0.0/0.0.0.0,192.168.0.123,fixed,,123456,Jane Doe,disabled,ogg,,en,Adhoc,Adhoc,enabled,1234,j.doe@foo.bar,j.doe.pager@foo.bar,attach=yes,saycid=no,envelope=yes,delete=yes,review=yes,default,checked,checked,checked,checked,checked,,,27328,27329,,,,,,,,,,,,,,,, 
     5edit,654321,Jorge Doe,654321,,,0,enabled,0,,,zap,,5001,,,,,from-internal,no,fxo_ks,yes,,800,no,7,no,,,,,,,,,,ZAP/5001,,654321@device,,,fixed,,654321,Jorge Doe,disabled,ogg,,,Adhoc,Adhoc,enabled,1234,,,attach=no,saycid=no,envelope=no,delete=no,,default,checked,,,,,70904,,,,654321,CHECKED,13,hunt,25,654321-27346-123456-999999,2,default,,,CHECKED,2,2,"app-blackhole,zapateller,1,,
    66 
    77 
    8 add,999999,John Doe,999999,,,0,enabled,0,,,sip,,,1234,,rfc2833,no,from-internal,,,,,,,,,dynamic,friend,yes,5060,yes,,,,,SIP/999999,,999999@device,0.0.0.0/0.0.0.0,0.0.0.0/0.0.0.0,fixed,,999999,John Doe,disabled,ogg,,,Adhoc,Adhoc,enabled,1234,j.doe@foo.bar,j.doe.pager@foo.bar,attach=no,saycid=no,envelope=no,delete=no,,default,,,,,checked,,,,,999999,CHECKED,0,ringallv2,20,999999-552244,2,Ring,TEST,,CHECKED,0,0,"ext-local,vmu552244,1
    9 add,123456,Jane Doe,1234,"sipalias,man",SUPPORT <1234>,8,enabled,memory,,411,iax2,,,1234,yes,,,from-internal,,,,,,,,,dynamic,friend,,4569,yes,,,,,IAX2/123456,,123456@device,,,fixed,,123456,Jane Doe,disabled,ogg,,en,Adhoc,Adhoc,enabled,1234,j.doe@foo.bar,j.doe.pager@foo.bar,attach=yes,saycid=no,envelope=yes,delete=yes,review=yes,default,checked,checked,checked,checked,checked,,,27328,27329,,,,,,,,,,,,,, 
    10 add,654321,Jorge Doe,654321,,,0,enabled,0,,,zap,,5001,,,,,from-internal,no,fxo_ks,yes,,800,no,7,no,,,,,,,,,,ZAP/5001,,654321@device,,,fixed,,654321,Jorge Doe,disabled,ogg,,,Adhoc,Adhoc,enabled,1234,,,attach=no,saycid=no,envelope=no,delete=no,,default,checked,,,,,70904,,,,654321,CHECKED,13,hunt,25,654321-27346-123456-999999,2,default,,,CHECKED,2,2,"app-blackhole,zapateller,1
     8add,999999,John Doe,999999,,,0,enabled,0,,,sip,,,1234,,rfc2833,no,from-internal,,,,,,,,,dynamic,friend,yes,5060,yes,,,,,SIP/999999,,999999@device,0.0.0.0/0.0.0.0,0.0.0.0/0.0.0.0,fixed,,999999,John Doe,disabled,ogg,,,Adhoc,Adhoc,enabled,1234,j.doe@foo.bar,j.doe.pager@foo.bar,attach=no,saycid=no,envelope=no,delete=no,,default,,,,,checked,,,,,999999,CHECKED,0,ringallv2,20,999999-552244,2,Ring,TEST,,CHECKED,0,0,"ext-local,vmu552244,1,,
     9add,123456,Jane Doe,1234,"sipalias,man",SUPPORT <1234>,8,enabled,memory,,411,iax2,,,1234,yes,,,from-internal,,,,,,,,,dynamic,friend,,4569,yes,,,,,IAX2/123456,,123456@device,,,fixed,,123456,Jane Doe,disabled,ogg,,en,Adhoc,Adhoc,enabled,1234,j.doe@foo.bar,j.doe.pager@foo.bar,attach=yes,saycid=no,envelope=yes,delete=yes,review=yes,default,checked,checked,checked,checked,checked,,,27328,27329,,,,,,,,,,,,,,,, 
     10add,654321,Jorge Doe,654321,,,0,enabled,0,,,zap,,5001,,,,,from-internal,no,fxo_ks,yes,,800,no,7,no,,,,,,,,,,ZAP/5001,,654321@device,,,fixed,,654321,Jorge Doe,disabled,ogg,,,Adhoc,Adhoc,enabled,1234,,,attach=no,saycid=no,envelope=no,delete=no,,default,checked,,,,,70904,,,,654321,CHECKED,13,hunt,25,654321-27346-123456-999999,2,default,,,CHECKED,2,2,"app-blackhole,zapateller,1,,
    1111 
    1212