diff --git a/app/basic_operator_panel/app_config.php b/app/basic_operator_panel/app_config.php index dba39c97a0..ab1473f8ab 100644 --- a/app/basic_operator_panel/app_config.php +++ b/app/basic_operator_panel/app_config.php @@ -57,4 +57,15 @@ $y++; $apps[$x]['permissions'][$y]['name'] = "operator_panel_on_demand"; -?> + //default settings + $y=0; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "569280f2-a433-4eaf-9c08-945efdc6cf8f"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "operator_panel"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "refresh"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1500"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the refresh rate in seconds (<=120) or milliseconds (>=500)."; + $y++; + +?> \ No newline at end of file diff --git a/app/basic_operator_panel/index.php b/app/basic_operator_panel/index.php index a163b0ca26..49804a2186 100644 --- a/app/basic_operator_panel/index.php +++ b/app/basic_operator_panel/index.php @@ -64,7 +64,12 @@ } //update the status - if (permission_exists("user_account_setting_edit")) { + if (permission_exists("user_setting_edit")) { + //add the user_edit permission + $p = new permissions; + $p->add("user_edit", "temp"); + + //update the database user_status $array['users'][0]['user_uuid'] = $_SESSION['user']['user_uuid']; $array['users'][0]['domain_uuid'] = $_SESSION['user']['domain_uuid']; $array['users'][0]['user_status'] = $user_status; @@ -72,6 +77,10 @@ $database->app_name = 'operator_panel'; $database->app_uuid = 'dd3d173a-5d51-4231-ab22-b18c5b712bb2'; $database->save($array); + + //remove the temporary permission + $p->delete("user_edit", "temp"); + unset($array); } @@ -185,8 +194,24 @@ \n"; + } //make sub action bar sticky @@ -639,4 +685,4 @@ //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/app/call_block/resources/classes/call_block.php b/app/call_block/resources/classes/call_block.php index fcb61a6555..947f123f65 100644 --- a/app/call_block/resources/classes/call_block.php +++ b/app/call_block/resources/classes/call_block.php @@ -23,6 +23,7 @@ if (!class_exists('call_block')) { /** * declare public variables */ + public $call_block_direction; public $extension_uuid; public $call_block_app; public $call_block_data; @@ -307,7 +308,7 @@ if (!class_exists('call_block')) { //get the caller id info from cdrs if (is_array($uuids) && @sizeof($uuids) != 0) { - $sql = "select caller_id_name, caller_id_number from v_xml_cdr "; + $sql = "select caller_id_name, caller_id_number, caller_destination from v_xml_cdr "; $sql .= "where xml_cdr_uuid in (".implode(', ', $uuids).") "; $database = new database; $rows = $database->select($sql, $parameters, 'all'); @@ -322,11 +323,17 @@ if (!class_exists('call_block')) { if (permission_exists('call_block_all')) { $array['call_block'][$x]['call_block_uuid'] = uuid(); $array['call_block'][$x]['domain_uuid'] = $_SESSION['domain_uuid']; + $array['call_block'][$x]['call_block_direction'] = $this->call_block_direction; if (is_uuid($this->extension_uuid)) { $array['call_block'][$x]['extension_uuid'] = $this->extension_uuid; } - $array['call_block'][$x]['call_block_name'] = trim($row["caller_id_name"]); - $array['call_block'][$x]['call_block_number'] = trim($row["caller_id_number"]); + if ($this->call_block_direction == 'inbound') { + $array['call_block'][$x]['call_block_name'] = trim($row["caller_id_name"]); + $array['call_block'][$x]['call_block_number'] = trim($row["caller_id_number"]); + } + if ($this->call_block_direction == 'outbound') { + $array['call_block'][$x]['call_block_number'] = trim($row["caller_destination"]); + } $array['call_block'][$x]['call_block_count'] = 0; $array['call_block'][$x]['call_block_app'] = $this->call_block_app; $array['call_block'][$x]['call_block_data'] = $this->call_block_data; @@ -340,9 +347,15 @@ if (!class_exists('call_block')) { if (is_uuid($field['extension_uuid'])) { $array['call_block'][$x]['call_block_uuid'] = uuid(); $array['call_block'][$x]['domain_uuid'] = $_SESSION['domain_uuid']; + $array['call_block'][$x]['call_block_direction'] = $this->call_block_direction; $array['call_block'][$x]['extension_uuid'] = $field['extension_uuid']; - $array['call_block'][$x]['call_block_name'] = trim($row["caller_id_name"]); - $array['call_block'][$x]['call_block_number'] = trim($row["caller_id_number"]); + if ($this->call_block_direction == 'inbound') { + $array['call_block'][$x]['call_block_name'] = trim($row["caller_id_name"]); + $array['call_block'][$x]['call_block_number'] = trim($row["caller_id_number"]); + } + if ($this->call_block_direction == 'outbound') { + $array['call_block'][$x]['call_block_number'] = trim($row["caller_destination"]); + } $array['call_block'][$x]['call_block_count'] = 0; $array['call_block'][$x]['call_block_app'] = $this->call_block_app; $array['call_block'][$x]['call_block_data'] = $this->call_block_data; diff --git a/app/call_broadcast/app_config.php b/app/call_broadcast/app_config.php index 315f60ae70..58f4dfe9be 100644 --- a/app/call_broadcast/app_config.php +++ b/app/call_broadcast/app_config.php @@ -155,5 +155,9 @@ $apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_accountcode"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_toll_allow"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; ?> diff --git a/app/call_broadcast/call_broadcast_edit.php b/app/call_broadcast/call_broadcast_edit.php index 43ce0b19a5..f224f243f9 100644 --- a/app/call_broadcast/call_broadcast_edit.php +++ b/app/call_broadcast/call_broadcast_edit.php @@ -103,6 +103,7 @@ $broadcast_avmd = $_POST["broadcast_avmd"]; $broadcast_destination_data = $_POST["broadcast_destination_data"]; $broadcast_description = $_POST["broadcast_description"]; + $broadcast_toll_allow = $_POST["broadcast_toll_allow"]; if (if_group("superadmin")) { $broadcast_accountcode = $_POST["broadcast_accountcode"]; @@ -234,6 +235,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $array['call_broadcasts'][0]['broadcast_destination_data'] = $broadcast_destination_data; $array['call_broadcasts'][0]['broadcast_accountcode'] = $broadcast_accountcode; $array['call_broadcasts'][0]['broadcast_description'] = $broadcast_description; + $array['call_broadcasts'][0]['broadcast_toll_allow'] = $broadcast_toll_allow; //execute $database = new database; @@ -274,6 +276,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $broadcast_destination_data = $row["broadcast_destination_data"]; $broadcast_accountcode = $row["broadcast_accountcode"]; $broadcast_description = $row["broadcast_description"]; + $broadcast_toll_allow = $row["broadcast_toll_allow"]; } unset($sql, $parameters, $row); } @@ -493,6 +496,17 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo " ".$text['label-broadcast_toll_allow']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-broadcast_toll_allow']."\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo " ".$text['label-description']."\n"; diff --git a/app/call_broadcast/call_broadcast_send.php b/app/call_broadcast/call_broadcast_send.php index 51786bbcd0..8fdb40ee05 100644 --- a/app/call_broadcast/call_broadcast_send.php +++ b/app/call_broadcast/call_broadcast_send.php @@ -182,6 +182,7 @@ $channel_variables .= ",domain=".$_SESSION['domain_name']; $channel_variables .= ",domain_name=".$_SESSION['domain_name']; $channel_variables .= ",accountcode='$broadcast_accountcode'"; + $channel_variables .= ",toll_allow='$broadcast_toll_allow'"; if ($broadcast_avmd == "true") { $channel_variables .= ",execute_on_answer='avmd start'"; } diff --git a/app/call_centers/app_config.php b/app/call_centers/app_config.php index 2a0ebe4438..4cb5dc14a9 100644 --- a/app/call_centers/app_config.php +++ b/app/call_centers/app_config.php @@ -35,7 +35,7 @@ $apps[$x]['destinations'][$y]['type'] = "sql"; $apps[$x]['destinations'][$y]['label'] = "call_centers"; $apps[$x]['destinations'][$y]['name'] = "call_centers"; - $apps[$x]['destinations'][$y]['sql'] = "select queue_extension as destination, queue_extension as extension, queue_description as description from v_call_center_queues"; + $apps[$x]['destinations'][$y]['sql'] = "select queue_name as name, queue_extension as destination, queue_extension as extension, queue_description as description from v_call_center_queues"; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' "; $apps[$x]['destinations'][$y]['order_by'] = "queue_name asc"; $apps[$x]['destinations'][$y]['field']['name'] = "queue_name"; @@ -121,7 +121,6 @@ $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; - $y++; $apps[$x]['permissions'][$y]['name'] = "call_center_outbound_caller_id_name"; //$apps[$x]['permissions'][$y]['groups'][] = "admin"; //$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; @@ -156,6 +155,14 @@ $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "bc73c8eb-f3eb-4182-adc0-9ac5aeedae2a"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "call_center"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "agent_contact_method"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "user"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Options: user (default)"; //cache details $apps[$x]['cache']['key'] = "dialplan.\${domain_name}"; @@ -254,6 +261,10 @@ $apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_no_answer_delay_time"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_record"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $y++; $apps[$x]['db'][$y]['table']['name'] = "v_call_center_queues"; @@ -326,6 +337,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_time_base_score_sec"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Used to set the time base score of the Call Center to prioritize one call center over another."; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_max_wait_time"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; diff --git a/app/call_centers/app_languages.php b/app/call_centers/app_languages.php index b69d2c6f0a..c87041aea5 100644 --- a/app/call_centers/app_languages.php +++ b/app/call_centers/app_languages.php @@ -30,8 +30,8 @@ $text['title-call_center_tier_edit']['de-ch'] = "Callcenter Ebene"; //copied fro $text['title-call_center_tier_edit']['de-de'] = "Callcenter Ebene"; $text['title-call_center_tier_edit']['es-cl'] = "Editar Nivel de Centro de Llamados"; $text['title-call_center_tier_edit']['es-mx'] = "Editar Nivel de Centro de Llamados"; //copied from es-cl -$text['title-call_center_tier_edit']['fr-ca'] = "Editer un Niveau du Centre d'Appel"; //copied from fr-fr -$text['title-call_center_tier_edit']['fr-fr'] = "Editer un Niveau du Centre d'Appel"; +$text['title-call_center_tier_edit']['fr-ca'] = "Editer un niveau du centre d'appel"; +$text['title-call_center_tier_edit']['fr-fr'] = "Editer un niveau du Centre d'appel"; $text['title-call_center_tier_edit']['he-il'] = ""; $text['title-call_center_tier_edit']['it-it'] = "Tier del Call Center"; $text['title-call_center_tier_edit']['nl-nl'] = "Call-center vergelijking"; @@ -177,8 +177,8 @@ $text['title-call_center_agent_status']['de-ch'] = "Callcenter Agenten Status"; $text['title-call_center_agent_status']['de-de'] = "Callcenter Agenten Status"; $text['title-call_center_agent_status']['es-cl'] = "Estado de Agente de Centro de Llamados"; $text['title-call_center_agent_status']['es-mx'] = "Estado de Agente de Centro de Llamados"; //copied from es-cl -$text['title-call_center_agent_status']['fr-ca'] = "Etat de l'Agent"; //copied from fr-fr -$text['title-call_center_agent_status']['fr-fr'] = "Etat de l'Agent"; +$text['title-call_center_agent_status']['fr-ca'] = "État de l'agent"; +$text['title-call_center_agent_status']['fr-fr'] = "Etat de l'agent"; $text['title-call_center_agent_status']['he-il'] = ""; $text['title-call_center_agent_status']['it-it'] = "Stato Agenti Call Center"; $text['title-call_center_agent_status']['nl-nl'] = "Call-Center agent status"; @@ -198,8 +198,8 @@ $text['title-call_center_agent_edit']['de-ch'] = "Callcenter Agenten"; //copied $text['title-call_center_agent_edit']['de-de'] = "Callcenter Agenten"; $text['title-call_center_agent_edit']['es-cl'] = "Editar Agente de Centro de Llamados"; $text['title-call_center_agent_edit']['es-mx'] = "Editar Agente de Centro de Llamados"; //copied from es-cl -$text['title-call_center_agent_edit']['fr-ca'] = "Agent de centre d'appel"; //copied from fr-fr -$text['title-call_center_agent_edit']['fr-fr'] = "Agent de centre d'appel"; +$text['title-call_center_agent_edit']['fr-ca'] = "Agent du centre d'appel"; +$text['title-call_center_agent_edit']['fr-fr'] = "Agent du centre d'appel"; $text['title-call_center_agent_edit']['he-il'] = ""; $text['title-call_center_agent_edit']['it-it'] = "Agente Call Center"; $text['title-call_center_agent_edit']['nl-nl'] = "Call-Center Agent"; @@ -324,8 +324,8 @@ $text['option-top_down']['de-ch'] = "Absteigend"; //copied from de-de $text['option-top_down']['de-de'] = "Absteigend"; $text['option-top_down']['es-cl'] = "Top Down"; $text['option-top_down']['es-mx'] = "Top Down"; //copied from es-cl -$text['option-top_down']['fr-ca'] = "Haut bas"; //copied from fr-fr -$text['option-top_down']['fr-fr'] = "Haut bas"; +$text['option-top_down']['fr-ca'] = "Du haut vers le bas"; +$text['option-top_down']['fr-fr'] = "Du haut vers le bas"; $text['option-top_down']['he-il'] = ""; $text['option-top_down']['it-it'] = "Dall'alto al basso"; $text['option-top_down']['nl-nl'] = "Hoog->Laag"; @@ -450,8 +450,8 @@ $text['option-ring_all']['de-ch'] = "Alle läuten"; //copied from de-de $text['option-ring_all']['de-de'] = "Alle läuten"; $text['option-ring_all']['es-cl'] = "Sonar todos"; $text['option-ring_all']['es-mx'] = "Sonar todos"; //copied from es-cl -$text['option-ring_all']['fr-ca'] = "Sonner tous"; //copied from fr-fr -$text['option-ring_all']['fr-fr'] = "Sonner tous"; +$text['option-ring_all']['fr-ca'] = "Sonner partout"; //copied from fr-fr +$text['option-ring_all']['fr-fr'] = "Sonner partout"; $text['option-ring_all']['he-il'] = ""; $text['option-ring_all']['it-it'] = "Squillano tutti"; $text['option-ring_all']['nl-nl'] = "Allen gelijktijdig"; @@ -534,7 +534,7 @@ $text['option-on_break']['de-ch'] = "In Pause"; //copied from de-de $text['option-on_break']['de-de'] = "In Pause"; $text['option-on_break']['es-cl'] = "En Pausa"; $text['option-on_break']['es-mx'] = "En Pausa"; //copied from es-cl -$text['option-on_break']['fr-ca'] = "En Pause"; //copied from fr-fr +$text['option-on_break']['fr-ca'] = "En pause"; $text['option-on_break']['fr-fr'] = "En Pause"; $text['option-on_break']['he-il'] = ""; $text['option-on_break']['it-it'] = "In Pausa"; @@ -555,7 +555,7 @@ $text['option-no_change']['de-ch'] = "Keine Änderung"; //copied from de-de $text['option-no_change']['de-de'] = "Keine Änderung"; $text['option-no_change']['es-cl'] = "Sin Cambios"; $text['option-no_change']['es-mx'] = "Sin Cambios"; //copied from es-cl -$text['option-no_change']['fr-ca'] = "Pas de Changement"; //copied from fr-fr +$text['option-no_change']['fr-ca'] = "Pas de changement"; $text['option-no_change']['fr-fr'] = "Pas de Changement"; $text['option-no_change']['he-il'] = ""; $text['option-no_change']['it-it'] = "Nessun Cambiamento"; @@ -576,8 +576,8 @@ $text['option-longest_idle_agent']['de-ch'] = "Agent mit der höchsten Wartezeit $text['option-longest_idle_agent']['de-de'] = "Agent mit der höchsten Wartezeit"; $text['option-longest_idle_agent']['es-cl'] = "Agente desocupado por más tiempo"; $text['option-longest_idle_agent']['es-mx'] = "Agente desocupado por más tiempo"; //copied from es-cl -$text['option-longest_idle_agent']['fr-ca'] = "Agent logué depuis le plus lontemps"; //copied from fr-fr -$text['option-longest_idle_agent']['fr-fr'] = "Agent logué depuis le plus lontemps"; +$text['option-longest_idle_agent']['fr-ca'] = "Agent inactif le plus longtemps"; +$text['option-longest_idle_agent']['fr-fr'] = "Agent inactif le plus longtemps"; $text['option-longest_idle_agent']['he-il'] = ""; $text['option-longest_idle_agent']['it-it'] = "Da più tempo libero"; $text['option-longest_idle_agent']['nl-nl'] = "Langst wachtende agent"; @@ -702,8 +702,8 @@ $text['option-do_not_disturb']['de-ch'] = "Bitte nicht stören"; //copied from d $text['option-do_not_disturb']['de-de'] = "Bitte nicht stören"; $text['option-do_not_disturb']['es-cl'] = "No Molestar"; $text['option-do_not_disturb']['es-mx'] = "No Molestar"; //copied from es-cl -$text['option-do_not_disturb']['fr-ca'] = "Ne Pas Derranger"; //copied from fr-fr -$text['option-do_not_disturb']['fr-fr'] = "Ne Pas Derranger"; +$text['option-do_not_disturb']['fr-ca'] = "Ne pas déranger"; //copied from fr-fr +$text['option-do_not_disturb']['fr-fr'] = "Ne pas déranger"; $text['option-do_not_disturb']['he-il'] = ""; $text['option-do_not_disturb']['it-it'] = "Non Disturbare"; $text['option-do_not_disturb']['nl-nl'] = "Niet Storen"; @@ -723,8 +723,8 @@ $text['option-available_on_demand']['de-ch'] = "Verfügbar (auf Anfrage)"; //cop $text['option-available_on_demand']['de-de'] = "Verfügbar (auf Anfrage)"; $text['option-available_on_demand']['es-cl'] = "Disponible (Bajo Demanda)"; $text['option-available_on_demand']['es-mx'] = "Disponible (Bajo Demanda)"; //copied from es-cl -$text['option-available_on_demand']['fr-ca'] = "Disponible (Sur Demande)"; //copied from fr-fr -$text['option-available_on_demand']['fr-fr'] = "Disponible (Sur Demande)"; +$text['option-available_on_demand']['fr-ca'] = "Disponible (sur demande)"; +$text['option-available_on_demand']['fr-fr'] = "Disponible (sur demande)"; $text['option-available_on_demand']['he-il'] = ""; $text['option-available_on_demand']['it-it'] = "Disponibile (Su Richiesta)"; $text['option-available_on_demand']['nl-nl'] = "beschikbaar (op aanvraag)"; @@ -765,8 +765,8 @@ $text['option-agent_with_least_talk_time']['de-ch'] = "Agent mit geringster Spre $text['option-agent_with_least_talk_time']['de-de'] = "Agent mit geringster Sprechzeit"; $text['option-agent_with_least_talk_time']['es-cl'] = "Agente con el menor tiempo de comunicación"; $text['option-agent_with_least_talk_time']['es-mx'] = "Agente con el menor tiempo de comunicación"; //copied from es-cl -$text['option-agent_with_least_talk_time']['fr-ca'] = "Agent ayant le plus petit temps de parole"; //copied from fr-fr -$text['option-agent_with_least_talk_time']['fr-fr'] = "Agent ayant le plus petit temps de parole"; +$text['option-agent_with_least_talk_time']['fr-ca'] = "Agent avec le moins de temps de conversation"; +$text['option-agent_with_least_talk_time']['fr-fr'] = "Agent avec le moins de temps de conversation"; $text['option-agent_with_least_talk_time']['he-il'] = ""; $text['option-agent_with_least_talk_time']['it-it'] = "Agent che ha parlato di meno"; $text['option-agent_with_least_talk_time']['nl-nl'] = "Agent met kostste gesprekstijd"; @@ -807,7 +807,7 @@ $text['message-maximum_queues']['de-ch'] = "Maximale Anzahl Warteschlangen:"; // $text['message-maximum_queues']['de-de'] = "Maximale Anzahl Warteschlangen:"; $text['message-maximum_queues']['es-cl'] = "Colas Máximo Permitido:"; $text['message-maximum_queues']['es-mx'] = "Colas Máximo Permitido:"; //copied from es-cl -$text['message-maximum_queues']['fr-ca'] = "Files d'attente Maximum Autorisé:"; //copied from fr-fr +$text['message-maximum_queues']['fr-ca'] = "Files d'attente maximum autorisé:"; $text['message-maximum_queues']['fr-fr'] = "Files d'attente Maximum Autorisé:"; $text['message-maximum_queues']['he-il'] = ""; $text['message-maximum_queues']['it-it'] = "Massimo Code:"; @@ -828,8 +828,8 @@ $text['message-duplicate_agent_id']['de-ch'] = "Agenten ID bereits vorhanden"; / $text['message-duplicate_agent_id']['de-de'] = "Agenten ID bereits vorhanden"; $text['message-duplicate_agent_id']['es-cl'] = "Duplicar ID de Agente detectada"; $text['message-duplicate_agent_id']['es-mx'] = "Duplicar ID de Agente detectada"; //copied from es-cl -$text['message-duplicate_agent_id']['fr-ca'] = "Dupliquer Agent ID détecté"; //copied from fr-fr -$text['message-duplicate_agent_id']['fr-fr'] = "Dupliquer Agent ID détecté"; +$text['message-duplicate_agent_id']['fr-ca'] = "ID d'agent duplicat détecté"; +$text['message-duplicate_agent_id']['fr-fr'] = "ID d'agent duplicat détecté"; $text['message-duplicate_agent_id']['he-il'] = ""; $text['message-duplicate_agent_id']['it-it'] = "Rilevato ID Agente Duplicato"; $text['message-duplicate_agent_id']['nl-nl'] = "Duplicaat Agent ID ontdekt"; @@ -849,8 +849,8 @@ $text['label-wrap_up_time']['de-ch'] = "Nachbereitungszeit"; //copied from de-de $text['label-wrap_up_time']['de-de'] = "Nachbereitungszeit"; $text['label-wrap_up_time']['es-cl'] = "Tiempo de Preparación"; $text['label-wrap_up_time']['es-mx'] = "Tiempo de Preparación"; //copied from es-cl -$text['label-wrap_up_time']['fr-ca'] = "temps de Wrap Up"; //copied from fr-fr -$text['label-wrap_up_time']['fr-fr'] = "temps de Wrap Up"; +$text['label-wrap_up_time']['fr-ca'] = "Temps de clôture"; +$text['label-wrap_up_time']['fr-fr'] = "Temps de clôture"; $text['label-wrap_up_time']['he-il'] = ""; $text['label-wrap_up_time']['it-it'] = "Wrap Up Time"; $text['label-wrap_up_time']['nl-nl'] = "Afrondtijd"; @@ -870,8 +870,8 @@ $text['label-type']['de-ch'] = "Typ"; //copied from de-de $text['label-type']['de-de'] = "Typ"; $text['label-type']['es-cl'] = "Tipo"; $text['label-type']['es-mx'] = "Tipo"; //copied from es-cl -$text['label-type']['fr-ca'] = "Type"; //copied from fr-fr -$text['label-type']['fr-fr'] = "Type"; +$text['label-type']['fr-ca'] = "Genre"; +$text['label-type']['fr-fr'] = "Genre"; $text['label-type']['he-il'] = ""; $text['label-type']['it-it'] = "Tipo"; $text['label-type']['nl-nl'] = "Type"; @@ -891,7 +891,7 @@ $text['label-timeout_action']['de-ch'] = "Aktion bei Zeitüberschreitung"; //cop $text['label-timeout_action']['de-de'] = "Aktion bei Zeitüberschreitung"; $text['label-timeout_action']['es-cl'] = "Acción de Timeout"; $text['label-timeout_action']['es-mx'] = "Acción de Timeout"; //copied from es-cl -$text['label-timeout_action']['fr-ca'] = "Action sur Timeout"; //copied from fr-fr +$text['label-timeout_action']['fr-ca'] = "Action si délai d'attente excédé"; $text['label-timeout_action']['fr-fr'] = "Action sur Timeout"; $text['label-timeout_action']['he-il'] = ""; $text['label-timeout_action']['it-it'] = "Azione al Timeout"; @@ -912,8 +912,8 @@ $text['label-time_base_score']['de-ch'] = "Zeitgeber für Klassifikation"; //cop $text['label-time_base_score']['de-de'] = "Zeitgeber für Klassifikation"; $text['label-time_base_score']['es-cl'] = "Puntuación basada en tiempo"; $text['label-time_base_score']['es-mx'] = "Puntuación basada en tiempo"; //copied from es-cl -$text['label-time_base_score']['fr-ca'] = "Score Basé sur le Temps"; //copied from fr-fr -$text['label-time_base_score']['fr-fr'] = "Score Basé sur le Temps"; +$text['label-time_base_score']['fr-ca'] = "Score basé sur le temps"; +$text['label-time_base_score']['fr-fr'] = "Score Basé sur le temps"; $text['label-time_base_score']['he-il'] = ""; $text['label-time_base_score']['it-it'] = "Punteggio su Base Tempo"; $text['label-time_base_score']['nl-nl'] = "Tijd basis score"; @@ -925,6 +925,27 @@ $text['label-time_base_score']['ru-ru'] = "Оценка по времени"; $text['label-time_base_score']['sv-se'] = "Tidsbaserat Resultat"; $text['label-time_base_score']['uk-ua'] = ""; +$text['label-time_base_score_sec']['en-us'] = "Time Base Score Seconds"; +$text['label-time_base_score_sec']['en-gb'] = "Time Base Score Seconds"; +$text['label-time_base_score_sec']['ar-eg'] = ""; +$text['label-time_base_score_sec']['de-at'] = "Zeitgeber für Klassifikation Seconden"; //copied from de-de +$text['label-time_base_score_sec']['de-ch'] = "Zeitgeber für Klassifikation Seconden"; //copied from de-de +$text['label-time_base_score_sec']['de-de'] = "Zeitgeber für Klassifikation Seconden"; +$text['label-time_base_score_sec']['es-cl'] = "Puntuación basada en tiempo Segundos"; +$text['label-time_base_score_sec']['es-mx'] = "Puntuación basada en tiempo Segundos"; //copied from es-cl +$text['label-time_base_score_sec']['fr-ca'] = "Score basé sur le temps Seconds"; +$text['label-time_base_score_sec']['fr-fr'] = "Score Basé sur le temps Seconds"; +$text['label-time_base_score_sec']['he-il'] = ""; +$text['label-time_base_score_sec']['it-it'] = "Punteggio su Base Tempo Secondi"; +$text['label-time_base_score_sec']['nl-nl'] = "Tijd basis score"; +$text['label-time_base_score_sec']['pl-pl'] = "Wynik oparty na czasie Sekundy"; +$text['label-time_base_score_sec']['pt-br'] = "Pontuação baseada no tempo Segundos"; //copied from pt-pt +$text['label-time_base_score_sec']['pt-pt'] = "Pontuação baseada no tempo Segundos"; +$text['label-time_base_score_sec']['ro-ro'] = ""; +$text['label-time_base_score_sec']['ru-ru'] = "Оценка по времени секунды"; +$text['label-time_base_score_sec']['sv-se'] = "Tidsbaserat Resultat Sekunder"; +$text['label-time_base_score_sec']['uk-ua'] = ""; + $text['label-tiers']['en-us'] = "Tiers"; $text['label-tiers']['en-gb'] = "Tiers"; $text['label-tiers']['ar-eg'] = ""; @@ -933,8 +954,8 @@ $text['label-tiers']['de-ch'] = "Ebenen"; //copied from de-de $text['label-tiers']['de-de'] = "Ebenen"; $text['label-tiers']['es-cl'] = "Niveles de Centro de Llamados"; $text['label-tiers']['es-mx'] = "Niveles de Centro de Llamados"; //copied from es-cl -$text['label-tiers']['fr-ca'] = "Niveaux du Centre d'Appel"; //copied from fr-fr -$text['label-tiers']['fr-fr'] = "Niveaux du Centre d'Appel"; +$text['label-tiers']['fr-ca'] = "Niveaux du centre d'appel"; +$text['label-tiers']['fr-fr'] = "Niveaux du Centre d'appel"; $text['label-tiers']['he-il'] = ""; $text['label-tiers']['it-it'] = "Tiers"; $text['label-tiers']['nl-nl'] = "Vergelijkingen"; @@ -954,8 +975,8 @@ $text['label-tier_rules_apply']['de-ch'] = "Ebenen-Regeln werden angewendet"; // $text['label-tier_rules_apply']['de-de'] = "Ebenen-Regeln werden angewendet"; $text['label-tier_rules_apply']['es-cl'] = "Aplicar Reglas de Nivel"; $text['label-tier_rules_apply']['es-mx'] = "Aplicar Reglas de Nivel"; //copied from es-cl -$text['label-tier_rules_apply']['fr-ca'] = "Appliquer la Règle du Niveau"; //copied from fr-fr -$text['label-tier_rules_apply']['fr-fr'] = "Appliquer la Règle du Niveau"; +$text['label-tier_rules_apply']['fr-ca'] = "Appliquer les règles du niveau"; +$text['label-tier_rules_apply']['fr-fr'] = "Appliquer les règles du niveau"; $text['label-tier_rules_apply']['he-il'] = ""; $text['label-tier_rules_apply']['it-it'] = "Applica regole del Tier"; $text['label-tier_rules_apply']['nl-nl'] = "Vergelijkingsregels zijn van toepassing"; @@ -975,8 +996,8 @@ $text['label-tier_rule_wait_second']['de-ch'] = "Ebenen-Regel Wartezeit"; //copi $text['label-tier_rule_wait_second']['de-de'] = "Ebenen-Regel Wartezeit"; $text['label-tier_rule_wait_second']['es-cl'] = "Regla de nível segundo de espera"; $text['label-tier_rule_wait_second']['es-mx'] = "Regla de nível segundo de espera"; //copied from es-cl -$text['label-tier_rule_wait_second']['fr-ca'] = "Attente, en seconde, de la Règle du Tier"; //copied from fr-fr -$text['label-tier_rule_wait_second']['fr-fr'] = "Attente, en seconde, de la Règle du Tier"; +$text['label-tier_rule_wait_second']['fr-ca'] = "Délai d'attente, en secondes, de la règle du niveau"; +$text['label-tier_rule_wait_second']['fr-fr'] = "Délai d'attente, en secondes, de la règle du niveau"; $text['label-tier_rule_wait_second']['he-il'] = ""; $text['label-tier_rule_wait_second']['it-it'] = "Regola Tier Attesa Secondi"; $text['label-tier_rule_wait_second']['nl-nl'] = "Vergelijkigsregels wachttijd"; @@ -996,8 +1017,8 @@ $text['label-tier_rule_wait_multiply_level']['de-ch'] = "Multiplikator für die $text['label-tier_rule_wait_multiply_level']['de-de'] = "Multiplikator für die Ebenen-Regel Wartezeit"; $text['label-tier_rule_wait_multiply_level']['es-cl'] = "Regla de nivel multiplicar nivel de espera"; $text['label-tier_rule_wait_multiply_level']['es-mx'] = "Regla de nivel multiplicar nivel de espera"; //copied from es-cl -$text['label-tier_rule_wait_multiply_level']['fr-ca'] = "Règle d'Attente du Niveau Multipliée par Niveau"; //copied from fr-fr -$text['label-tier_rule_wait_multiply_level']['fr-fr'] = "Règle d'Attente du Niveau Multipliée par Niveau"; +$text['label-tier_rule_wait_multiply_level']['fr-ca'] = "Règle d'attente du niveau multipliée par niveau"; +$text['label-tier_rule_wait_multiply_level']['fr-fr'] = "Règle d'attente du niveau multipliée par niveau"; $text['label-tier_rule_wait_multiply_level']['he-il'] = ""; $text['label-tier_rule_wait_multiply_level']['it-it'] = "Regola Tier Attesa Moltiplica Livello"; $text['label-tier_rule_wait_multiply_level']['nl-nl'] = "Vergelijkingsregels Vermenigvuldigingsfactor"; @@ -1017,8 +1038,8 @@ $text['label-tier_rule_no_agent_no_wait']['de-ch'] = "Ebenen-Regel kein Agent ni $text['label-tier_rule_no_agent_no_wait']['de-de'] = "Ebenen-Regel kein Agent nicht warten"; $text['label-tier_rule_no_agent_no_wait']['es-cl'] = "Regla de nivel No espera Sin Agente"; $text['label-tier_rule_no_agent_no_wait']['es-mx'] = "Regla de nivel No espera Sin Agente"; //copied from es-cl -$text['label-tier_rule_no_agent_no_wait']['fr-ca'] = "Règle du Niveau Pas d'Agent, Pas d'attente"; //copied from fr-fr -$text['label-tier_rule_no_agent_no_wait']['fr-fr'] = "Règle du Niveau Pas d'Agent, Pas d'attente"; +$text['label-tier_rule_no_agent_no_wait']['fr-ca'] = "Règle du niveau pas d'agent, pas d'attente"; +$text['label-tier_rule_no_agent_no_wait']['fr-fr'] = "Règle du niveau pas d'agent, pas d'attente"; $text['label-tier_rule_no_agent_no_wait']['he-il'] = ""; $text['label-tier_rule_no_agent_no_wait']['it-it'] = "Regola Tier No Agente No Attesa"; $text['label-tier_rule_no_agent_no_wait']['nl-nl'] = "Vergelijkingsregel Geen agent niet wachten"; @@ -1101,8 +1122,8 @@ $text['label-status']['de-ch'] = "Status"; //copied from de-de $text['label-status']['de-de'] = "Status"; $text['label-status']['es-cl'] = "Estado"; $text['label-status']['es-mx'] = "Estado"; //copied from es-cl -$text['label-status']['fr-ca'] = "Etat"; //copied from fr-fr -$text['label-status']['fr-fr'] = "Etat"; +$text['label-status']['fr-ca'] = "État"; +$text['label-status']['fr-fr'] = "État"; $text['label-status']['he-il'] = ""; $text['label-status']['it-it'] = "Status"; $text['label-status']['nl-nl'] = "Status"; @@ -1122,8 +1143,8 @@ $text['label-reject_delay_time']['de-ch'] = "Zeitverzögerung für Zeitüberschr $text['label-reject_delay_time']['de-de'] = "Zeitverzögerung für Zeitüberschreitung"; $text['label-reject_delay_time']['es-cl'] = "Tiempo de Espera para Rechazar"; $text['label-reject_delay_time']['es-mx'] = "Tiempo de Espera para Rechazar"; //copied from es-cl -$text['label-reject_delay_time']['fr-ca'] = "Délais pour le Rejet"; //copied from fr-fr -$text['label-reject_delay_time']['fr-fr'] = "Délais pour le Rejet"; +$text['label-reject_delay_time']['fr-ca'] = "Délai avant de rejeter"; +$text['label-reject_delay_time']['fr-fr'] = "Délai avant de rejeter"; $text['label-reject_delay_time']['he-il'] = ""; $text['label-reject_delay_time']['it-it'] = "Tempo Ritardo Rifiuto"; $text['label-reject_delay_time']['nl-nl'] = "Afwijzings vertragingstijd"; @@ -1143,8 +1164,8 @@ $text['label-record_template']['de-ch'] = "Aufnehmen"; //copied from de-de $text['label-record_template']['de-de'] = "Aufnehmen"; $text['label-record_template']['es-cl'] = "Guardar"; $text['label-record_template']['es-mx'] = "Guardar"; //copied from es-cl -$text['label-record_template']['fr-ca'] = "Enregistrement"; //copied from fr-fr -$text['label-record_template']['fr-fr'] = "Enregistrement"; +$text['label-record_template']['fr-ca'] = "Enregistrer"; +$text['label-record_template']['fr-fr'] = "Enregistrer"; $text['label-record_template']['he-il'] = ""; $text['label-record_template']['it-it'] = "Registra"; $text['label-record_template']['nl-nl'] = "Opnemen"; @@ -1248,8 +1269,8 @@ $text['label-no_answer_delay_time']['de-ch'] = "Verzögerung für keine Antwort" $text['label-no_answer_delay_time']['de-de'] = "Verzögerung für keine Antwort"; $text['label-no_answer_delay_time']['es-cl'] = "Tiempo de Espera sin Respuesta"; $text['label-no_answer_delay_time']['es-mx'] = "Tiempo de Espera sin Respuesta"; //copied from es-cl -$text['label-no_answer_delay_time']['fr-ca'] = "Delais de Non Réponse"; //copied from fr-fr -$text['label-no_answer_delay_time']['fr-fr'] = "Delais de Non Réponse"; +$text['label-no_answer_delay_time']['fr-ca'] = "Délai de non réponse"; +$text['label-no_answer_delay_time']['fr-fr'] = "Délai de non réponse"; $text['label-no_answer_delay_time']['he-il'] = ""; $text['label-no_answer_delay_time']['it-it'] = "Tempo Ritardo Mancata Risposta"; $text['label-no_answer_delay_time']['nl-nl'] = "Geen antwoord vertragingstijd"; @@ -1269,8 +1290,8 @@ $text['label-music_on_hold']['de-ch'] = "Wartemusik"; //copied from de-de $text['label-music_on_hold']['de-de'] = "Wartemusik"; $text['label-music_on_hold']['es-cl'] = "Música en Espera"; $text['label-music_on_hold']['es-mx'] = "Música en Espera"; //copied from es-cl -$text['label-music_on_hold']['fr-ca'] = "Musique en attente"; //copied from fr-fr -$text['label-music_on_hold']['fr-fr'] = "Musique en attente"; +$text['label-music_on_hold']['fr-ca'] = "Musique d'attente"; +$text['label-music_on_hold']['fr-fr'] = "Musique d'attente"; $text['label-music_on_hold']['he-il'] = ""; $text['label-music_on_hold']['it-it'] = "Musica d'Attesa"; $text['label-music_on_hold']['nl-nl'] = "Wachtmuziek"; @@ -1290,8 +1311,8 @@ $text['label-max_wait_time_with_no_agent_time_reached']['de-ch'] = "Maximale War $text['label-max_wait_time_with_no_agent_time_reached']['de-de'] = "Maximale Wartezeit ohne Agent erreicht"; $text['label-max_wait_time_with_no_agent_time_reached']['es-cl'] = "Tiempo máximo de espera sin agente obtenido"; $text['label-max_wait_time_with_no_agent_time_reached']['es-mx'] = "Tiempo máximo de espera sin agente obtenido"; //copied from es-cl -$text['label-max_wait_time_with_no_agent_time_reached']['fr-ca'] = "Max Attente Sans Agent Atteinte"; //copied from fr-fr -$text['label-max_wait_time_with_no_agent_time_reached']['fr-fr'] = "Max Attente Sans Agent Atteinte"; +$text['label-max_wait_time_with_no_agent_time_reached']['fr-ca'] = "Temps d'attente maximum sans temps d'agent atteint"; +$text['label-max_wait_time_with_no_agent_time_reached']['fr-fr'] = "Temps d'attente maximum sans temps d'agent atteint"; $text['label-max_wait_time_with_no_agent_time_reached']['he-il'] = ""; $text['label-max_wait_time_with_no_agent_time_reached']['it-it'] = "Max Tempo Attesa Raggiungimento Tempo No Agenti"; $text['label-max_wait_time_with_no_agent_time_reached']['nl-nl'] = "Maximale wachttijd zonder agent bereikt"; @@ -1311,8 +1332,8 @@ $text['label-max_wait_time_with_no_agent']['de-ch'] = "Maximale Wartezeit ohne A $text['label-max_wait_time_with_no_agent']['de-de'] = "Maximale Wartezeit ohne Agent"; $text['label-max_wait_time_with_no_agent']['es-cl'] = "Tiempo máximo de espera sin agente"; $text['label-max_wait_time_with_no_agent']['es-mx'] = "Tiempo máximo de espera sin agente"; //copied from es-cl -$text['label-max_wait_time_with_no_agent']['fr-ca'] = "Temps d'attente maximal Sans Agent"; //copied from fr-fr -$text['label-max_wait_time_with_no_agent']['fr-fr'] = "Temps d'attente maximal Sans Agent"; +$text['label-max_wait_time_with_no_agent']['fr-ca'] = "Temps d'attente maximum sans agent"; +$text['label-max_wait_time_with_no_agent']['fr-fr'] = "Temps d'attente maximum sans agent"; $text['label-max_wait_time_with_no_agent']['he-il'] = ""; $text['label-max_wait_time_with_no_agent']['it-it'] = "Max Tempo Attesa No Agenti"; $text['label-max_wait_time_with_no_agent']['nl-nl'] = "Maximale wachttijd zonder agent"; @@ -1395,8 +1416,8 @@ $text['label-discard_abandoned_after']['de-ch'] = "Zurückweisen nach Zeitübers $text['label-discard_abandoned_after']['de-de'] = "Zurückweisen nach Zeitüberschreitung"; $text['label-discard_abandoned_after']['es-cl'] = "Descartar Abandono Despues de"; $text['label-discard_abandoned_after']['es-mx'] = "Descartar Abandono Despues de"; //copied from es-cl -$text['label-discard_abandoned_after']['fr-ca'] = "Ecarter les Abandons fait Après"; //copied from fr-fr -$text['label-discard_abandoned_after']['fr-fr'] = "Ecarter les Abandons fait Après"; +$text['label-discard_abandoned_after']['fr-ca'] = "Écarter les abandons après"; +$text['label-discard_abandoned_after']['fr-fr'] = "Écarter les abandons après"; $text['label-discard_abandoned_after']['he-il'] = ""; $text['label-discard_abandoned_after']['it-it'] = "Scarta chi Abbandona Dopo"; $text['label-discard_abandoned_after']['nl-nl'] = "Afbreken na tijdsoverschreiding"; @@ -1416,8 +1437,8 @@ $text['label-default_status']['de-ch'] = "Standardzustand"; //copied from de-de $text['label-default_status']['de-de'] = "Standardzustand"; $text['label-default_status']['es-cl'] = "Estado Predeterminado"; $text['label-default_status']['es-mx'] = "Estado Predeterminado"; //copied from es-cl -$text['label-default_status']['fr-ca'] = "Statut Prédéterminée"; //copied from fr-fr -$text['label-default_status']['fr-fr'] = "Statut Prédéterminée"; +$text['label-default_status']['fr-ca'] = "État par défaut"; +$text['label-default_status']['fr-fr'] = "État par défaut"; $text['label-default_status']['he-il'] = ""; $text['label-default_status']['it-it'] = "Status di Default"; $text['label-default_status']['nl-nl'] = "Standaard status"; @@ -1458,8 +1479,8 @@ $text['label-caller_id_name_prefix']['de-ch'] = "Anruferkennung (Name) Prefix"; $text['label-caller_id_name_prefix']['de-de'] = "Anruferkennung (Name) Prefix"; $text['label-caller_id_name_prefix']['es-cl'] = "Prefijo de nombre de quien llama"; $text['label-caller_id_name_prefix']['es-mx'] = "Prefijo de nombre de quien llama"; //copied from es-cl -$text['label-caller_id_name_prefix']['fr-ca'] = "Préfixe du Nom d'Appelant"; //copied from fr-fr -$text['label-caller_id_name_prefix']['fr-fr'] = "Préfixe du Nom d'Appelant"; +$text['label-caller_id_name_prefix']['fr-ca'] = "Préfixe du nom de l'identification de l'appelant"; +$text['label-caller_id_name_prefix']['fr-fr'] = "Préfixe du nom de l'identification de l'appelant"; $text['label-caller_id_name_prefix']['he-il'] = ""; $text['label-caller_id_name_prefix']['it-it'] = "Prefisso Nome Chiamante"; $text['label-caller_id_name_prefix']['nl-nl'] = "CID Naam prefix"; @@ -1479,7 +1500,7 @@ $text['label-outbound_caller_id_name']['de-ch'] = "Ausgehende Anruferkennung (Na $text['label-outbound_caller_id_name']['de-de'] = "Ausgehende Anruferkennung (Name)"; $text['label-outbound_caller_id_name']['es-cl'] = "Nombre de Caller ID Saliente"; $text['label-outbound_caller_id_name']['es-mx'] = "Nombre de Caller ID Saliente"; //copied from es-cl -$text['label-outbound_caller_id_name']['fr-ca'] = "Nom de l'appelant sortant"; //copied from fr-fr +$text['label-outbound_caller_id_name']['fr-ca'] = "Nom de l'appelant sortant"; $text['label-outbound_caller_id_name']['fr-fr'] = "Nom de l'appelant sortant"; $text['label-outbound_caller_id_name']['he-il'] = ""; $text['label-outbound_caller_id_name']['it-it'] = "ID Nome Chiamante Esterno"; @@ -1521,8 +1542,8 @@ $text['label-caller_announce_sound']['de-ch'] = "Ton für Ankündigung"; //copie $text['label-caller_announce_sound']['de-de'] = "Ton für Ankündigung"; $text['label-caller_announce_sound']['es-cl'] = "El sonido anuncian"; $text['label-caller_announce_sound']['es-mx'] = "El sonido anuncian"; //copied from es-cl -$text['label-caller_announce_sound']['fr-ca'] = "Annoncer Sonore"; //copied from fr-fr -$text['label-caller_announce_sound']['fr-fr'] = "Annoncer Sonore"; +$text['label-caller_announce_sound']['fr-ca'] = "Son d'annonce"; +$text['label-caller_announce_sound']['fr-fr'] = "Son d'annonce"; $text['label-caller_announce_sound']['he-il'] = ""; $text['label-caller_announce_sound']['it-it'] = "Audio Annuncio"; $text['label-caller_announce_sound']['nl-nl'] = "Aankondigingsgeluid"; @@ -1542,8 +1563,8 @@ $text['label-caller_announce_frequency']['de-ch'] = "Häufigkeit der Ankündigun $text['label-caller_announce_frequency']['de-de'] = "Häufigkeit der Ankündigung"; $text['label-caller_announce_frequency']['es-cl'] = "La frecuencia anuncian"; $text['label-caller_announce_frequency']['es-mx'] = "La frecuencia anuncian"; //copied from es-cl -$text['label-caller_announce_frequency']['fr-ca'] = "Annoncer Fréquence"; //copied from fr-fr -$text['label-caller_announce_frequency']['fr-fr'] = "Annoncer Fréquence"; +$text['label-caller_announce_frequency']['fr-ca'] = "Fréquence d'annonce"; +$text['label-caller_announce_frequency']['fr-fr'] = "Fréquence d'annonce"; $text['label-caller_announce_frequency']['he-il'] = ""; $text['label-caller_announce_frequency']['it-it'] = "Frequenza Annuncio"; $text['label-caller_announce_frequency']['nl-nl'] = "Aantal aankondigingen"; @@ -1563,8 +1584,8 @@ $text['label-exit_keys']['de-ch'] = "Abbruch Taste"; //copied from de-de $text['label-exit_keys']['de-de'] = "Abbruch Taste"; $text['label-exit_keys']['es-cl'] = "Tecla de salida"; $text['label-exit_keys']['es-mx'] = "Tecla de salida"; //copied from es-cl -$text['label-exit_keys']['fr-ca'] = "Clé pour sortir la queue"; //copied from fr-fr -$text['label-exit_keys']['fr-fr'] = "Clé pour sortir la queue"; +$text['label-exit_keys']['fr-ca'] = "Touche pour sortir de la file d'attente"; +$text['label-exit_keys']['fr-fr'] = "Touche pour sortir de la file d'attente"; $text['label-exit_keys']['he-il'] = ""; $text['label-exit_keys']['it-it'] = ""; $text['label-exit_keys']['nl-nl'] = "Verlaat toets"; @@ -1584,8 +1605,8 @@ $text['description-exit_keys']['de-ch'] = "Tasten um die aktuelle Warteschlange $text['description-exit_keys']['de-de'] = "Tasten um die aktuelle Warteschlange zu verlassen."; $text['description-exit_keys']['es-cl'] = "Teclas para salir de la espera de la cola."; $text['description-exit_keys']['es-mx'] = "Teclas para salir de la espera de la cola."; //copied from es-cl -$text['description-exit_keys']['fr-ca'] = "Clés pour sortir de l'attendance de la queue."; //copied from fr-fr -$text['description-exit_keys']['fr-fr'] = "Clés pour sortir de l'attendance de la queue."; +$text['description-exit_keys']['fr-ca'] = "Touches pour quitter la file d'attente actuelle."; +$text['description-exit_keys']['fr-fr'] = "Touches pour quitter la file d'attente actuelle"; $text['description-exit_keys']['he-il'] = ""; $text['description-exit_keys']['it-it'] = ""; $text['description-exit_keys']['nl-nl'] = "Toetsen om de huidige wachtrij te verlaten."; @@ -1605,8 +1626,8 @@ $text['label-call_timeout']['de-ch'] = "Zeitüberschreitung"; //copied from de-d $text['label-call_timeout']['de-de'] = "Zeitüberschreitung"; $text['label-call_timeout']['es-cl'] = "Timeout de Llamada"; $text['label-call_timeout']['es-mx'] = "Timeout de Llamada"; //copied from es-cl -$text['label-call_timeout']['fr-ca'] = "Timeout d'appel"; //copied from fr-fr -$text['label-call_timeout']['fr-fr'] = "Timeout d'appel"; +$text['label-call_timeout']['fr-ca'] = "Délai d'expiration de l'appel"; +$text['label-call_timeout']['fr-fr'] = "Délai d'expiration de l'appel"; $text['label-call_timeout']['he-il'] = ""; $text['label-call_timeout']['it-it'] = "Timeout di Chiamata"; $text['label-call_timeout']['nl-nl'] = "Oproep tijdsoverschrijding"; @@ -1626,8 +1647,8 @@ $text['label-busy_delay_time']['de-ch'] = "Verzögerungszeit für Besetzt"; //co $text['label-busy_delay_time']['de-de'] = "Verzögerungszeit für Besetzt"; $text['label-busy_delay_time']['es-cl'] = "Tiempo de espera para ocupado"; $text['label-busy_delay_time']['es-mx'] = "Tiempo de espera para ocupado"; //copied from es-cl -$text['label-busy_delay_time']['fr-ca'] = "Délais d'occupation"; //copied from fr-fr -$text['label-busy_delay_time']['fr-fr'] = "Délais d'occupation"; +$text['label-busy_delay_time']['fr-ca'] = "Délai de temps occupé"; +$text['label-busy_delay_time']['fr-fr'] = "Délai de temps occupé"; $text['label-busy_delay_time']['he-il'] = ""; $text['label-busy_delay_time']['it-it'] = "Tempo ritardo su Occupato"; $text['label-busy_delay_time']['nl-nl'] = "Bezet wachttijd"; @@ -1647,8 +1668,8 @@ $text['label-agent_password']['de-ch'] = "Agenten Passwort"; //copied from de-de $text['label-agent_password']['de-de'] = "Agenten Passwort"; $text['label-agent_password']['es-cl'] = "Agente de Password"; $text['label-agent_password']['es-mx'] = "Agente de Password"; //copied from es-cl -$text['label-agent_password']['fr-ca'] = "Agent Mot de passe"; //copied from fr-fr -$text['label-agent_password']['fr-fr'] = "Agent Mot de passe"; +$text['label-agent_password']['fr-ca'] = "Mot de passe d'agent"; +$text['label-agent_password']['fr-fr'] = "Mot de passe d'agent"; $text['label-agent_password']['he-il'] = ""; $text['label-agent_password']['it-it'] = "Password Agente"; $text['label-agent_password']['nl-nl'] = "Agent wachtwoord"; @@ -1710,8 +1731,8 @@ $text['label-agent_id']['de-ch'] = "Agenten ID"; //copied from de-de $text['label-agent_id']['de-de'] = "Agenten ID"; $text['label-agent_id']['es-cl'] = "Agente de identidad"; $text['label-agent_id']['es-mx'] = "Agente de identidad"; //copied from es-cl -$text['label-agent_id']['fr-ca'] = "Identification Agent"; //copied from fr-fr -$text['label-agent_id']['fr-fr'] = "Identification Agent"; +$text['label-agent_id']['fr-ca'] = "Identification d'agent"; +$text['label-agent_id']['fr-fr'] = "Identification d'agent"; $text['label-agent_id']['he-il'] = ""; $text['label-agent_id']['it-it'] = "ID Agente"; $text['label-agent_id']['nl-nl'] = "Agent ID"; @@ -1773,8 +1794,8 @@ $text['label-abandoned_resume_allowed']['de-ch'] = "Wiederaufnahme nach Zurückw $text['label-abandoned_resume_allowed']['de-de'] = "Wiederaufnahme nach Zurückweisung erlaubt"; $text['label-abandoned_resume_allowed']['es-cl'] = "Permitir Reanudación de Abandono"; $text['label-abandoned_resume_allowed']['es-mx'] = "Permitir Reanudación de Abandono"; //copied from es-cl -$text['label-abandoned_resume_allowed']['fr-ca'] = "Recupération Permise des Abandons"; //copied from fr-fr -$text['label-abandoned_resume_allowed']['fr-fr'] = "Recupération Permise des Abandons"; +$text['label-abandoned_resume_allowed']['fr-ca'] = "Récupération des abandons permis"; +$text['label-abandoned_resume_allowed']['fr-fr'] = "Récupération des abandons permis"; $text['label-abandoned_resume_allowed']['he-il'] = ""; $text['label-abandoned_resume_allowed']['it-it'] = "Permetti ripristino chi Abbandona"; $text['label-abandoned_resume_allowed']['nl-nl'] = "Verlaten oproep voortzetten toestaan"; @@ -1794,8 +1815,8 @@ $text['header-call_center_tier_edit']['de-ch'] = "Callcenter Ebene"; //copied fr $text['header-call_center_tier_edit']['de-de'] = "Callcenter Ebene"; $text['header-call_center_tier_edit']['es-cl'] = "Editar Nivel de Centro de Llamados"; $text['header-call_center_tier_edit']['es-mx'] = "Editar Nivel de Centro de Llamados"; //copied from es-cl -$text['header-call_center_tier_edit']['fr-ca'] = "Niveau du Centre d'Appel"; //copied from fr-fr -$text['header-call_center_tier_edit']['fr-fr'] = "Niveau du Centre d'Appel"; +$text['header-call_center_tier_edit']['fr-ca'] = "Niveau du centre d'appel"; +$text['header-call_center_tier_edit']['fr-fr'] = "Niveau du centre d'appel"; $text['header-call_center_tier_edit']['he-il'] = ""; $text['header-call_center_tier_edit']['it-it'] = "Tier del Call Center"; $text['header-call_center_tier_edit']['nl-nl'] = "Call-Center vergelijking"; @@ -1899,7 +1920,7 @@ $text['header-call_center_agent_status']['de-ch'] = "Callcenter Agenten-Status"; $text['header-call_center_agent_status']['de-de'] = "Callcenter Agenten-Status"; $text['header-call_center_agent_status']['es-cl'] = "Estado de Agente de Centro de Llamados"; $text['header-call_center_agent_status']['es-mx'] = "Estado de Agente de Centro de Llamados"; //copied from es-cl -$text['header-call_center_agent_status']['fr-ca'] = "Etat de l'agent du Centre d'Appel"; //copied from fr-fr +$text['header-call_center_agent_status']['fr-ca'] = "État de l'agent du Centre d'appel"; $text['header-call_center_agent_status']['fr-fr'] = "Etat de l'agent du Centre d'Appel"; $text['header-call_center_agent_status']['he-il'] = ""; $text['header-call_center_agent_status']['it-it'] = "Stato Agente Call Center"; @@ -1920,7 +1941,7 @@ $text['header-call_center_agent_edit']['de-ch'] = "Callcenter Agent"; //copied f $text['header-call_center_agent_edit']['de-de'] = "Callcenter Agent"; $text['header-call_center_agent_edit']['es-cl'] = "Editar Agente de Centro de Llamados"; $text['header-call_center_agent_edit']['es-mx'] = "Editar Agente de Centro de Llamados"; //copied from es-cl -$text['header-call_center_agent_edit']['fr-ca'] = "Agent du Centre d'Appel"; //copied from fr-fr +$text['header-call_center_agent_edit']['fr-ca'] = "Agent du Centre d'appel"; $text['header-call_center_agent_edit']['fr-fr'] = "Agent du Centre d'Appel"; $text['header-call_center_agent_edit']['he-il'] = ""; $text['header-call_center_agent_edit']['it-it'] = "Agente Call Center"; @@ -1941,8 +1962,8 @@ $text['header-call_center_agent_add']['de-ch'] = "Callcenter Agenten"; //copied $text['header-call_center_agent_add']['de-de'] = "Callcenter Agenten"; $text['header-call_center_agent_add']['es-cl'] = "Agregar Agente de Centro de Llamados"; $text['header-call_center_agent_add']['es-mx'] = "Agregar Agente de Centro de Llamados"; //copied from es-cl -$text['header-call_center_agent_add']['fr-ca'] = "Agent du Centre d'Appel"; //copied from fr-fr -$text['header-call_center_agent_add']['fr-fr'] = "Agent du Centre d'Appel"; +$text['header-call_center_agent_add']['fr-ca'] = "Agents du centre d'appel"; +$text['header-call_center_agent_add']['fr-fr'] = "Agents du centre d'appel"; $text['header-call_center_agent_add']['he-il'] = ""; $text['header-call_center_agent_add']['it-it'] = "Agenti Call Center"; $text['header-call_center_agent_add']['nl-nl'] = "Call-Center agenten"; @@ -1962,8 +1983,8 @@ $text['description-wrap_up_time']['de-ch'] = "Geben Sie die Nachbereitungszeit e $text['description-wrap_up_time']['de-de'] = "Geben Sie die Nachbereitungszeit ein."; $text['description-wrap_up_time']['es-cl'] = "Introduzca el tiempo de preparación."; $text['description-wrap_up_time']['es-mx'] = "Introduzca el tiempo de preparación."; //copied from es-cl -$text['description-wrap_up_time']['fr-ca'] = "choisir le temps de wrap up."; //copied from fr-fr -$text['description-wrap_up_time']['fr-fr'] = "choisir le temps de wrap up."; +$text['description-wrap_up_time']['fr-ca'] = "Choisir le temps de clôture."; +$text['description-wrap_up_time']['fr-fr'] = "Choisir le temps de clôture."; $text['description-wrap_up_time']['he-il'] = ""; $text['description-wrap_up_time']['it-it'] = "Inserire Tempo di wrap up."; $text['description-wrap_up_time']['nl-nl'] = "Voer de afwikkeltijd in."; @@ -2004,8 +2025,8 @@ $text['description-timeout_action']['de-ch'] = "Aktion, wenn die maximale Wartez $text['description-timeout_action']['de-de'] = "Aktion, wenn die maximale Wartezeit erreicht wurde."; $text['description-timeout_action']['es-cl'] = "Defina una acción a realizar cuando el tiempo máximo es alcanzado."; $text['description-timeout_action']['es-mx'] = "Defina una acción a realizar cuando el tiempo máximo es alcanzado."; //copied from es-cl -$text['description-timeout_action']['fr-ca'] = "Choisir l'action à faire quand le temps max d'attente est atteint."; //copied from fr-fr -$text['description-timeout_action']['fr-fr'] = "Choisir l'action à faire quand le temps max d'attente est atteint."; +$text['description-timeout_action']['fr-ca'] = "Définir l'action à exécuter lorsque le temps d'attente maximal est atteint."; +$text['description-timeout_action']['fr-fr'] = "Définir l'action à exécuter lorsque le temps d'attente maximal est atteint."; $text['description-timeout_action']['he-il'] = ""; $text['description-timeout_action']['it-it'] = "Seleziona l'azione da eseguire quando il tempo di attesa max viene superato."; $text['description-timeout_action']['nl-nl'] = "Aktie als de maximale wachttijd bereikt wordt"; @@ -2025,8 +2046,8 @@ $text['description-time_base_score']['de-ch'] = "Wählen Sie die Zeitgeber für $text['description-time_base_score']['de-de'] = "Wählen Sie die Zeitgeber für Klassifikation"; $text['description-time_base_score']['es-cl'] = "Seleccione el tiempo base"; $text['description-time_base_score']['es-mx'] = "Seleccione el tiempo base"; //copied from es-cl -$text['description-time_base_score']['fr-ca'] = "Sélection du score sur base de temps."; //copied from fr-fr -$text['description-time_base_score']['fr-fr'] = "Sélection du score sur base de temps."; +$text['description-time_base_score']['fr-ca'] = "Sélection du score basé sur le temps."; +$text['description-time_base_score']['fr-fr'] = "Sélection du score basé sur le temps."; $text['description-time_base_score']['he-il'] = ""; $text['description-time_base_score']['it-it'] = "Seleziona il punteggio su base tempo."; $text['description-time_base_score']['nl-nl'] = "Select de tijdsbasis score."; @@ -2038,6 +2059,28 @@ $text['description-time_base_score']['ru-ru'] = "Выберие оценку п $text['description-time_base_score']['sv-se'] = "Ange tids-baserad poäng."; $text['description-time_base_score']['uk-ua'] = ""; + +$text['description-time_base_score_sec']['en-us'] = "Set the time base score in seconds. Higher numbers mean higher priority over other call centers."; +$text['description-time_base_score_sec']['en-gb'] = "Set the time base score in seconds. Higher numbers mean higher priority over other call centers."; +$text['description-time_base_score_sec']['ar-eg'] = ""; +$text['description-time_base_score_sec']['de-at'] = ""; +$text['description-time_base_score_sec']['de-ch'] = ""; +$text['description-time_base_score_sec']['de-de'] = ""; +$text['description-time_base_score_sec']['es-cl'] = ""; +$text['description-time_base_score_sec']['es-mx'] = ""; +$text['description-time_base_score_sec']['fr-ca'] = ""; +$text['description-time_base_score_sec']['fr-fr'] = ""; +$text['description-time_base_score_sec']['he-il'] = ""; +$text['description-time_base_score_sec']['it-it'] = ""; +$text['description-time_base_score_sec']['nl-nl'] = ""; +$text['description-time_base_score_sec']['pl-pl'] = ""; +$text['description-time_base_score_sec']['pt-br'] = ""; +$text['description-time_base_score_sec']['pt-pt'] = ""; +$text['description-time_base_score_sec']['ro-ro'] = ""; +$text['description-time_base_score_sec']['ru-ru'] = ""; +$text['description-time_base_score_sec']['sv-se'] = ""; +$text['description-time_base_score_sec']['uk-ua'] = ""; + $text['description-tiers']['en-us'] = "Tiers assign agents to queues."; $text['description-tiers']['en-gb'] = "Tiers assign agents to queues."; $text['description-tiers']['ar-eg'] = ""; @@ -2046,8 +2089,8 @@ $text['description-tiers']['de-ch'] = "Agenten einer Warteschlange pro Ebene zuw $text['description-tiers']['de-de'] = "Agenten einer Warteschlange pro Ebene zuweisen."; $text['description-tiers']['es-cl'] = "Lista todos los niveles. Los niveles asignan agentes a las colas."; $text['description-tiers']['es-mx'] = "Lista todos los niveles. Los niveles asignan agentes a las colas."; //copied from es-cl -$text['description-tiers']['fr-ca'] = "Liste tous les Niveaux. Les Niveaux permettent d'affecter les agents aux queues."; //copied from fr-fr -$text['description-tiers']['fr-fr'] = "Liste tous les Niveaux. Les Niveaux permettent d'affecter les agents aux queues."; +$text['description-tiers']['fr-ca'] = "Liste tous les niveaux. Les niveaux permettent d'affecter les agents aux files d'attente."; +$text['description-tiers']['fr-fr'] = "Liste tous les niveaux. Les niveaux permettent d'affecter les agents aux files d'attente."; $text['description-tiers']['he-il'] = ""; $text['description-tiers']['it-it'] = "I tiers assegnano gli agenti alle code."; $text['description-tiers']['nl-nl'] = "Vergelijkingen towijzen van agenten aan wachtrij"; @@ -2067,8 +2110,8 @@ $text['description-tier_rules_apply']['de-ch'] = "Setzen Sie die Ebenen-Regel. R $text['description-tier_rules_apply']['de-de'] = "Setzen Sie die Ebenen-Regel. Regeln sind Ein oder Aus"; $text['description-tier_rules_apply']['es-cl'] = "Defina las reglas de nivel como verdaero o falso."; $text['description-tier_rules_apply']['es-mx'] = "Defina las reglas de nivel como verdaero o falso."; //copied from es-cl -$text['description-tier_rules_apply']['fr-ca'] = "Choisir l'activation de la règle du Niveau à oui ou non."; //copied from fr-fr -$text['description-tier_rules_apply']['fr-fr'] = "Choisir l'activation de la règle du Niveau à oui ou non."; +$text['description-tier_rules_apply']['fr-ca'] = "Définir l'activation de la règle du niveau à oui ou non."; +$text['description-tier_rules_apply']['fr-fr'] = "Définir l'activation de la règle du niveau à oui ou non."; $text['description-tier_rules_apply']['he-il'] = ""; $text['description-tier_rules_apply']['it-it'] = "Imposta a vero o falso se si vogliono applicare le regole di tier."; $text['description-tier_rules_apply']['nl-nl'] = "Kies de vergelijkingsregels, Regels staan aan of uit"; @@ -2109,8 +2152,8 @@ $text['description-tier_rule_wait_multiply_level']['de-ch'] = "Setzen Sie den Mu $text['description-tier_rule_wait_multiply_level']['de-de'] = "Setzen Sie den Multiplikator für die Ebenen-Regel Wartezeit auf Ein oder Aus."; $text['description-tier_rule_wait_multiply_level']['es-cl'] = "Ajuste el nidenvel de espera multiplicar regla de nivel de verdadero o falso."; $text['description-tier_rule_wait_multiply_level']['es-mx'] = "Ajuste el nidenvel de espera multiplicar regla de nivel de verdadero o falso."; //copied from es-cl -$text['description-tier_rule_wait_multiply_level']['fr-ca'] = "Choisir la multiplication du temps d'attente par niveau à oui ou non."; //copied from fr-fr -$text['description-tier_rule_wait_multiply_level']['fr-fr'] = "Choisir la multiplication du temps d'attente par niveau à oui ou non."; +$text['description-tier_rule_wait_multiply_level']['fr-ca'] = "Définir la multiplication du temps d'attente par niveau à oui ou non."; +$text['description-tier_rule_wait_multiply_level']['fr-fr'] = "Définir la multiplication du temps d'attente par niveau à oui ou non."; $text['description-tier_rule_wait_multiply_level']['he-il'] = ""; $text['description-tier_rule_wait_multiply_level']['it-it'] = "Imposta a vero o falso il tempo attesa moltiplica livello come regola tier."; $text['description-tier_rule_wait_multiply_level']['nl-nl'] = "Kies vergelijkingsregel vemenigvuldiging aan of uit "; @@ -2235,8 +2278,8 @@ $text['description-reject_delay_time']['de-ch'] = "Geben Sie die Verzögerung bi $text['description-reject_delay_time']['de-de'] = "Geben Sie die Verzögerung bis zur Zurückweisung an."; $text['description-reject_delay_time']['es-cl'] = "Introduzca el tiempo de espera de rechazo."; $text['description-reject_delay_time']['es-mx'] = "Introduzca el tiempo de espera de rechazo."; //copied from es-cl -$text['description-reject_delay_time']['fr-ca'] = "Choisir le délais de rejet."; //copied from fr-fr -$text['description-reject_delay_time']['fr-fr'] = "Choisir le délais de rejet."; +$text['description-reject_delay_time']['fr-ca'] = "Choisir le délai avant de rejeter."; +$text['description-reject_delay_time']['fr-fr'] = "Choisir le délai avant de rejeter."; $text['description-reject_delay_time']['he-il'] = ""; $text['description-reject_delay_time']['it-it'] = "Inserire Tempo Ritardo Rifiuto."; $text['description-reject_delay_time']['nl-nl'] = "Kies afwijzingsvertragingstijd"; @@ -2319,8 +2362,8 @@ $text['description-no_answer_delay_time']['de-ch'] = "Geben Sie die Zeit in Seku $text['description-no_answer_delay_time']['de-de'] = "Geben Sie die Zeit in Sekunden an, die gewartet werden soll bis ein Agent annimmt."; $text['description-no_answer_delay_time']['es-cl'] = "Introduzca el tiempo de espera sin responder del agente en segundos."; $text['description-no_answer_delay_time']['es-mx'] = "Introduzca el tiempo de espera sin responder del agente en segundos."; //copied from es-cl -$text['description-no_answer_delay_time']['fr-ca'] = "Choisir le delais de non réponse de l'agent."; //copied from fr-fr -$text['description-no_answer_delay_time']['fr-fr'] = "Choisir le delais de non réponse de l'agent."; +$text['description-no_answer_delay_time']['fr-ca'] = "Définir le délai maximum sans réponse de l'agent en secondes."; +$text['description-no_answer_delay_time']['fr-fr'] = "Définir le délai maximum sans réponse de l'agent en secondes."; $text['description-no_answer_delay_time']['he-il'] = ""; $text['description-no_answer_delay_time']['it-it'] = "Inserire il tempo ritardo agente non risponde in secondi."; $text['description-no_answer_delay_time']['nl-nl'] = "Voer de agent geen antwoord vertragingstijd in (seconden)"; @@ -2340,8 +2383,8 @@ $text['description-music_on_hold']['de-ch'] = "Wählen Sie die gewünschte Warte $text['description-music_on_hold']['de-de'] = "Wählen Sie die gewünschte Wartemusik."; $text['description-music_on_hold']['es-cl'] = "Seleccione una música de espera."; $text['description-music_on_hold']['es-mx'] = "Seleccione una música de espera."; //copied from es-cl -$text['description-music_on_hold']['fr-ca'] = "Sélection de la musique en attente."; //copied from fr-fr -$text['description-music_on_hold']['fr-fr'] = "Sélection de la musique en attente."; +$text['description-music_on_hold']['fr-ca'] = "Sélection de la musique d'attente."; +$text['description-music_on_hold']['fr-fr'] = "Sélection de la musique d'attente."; $text['description-music_on_hold']['he-il'] = ""; $text['description-music_on_hold']['it-it'] = "Selezionare la musica di attesa desiderata."; $text['description-music_on_hold']['nl-nl'] = "Kies de gewenste wachtmuziek."; @@ -2361,8 +2404,8 @@ $text['description-max_wait_time_with_no_agent_time_reached']['de-ch'] = "Geben $text['description-max_wait_time_with_no_agent_time_reached']['de-de'] = "Geben Sie die maximale Wartezeit in Sekunden an, die ohne Agent gewartet werden soll."; $text['description-max_wait_time_with_no_agent_time_reached']['es-cl'] = "Introduzca el tiempo máximo de espera sin agente alcanzado."; $text['description-max_wait_time_with_no_agent_time_reached']['es-mx'] = "Introduzca el tiempo máximo de espera sin agente alcanzado."; //copied from es-cl -$text['description-max_wait_time_with_no_agent_time_reached']['fr-ca'] = " Entrez le temps d'attente maximum avec un rien de temps de l'agent atteint."; //copied from fr-fr -$text['description-max_wait_time_with_no_agent_time_reached']['fr-fr'] = " Entrez le temps d'attente maximum avec un rien de temps de l'agent atteint."; +$text['description-max_wait_time_with_no_agent_time_reached']['fr-ca'] = "Entrer le temps d'attente maximal atteint sans agent."; +$text['description-max_wait_time_with_no_agent_time_reached']['fr-fr'] = "Entrer le temps d'attente maximal atteint sans agent."; $text['description-max_wait_time_with_no_agent_time_reached']['he-il'] = ""; $text['description-max_wait_time_with_no_agent_time_reached']['it-it'] = "Inserire Max Tempo Attesa Raggiungimento Tempo No Agenti."; $text['description-max_wait_time_with_no_agent_time_reached']['nl-nl'] = "Voer de maximale wachttijd voor 'geen agent' beschikbaar."; @@ -2382,7 +2425,7 @@ $text['description-max_wait_time_with_no_agent']['de-ch'] = "Geben Sie die maxim $text['description-max_wait_time_with_no_agent']['de-de'] = "Geben Sie die maximale Wartezeit ohne Agent an."; $text['description-max_wait_time_with_no_agent']['es-cl'] = "Introduzca el tiempo máximo de espera sin agente."; $text['description-max_wait_time_with_no_agent']['es-mx'] = "Introduzca el tiempo máximo de espera sin agente."; //copied from es-cl -$text['description-max_wait_time_with_no_agent']['fr-ca'] = "Entrer le temps max d'attente sans agent."; //copied from fr-fr +$text['description-max_wait_time_with_no_agent']['fr-ca'] = "Entrer le temps maximal d'attente sans agent."; $text['description-max_wait_time_with_no_agent']['fr-fr'] = "Entrer le temps max d'attente sans agent."; $text['description-max_wait_time_with_no_agent']['he-il'] = ""; $text['description-max_wait_time_with_no_agent']['it-it'] = "Inserire max tempo attesa senza agenti."; @@ -2416,16 +2459,16 @@ $text['description-max_wait_time']['ru-ru'] = "Введите максималь $text['description-max_wait_time']['sv-se'] = "Ange max vänt-tid."; $text['description-max_wait_time']['uk-ua'] = ""; -$text['description-max_no_answer']['en-us'] = "Enter max no answer."; -$text['description-max_no_answer']['en-gb'] = "Enter max no answer."; +$text['description-max_no_answer']['en-us'] = "At max no answer, the agent will be logged out."; +$text['description-max_no_answer']['en-gb'] = "At max no answer, the agent will be logged out."; $text['description-max_no_answer']['ar-eg'] = ""; $text['description-max_no_answer']['de-at'] = "Geben Sie Max keine Antwort an."; //copied from de-de $text['description-max_no_answer']['de-ch'] = "Geben Sie Max keine Antwort an."; //copied from de-de $text['description-max_no_answer']['de-de'] = "Geben Sie Max keine Antwort an."; -$text['description-max_no_answer']['es-cl'] = "Introduza el máximo de no respuestas."; -$text['description-max_no_answer']['es-mx'] = "Introduza el máximo de no respuestas."; //copied from es-cl -$text['description-max_no_answer']['fr-ca'] = "Choisir le maximum pas de réponse."; //copied from fr-fr -$text['description-max_no_answer']['fr-fr'] = "Choisir le maximum pas de réponse."; +$text['description-max_no_answer']['es-cl'] = "Si no hay respuesta como máximo, se cerrará la sesión del agente."; +$text['description-max_no_answer']['es-mx'] = "Si no hay respuesta como máximo, se cerrará la sesión del agente."; +$text['description-max_no_answer']['fr-ca'] = "Au maximum sans réponse, l'agent sera déconnecté"; +$text['description-max_no_answer']['fr-fr'] = "Au maximum sans réponse, l'agent sera déconnecté"; $text['description-max_no_answer']['he-il'] = ""; $text['description-max_no_answer']['it-it'] = "Inserire max mancata risposta."; $text['description-max_no_answer']['nl-nl'] = "Voer maximale geen antwoord tijd in."; @@ -2445,8 +2488,8 @@ $text['description-extension']['de-ch'] = "Geben Sie die Nebenstelle an."; //cop $text['description-extension']['de-de'] = "Geben Sie die Nebenstelle an."; $text['description-extension']['es-cl'] = "Introduzca el número de extensión."; $text['description-extension']['es-mx'] = "Introduzca el número de extensión."; //copied from es-cl -$text['description-extension']['fr-ca'] = "Entrer un numéro d'extension"; //copied from fr-fr -$text['description-extension']['fr-fr'] = "Entrer un numéro d'extension"; +$text['description-extension']['fr-ca'] = "Entrer un numéro de poste"; +$text['description-extension']['fr-fr'] = "Entrer un numéro de poste"; $text['description-extension']['he-il'] = ""; $text['description-extension']['it-it'] = "Inserire numero di interno."; $text['description-extension']['nl-nl'] = "Voer toestelnummer in."; @@ -2466,8 +2509,8 @@ $text['description-discard_abandoned_after']['de-ch'] = "Setzen Sie die Zeit in $text['description-discard_abandoned_after']['de-de'] = "Setzen Sie die Zeit in Sekunden, nach der ein Anrufer nicht wieder in die Warteschlange eingereiht wird."; $text['description-discard_abandoned_after']['es-cl'] = "Defina la cantidad de segundos para el abandono de descarte."; $text['description-discard_abandoned_after']['es-mx'] = "Defina la cantidad de segundos para el abandono de descarte."; //copied from es-cl -$text['description-discard_abandoned_after']['fr-ca'] = "Choisir d'écartrer les abandons après un nombre de secondes."; //copied from fr-fr -$text['description-discard_abandoned_after']['fr-fr'] = "Choisir d'écartrer les abandons après un nombre de secondes."; +$text['description-discard_abandoned_after']['fr-ca'] = "Définir le nombre de secondes avant écarter les appels abandonnés."; +$text['description-discard_abandoned_after']['fr-fr'] = "Définir le nombre de secondes avant écarter les appels abandonnés."; $text['description-discard_abandoned_after']['he-il'] = ""; $text['description-discard_abandoned_after']['it-it'] = "Imposta Scarta chi Abbandona Dopo secondi."; $text['description-discard_abandoned_after']['nl-nl'] = "Stel afwijzings tijd (seconden) in waarna de oproeper wer in de wachtrij gezet wordt."; @@ -2611,10 +2654,10 @@ $text['description-caller_announce_sound']['ar-eg'] = ""; $text['description-caller_announce_sound']['de-at'] = "Eine Datei, die regelmäßig dem Anrufer vorgespielt werden soll. Benötigt den kompletten Pfad zur wav Datei."; //copied from de-de $text['description-caller_announce_sound']['de-ch'] = "Eine Datei, die regelmäßig dem Anrufer vorgespielt werden soll. Benötigt den kompletten Pfad zur wav Datei."; //copied from de-de $text['description-caller_announce_sound']['de-de'] = "Eine Datei, die regelmäßig dem Anrufer vorgespielt werden soll. Benötigt den kompletten Pfad zur wav Datei."; -$text['description-caller_announce_sound']['es-cl'] = " Translate from: English Un sonido jugar a un cada persona que llama anunciar segundos de sonido. Necesita la ruta completa al archivo wav."; -$text['description-caller_announce_sound']['es-mx'] = " Translate from: English Un sonido jugar a un cada persona que llama anunciar segundos de sonido. Necesita la ruta completa al archivo wav."; //copied from es-cl -$text['description-caller_announce_sound']['fr-ca'] = " Un son à jouer à un appelant chaque annoncer secondes sonores. Besoins le chemin complet vers le fichier wav."; //copied from fr-fr -$text['description-caller_announce_sound']['fr-fr'] = " Un son à jouer à un appelant chaque annoncer secondes sonores. Besoins le chemin complet vers le fichier wav."; +$text['description-caller_announce_sound']['es-cl'] = "Translate from: English Un sonido jugar a un cada persona que llama anunciar segundos de sonido. Necesita la ruta completa al archivo wav."; +$text['description-caller_announce_sound']['es-mx'] = "Translate from: English Un sonido jugar a un cada persona que llama anunciar segundos de sonido. Necesita la ruta completa al archivo wav."; //copied from es-cl +$text['description-caller_announce_sound']['fr-ca'] = "Un son à jouer à un appelant à chaque fréquence de son d'annonce. Nécessite le chemin complet du fichier wav."; +$text['description-caller_announce_sound']['fr-fr'] = "Un son à jouer à un appelant à chaque fréquence de son d'annonce. Nécessite le chemin complet du fichier wav."; $text['description-caller_announce_sound']['he-il'] = ""; $text['description-caller_announce_sound']['it-it'] = "Un audio da suonare al chiamante ogni intervallo in secondi per l'annuncio. E' necessario il percorso completo al file wav."; $text['description-caller_announce_sound']['nl-nl'] = "Stel geluid in de oproeper hoort om de aankondigings tijd(seconden), volledige pad naar de .wav file."; @@ -2634,8 +2677,8 @@ $text['description-caller_announce_frequency']['de-ch'] = "Wie häufig soll der $text['description-caller_announce_frequency']['de-de'] = "Wie häufig soll der Anmeldeton abgespielt werden. Geben Sie eine Zahl in Sekunden an."; $text['description-caller_announce_frequency']['es-cl'] = "¿Con qué frecuencia deberíamos reproducir el sonido anunciar. Introduzca un número en segundos."; $text['description-caller_announce_frequency']['es-mx'] = "¿Con qué frecuencia deberíamos reproducir el sonido anunciar. Introduzca un número en segundos."; //copied from es-cl -$text['description-caller_announce_frequency']['fr-ca'] = " Combien de fois devrions-nous jouer le son annonce. Entrez un nombre dans secondes."; //copied from fr-fr -$text['description-caller_announce_frequency']['fr-fr'] = " Combien de fois devrions-nous jouer le son annonce. Entrez un nombre dans secondes."; +$text['description-caller_announce_frequency']['fr-ca'] = "Fréquence auquel le son d'annonce joue. Entrer un nombre en secondes."; +$text['description-caller_announce_frequency']['fr-fr'] = "Fréquence auquel le son d'annonce joue. Entrer un nombre en secondes."; $text['description-caller_announce_frequency']['he-il'] = ""; $text['description-caller_announce_frequency']['it-it'] = "Quanto spesso deve essere suonato l'annuncio, in secondi."; $text['description-caller_announce_frequency']['nl-nl'] = "Hoe vaak wordt de annoncering afgespeeld"; @@ -2655,8 +2698,8 @@ $text['description-call_timeout']['de-ch'] = "Geben Sie den Wert für die Zeitü $text['description-call_timeout']['de-de'] = "Geben Sie den Wert für die Zeitüberschreitung an."; $text['description-call_timeout']['es-cl'] = "Introduzca el timeout de la llamada."; $text['description-call_timeout']['es-mx'] = "Introduzca el timeout de la llamada."; //copied from es-cl -$text['description-call_timeout']['fr-ca'] = "Choisir le timeout de l'appel."; //copied from fr-fr -$text['description-call_timeout']['fr-fr'] = "Choisir le timeout de l'appel."; +$text['description-call_timeout']['fr-ca'] = "Définir le délai d'expiration de l'appel."; +$text['description-call_timeout']['fr-fr'] = "Définir le délai d'expiration de l'appel"; $text['description-call_timeout']['he-il'] = ""; $text['description-call_timeout']['it-it'] = "Inserire timeout di chiamata."; $text['description-call_timeout']['nl-nl'] = "Voer oproep overscheidingstijd in."; @@ -2739,8 +2782,8 @@ $text['description-busy_delay_time']['de-ch'] = "Geben Sie eine Wartezeit für d $text['description-busy_delay_time']['de-de'] = "Geben Sie eine Wartezeit für den Agenten an."; $text['description-busy_delay_time']['es-cl'] = "Introduzca el tiempo de espera de agente ocupado."; $text['description-busy_delay_time']['es-mx'] = "Introduzca el tiempo de espera de agente ocupado."; //copied from es-cl -$text['description-busy_delay_time']['fr-ca'] = "Choisir le temps d'attente quand l'agent est occupé."; //copied from fr-fr -$text['description-busy_delay_time']['fr-fr'] = "Choisir le temps d'attente quand l'agent est occupé."; +$text['description-busy_delay_time']['fr-ca'] = "Choisir le délai d'attente lorsque l'agent est occupé."; +$text['description-busy_delay_time']['fr-fr'] = "Choisir le délai d'attente lorsque l'agent est occupé."; $text['description-busy_delay_time']['he-il'] = ""; $text['description-busy_delay_time']['it-it'] = "Inserire il tempo di ritardo su agente occupato."; $text['description-busy_delay_time']['nl-nl'] = "Voer de agent bezet wachttijd in"; @@ -2865,8 +2908,8 @@ $text['description-abandoned_resume_allowed']['de-ch'] = "Schalten Sie die Wider $text['description-abandoned_resume_allowed']['de-de'] = "Schalten Sie die Wideraufnahme von Anrufern in der Warteschlange Ein oder Aus."; $text['description-abandoned_resume_allowed']['es-cl'] = "Defina el permiso para permitir la continuación de abandono a verdadero o falso."; $text['description-abandoned_resume_allowed']['es-mx'] = "Defina el permiso para permitir la continuación de abandono a verdadero o falso."; //copied from es-cl -$text['description-abandoned_resume_allowed']['fr-ca'] = "choisir l'autorisation de reprise d'abandon à oui ou non."; //copied from fr-fr -$text['description-abandoned_resume_allowed']['fr-fr'] = "choisir l'autorisation de reprise d'abandon à oui ou non."; +$text['description-abandoned_resume_allowed']['fr-ca'] = "Définir l'autorisation de reprise d'abandon à oui ou non."; +$text['description-abandoned_resume_allowed']['fr-fr'] = "Définir l'autorisation de reprise d'abandon à oui ou non."; $text['description-abandoned_resume_allowed']['he-il'] = ""; $text['description-abandoned_resume_allowed']['it-it'] = "Imposta a vero o falso il permesso di ripristinare chi ha abbandonato."; $text['description-abandoned_resume_allowed']['nl-nl'] = "Kies de afgebroken vervolgen toestaan aan of uit."; @@ -2886,8 +2929,8 @@ $text['confirm-copy']['de-ch'] = "Wollen Sie das wirklich kopieren?"; //copied f $text['confirm-copy']['de-de'] = "Wollen Sie das wirklich kopieren?"; $text['confirm-copy']['es-cl'] = "¿Realmente desea copiar esto?"; $text['confirm-copy']['es-mx'] = "¿Realmente desea copiar esto?"; //copied from es-cl -$text['confirm-copy']['fr-ca'] = "Voulez-vous vraiment copier cela?"; //copied from fr-fr -$text['confirm-copy']['fr-fr'] = "Voulez-vous vraiment copier cela?"; +$text['confirm-copy']['fr-ca'] = "Voulez-vous vraiment créer une copie?"; +$text['confirm-copy']['fr-fr'] = "Voulez-vous vraiment créer une copie?"; $text['confirm-copy']['he-il'] = ""; $text['confirm-copy']['it-it'] = "Vuoi veramente farne una copia?"; $text['confirm-copy']['nl-nl'] = "Wil je dit werkelijk overnemen?"; @@ -2907,8 +2950,8 @@ $text['button-update_status']['de-ch'] = "Status Aktualisieren"; //copied from d $text['button-update_status']['de-de'] = "Status Aktualisieren"; $text['button-update_status']['es-cl'] = "Actualizar Estado"; $text['button-update_status']['es-mx'] = "Actualizar Estado"; //copied from es-cl -$text['button-update_status']['fr-ca'] = "Mis à jour état"; //copied from fr-fr -$text['button-update_status']['fr-fr'] = "Mis à jour état"; +$text['button-update_status']['fr-ca'] = "Mettre à jour l'état"; +$text['button-update_status']['fr-fr'] = "Mettre à jour l'état"; $text['button-update_status']['he-il'] = ""; $text['button-update_status']['it-it'] = "Stato Aggiornato"; $text['button-update_status']['nl-nl'] = "Bijwerk status"; @@ -2928,8 +2971,8 @@ $text['button-tiers']['de-ch'] = "Ebenen"; //copied from de-de $text['button-tiers']['de-de'] = "Ebenen"; $text['button-tiers']['es-cl'] = "Niveles"; $text['button-tiers']['es-mx'] = "Niveles"; //copied from es-cl -$text['button-tiers']['fr-ca'] = "Tiers"; //copied from fr-fr -$text['button-tiers']['fr-fr'] = "Tiers"; +$text['button-tiers']['fr-ca'] = "Niveaux"; +$text['button-tiers']['fr-fr'] = "Niveaux"; $text['button-tiers']['he-il'] = ""; $text['button-tiers']['it-it'] = "Tiers"; $text['button-tiers']['nl-nl'] = "Vergelijkingen"; diff --git a/app/call_centers/call_center_agent_dashboard.php b/app/call_centers/call_center_agent_dashboard.php index 6c35982456..95b24cb3d4 100644 --- a/app/call_centers/call_center_agent_dashboard.php +++ b/app/call_centers/call_center_agent_dashboard.php @@ -212,7 +212,4 @@ echo "\n"; echo "\n"; -//include footer - require_once "resources/footer.php"; - -?> \ No newline at end of file +?> diff --git a/app/call_centers/call_center_agent_edit.php b/app/call_centers/call_center_agent_edit.php index 1cb143ee77..f2d404663b 100644 --- a/app/call_centers/call_center_agent_edit.php +++ b/app/call_centers/call_center_agent_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2019 + Portions created by the Initial Developer are Copyright (C) 2008-2020 the Initial Developer. All Rights Reserved. Contributor(s): @@ -93,6 +93,7 @@ $agent_wrap_up_time = $_POST["agent_wrap_up_time"]; $agent_reject_delay_time = $_POST["agent_reject_delay_time"]; $agent_busy_delay_time = $_POST["agent_busy_delay_time"]; + $agent_record = $_POST["agent_record"]; //$agent_logout = $_POST["agent_logout"]; } @@ -152,6 +153,12 @@ $users = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); + //change the contact string to loopback - Not recommended added for backwards comptability causes multiple problems + if ($_SESSION['call_center']['agent_contact_method']['text'] == 'loopback') { + $agent_contact = str_replace("user/", "loopback/", $agent_contact); + $agent_contact = str_replace("@", "/", $agent_contact); + } + //prepare the array $array['call_center_agents'][0]['domain_uuid'] = $_SESSION['domain_uuid']; $array['call_center_agents'][0]['call_center_agent_uuid'] = $call_center_agent_uuid; @@ -168,6 +175,7 @@ $array['call_center_agents'][0]['agent_wrap_up_time'] = $agent_wrap_up_time; $array['call_center_agents'][0]['agent_reject_delay_time'] = $agent_reject_delay_time; $array['call_center_agents'][0]['agent_busy_delay_time'] = $agent_busy_delay_time; + $array['call_center_agents'][0]['agent_record'] = $agent_record; if (is_uuid($user_uuid)) { $array['users'][0]['domain_uuid'] = $_SESSION['domain_uuid']; $array['users'][0]['user_uuid'] = $user_uuid; @@ -295,6 +303,7 @@ $agent_wrap_up_time = $row["agent_wrap_up_time"]; $agent_reject_delay_time = $row["agent_reject_delay_time"]; $agent_busy_delay_time = $row["agent_busy_delay_time"]; + $agent_record = $row["agent_record"]; //$agent_logout = $row["agent_logout"]; } unset($sql, $parameters, $row); @@ -573,6 +582,20 @@ echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo " ".$text['label-record_template']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-record_template']."\n"; + echo "\n"; + echo "\n"; + /* echo "\n"; echo "\n"; @@ -599,4 +622,4 @@ //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/app/call_centers/call_center_agents.php b/app/call_centers/call_center_agents.php index 5542f2fe77..69d9d7ad38 100644 --- a/app/call_centers/call_center_agents.php +++ b/app/call_centers/call_center_agents.php @@ -119,6 +119,9 @@ echo "
".$text['header-call_center_agents']." (".$num_rows.")
\n"; echo "
\n"; echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','link'=>'call_center_queues.php','style'=>'margin-right: 15px;']); + if (permission_exists('call_center_imports')) { + echo button::create(['type'=>'button','label'=>$text['button-import'],'icon'=>$_SESSION['theme']['button_icon_import'],'link'=>PROJECT_PATH.'/app/call_center_imports/call_center_imports.php?import_type=call_center_agents']); + } if ($num_rows) { echo button::create(['type'=>'button','label'=>$text['button-status'],'icon'=>'user-clock','style'=>'margin-right: 15px;','link'=>'call_center_agent_status.php']); } @@ -242,4 +245,4 @@ //show the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index 8652d49f82..622f5cc86d 100644 --- a/app/call_centers/call_center_queue_edit.php +++ b/app/call_centers/call_center_queue_edit.php @@ -86,6 +86,7 @@ $queue_moh_sound = $_POST["queue_moh_sound"]; $queue_record_template = $_POST["queue_record_template"]; $queue_time_base_score = $_POST["queue_time_base_score"]; + $queue_time_base_score_sec = $_POST["queue_time_base_score_sec"]; $queue_max_wait_time = $_POST["queue_max_wait_time"]; $queue_max_wait_time_with_no_agent = $_POST["queue_max_wait_time_with_no_agent"]; $queue_max_wait_time_with_no_agent_time_reached = $_POST["queue_max_wait_time_with_no_agent_time_reached"]; @@ -188,6 +189,7 @@ //if (strlen($queue_moh_sound) == 0) { $msg .= $text['message-required'].$text['label-music_on_hold']."
\n"; } //if (strlen($queue_record_template) == 0) { $msg .= $text['message-required'].$text['label-record_template']."
\n"; } //if (strlen($queue_time_base_score) == 0) { $msg .= $text['message-required'].$text['label-time_base_score']."
\n"; } + //if (strlen($queue_time_base_score_sec) == 0) { $msg .= $text['message-required'].$text['label-time_base_score_sec']."
\n"; } //if (strlen($queue_max_wait_time) == 0) { $msg .= $text['message-required'].$text['label-max_wait_time']."
\n"; } //if (strlen($queue_max_wait_time_with_no_agent) == 0) { $msg .= $text['message-required'].$text['label-max_wait_time_with_no_agent']."
\n"; } //if (strlen($queue_max_wait_time_with_no_agent_time_reached) == 0) { $msg .= $text['message-required'].$text['label-max_wait_time_with_no_agent_time_reached']."
\n"; } @@ -269,6 +271,7 @@ $array['call_center_queues'][0]['queue_moh_sound'] = $queue_moh_sound; $array['call_center_queues'][0]['queue_record_template'] = $queue_record_template; $array['call_center_queues'][0]['queue_time_base_score'] = $queue_time_base_score; + $array['call_center_queues'][0]['queue_time_base_score_sec'] = $queue_time_base_score_sec; $array['call_center_queues'][0]['queue_max_wait_time'] = $queue_max_wait_time; $array['call_center_queues'][0]['queue_max_wait_time_with_no_agent'] = $queue_max_wait_time_with_no_agent; $array['call_center_queues'][0]['queue_max_wait_time_with_no_agent_time_reached'] = $queue_max_wait_time_with_no_agent_time_reached; @@ -324,8 +327,19 @@ $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; + if ($queue_time_base_score_sec != '') { + $dialplan_xml .= " \n"; + } if ($queue_greeting_path != '') { - $dialplan_xml .= " \n"; + $greeting_array = explode(':', $queue_greeting_path); + if (count($greeting_array) == 1) { + $dialplan_xml .= " \n"; + } + else { + if ($greeting_array[0] == 'say' || $greeting_array[0] == 'tone_stream' || $greeting_array[0] == 'phrase') { + $dialplan_xml .= " \n"; + } + } } if (strlen($queue_cid_prefix) > 0) { $dialplan_xml .= " \n"; @@ -345,7 +359,7 @@ $array['dialplans'][0]["dialplan_uuid"] = $dialplan_uuid; $array['dialplans'][0]["dialplan_name"] = $queue_name; $array['dialplans'][0]["dialplan_number"] = $queue_extension; - $array['dialplans'][0]["dialplan_context"] = $_SESSION['context']; + $array['dialplans'][0]["dialplan_context"] = $_SESSION['domain_name']; $array['dialplans'][0]["dialplan_continue"] = "false"; $array['dialplans'][0]["dialplan_xml"] = $dialplan_xml; $array['dialplans'][0]["dialplan_order"] = "230"; @@ -377,7 +391,12 @@ //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } //redirect the user if (isset($action)) { @@ -468,6 +487,7 @@ $queue_moh_sound = $row["queue_moh_sound"]; $queue_record_template = $row["queue_record_template"]; $queue_time_base_score = $row["queue_time_base_score"]; + $queue_time_base_score_sec = $row["queue_time_base_score_sec"]; $queue_max_wait_time = $row["queue_max_wait_time"]; $queue_max_wait_time_with_no_agent = $row["queue_max_wait_time_with_no_agent"]; $queue_max_wait_time_with_no_agent_time_reached = $row["queue_max_wait_time_with_no_agent_time_reached"]; @@ -538,6 +558,7 @@ if (strlen($queue_strategy) == 0) { $queue_strategy = "longest-idle-agent"; } if (strlen($queue_moh_sound) == 0) { $queue_moh_sound = "\$\${hold_music}"; } if (strlen($queue_time_base_score) == 0) { $queue_time_base_score = "system"; } + if (strlen($queue_time_base_score) == 0) { $queue_time_base_score = ""; } if (strlen($queue_max_wait_time) == 0) { $queue_max_wait_time = "0"; } if (strlen($queue_max_wait_time_with_no_agent) == 0) { $queue_max_wait_time_with_no_agent = "90"; } if (strlen($queue_max_wait_time_with_no_agent_time_reached) == 0) { $queue_max_wait_time_with_no_agent_time_reached = "30"; } @@ -768,16 +789,17 @@ echo " \n"; echo " "; if (strlen($field['call_center_tier_uuid']) > 0) { - echo " \n"; + echo " \n"; } - echo " \n"; + if (is_uuid($field['call_center_agent_uuid'])) { + echo " \n"; + } + else { + echo " \n"; + foreach($agents as $row) { + echo " \n"; } - echo " \n"; } echo " "; echo " \n"; @@ -884,6 +906,17 @@ echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo " ".$text['label-time_base_score_sec']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-time_base_score_sec']."\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo " ".$text['label-max_wait_time']."\n"; diff --git a/app/call_centers/call_center_queues.php b/app/call_centers/call_center_queues.php index 86a8ed46c4..f56991567e 100644 --- a/app/call_centers/call_center_queues.php +++ b/app/call_centers/call_center_queues.php @@ -124,6 +124,9 @@ echo "
\n"; echo "
".$text['header-call_center_queues']." (".$num_rows.")
\n"; echo "
\n"; + if (permission_exists('call_center_imports')) { + echo button::create(['type'=>'button','label'=>$text['button-import'],'icon'=>$_SESSION['theme']['button_icon_import'],'link'=>PROJECT_PATH.'/app/call_center_imports/call_center_imports.php?import_type=call_center_queues']); + } if (permission_exists('call_center_agent_view')) { echo button::create(['type'=>'button','label'=>$text['button-agents'],'icon'=>'users','link'=>'call_center_agents.php']); } @@ -182,6 +185,7 @@ //echo th_order_by('queue_moh_sound', $text['label-music_on_hold'], $order_by, $order); //echo th_order_by('queue_record_template', $text['label-record_template'], $order_by, $order); //echo th_order_by('queue_time_base_score', $text['label-time_base_score'], $order_by, $order); + //echo th_order_by('queue_time_base_score_sec', $text['label-time_base_score_sec'], $order_by, $order); //echo th_order_by('queue_max_wait_time', $text['label-max_wait_time'], $order_by, $order); //echo th_order_by('queue_max_wait_time_with_no_agent', $text['label-max_wait_time_with_no_agent'], $order_by, $order); echo th_order_by('queue_tier_rules_apply', $text['label-tier_rules_apply'], $order_by, $order); @@ -222,6 +226,7 @@ //echo " ".escape($row[queue_moh_sound])." \n"; //echo " ".escape($row[queue_record_template])." \n"; //echo " ".escape($row[queue_time_base_score])." \n"; + //echo " ".escape($row[queue_time_base_score_sec])." \n"; //echo " ".escape($row[queue_max_wait_time])." \n"; //echo " ".escape($row[queue_max_wait_time_with_no_agent])." \n"; echo " ".ucwords(escape($row['queue_tier_rules_apply']))."\n"; @@ -253,4 +258,4 @@ //show the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/app/call_centers/resources/classes/call_center.php b/app/call_centers/resources/classes/call_center.php index c5e8f59d69..53b08e0065 100644 --- a/app/call_centers/resources/classes/call_center.php +++ b/app/call_centers/resources/classes/call_center.php @@ -109,7 +109,7 @@ $dialplan["domain_uuid"] = $this->domain_uuid; $dialplan["dialplan_name"] = ($this->queue_name != '') ? $this->queue_name : format_phone($this->destination_number); $dialplan["dialplan_number"] = $this->destination_number; - $dialplan["dialplan_context"] = $_SESSION['context']; + $dialplan["dialplan_context"] = $_SESSION['domain_name']; $dialplan["dialplan_continue"] = "false"; $dialplan["dialplan_order"] = "210"; $dialplan["dialplan_enabled"] = "true"; @@ -267,7 +267,7 @@ //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION['context']); + $cache->delete("dialplan:".$_SESSION['domain_name']); //return the dialplan_uuid return $dialplan_response; @@ -346,6 +346,17 @@ //delete the checked rows if (is_array($array) && @sizeof($array) != 0) { + //setup the event socket connection + $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); + + //delete the queue in the switch + if ($fp) { + foreach ($uuids as $uuid) { + $cmd = "api callcenter_config queue unload ".$uuid; + $response = event_socket_request($fp, $cmd); + } + } + //grant temporary permissions $p = new permissions; $p->add('call_center_tier_delete', 'temp'); @@ -366,9 +377,14 @@ //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); remove_config_from_cache('configuration:callcenter.conf'); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //synchronize configuration save_call_center_xml(); @@ -417,7 +433,7 @@ //build the delete array if (is_array($uuids) && @sizeof($uuids) != 0) { - foreach ($uuids as $uuid) { + foreach ($uuids as $x => $uuid) { $array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid; $array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid']; $array['call_center_tiers'][$x]['call_center_agent_uuid'] = $uuid; @@ -592,7 +608,7 @@ //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); //set message message::add($text['message-copy']); diff --git a/app/call_flows/call_flow_edit.php b/app/call_flows/call_flow_edit.php index c507527df7..d7b4cc6f21 100644 --- a/app/call_flows/call_flow_edit.php +++ b/app/call_flows/call_flow_edit.php @@ -255,6 +255,11 @@ $cache = new cache; $cache->delete("dialplan:".$call_flow_context); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //redirect the user if (isset($action)) { if ($action == "add") { diff --git a/app/call_flows/resources/classes/call_flows.php b/app/call_flows/resources/classes/call_flows.php index 2bb4d87647..cff8c934f0 100644 --- a/app/call_flows/resources/classes/call_flows.php +++ b/app/call_flows/resources/classes/call_flows.php @@ -158,6 +158,11 @@ if (!class_exists('call_flows')) { } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-delete']); } @@ -250,6 +255,11 @@ if (!class_exists('call_flows')) { } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-toggle']); } diff --git a/app/calls/app_config.php b/app/calls/app_config.php index 157c972801..ec3f393e8e 100644 --- a/app/calls/app_config.php +++ b/app/calls/app_config.php @@ -51,8 +51,6 @@ $y++; $apps[$x]['permissions'][$y]['name'] = "call_forward_all"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; - $y++; - $apps[$x]['permissions'][$y]['name'] = "call_forward_caller_id"; //default settings $y=0; diff --git a/app/calls/call_edit.php b/app/calls/call_edit.php index 167c836259..56ec9d6c84 100644 --- a/app/calls/call_edit.php +++ b/app/calls/call_edit.php @@ -101,7 +101,6 @@ $forward_user_not_registered_destination = $row["forward_user_not_registered_destination"]; $forward_user_not_registered_enabled = $row["forward_user_not_registered_enabled"]; $follow_me_uuid = $row["follow_me_uuid"]; - $forward_caller_id_uuid = $row["forward_caller_id_uuid"]; } else { echo "access denied"; @@ -123,11 +122,9 @@ $forward_user_not_registered_enabled = $_POST["forward_user_not_registered_enabled"]; $forward_user_not_registered_destination = $_POST["forward_user_not_registered_destination"]; - $forward_caller_id_uuid = $_POST["forward_caller_id_uuid"]; $cid_name_prefix = $_POST["cid_name_prefix"]; $cid_number_prefix = $_POST["cid_number_prefix"]; $follow_me_enabled = $_POST["follow_me_enabled"]; - $follow_me_caller_id_uuid = $_POST["follow_me_caller_id_uuid"]; $follow_me_ignore_busy = $_POST["follow_me_ignore_busy"]; $n = 0; @@ -194,7 +191,6 @@ $array['extensions'][0]['forward_no_answer_destination'] = $forward_no_answer_destination; $array['extensions'][0]['forward_user_not_registered_enabled'] = $forward_user_not_registered_enabled; $array['extensions'][0]['forward_user_not_registered_destination'] = $forward_user_not_registered_destination; - $array['extensions'][0]['forward_caller_id_uuid'] = $forward_caller_id_uuid; } //do not disturb (dnd) config @@ -226,7 +222,6 @@ $array['follow_me'][0]['follow_me_uuid'] = $follow_me_uuid; $array['follow_me'][0]['cid_name_prefix'] = $cid_name_prefix; $array['follow_me'][0]['cid_number_prefix'] = $cid_number_prefix; - $array['follow_me'][0]['follow_me_caller_id_uuid'] = $follow_me_caller_id_uuid; $array['follow_me'][0]['follow_me_ignore_busy'] = $follow_me_ignore_busy; if ($destination_found) { $array['follow_me'][0]['follow_me_enabled'] = $follow_me_enabled; @@ -297,7 +292,6 @@ $call_forward->extension_uuid = $extension_uuid; $call_forward->forward_all_destination = $forward_all_destination; $call_forward->forward_all_enabled = $forward_all_enabled; - $call_forward->forward_caller_id_uuid = $forward_caller_id_uuid; } //do not disturb (dnd) config @@ -328,7 +322,6 @@ $follow_me->extension_uuid = $extension_uuid; $follow_me->follow_me_uuid = $follow_me_uuid; $follow_me->follow_me_ignore_busy = $follow_me_ignore_busy; - $follow_me->follow_me_caller_id_uuid = $follow_me_caller_id_uuid; $follow_me->follow_me_enabled = $follow_me_enabled; $follow_me->set(); unset($follow_me); @@ -431,7 +424,6 @@ $cid_name_prefix = $row["cid_name_prefix"]; $cid_number_prefix = $row["cid_number_prefix"]; $follow_me_enabled = $row["follow_me_enabled"]; - $follow_me_caller_id_uuid = $row["follow_me_caller_id_uuid"]; $follow_me_ignore_busy = $row["follow_me_ignore_busy"]; unset($row); @@ -441,6 +433,8 @@ $parameters['follow_me_uuid'] = $follow_me_uuid; $database = new database; $result = $database->select($sql, $parameters, 'all'); + + unset($destinations); foreach ($result as $x => &$row) { $destinations[$x]['uuid'] = $row["follow_me_destination_uuid"]; $destinations[$x]['destination'] = $row["follow_me_destination"]; @@ -493,6 +487,7 @@ echo "});\n"; echo "\n"; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); @@ -579,43 +574,6 @@ echo "\n"; echo "\n"; - if (permission_exists('call_forward_caller_id')) { - $sql = "select destination_uuid, destination_number, destination_description, destination_caller_id_number, destination_caller_id_name "; - $sql .= "from v_destinations "; - $sql .= "where domain_uuid = :domain_uuid "; - $sql .= "and destination_type = 'inbound' "; - $sql .= "order by destination_number asc "; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; - $result = $database->select($sql, $parameters, 'all'); - if (is_array($result) && sizeof($result) != 0) { - echo "\n"; - echo ""; - echo $text['label-cid-number']; - echo "\n"; - echo "\n"; - echo "
\n"; - echo $text['description-cid-number']."\n"; - echo "\n"; - echo "\n"; - } - unset($sql, $parameters, $result, $row); - } - echo "
\n"; echo "\n"; @@ -625,9 +583,6 @@ echo "\n"; $on_click = "document.getElementById('forward_all_disabled').checked=true; "; $on_click .= "document.getElementById('dnd_disabled').checked=true; "; - if (permission_exists('follow_me_caller_id')) { - $on_click .= "document.getElementById('follow_me_caller_id_uuid').focus(); "; - } echo " \n"; echo " \n"; unset($on_click); @@ -696,45 +651,6 @@ echo " \n"; } - if (permission_exists('follow_me_caller_id')) { - $sql = "select destination_uuid, destination_number, destination_description, destination_caller_id_number, destination_caller_id_name "; - $sql .= "from v_destinations "; - $sql .= "where domain_uuid = :domain_uuid "; - $sql .= "and destination_type = 'inbound' "; - $sql .= "order by destination_number asc "; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; - $result = $database->select($sql, $parameters, 'all'); - if (is_array($result) && sizeof($result) != 0) { - echo "\n"; - echo ""; - echo $text['label-cid-number']; - echo "\n"; - echo "\n"; - echo "
\n"; - echo $text['description-cid-number']."\n"; - echo "\n"; - echo "\n"; - } - unset($sql, $parameters, $result, $row); - } - if (permission_exists('follow_me_cid_name_prefix')) { echo "\n"; echo "\n"; diff --git a/app/calls/calls.php b/app/calls/calls.php index cbfe56b6df..ff66f5bcbf 100644 --- a/app/calls/calls.php +++ b/app/calls/calls.php @@ -194,16 +194,6 @@ } require_once "resources/header.php"; -//javascript for toggle select box - echo "\n"; - //show the content if ($is_included) { echo "
\n"; @@ -222,21 +212,17 @@ echo "
\n"; if ($extensions) { - echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'name'=>'btn_toggle','onclick'=>"toggle_select(); this.blur();"]); + if (permission_exists('call_forward')) { + echo button::create(['type' => 'button', 'label' => $text['label-call_forward'], 'icon' => $_SESSION['theme']['button_icon_toggle'], 'collapse' => false, 'name' => 'btn_toggle_cfwd', 'onclick' => "list_action_set('toggle_call_forward'); modal_open('modal-toggle','btn_toggle');"]); + } + if (permission_exists('follow_me')) { + echo button::create(['type' => 'button', 'label' => $text['label-follow_me'], 'icon' => $_SESSION['theme']['button_icon_toggle'], 'collapse' => false, 'name' => 'btn_toggle_follow', 'onclick' => "list_action_set('toggle_follow_me'); modal_open('modal-toggle','btn_toggle');"]); + } + if (permission_exists('do_not_disturb')) { + echo button::create(['type' => 'button', 'label' => $text['label-dnd'], 'icon' => $_SESSION['theme']['button_icon_toggle'], 'collapse' => false, 'name' => 'btn_toggle_dnd', 'onclick' => "list_action_set('toggle_do_not_disturb'); modal_open('modal-toggle','btn_toggle');"]); + } } - echo ""; - if ($_GET['show'] !== 'all' && permission_exists('call_forward_all')) { + if ($_GET['show'] !== 'all' && permission_exists('call_forward_all')) { echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all'.($params ? '&'.implode('&', $params) : null)]); } echo "
\n"; if ($extensions) { - echo modal::create(['id'=>'modal-toggle','type'=>'toggle','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_toggle','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('toggle_' + document.getElementById('call_control_feature').options[document.getElementById('call_control_feature').selectedIndex].value); list_form_submit('form_list');"])]); + echo modal::create(['id'=>'modal-toggle','type'=>'toggle','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_toggle','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_form_submit('form_list');"])]); } echo $text['description-call_routing']."\n"; diff --git a/app/calls/resources/classes/call_forward.php b/app/calls/resources/classes/call_forward.php index 31517b5c65..e03f1d9daf 100644 --- a/app/calls/resources/classes/call_forward.php +++ b/app/calls/resources/classes/call_forward.php @@ -42,7 +42,6 @@ include "root.php"; private $dial_string; private $toll_allow; public $accountcode; - public $forward_caller_id_uuid; public $outbound_caller_id_name; public $outbound_caller_id_number; @@ -280,4 +279,4 @@ include "root.php"; }// class -?> \ No newline at end of file +?> diff --git a/app/calls/resources/classes/feature_event_notify.php b/app/calls/resources/classes/feature_event_notify.php index 28e0791011..b7efff6196 100644 --- a/app/calls/resources/classes/feature_event_notify.php +++ b/app/calls/resources/classes/feature_event_notify.php @@ -43,38 +43,40 @@ include "root.php"; //feature_event method public function send_notify() { - - $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); - if ($fp) { - //get the sip profile name - $command = "sofia_contact */".$this->extension."@".$this->domain_name; - $contact_string = event_socket_request($fp, "api ".$command); - if (substr($contact_string, 0, 5) == "sofia") { - $contact_array = explode("/", $contact_string); - $sip_profile_name = $contact_array[1]; - } - else { - $sip_profile_name = 'internal'; - } - //send the event - $event = "sendevent SWITCH_EVENT_PHONE_FEATURE\n"; - $event .= "profile: ".$sip_profile_name."\n"; - $event .= "user: ".$this->extension."\n"; - $event .= "host: ".$this->domain_name."\n"; - $event .= "device: \n"; - $event .= "Feature-Event: init\n"; - $event .= "forward_immediate_enabled: ".$this->forward_all_enabled."\n"; - $event .= "forward_immediate: ".$this->forward_all_destination."\n"; - $event .= "forward_busy_enabled: ".$this->forward_busy_enabled."\n"; - $event .= "forward_busy: ".$this->forward_busy_destination."\n"; - $event .= "forward_no_answer_enabled: ".$this->forward_no_answer_enabled."\n"; - $event .= "forward_no_answer: ".$this->forward_no_answer_destination."\n"; - $event .= "doNotDisturbOn: ".$this->do_not_disturb."\n"; - $event .= "ringCount: ".$this->ring_count."\n"; - event_socket_request($fp, $event); - - fclose($fp); + $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); + if ($fp) { + // Get the SIP profiles for the extension + $command = "sofia_contact */{$this->extension}@{$this->domain_name}"; + $contact_string = event_socket_request($fp, "api ".$command); + // The first value in the array will be full matching text, the second one will be the array of profile matches + preg_match_all('/sofia\/([^,]+)\/(?:[^,]+)/', $contact_string, $matches); + if (sizeof($matches) != 2 || sizeof($matches[1]) < 1) { + $profiles = array("internal"); + } else { + // We have at least one profile, get all of the unique profiles + $profiles = array_unique($matches[1]); } + + foreach ($profiles as $profile) { + //send the event + $event = "sendevent SWITCH_EVENT_PHONE_FEATURE\n"; + $event .= "profile: " . $profile . "\n"; + $event .= "user: " . $this->extension . "\n"; + $event .= "host: " . $this->domain_name . "\n"; + $event .= "device: \n"; + $event .= "Feature-Event: init\n"; + $event .= "forward_immediate_enabled: " . $this->forward_all_enabled . "\n"; + $event .= "forward_immediate: " . $this->forward_all_destination . "\n"; + $event .= "forward_busy_enabled: " . $this->forward_busy_enabled . "\n"; + $event .= "forward_busy: " . $this->forward_busy_destination . "\n"; + $event .= "forward_no_answer_enabled: " . $this->forward_no_answer_enabled . "\n"; + $event .= "forward_no_answer: " . $this->forward_no_answer_destination . "\n"; + $event .= "doNotDisturbOn: " . $this->do_not_disturb . "\n"; + $event .= "ringCount: " . $this->ring_count . "\n"; + event_socket_request($fp, $event); + } + fclose($fp); + } } //function } //class diff --git a/app/calls/resources/classes/follow_me.php b/app/calls/resources/classes/follow_me.php index fa6df03d8a..fa602d9654 100644 --- a/app/calls/resources/classes/follow_me.php +++ b/app/calls/resources/classes/follow_me.php @@ -39,7 +39,6 @@ include "root.php"; public $cid_number_prefix; public $accountcode; public $follow_me_enabled; - public $follow_me_caller_id_uuid; public $follow_me_ignore_busy; public $outbound_caller_id_name; public $outbound_caller_id_number; @@ -89,7 +88,7 @@ include "root.php"; if (strlen($this->cid_number_prefix) > 0) { $array['follow_me'][0]['cid_number_prefix'] = $this->cid_number_prefix; } - $array['follow_me'][0]['follow_me_caller_id_uuid'] = is_uuid($this->follow_me_caller_id_uuid) ? $this->follow_me_caller_id_uuid : null; + $array['follow_me'][0]['follow_me_enabled'] = $this->follow_me_enabled; $array['follow_me'][0]['follow_me_ignore_busy'] = $this->follow_me_ignore_busy; //grant temporary permissions @@ -114,7 +113,6 @@ include "root.php"; $array['follow_me'][0]['follow_me_uuid'] = $this->follow_me_uuid; $array['follow_me'][0]['cid_name_prefix'] = $this->cid_name_prefix; $array['follow_me'][0]['cid_number_prefix'] = $this->cid_number_prefix; - $array['follow_me'][0]['follow_me_caller_id_uuid'] = is_uuid($this->follow_me_caller_id_uuid) ? $this->follow_me_caller_id_uuid : null; $array['follow_me'][0]['follow_me_enabled'] = $this->follow_me_enabled; $array['follow_me'][0]['follow_me_ignore_busy'] = $this->follow_me_ignore_busy; //grant temporary permissions @@ -459,4 +457,4 @@ include "root.php"; } //class -?> \ No newline at end of file +?> diff --git a/app/click_to_call/app_languages.php b/app/click_to_call/app_languages.php index 4fd199f41d..25bc633844 100644 --- a/app/click_to_call/app_languages.php +++ b/app/click_to_call/app_languages.php @@ -450,8 +450,8 @@ $text['desc-ringback']['de-ch'] = "Geben Sie an, was Sie hören möchten, währe $text['desc-ringback']['de-de'] = "Geben Sie an, was Sie hören möchten, während die Verbindung aufgebaut wird. Zur Auswahl stehen musik (Wartemusik) oder Rufton"; $text['desc-ringback']['es-cl'] = "Defina qué desea escuchar mientras se llama al destinatario. Las opciones son música (música en espera) o tono de marcado"; $text['desc-ringback']['es-mx'] = "Defina qué desea escuchar mientras se llama al destinatario. Las opciones son música (música en espera) o tono de marcado"; //copied from es-cl -$text['desc-ringback']['fr-ca'] = "Défini ce vous entendrez pendant que la destination sera appelée. Les choix sont musique (musique de garde) sonnerie."; //copied from fr-fr -$text['desc-ringback']['fr-fr'] = "Défini ce vous entendrez pendant que la destination sera appelée. Les choix sont musique (musique de garde) sonnerie."; +$text['desc-ringback']['fr-ca'] = "Défini ce vous entendrez pendant que la destination sera appelée. Les choix sont musique (musique d'attente) sonnerie."; //copied from fr-fr +$text['desc-ringback']['fr-fr'] = "Défini ce vous entendrez pendant que la destination sera appelée. Les choix sont musique (musique d'attente) sonnerie."; $text['desc-ringback']['he-il'] = ""; $text['desc-ringback']['it-it'] = "Definisce cosa sentirai mentre il destinatario è chiamato. Le scelte sono musica (music on hold) o tono (ring tone)."; $text['desc-ringback']['nl-nl'] = "Kies wachtmuziek terwijl de bestemming gebeld wordt. De keuze is wachtmuziek of beltoon."; diff --git a/app/click_to_call/click_to_call.php b/app/click_to_call/click_to_call.php index 7a953f7b97..50a7ff3f5b 100644 --- a/app/click_to_call/click_to_call.php +++ b/app/click_to_call/click_to_call.php @@ -2,7 +2,7 @@ /* $Id$ */ /* click_to_call.php - Copyright (C) 2008, 2018 Mark J Crane + Copyright (C) 2008, 2021 Mark J Crane All rights reserved. Redistribution and use in source and binary forms, with or without @@ -66,7 +66,7 @@ $auto_answer = check_str($_GET['auto_answer']); //true,false $rec = check_str($_GET['rec']); //true,false $ringback = check_str($_GET['ringback']); - $context = $_SESSION['context']; + $context = $_SESSION['domain_name']; //clean up variable values $src = str_replace(array('.','(',')','-',' '), '', $src); @@ -209,7 +209,7 @@ else { //display the last command $switch_cmd = "api originate ".$source.$switch_cmd; - echo "
".$switch_cmd."

".$src." has called ".$dest."
\n"; + echo "
".escape($src)." has called ".escape($dest)."
\n"; //show the command result $result = trim(event_socket_request($fp, $switch_cmd)); if (substr($result, 0,3) == "+OK") { @@ -218,11 +218,13 @@ //use the server's time zone to ensure it matches the time zone used by freeswitch date_default_timezone_set($_SESSION['time_zone']['system']); //create the api record command and send it over event socket - $switch_cmd = "api uuid_record ".$origination_uuid." start ".$record_path."/".$record_name; + if (is_uuid($origination_uuid) && file_exists($record_path)) { + $switch_cmd = "api uuid_record ".$origination_uuid." start ".$record_path."/".$record_name; + } $result2 = trim(event_socket_request($fp, $switch_cmd)); } } - echo "

".$result."

\n"; + echo "

".escape($result)."

\n"; } } @@ -291,7 +293,7 @@ echo "\n"; echo " ".$text['label-src-num']."\n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['desc-src-num']."\n"; echo " \n"; @@ -300,7 +302,7 @@ echo "\n"; echo " ".$text['label-dest-num']."\n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['desc-dest-num']."\n"; echo " \n"; diff --git a/app/conference_centers/conference_center_edit.php b/app/conference_centers/conference_center_edit.php index 0d2ba8c3b1..fe8b29769e 100644 --- a/app/conference_centers/conference_center_edit.php +++ b/app/conference_centers/conference_center_edit.php @@ -147,7 +147,7 @@ $array['dialplans'][0]["dialplan_uuid"] = $dialplan_uuid; $array['dialplans'][0]["dialplan_name"] = $conference_center_name; $array['dialplans'][0]["dialplan_number"] = $conference_center_extension; - $array['dialplans'][0]["dialplan_context"] = $_SESSION['context']; + $array['dialplans'][0]["dialplan_context"] = $_SESSION['domain_name']; $array['dialplans'][0]["dialplan_continue"] = "false"; $array['dialplans'][0]["dialplan_xml"] = $dialplan_xml; $array['dialplans'][0]["dialplan_order"] = "333"; @@ -183,7 +183,12 @@ //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } //redirect the user if (isset($action)) { diff --git a/app/conference_centers/conference_sessions.php b/app/conference_centers/conference_sessions.php index efb14e0e7f..eca8b8fc25 100644 --- a/app/conference_centers/conference_sessions.php +++ b/app/conference_centers/conference_sessions.php @@ -89,12 +89,11 @@ //prepare to page the results $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ''; - if (isset($_GET['page'])) { - $page = is_numeric($_GET['page']) ? $_GET['page'] : 0; - list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page); - list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true); - $offset = $rows_per_page * $page; - } + $page = is_numeric($_GET['page']) ? $_GET['page'] : 0; + list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page); + list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true); + $offset = $rows_per_page * $page; + //get the list $sql = "select * from v_conference_sessions "; diff --git a/app/conference_centers/resources/classes/conference_centers.php b/app/conference_centers/resources/classes/conference_centers.php index d98b76715d..ed6b316039 100644 --- a/app/conference_centers/resources/classes/conference_centers.php +++ b/app/conference_centers/resources/classes/conference_centers.php @@ -89,7 +89,7 @@ if (!class_exists('conference_centers')) { } $sql = "select count(*) from v_conference_rooms as r, v_meetings as p "; if ($not_admin) { - $sql .= "v_meeting_users as u, "; + $sql .= ",v_meeting_users as u "; } $sql .= "where r.domain_uuid = :domain_uuid "; $sql .= "and r.meeting_uuid = p.meeting_uuid "; @@ -373,7 +373,12 @@ if (!class_exists('conference_centers')) { //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } //apply settings reminder $_SESSION["reload_xml"] = true; @@ -604,7 +609,12 @@ if (!class_exists('conference_centers')) { //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } //set message message::add($text['message-toggle']); diff --git a/app/conferences/conference_edit.php b/app/conferences/conference_edit.php index 45d60e7d59..0e12346361 100644 --- a/app/conferences/conference_edit.php +++ b/app/conferences/conference_edit.php @@ -205,7 +205,7 @@ $array['dialplans'][0]['app_uuid'] = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9'; $array['dialplans'][0]['dialplan_xml'] = $dialplan_xml; $array['dialplans'][0]['dialplan_order'] = '333'; - $array['dialplans'][0]['dialplan_context'] = $_SESSION['context']; + $array['dialplans'][0]['dialplan_context'] = $_SESSION['domain_name']; $array['dialplans'][0]['dialplan_enabled'] = $conference_enabled; $array['dialplans'][0]['dialplan_description'] = $conference_description; @@ -241,7 +241,12 @@ //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } //redirect the browser header("Location: conferences.php"); diff --git a/app/conferences/resources/classes/conferences.php b/app/conferences/resources/classes/conferences.php index d2e68865bb..38ce49cd9e 100644 --- a/app/conferences/resources/classes/conferences.php +++ b/app/conferences/resources/classes/conferences.php @@ -141,7 +141,12 @@ if (!class_exists('conferences')) { //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } //set message message::add($text['message-delete']); @@ -227,7 +232,12 @@ if (!class_exists('conferences')) { //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } //set message message::add($text['message-toggle']); @@ -362,7 +372,7 @@ if (!class_exists('conferences')) { //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); //set message message::add($text['message-copy']); diff --git a/app/contacts/app_languages.php b/app/contacts/app_languages.php index b6bb1dc152..a739bae454 100644 --- a/app/contacts/app_languages.php +++ b/app/contacts/app_languages.php @@ -4753,8 +4753,8 @@ $text['description-contacts_import_google']['ru-ru'] = "Выберите нуж $text['description-contacts_import_google']['sv-se'] = "Välj de kontakter som skall importeras."; $text['description-contacts_import_google']['uk-ua'] = ""; -$text['description-contacts_import']['en-us'] = "Export your contacts from outlook to a comma delimitted csv file. Then use this tool to upload and add the contacts from that file."; -$text['description-contacts_import']['en-gb'] = "Export your contacts from outlook to a comma delimitted csv file. Then use this tool to upload and add the contacts from that file."; +$text['description-contacts_import']['en-us'] = "Submit or upload delimited data to add multiple records."; +$text['description-contacts_import']['en-gb'] = "Submit or upload delimited data to add multiple records."; $text['description-contacts_import']['ar-eg'] = ""; $text['description-contacts_import']['de-at'] = "Exportieren Sie Ihre Kontakte aus Outlook in eine CSV Datei und benützen Sie diese Funktion um Ihre Kontakte zu importieren."; //copied from de-de $text['description-contacts_import']['de-ch'] = "Exportieren Sie Ihre Kontakte aus Outlook in eine CSV Datei und benützen Sie diese Funktion um Ihre Kontakte zu importieren."; //copied from de-de diff --git a/app/contacts/contact_import.php b/app/contacts/contact_import.php index 3dae4e74fb..dfb92964fc 100644 --- a/app/contacts/contact_import.php +++ b/app/contacts/contact_import.php @@ -143,7 +143,7 @@ $token = new token; if (!$token->validate($_SERVER['PHP_SELF'])) { message::add($text['message-invalid_token'],'negative'); - header('Location: extension_imports.php'); + header('Location: contact_import.php'); exit; } @@ -172,21 +172,44 @@ echo "\n"; + //define phone label options + if (is_array($_SESSION["contact"]["phone_label"]) && @sizeof($_SESSION["contact"]["phone_label"]) != 0) { + sort($_SESSION["contact"]["phone_label"]); + foreach($_SESSION["contact"]["phone_label"] as $row) { + $label_options[] = ""; + } + } + //loop through user columns $x = 0; foreach ($line_fields as $line_field) { $line_field = trim(trim($line_field), $enclosure); echo "\n"; echo " \n"; echo " \n"; echo "\n"; $x++; @@ -247,12 +271,13 @@ $token = new token; if (!$token->validate($_SERVER['PHP_SELF'])) { message::add($text['message-invalid_token'],'negative'); - header('Location: extension_imports.php'); + header('Location: contact_import.php'); exit; } - //user selected fields + //user selected fields, labels $fields = $_POST['fields']; + $labels = $_POST['labels']; //set the domain_uuid $domain_uuid = $_SESSION['domain_uuid']; @@ -312,6 +337,9 @@ if ($field_name != "username" && $field_name != "group_name") { $array[$parent][$row_id][$table_name][$y]['domain_uuid'] = $domain_uuid; $array[$parent][$row_id][$table_name][$y][$field_name] = $result[$key]; + if ($field_name == 'phone_number') { + $array[$parent][$row_id][$table_name][$y]['phone_label'] = $labels[$key]; + } } } @@ -337,11 +365,12 @@ } } } + if (is_array($array[$parent][$row_id])) { $y++; } } //process a chunk of the array if ($row_id === 1000) { - + //save to the data $database = new database; $database->app_name = 'contacts'; @@ -349,8 +378,8 @@ $database->save($array); //clear the array - unset($array); - + unset($array); + //set the row id back to 0 $row_id = 0; } @@ -359,6 +388,7 @@ $row_number++; $row_id++; } //end while + fclose($handle); //save to the data diff --git a/app/database_transactions/app_languages.php b/app/database_transactions/app_languages.php index 66adb0fe7d..2fb88996e0 100644 --- a/app/database_transactions/app_languages.php +++ b/app/database_transactions/app_languages.php @@ -64,6 +64,27 @@ $text['description-database_transactions']['ru-ru'] = "Изменения в б $text['description-database_transactions']['sv-se'] = "Databas Transaktioner"; $text['description-database_transactions']['uk-ua'] = ""; +$text['label-user']['en-us'] = "User"; +$text['label-user']['en-gb'] = "User"; +$text['label-user']['ar-eg'] = ""; +$text['label-user']['de-at'] = "Benutzer"; //copied from de-de +$text['label-user']['de-ch'] = "Benutzer"; //copied from de-de +$text['label-user']['de-de'] = "Benutzer"; +$text['label-user']['es-cl'] = ""; +$text['label-user']['es-mx'] = ""; +$text['label-user']['fr-ca'] = "Utilisateur"; +$text['label-user']['fr-fr'] = "Utilisateur"; +$text['label-user']['he-il'] = ""; +$text['label-user']['it-it'] = ""; +$text['label-user']['nl-nl'] = "Gebruiker"; +$text['label-user']['pl-pl'] = ""; +$text['label-user']['pt-br'] = ""; +$text['label-user']['pt-pt'] = ""; +$text['label-user']['ro-ro'] = ""; +$text['label-user']['ru-ru'] = "Пользователь"; +$text['label-user']['sv-se'] = "Användare"; +$text['label-user']['uk-ua'] = ""; + $text['label-user_uuid']['en-us'] = "User"; $text['label-user_uuid']['en-gb'] = "User"; $text['label-user_uuid']['ar-eg'] = ""; diff --git a/app/database_transactions/database_transactions.php b/app/database_transactions/database_transactions.php index 6970dae29b..4cbdb8932a 100644 --- a/app/database_transactions/database_transactions.php +++ b/app/database_transactions/database_transactions.php @@ -47,7 +47,8 @@ $order_by = $_GET["order_by"]; $order = $_GET["order"]; -//add the search term +//add the user filter and search term + $user_uuid = $_GET['user_uuid']; $search = strtolower($_GET["search"]); if ($search != '') { $sql_search = "and ("; @@ -62,10 +63,14 @@ } //prepare to page the results - $sql = "select count(*) from v_database_transactions as t "; + $sql = "select count(t.database_transaction_uuid) from v_database_transactions as t "; $sql .= "left outer join v_domains as d using (domain_uuid) "; $sql .= "left outer join v_users as u using (user_uuid) "; $sql .= "where t.domain_uuid = :domain_uuid "; + if (is_uuid($user_uuid)) { + $sql .= "and t.user_uuid = :user_uuid "; + $parameters['user_uuid'] = $user_uuid; + } $sql .= $sql_search; $parameters['domain_uuid'] = $_SESSION['domain_uuid']; $database = new database; @@ -81,12 +86,26 @@ $offset = $rows_per_page * $page; //get the list - $sql = str_replace('count(*)','t.database_transaction_uuid, d.domain_name, u.username, t.user_uuid, t.app_name, t.app_uuid, t.transaction_code, t.transaction_address, t.transaction_type, t.transaction_date', $sql); + $sql = str_replace('count(t.database_transaction_uuid)','t.database_transaction_uuid, d.domain_name, u.username, t.user_uuid, t.app_name, t.app_uuid, t.transaction_code, t.transaction_address, t.transaction_type, t.transaction_date', $sql); $sql .= order_by($order_by, $order, 't.transaction_date', 'desc'); $sql .= limit_offset($rows_per_page, $offset); $database = new database; $result = $database->select($sql, $parameters, 'all'); - unset($sql); + unset($sql, $parameters); + +//get users + $sql = "select user_uuid, username from v_users "; + $sql .= "where domain_uuid = :domain_uuid "; + $sql .= "order by username "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $database = new database; + $rows = $database->select($sql, $parameters, 'all'); + if (is_array($rows) && @sizeof($rows) != 0) { + foreach ($rows as $row) { + $users[$row['user_uuid']] = $row['username']; + } + } + unset($sql, $parameters, $rows, $row); //additional includes $document['title'] = $text['title-database_transactions']; @@ -97,9 +116,19 @@ echo "
".$text['title-database_transactions']." (".$num_rows.")
\n"; echo "
\n"; echo "\n"; + if (is_array($users) && @sizeof($users) != 0) { + echo ""; + } echo ""; echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]); - echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'database_transactions.php','style'=>($search == '' ? 'display: none;' : null)]); + echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','onclick'=>"document.getElementById('search').value = ''; document.getElementById('form_search').submit();",'style'=>(!$search ? 'display: none;' : null)]); if ($paging_controls_mini != '') { echo "".$paging_controls_mini.""; } diff --git a/app/destinations/app_config.php b/app/destinations/app_config.php index bb7129e58a..334e241324 100644 --- a/app/destinations/app_config.php +++ b/app/destinations/app_config.php @@ -45,6 +45,29 @@ $apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination_number} XML \${destination_context}"; $apps[$x]['destinations'][$y]['select_value']['user_contact'] = "loopback/\${destination_number}"; $apps[$x]['destinations'][$y]['select_label'] = "\${destination_number} \${destination_description}"; + /* + $y++; + $apps[$x]['destinations'][$y]['type'] = 'array'; + $apps[$x]['destinations'][$y]['label'] = 'other'; + $apps[$x]['destinations'][$y]['name'] = 'dialplans'; + $apps[$x]['destinations'][$y]['field']['name'] = 'name'; + $apps[$x]['destinations'][$y]['field']['destination'] = 'destination'; + $apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination}"; + $apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination}"; + $apps[$x]['destinations'][$y]['select_label'] = "\${name}"; + $z=0; + $apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'check_voicemail'; + $apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = '*98 XML ${context}'; + $z++; + $apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'company_directory'; + $apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = '*411 XML ${context}'; + $z++; + $apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'hangup'; + $apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = 'hangup'; + $z++; + $apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'company_directory'; + $apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = '*732 XML ${context}'; + */ //permission details $y=0; @@ -97,13 +120,24 @@ $apps[$x]['permissions'][$y]['name'] = "destination_context"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "destination_accountcode"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "destination_fax"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "destination_emergency"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "destination_destinations"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "other_destinations"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; //default settings $y = 0; @@ -129,7 +163,24 @@ $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; $apps[$x]['default_settings'][$y]['default_setting_value'] = "multiple"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Options: multiple, single"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b132ff5a-da8d-4846-b46d-2f0bfa9ae96b"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "destinations"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "unique"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Require destinations to be unique true or false."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "d6cf39aa-edc0-4682-9868-5f8198b3383c"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "destinations"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "select_mode"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "default"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Options: default, dynamic"; + $y++; //cache details $apps[$x]['cache']['key'] = "dialplan.\${destination_context}"; @@ -243,6 +294,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Number is used for fax calls."; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_type_emergency"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Number is used to place emergency calls."; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_type_text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Number is used for text messages."; @@ -264,6 +319,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the alternate data."; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_order"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the destination order."; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_enabled"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; diff --git a/app/destinations/app_defaults.php b/app/destinations/app_defaults.php index 6b69b9c1f4..fbde451a8c 100644 --- a/app/destinations/app_defaults.php +++ b/app/destinations/app_defaults.php @@ -39,8 +39,7 @@ if (is_array($extensions) && @sizeof($extensions) != 0) { foreach($extensions as $row) { $sql = "update v_destinations "; - $sql .= "set destination_app = :destination_app "; - $sql .= "destination_data = :destination_data "; + $sql .= "set destination_app = :destination_app, destination_data = :destination_data "; $sql .= "where dialplan_uuid = :dialplan_uuid "; $parameters['destination_app'] = $row['destination_app']; $parameters['destination_data'] = $row['destination_data']; diff --git a/app/destinations/app_languages.php b/app/destinations/app_languages.php index 8b7c0c73b0..0e18def489 100644 --- a/app/destinations/app_languages.php +++ b/app/destinations/app_languages.php @@ -723,8 +723,8 @@ $text['label-destination_hold_music']['de-ch'] = "Wartemusik"; //copied from de- $text['label-destination_hold_music']['de-de'] = "Wartemusik"; $text['label-destination_hold_music']['es-cl'] = "Música en Espera"; $text['label-destination_hold_music']['es-mx'] = "Música en Espera"; //copied from es-cl -$text['label-destination_hold_music']['fr-ca'] = "Musique de Garde"; //copied from fr-fr -$text['label-destination_hold_music']['fr-fr'] = "Musique de Garde"; +$text['label-destination_hold_music']['fr-ca'] = "Musique d'attente"; //copied from fr-fr +$text['label-destination_hold_music']['fr-fr'] = "Musique d'attente"; $text['label-destination_hold_music']['he-il'] = "מוסיקה בהמתנה"; $text['label-destination_hold_music']['it-it'] = "Musica di Attesa"; $text['label-destination_hold_music']['nl-nl'] = "Wachtmuziek"; @@ -883,6 +883,27 @@ $text['label-text']['ru-ru'] = "Текст"; $text['label-text']['sv-se'] = "Text"; $text['label-text']['uk-ua'] = "Текст"; +$text['label-emergency']['en-us'] = "Emergency"; +$text['label-emergency']['en-gb'] = "Emergency"; +$text['label-emergency']['ar-eg'] = ""; +$text['label-emergency']['de-at'] = "Anruferkennung"; //copied from de-de +$text['label-emergency']['de-ch'] = "Anruferkennung"; +$text['label-emergency']['de-de'] = "Notruf Anruferkennung"; +$text['label-emergency']['es-cl'] = "Emergencia"; +$text['label-emergency']['es-mx'] = "Emergencia"; //copied from es-cl +$text['label-emergency']['fr-ca'] = "Urgence"; //copied from fr-fr +$text['label-emergency']['fr-fr'] = "Urgence"; +$text['label-emergency']['he-il'] = ""; +$text['label-emergency']['it-it'] = "Emergenze"; +$text['label-emergency']['nl-nl'] = "Noodnummer"; +$text['label-emergency']['pl-pl'] = "Prezentacja nazwy dzwoniącego (emergency)"; +$text['label-emergency']['pt-br'] = "Emergência"; +$text['label-emergency']['pt-pt'] = "Emergência"; +$text['label-emergency']['ro-ro'] = ""; +$text['label-emergency']['ru-ru'] = "Идентификатор (Caller ID) имени экстренного вызова"; +$text['label-emergency']['sv-se'] = "Nöd Namnpresentation"; +$text['label-emergency']['uk-ua'] = ""; + $text['header-destinations']['en-us'] = "Destinations"; $text['header-destinations']['en-gb'] = "Destinations"; $text['header-destinations']['ar-eg'] = "جهات الأتصال"; diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 5c440194fd..7231204d62 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2020 + Portions created by the Initial Developer are Copyright (C) 2008-2021 the Initial Developer. All Rights Reserved. Contributor(s): @@ -95,6 +95,7 @@ $destination_cid_name_prefix = trim($_POST["destination_cid_name_prefix"]); $destination_context = trim($_POST["destination_context"]); $fax_uuid = trim($_POST["fax_uuid"]); + $destination_order= trim($_POST["destination_order"]); $destination_enabled = trim($_POST["destination_enabled"]); $destination_description = trim($_POST["destination_description"]); $destination_sell = check_float($_POST["destination_sell"]); @@ -107,6 +108,7 @@ $destination_type_voice = $_POST["destination_type_voice"]; $destination_type_fax = $_POST["destination_type_fax"]; $destination_type_text = $_POST["destination_type_text"]; + $destination_type_emergency = $_POST["destination_type_emergency"]; $destination_carrier = trim($_POST["destination_carrier"]); //get the destination app and data @@ -161,7 +163,7 @@ if (strlen($destination_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-destination_enabled']."
\n"; } //check for duplicates - if ($destination_type == 'inbound' && $destination_number != $db_destination_number) { + if ($destination_type == 'inbound' && $destination_number != $db_destination_number && $_SESSION['destinations']['unique']['boolean'] == 'true') { $sql = "select count(*) from v_destinations "; $sql .= "where (destination_number = :destination_number or destination_prefix || destination_number = :destination_number) "; $sql .= "and destination_type = 'inbound' "; @@ -195,12 +197,12 @@ //array cleanup if (is_array($dialplan_details)) { - foreach ($dialplan_details as $index => $row) { - //unset the empty row - if (strlen($row["dialplan_detail_data"]) == 0) { - unset($dialplan_details[$index]); - } + foreach ($dialplan_details as $index => $row) { + //unset the empty row + if (strlen($row["dialplan_detail_data"]) == 0) { + unset($dialplan_details[$index]); } + } } //get the fax information @@ -258,7 +260,21 @@ } //convert the number to a regular expression - $destination_number_regex = string_to_regex($destination_area_code.$destination_number, $destination_prefix); + if (isset($destination_prefix) && strlen($destination_prefix) > 0) { + $destination_numbers['destination_prefix'] = $destination_prefix; + } + if (isset($destination_trunk_prefix) && strlen($destination_trunk_prefix) > 0) { + $destination_numbers['destination_trunk_prefix'] = $destination_trunk_prefix; + } + if (isset($destination_area_code) && strlen($destination_area_code) > 0) { + $destination_numbers['destination_area_code'] = $destination_area_code; + } + if (isset($destination_number) && strlen($destination_number) > 0) { + $destination_numbers['destination_number'] = $destination_number; + } + $destination = new destinations; + $destination_number_regex = $destination->to_regex($destination_numbers); + unset($destination_numbers); //if empty then get new uuid if (!is_uuid($dialplan_uuid)) { @@ -281,7 +297,7 @@ $dialplan["dialplan_number"] = $destination_area_code.$destination_number; $dialplan["dialplan_context"] = $destination_context; $dialplan["dialplan_continue"] = "false"; - $dialplan["dialplan_order"] = "100"; + $dialplan["dialplan_order"] = $destination_order; $dialplan["dialplan_enabled"] = $destination_enabled; $dialplan["dialplan_description"] = ($dialplan_description != '') ? $dialplan_description : $destination_description; $dialplan_detail_order = 10; @@ -321,7 +337,7 @@ $dialplan["dialplan_xml"] .= " \n"; } if (strlen($destination_accountcode) > 0) { - $dialplan["dialplan_xml"] .= " \n"; + $dialplan["dialplan_xml"] .= " \n"; } if (strlen($destination_carrier) > 0) { $dialplan["dialplan_xml"] .= " \n"; @@ -425,7 +441,7 @@ if (strlen($destination_accountcode) > 0) { $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; - $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set"; + $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "export"; $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "accountcode=".$destination_accountcode; $dialplan["dialplan_details"][$y]["dialplan_detail_inline"] = "true"; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; @@ -657,6 +673,9 @@ $array['destinations'][0]["destination_type_voice"] = $destination_type_voice ? 1 : null; $array['destinations'][0]["destination_type_fax"] = $destination_type_fax ? 1 : null; $array['destinations'][0]["destination_type_text"] = $destination_type_text ? 1 : null; + if (permission_exists('destination_emergency')){ + $array['destinations'][0]["destination_type_emergency"] = $destination_type_emergency ? 1 : null; + } if ($destination->valid($destination_app.':'.$destination_data)) { $array['destinations'][0]["destination_app"] = $destination_app; $array['destinations'][0]["destination_data"] = $destination_data; @@ -665,8 +684,10 @@ $array['destinations'][0]["destination_alternate_app"] = $destination_alternate_app; $array['destinations'][0]["destination_alternate_data"] = $destination_alternate_data; } + $array['destinations'][0]["destination_order"] = $destination_order; $array['destinations'][0]["destination_enabled"] = $destination_enabled; $array['destinations'][0]["destination_description"] = $destination_description; + //prepare the array $array['dialplans'][] = $dialplan; unset($dialplan); @@ -731,6 +752,12 @@ $database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139'; $database->save($array); $dialplan_response = $database->message; + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + } //redirect the user @@ -746,7 +773,7 @@ } //pre-populate the form - if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { + if (is_array($_GET) > 0 && $_POST["persistformvar"] != "true") { if (is_uuid($_GET["id"])) { $destination_uuid = $_GET["id"]; $sql = "select * from v_destinations "; @@ -772,19 +799,21 @@ $destination_type_voice = $row["destination_type_voice"]; $destination_type_fax = $row["destination_type_fax"]; $destination_type_text = $row["destination_type_text"]; + $destination_type_emergency = $row["destination_type_emergency"]; $destination_context = $row["destination_context"]; $destination_app = $row["destination_app"]; $destination_data = $row["destination_data"]; $destination_alternate_app = $row["destination_alternate_app"]; $destination_alternate_data = $row["destination_alternate_data"]; $fax_uuid = $row["fax_uuid"]; - $destination_enabled = $row["destination_enabled"]; - $destination_description = $row["destination_description"]; $currency = $row["currency"]; $destination_sell = $row["destination_sell"]; $destination_buy = $row["destination_buy"]; $currency_buy = $row["currency_buy"]; $destination_carrier = $row["destination_carrier"]; + $destination_order = $row["destination_order"]; + $destination_enabled = $row["destination_enabled"]; + $destination_description = $row["destination_description"]; } unset($sql, $parameters, $row); } @@ -802,7 +831,7 @@ unset($sql, $parameters); //add an empty row to the array - $x = count($dialplan_details); + $x = (is_array($dialplan_details)) ? count($dialplan_details) : $x = 0; $limit = $x + 1; while($x < $limit) { $dialplan_details[$x]['domain_uuid'] = $domain_uuid; @@ -840,6 +869,7 @@ } //set the defaults + if (strlen($destination_order) == 0) { $destination_order = '100'; } if (strlen($destination_type) == 0) { $destination_type = 'inbound'; } if (strlen($destination_context) == 0) { $destination_context = 'public'; } if ($destination_type =="outbound") { $destination_context = $_SESSION['domain_name']; } @@ -1098,7 +1128,7 @@ if (is_array($dialplan_details) && @sizeof($dialplan_details) != 0) { foreach($dialplan_details as $row) { if ($row["dialplan_detail_tag"] != "condition") { - if ($row["dialplan_detail_tag"] == "action" && $row["dialplan_detail_type"] == "set" && strpos($row["dialplan_detail_data"], "accountcode") == 0) { continue; } //exclude set:accountcode actions + if ($row["dialplan_detail_tag"] == "action" && ($row["dialplan_detail_type"] == "set" || $row["dialplan_detail_type"] == "export") && strpos($row["dialplan_detail_data"], "accountcode") == 0) { continue; } //exclude set:accountcode actions if (strlen($row['dialplan_detail_uuid']) > 0) { echo " \n"; } @@ -1201,15 +1231,17 @@ echo "\n"; } - echo "
\n"; - echo "\n"; - echo "\n"; + if (permission_exists("destination_accountcode")) { + echo "\n"; + echo "\n"; + echo "\n"; + } echo "\n"; echo "\n"; @@ -1255,6 +1290,31 @@ echo "\n"; } + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n"; echo "
\n"; - //echo " ".$text['label-zzz']."\n"; echo $line_field; echo " \n"; - echo " \n"; echo " \n"; foreach($schema as $row) { echo " \n"; foreach($row['fields'] as $field) { + if ($field == 'phone_label') { continue; } + if ($field == 'contact_url') { continue; } // can remove this after field is removed from the table $selected = ''; if ($field == $line_field) { $selected = "selected='selected'"; @@ -198,8 +221,9 @@ echo " \n"; } echo " \n"; - //echo "
\n"; - //echo $text['description-zzz']."\n"; + echo " \n"; echo "
\n"; - echo " ".$text['label-account_code']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-account_code']."\n"; - echo "
\n"; + echo " ".$text['label-account_code']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-account_code']."\n"; + echo "
\n"; @@ -1218,7 +1250,10 @@ echo "\n"; echo "  \n"; echo "  \n"; - echo " \n"; + echo "  \n"; + if (permission_exists('destination_emergency')){ + echo " \n"; + } echo "
\n"; echo $text['description-usage']."\n"; echo "
\n"; + echo " ".$text['label-order']."\n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo "
\n"; echo " ".$text['label-destination_enabled']."\n"; diff --git a/app/destinations/destinations.php b/app/destinations/destinations.php index fb67cd79d9..7784278e7a 100644 --- a/app/destinations/destinations.php +++ b/app/destinations/destinations.php @@ -110,22 +110,6 @@ //add the search term $search = strtolower($_GET["search"]); - if (strlen($search) > 0) { - $sql_search = "and ("; - $sql_search .= "lower(destination_type) like :search "; - $sql_search .= "or lower(destination_number) like :search "; - $sql_search .= "or lower(destination_context) like :search "; - $sql_search .= "or lower(destination_accountcode) like :search "; - if (permission_exists('outbound_caller_id_select')) { - $sql_search .= "or lower(destination_caller_id_name) like :search "; - $sql_search .= "or destination_caller_id_number like :search "; - } - $sql_search .= "or lower(destination_enabled) like :search "; - $sql_search .= "or lower(destination_description) like :search "; - $sql_search .= "or lower(destination_data) like :search "; - $sql_search .= ") "; - $parameters['search'] = '%'.$search.'%'; - } //prepare to page the results $sql = "select count(*) from v_destinations "; @@ -134,7 +118,22 @@ $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; $parameters['domain_uuid'] = $domain_uuid; } - $sql .= $sql_search; + if (strlen($search) > 0) { + $sql .= "and ("; + $sql .= "lower(destination_type) like :search "; + $sql .= "or lower(destination_number) like :search "; + $sql .= "or lower(destination_context) like :search "; + $sql .= "or lower(destination_accountcode) like :search "; + if (permission_exists('outbound_caller_id_select')) { + $sql .= "or lower(destination_caller_id_name) like :search "; + $sql .= "or destination_caller_id_number like :search "; + } + $sql .= "or lower(destination_enabled) like :search "; + $sql .= "or lower(destination_description) like :search "; + $sql .= "or lower(destination_data) like :search "; + $sql .= ") "; + $parameters['search'] = '%'.$search.'%'; + } $parameters['destination_type'] = $destination_type; $database = new database; $num_rows = $database->select($sql, $parameters, 'column'); @@ -152,8 +151,29 @@ $offset = $rows_per_page * $page; //get the list - $sql = str_replace('count(*)', '*', $sql); - $sql .= order_by($order_by, $order, 'destination_number', 'asc'); + $sql = "select * from v_destinations "; + $sql .= "where destination_type = :destination_type "; + if ($_GET['show'] != "all" || !permission_exists('destination_all')) { + $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; + $parameters['domain_uuid'] = $domain_uuid; + } + if (strlen($search) > 0) { + $sql .= "and ("; + $sql .= "lower(destination_type) like :search "; + $sql .= "or lower(destination_number) like :search "; + $sql .= "or lower(destination_context) like :search "; + $sql .= "or lower(destination_accountcode) like :search "; + if (permission_exists('outbound_caller_id_select')) { + $sql .= "or lower(destination_caller_id_name) like :search "; + $sql .= "or destination_caller_id_number like :search "; + } + $sql .= "or lower(destination_enabled) like :search "; + $sql .= "or lower(destination_description) like :search "; + $sql .= "or lower(destination_data) like :search "; + $sql .= ") "; + $parameters['search'] = '%'.$search.'%'; + } + $sql .= order_by($order_by, $order, 'destination_number, destination_order ', 'asc'); $sql .= limit_offset($rows_per_page, $offset); $database = new database; $destinations = $database->select($sql, $parameters, 'all'); diff --git a/app/destinations/resources/classes/destinations.php b/app/destinations/resources/classes/destinations.php index 10ca9ddab0..38db669146 100644 --- a/app/destinations/resources/classes/destinations.php +++ b/app/destinations/resources/classes/destinations.php @@ -78,6 +78,84 @@ if (!class_exists('destinations')) { } } + /** + * Convert destination number to a regular expression + * @var string $array destination_prefix, destination_trunk_prefix, destination_area_code, destination_number + */ + public function to_regex($array) { + + if (isset($array['destination_prefix']) && isset($array['destination_trunk_prefix']) && isset($array['destination_area_code']) && isset($array['destination_number'])) { + $destination_regex = "(\+?".$array['destination_prefix'].$array['destination_area_code'].$array['destination_number']."\$|"; + $destination_regex .= "^".$array['destination_trunk_prefix'].$array['destination_area_code'].$array['destination_number']."\$|"; + $destination_regex .= "^".$array['destination_area_code'].$array['destination_number']."\$|"; + $destination_regex .= "^".$array['destination_number']."\$)"; + } + elseif (isset($array['destination_prefix']) && isset($array['destination_area_code']) && isset($array['destination_number'])) { + $destination_regex = "(\+?".$array['destination_prefix'].$array['destination_area_code'].$array['destination_number']."\$|"; + $destination_regex .= "^".$array['destination_area_code'].$array['destination_number']."\$|"; + $destination_regex .= "^".$array['destination_number']."\$)"; + } + elseif ((isset($array['destination_prefix']) && isset($array['destination_number'])) || isset($array['destination_number'])) { + + //set the variables + $destination_prefix = $array['destination_prefix']; + $destination_number = $array['destination_number']; + $destination_regex = $array['destination_number']; + + //escape the plus + if (substr($destination_number, 0, 1) == "+") { + $destination_regex = "^\\+(".substr($destination_number, 1).")$"; + } + + //add prefix + if (strlen($destination_prefix) > 0) { + if (strlen($destination_prefix) > 0 && strlen($destination_prefix) < 4) { + $plus = (substr($destination_prefix, 0, 1) == "+") ? '' : '\+?'; + $destination_prefix = $plus.$destination_prefix.'?'; + } + else { + $destination_prefix = '(?:'.$destination_prefix.')?'; + } + } + + //convert N,X,Z syntax to regex + $destination_regex = str_ireplace("N", "[2-9]", $destination_regex); + $destination_regex = str_ireplace("X", "[0-9]", $destination_regex); + $destination_regex = str_ireplace("Z", "[1-9]", $destination_regex); + + //add ^ to the start of the string if missing + if (substr($destination_regex, 0, 1) != "^") { + $destination_regex = "^".$destination_regex; + } + + //add $ to the end of the string if missing + if (substr($destination_regex, -1) != "$") { + $destination_regex = $destination_regex."$"; + } + + //add the round brackets + if (!strstr($destination_regex, '(')) { + if (strstr($destination_regex, '^')) { + $destination_regex = str_replace("^", "^".$destination_prefix."(", $destination_regex); + } + else { + $destination_regex = '^('.$destination_regex; + } + if (strstr($destination_regex, '$')) { + $destination_regex = str_replace("$", ")$", $destination_regex); + } + else { + $destination_regex = $destination_regex.')$'; + } + } + + } + + return $destination_regex; + + } + + /** * Build the destination select list * @var string $destination_type can be ivr, dialplan, call_center_contact or bridge @@ -96,247 +174,358 @@ if (!class_exists('destinations')) { $database = new database; $this->domain_name = $database->select($sql, $parameters, 'column'); - //get the destinations - if (!is_array($this->destinations)) { + //create a single destination select list + if ($_SESSION['destinations']['select_mode']['text'] == 'default') { + //get the destinations + if (!is_array($this->destinations)) { - //get the array from the app_config.php files - $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php"); - $x = 0; - foreach ($config_list as &$config_path) { - include($config_path); - $x++; - } - $i = 0; - foreach ($apps as $x => &$app) { - if (isset($app['destinations'])) foreach ($app['destinations'] as &$row) { - if (permission_exists($this->singular($row["name"])."_destinations")) { - $this->destinations[] = $row; - } - } - } - //put the array in order - if ($this->destinations !== null && is_array($this->destinations)) { - foreach ($this->destinations as $row) { - $option_groups[] = $row['label']; - } - array_multisort($option_groups, SORT_ASC, $this->destinations); - } - //add the sql and data to the array - if ($this->destinations !== null && is_array($this->destinations)) { + //get the array from the app_config.php files + $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php"); $x = 0; - foreach ($this->destinations as $row) { - if ($row['type'] === 'sql') { - $table_name = preg_replace('#[^a-zA-Z0-9_]#', '', $row['name']); - if (isset($row['sql'])) { - if (is_array($row['sql'])) { - $sql = trim($row['sql'][$db_type])." "; - } - else { - $sql = trim($row['sql'])." "; - } - } - else { - $field_count = count($row['field']); - $fields = ''; - $c = 1; - foreach ($row['field'] as $key => $value) { - $key = preg_replace('#[^a-zA-Z0-9_]#', '', $key); - $value = preg_replace('#[^a-zA-Z0-9_]#', '', $value); - if ($field_count != $c) { $delimiter = ','; } else { $delimiter = ''; } - $fields .= $value." as ".$key.$delimiter." "; - $c++; - } - $sql = "select ".$fields; - $sql .= " from v_".$table_name." "; - } - if (isset($row['where'])) { - $sql .= trim($row['where'])." "; - } - $sql .= "order by ".trim($row['order_by']); - $sql = str_replace("\${domain_uuid}", $this->domain_uuid, $sql); - $database = new database; - $result = $database->select($sql, null, 'all'); - - $this->destinations[$x]['result']['sql'] = $sql; - $this->destinations[$x]['result']['data'] = $result; + foreach ($config_list as &$config_path) { + try { + include($config_path); } - if ($row['type'] === 'array') { - $this->destinations[$x] = $row; + catch (Exception $e) { + //echo 'Caught exception: ', $e->getMessage(), "\n"; } $x++; } - } - - $this->destinations[$x]['type'] = 'array'; - $this->destinations[$x]['label'] = 'other'; - $this->destinations[$x]['name'] = 'dialplans'; - $this->destinations[$x]['field']['name'] = "name"; - $this->destinations[$x]['field']['destination'] = "destination"; - $this->destinations[$x]['select_value']['dialplan'] = "transfer:\${destination}"; - $this->destinations[$x]['select_value']['ivr'] = "menu-exec-app:transfer \${destination}"; - $this->destinations[$x]['select_label'] = "\${name}"; - $y = 0; - $this->destinations[$x]['result']['data'][$y]['label'] = 'check_voicemail'; - $this->destinations[$x]['result']['data'][$y]['name'] = '*98'; - $this->destinations[$x]['result']['data'][$y]['destination'] = '*98 XML ${context}'; - $y++; - $this->destinations[$x]['result']['data'][$y]['label'] = 'company_directory'; - $this->destinations[$x]['result']['data'][$y]['name'] = '*411'; - $this->destinations[$x]['result']['data'][$y]['destination'] = '*411 XML ${context}'; - $y++; - $this->destinations[$x]['result']['data'][$y]['label'] = 'hangup'; - $this->destinations[$x]['result']['data'][$y]['name'] = 'hangup'; - $this->destinations[$x]['result']['data'][$y]['application'] = 'hangup'; - $this->destinations[$x]['result']['data'][$y]['destination'] = ''; - $y++; - $this->destinations[$x]['result']['data'][$y]['label'] = 'record'; - $this->destinations[$x]['result']['data'][$y]['name'] = '*732'; - $this->destinations[$x]['result']['data'][$y]['destination'] = '*732 XML ${context}'; - $y++; - } - - //remove special characters from the name - $destination_id = str_replace("]", "", $destination_name); - $destination_id = str_replace("[", "_", $destination_id); - - //set the css style - $select_style = 'width: 200px;'; - - //add additional - if (if_group("superadmin")) { - $response = "\n"; - $response .= "\n"; - } - - //set default to false - $select_found = false; - - $response .= " \n"; + $response .= " \n"; + foreach ($this->destinations as $row) { + + $name = $row['name']; + $label = $row['label']; + $destination = $row['field']['destination']; + + //add multi-lingual support + if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$name."/app_languages.php")) { + $language2 = new text; + $text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$name); + } + + if (is_array($row['result']['data']) && count($row['result']['data']) > 0 and strlen($row['select_value'][$destination_type]) > 0) { + $response .= " \n"; + $label2 = $label; + foreach ($row['result']['data'] as $data) { + $select_value = $row['select_value'][$destination_type]; + $select_label = $row['select_label']; + foreach ($row['field'] as $key => $value) { + if ($key == 'destination' and is_array($value)){ + if ($value['type'] === 'csv') { + $array = explode($value['delimiter'], $data[$key]); + $select_value = str_replace("\${destination}", $array[0], $select_value); + $select_label = str_replace("\${destination}", $array[0], $select_label); + } + } + else { + if (strpos($value,',') !== false) { + $keys = explode(",", $value); + foreach ($keys as $k) { + if (strlen($data[$k]) > 0) { + $select_value = str_replace("\${".$key."}", $data[$k], $select_value); + if (strlen($data['label']) == 0) { + $select_label = str_replace("\${".$key."}", $data[$k], $select_label); + } + else { + $label = $data['label']; + $select_label = str_replace("\${".$key."}", $text2['option-'.$label], $select_label); + } + } + } } else { - $label = $data['label']; - $select_label = str_replace("\${".$key."}", $text2['option-'.$label], $select_label); + $select_value = str_replace("\${".$key."}", $data[$key], $select_value); + if (strlen($data['label']) == 0) { + $select_label = str_replace("\${".$key."}", $data[$key], $select_label); + } + else { + $label = $data['label']; + $select_label = str_replace("\${".$key."}", $text2['option-'.$label], $select_label); + } + } + //application: hangup + if (strlen($data['application']) > 0) { + $select_value = str_replace("transfer", $data['application'], $select_value); } } - //application: hangup - if (strlen($data['application']) > 0) { - $select_value = str_replace("transfer", $data['application'], $select_value); - } } - } - $select_value = str_replace("\${domain_name}", $this->domain_name, $select_value); - $select_value = str_replace("\${context}", $this->domain_name, $select_value); - $select_label = str_replace("\${domain_name}", $this->domain_name, $select_label); - $select_label = str_replace("\${context}", $this->domain_name, $select_label); - $select_label = str_replace("✉", 'email-icon', $select_label); - $select_label = escape(trim($select_label)); - $select_label = str_replace('email-icon', '✉', $select_label); - if ($select_value == $destination_value) { $selected = "selected='selected' "; $select_found = true; } else { $selected = ''; } - if ($label2 == 'destinations') { $select_label = format_phone($select_label); } - $response .= " \n"; + $select_value = str_replace("\${domain_name}", $this->domain_name, $select_value); + $select_value = str_replace("\${context}", $this->domain_name, $select_value); + $select_label = str_replace("\${domain_name}", $this->domain_name, $select_label); + $select_label = str_replace("\${context}", $this->domain_name, $select_label); + $select_label = str_replace("✉", 'email-icon', $select_label); + $select_label = escape(trim($select_label)); + $select_label = str_replace('email-icon', '✉', $select_label); + if ($select_value == $destination_value) { $selected = "selected='selected' "; $select_found = true; } else { $selected = ''; } + if ($label2 == 'destinations') { $select_label = format_phone($select_label); } + $response .= " \n"; + } + $response .= " \n"; + unset($text); } - $response .= " \n"; - unset($text); + } + if (!$select_found) { + $destination_label = str_replace(":", " ", $destination_value); + $destination_label = str_replace("menu-exec-app", "", $destination_label); + $destination_label = str_replace("transfer", "", $destination_label); + $destination_label = str_replace("XML ".$this->domain_name, "", $destination_label); + if ($destination_value != '' || $destination_label != '') { + $response .= " \n"; + } + } + $response .= " \n"; + if (if_group("superadmin")) { + $response .= ""; } } - if (!$select_found) { - $destination_label = str_replace(":", " ", $destination_value); - $destination_label = str_replace("menu-exec-app", "", $destination_label); - $destination_label = str_replace("transfer", "", $destination_label); - $destination_label = str_replace("XML ".$this->domain_name, "", $destination_label); - if ($destination_value != '' || $destination_label != '') { - $response .= " \n"; + + //create a dynamic destination select list + if ($_SESSION['destinations']['select_mode']['text'] == 'dynamic') { + + //remove special characters from the name + $destination_id = str_replace("]", "", $destination_name); + $destination_id = str_replace("[", "_", $destination_id); + //$destination_id = preg_replace('/[^a-zA-Z_,.]/', '', $destination_name); + + ?> + + get($destination_type); } - } - $response .= " \n"; - if (if_group("superadmin")) { - $response .= ""; + + //get the destination label + foreach($_SESSION['destinations']['array'][$destination_type] as $key => $value) { + foreach($value as $k => $row) { + if ($destination_value == $row['destination']) { + $destination_key = $key; + $destination_label = $row['label']; + break; + } + } + } + + //add the language object + $language2 = new text; + + //build the destination select list in html + $response .= " \n"; + $response .= " "; + $response .= button::create([ + 'type'=>'button', + 'icon'=>'external-link-alt', + 'id'=>'btn_dest_go', + 'title'=>$text['label-edit'], + 'onclick'=>"let types = document.getElementById('{$destination_id}_type').options; let opts = document.getElementById('{$destination_id}').options; if(opts[opts.selectedIndex].id && opts[opts.selectedIndex].id.length > 0) {window.open('/app/'+types[types.selectedIndex].className+'/'+types[types.selectedIndex].id+'_edit.php?id='+opts[opts.selectedIndex].id, '_blank');}" + ])."\n"; + + //debug information + //echo $response; + //echo "destination_key $destination_key\n"; + //echo "destination_id $destination_id\n"; + //echo "destination_type $destination_type\n"; + //echo "destination_name $destination_name\n"; + //echo "destination_value $destination_value\n"; + //exit; + } //return the formatted destinations @@ -366,7 +555,12 @@ if (!class_exists('destinations')) { $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php"); $x = 0; foreach ($config_list as &$config_path) { - include($config_path); + try { + include($config_path); + } + catch (Exception $e) { + //echo 'Caught exception: ', $e->getMessage(), "\n"; + } $x++; } $i = 0; @@ -436,22 +630,18 @@ if (!class_exists('destinations')) { $this->destinations[$x]['select_value']['dialplan'] = "transfer:\${destination}"; $this->destinations[$x]['select_value']['ivr'] = "menu-exec-app:transfer \${destination}"; $this->destinations[$x]['select_label'] = "\${name}"; - $y = 0; - $this->destinations[$x]['result']['data'][$y]['label'] = 'check_voicemail'; - $this->destinations[$x]['result']['data'][$y]['name'] = '*98'; + $y=0; + $this->destinations[$x]['result']['data'][$y]['name'] = 'check_voicemail'; $this->destinations[$x]['result']['data'][$y]['destination'] = '*98 XML ${context}'; $y++; - $this->destinations[$x]['result']['data'][$y]['label'] = 'company_directory'; - $this->destinations[$x]['result']['data'][$y]['name'] = '*411'; + $this->destinations[$x]['result']['data'][$y]['name'] = 'company_directory'; $this->destinations[$x]['result']['data'][$y]['destination'] = '*411 XML ${context}'; $y++; - $this->destinations[$x]['result']['data'][$y]['label'] = 'hangup'; $this->destinations[$x]['result']['data'][$y]['name'] = 'hangup'; $this->destinations[$x]['result']['data'][$y]['application'] = 'hangup'; $this->destinations[$x]['result']['data'][$y]['destination'] = ''; $y++; - $this->destinations[$x]['result']['data'][$y]['label'] = 'record'; - $this->destinations[$x]['result']['data'][$y]['name'] = '*732'; + $this->destinations[$x]['result']['data'][$y]['name'] = 'record'; $this->destinations[$x]['result']['data'][$y]['destination'] = '*732 XML ${context}'; $y++; } @@ -570,7 +760,12 @@ if (!class_exists('destinations')) { $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php"); $x = 0; foreach ($config_list as &$config_path) { - include($config_path); + try { + include($config_path); + } + catch (Exception $e) { + //echo 'Caught exception: ', $e->getMessage(), "\n"; + } $x++; } $i = 0; @@ -628,40 +823,39 @@ if (!class_exists('destinations')) { $this->destinations[$x]['result']['data'] = $result; } if ($row['type'] === 'array') { - $this->destinations[$x] = $row['result']['data']; + $this->destinations[$x] = $row; } $x++; } $this->destinations[$x]['type'] = 'array'; $this->destinations[$x]['label'] = 'other'; - $this->destinations[$x]['name'] = 'dialplans'; + $this->destinations[$x]['name'] = 'other'; + $this->destinations[$x]['field']['label'] = "label"; $this->destinations[$x]['field']['name'] = "name"; + $this->destinations[$x]['field']['extension'] = "extension"; $this->destinations[$x]['field']['destination'] = "destination"; $this->destinations[$x]['select_value']['dialplan'] = "transfer:\${destination}"; $this->destinations[$x]['select_value']['ivr'] = "menu-exec-app:transfer \${destination}"; $this->destinations[$x]['select_label'] = "\${name}"; $y = 0; - $this->destinations[$x]['result']['data'][$y]['label'] = 'check_voicemail'; - $this->destinations[$x]['result']['data'][$y]['name'] = '*98'; + $this->destinations[$x]['result']['data'][$y]['name'] = 'check_voicemail'; $this->destinations[$x]['result']['data'][$y]['extension'] = '*98'; $this->destinations[$x]['result']['data'][$y]['destination'] = '*98 XML ${context}'; $y++; - $this->destinations[$x]['result']['data'][$y]['label'] = 'company_directory'; - $this->destinations[$x]['result']['data'][$y]['name'] = '*411'; + $this->destinations[$x]['result']['data'][$y]['name'] = 'company_directory'; $this->destinations[$x]['result']['data'][$y]['extension'] = '*411'; $this->destinations[$x]['result']['data'][$y]['destination'] = '*411 XML ${context}'; $y++; - $this->destinations[$x]['result']['data'][$y]['label'] = 'hangup'; $this->destinations[$x]['result']['data'][$y]['name'] = 'hangup'; $this->destinations[$x]['result']['data'][$y]['application'] = 'hangup'; $this->destinations[$x]['result']['data'][$y]['destination'] = ''; $y++; - $this->destinations[$x]['result']['data'][$y]['label'] = 'record'; - $this->destinations[$x]['result']['data'][$y]['name'] = '*732'; + $this->destinations[$x]['result']['data'][$y]['name'] = 'record'; $this->destinations[$x]['result']['data'][$y]['extension'] = '*732'; $this->destinations[$x]['result']['data'][$y]['destination'] = '*732 XML ${context}'; $y++; + } //remove special characters from the name @@ -684,11 +878,12 @@ if (!class_exists('destinations')) { $text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$name); } - if (count($row['result']['data']) > 0 and strlen($row['select_value'][$destination_type]) > 0) { + if (is_array($row['result']['data']) && strlen($row['select_value'][$destination_type]) > 0) { $label2 = $label; foreach ($row['result']['data'] as $data) { $select_value = $row['select_value'][$destination_type]; $select_label = $row['select_label']; + //echo $select_label." ".__line__." ".$name."
\n"; foreach ($row['field'] as $key => $value) { if ($key == 'destination' and is_array($value)) { if ($value['type'] == 'csv') { @@ -730,6 +925,12 @@ if (!class_exists('destinations')) { } } + //view_array($data, false); + //echo "name ".$name."\n"; + //echo "select_value ".$select_value."\n"; + //echo "select_label ".$select_label."\n"; + //echo "\n"; + $select_value = str_replace("\${domain_name}", $this->domain_name, $select_value); $select_value = str_replace("\${context}", $this->domain_name, $select_value); $select_label = str_replace("\${domain_name}", $this->domain_name, $select_label); @@ -751,10 +952,12 @@ if (!class_exists('destinations')) { $i++; } + $i = 0; unset($text); } } + if (!$selected) { $destination_label = str_replace(":", " ", $destination_value); $destination_label = str_replace("menu-exec-app", "", $destination_label); @@ -767,7 +970,7 @@ if (!class_exists('destinations')) { //$array[$name][$i]['select_name'] = $select_name; //$array[$name][$i]['select_value'] = $select_value; $array[$name][$i]['destination'] = $destination_value; - + $i++; } @@ -869,6 +1072,11 @@ if (!class_exists('destinations')) { } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-delete']); diff --git a/app/destinations/resources/destinations.php b/app/destinations/resources/destinations.php new file mode 100644 index 0000000000..ae026b5e6e --- /dev/null +++ b/app/destinations/resources/destinations.php @@ -0,0 +1,62 @@ +get($destination_type); + +//show the select + echo " \n"; + +?> diff --git a/app/destinations/resources/root.php b/app/destinations/resources/root.php new file mode 100644 index 0000000000..22735436d0 --- /dev/null +++ b/app/destinations/resources/root.php @@ -0,0 +1,90 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ + +// make sure the PATH_SEPARATOR is defined + umask(2); + if (!defined("PATH_SEPARATOR")) { + if (strpos($_ENV["OS"], "Win") !== false) { + define("PATH_SEPARATOR", ";"); + } else { + define("PATH_SEPARATOR", ":"); + } + } + + if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html'; + + // make sure the document_root is set + $_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]); + if(PHP_SAPI == 'cli'){ + chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME)); + $script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]); + $dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME)); + if (file_exists('/project_root.php')) { + $path = '/'; + } else { + $i = 1; + $path = ''; + while ($i < count($dirs)) { + $path .= '/' . $dirs[$i]; + if (file_exists($path. '/project_root.php')) { + break; + } + $i++; + } + } + $_SERVER["DOCUMENT_ROOT"] = $path; + }else{ + $_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]); + } + $_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]); +// try to detect if a project path is being used + if (!defined('PROJECT_PATH')) { + if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) { + define('PROJECT_PATH', '/fusionpbx'); + } elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) { + define('PROJECT_PATH', ''); + } else { + $dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME))); + $i = 1; + $path = $_SERVER["DOCUMENT_ROOT"]; + while ($i < count($dirs)) { + $path .= '/' . $dirs[$i]; + if (file_exists($path. '/project_root.php')) { + break; + } + $i++; + } + if(!file_exists($path. '/project_root.php')){ + die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance"); + } + $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); + define('PROJECT_PATH', $project_path); + } + $_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH); + set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]); + } + +?> diff --git a/app/devices/app_config.php b/app/devices/app_config.php index f6c613c9e5..b75dda8590 100644 --- a/app/devices/app_config.php +++ b/app/devices/app_config.php @@ -2152,6 +2152,13 @@ $vendors[$y]['functions'][$z]['value'] = "none"; $vendors[$y]['functions'][$z]['groups'][] = "superadmin"; $vendors[$y]['functions'][$z]['groups'][] = "admin"; + $z++; + $vendors[$y]['functions'][$z]['uuid'] = "5fab2239-b72c-404a-a392-251e22770ec5"; + $vendors[$y]['functions'][$z]['label'] = "label-phonebook"; + $vendors[$y]['functions'][$z]['name'] = "phonebook"; + $vendors[$y]['functions'][$z]['value'] = "phonebook"; + $vendors[$y]['functions'][$z]['groups'][] = "superadmin"; + $vendors[$y]['functions'][$z]['groups'][] = "admin"; //mitel $y++; $vendors[$y]['uuid'] = "03931359-917e-455b-b4fc-f875c530b79c"; diff --git a/app/devices/app_languages.php b/app/devices/app_languages.php index fdb0516c8c..1358639e2f 100644 --- a/app/devices/app_languages.php +++ b/app/devices/app_languages.php @@ -1650,8 +1650,8 @@ $text['label-keys']['de-ch'] = "Tasten"; //copied from de-de $text['label-keys']['de-de'] = "Tasten"; $text['label-keys']['es-cl'] = "Claves"; $text['label-keys']['es-mx'] = "Claves"; //copied from es-cl -$text['label-keys']['fr-ca'] = "Clés"; //copied from fr-fr -$text['label-keys']['fr-fr'] = "Clés"; +$text['label-keys']['fr-ca'] = "Touches"; //copied from fr-fr +$text['label-keys']['fr-fr'] = "Touches"; $text['label-keys']['he-il'] = ""; $text['label-keys']['it-it'] = "Tasti"; $text['label-keys']['nl-nl'] = "Toetsen"; @@ -4583,6 +4583,27 @@ $text['label-custom']['ru-ru'] = ""; $text['label-custom']['sv-se'] = ""; $text['label-custom']['uk-ua'] = ""; +$text['label-fields']['en-us'] = "Fields"; +$text['label-fields']['en-gb'] = "Fields"; +$text['label-fields']['ar-eg'] = "Fields"; +$text['label-fields']['de-at'] = "Fields"; +$text['label-fields']['de-ch'] = "Fields"; +$text['label-fields']['de-de'] = "Fields"; +$text['label-fields']['es-cl'] = "Fields"; +$text['label-fields']['es-mx'] = "Fields"; +$text['label-fields']['fr-ca'] = "Fields"; +$text['label-fields']['fr-fr'] = "Fields"; +$text['label-fields']['he-il'] = "Fields"; +$text['label-fields']['it-it'] = "Fields"; +$text['label-fields']['nl-nl'] = "Fields"; +$text['label-fields']['pl-pl'] = "Fields"; +$text['label-fields']['pt-br'] = "Fields"; +$text['label-fields']['pt-pt'] = "Fields"; +$text['label-fields']['ro-ro'] = "Fields"; +$text['label-fields']['ru-ru'] = "Fields"; +$text['label-fields']['sv-se'] = "Fields"; +$text['label-fields']['uk-ua'] = "Fields"; + $text['header-device_import']['en-us'] = "Device Import"; $text['header-device_import']['en-gb'] = "Device Import"; $text['header-device_import']['ar-eg'] = ""; @@ -4713,6 +4734,29 @@ $text['header-device']['ru-ru'] = "Устройство"; $text['header-device']['sv-se'] = "Enhet"; $text['header-device']['uk-ua'] = ""; +$text['description-device_export']['en-us'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['en-gb'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['ar-eg'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['de-at'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['de-ch'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['de-de'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['ek-gr'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['es-cl'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['es-mx'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['fr-ca'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['fr-fr'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['he-il'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['it-it'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['nl-nl'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['pl-pl'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['pt-br'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['pt-pt'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['ro-ro'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['ru-ru'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['sv-se'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['uk-ua'] = "Select the fields you wish to include in the export."; +$text['description-device_export']['tr-tr'] = "Select the fields you wish to include in the export."; + $text['description-user']['en-us'] = "Assign a user to this device."; $text['description-user']['en-gb'] = "Assign a user to this device."; $text['description-user']['ar-eg'] = ""; diff --git a/app/devices/cmd.php b/app/devices/cmd.php index 132001f441..7faeea7ffd 100644 --- a/app/devices/cmd.php +++ b/app/devices/cmd.php @@ -41,7 +41,6 @@ else { //set the variables $cmd = check_str($_GET['cmd']); $rdr = check_str($_GET['rdr']); - $profile = check_str($_GET['profile']); $domain = check_str($_GET['domain']); $show = check_str($_GET['show']); $user = check_str($_GET['user']); @@ -51,26 +50,39 @@ else { //create the event socket connection $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if ($fp) { + // Get the SIP profiles for the user + $command = "sofia_contact */{$user}"; + $contact_string = event_socket_request($fp, "api ".$command); + // The first value in the array will be full matching text, the second one will be the array of profile matches + preg_match_all('/sofia\/([^,]+)\/(?:[^,]+)/', $contact_string, $matches); + if (sizeof($matches) != 2 || sizeof($matches[1]) < 1) { + $profiles = array("internal"); + } else { + // We have at least one profile, get all of the unique profiles + $profiles = array_unique($matches[1]); + } - //prepare the command + foreach ($profiles as $profile) { + //prepare the command if ($cmd == "unregister") { - $command = "sofia profile ".$profile." flush_inbound_reg ".$user." reboot"; + $command = "sofia profile {$profile} flush_inbound_reg {$user} reboot"; } else { - $command = "lua app.lua event_notify ".$profile." ".$cmd." ".$user." ".$vendor; + $command = "lua app.lua event_notify {$profile} {$cmd} {$user} {$vendor}"; //if ($cmd == "check_sync") { // $command = "sofia profile ".$profile." check_sync ".$user; //} } - //send the command - $response = event_socket_request($fp, "api ".$command); - $response = event_socket_request($fp, "api log notice ".$command); + //send the command + $response = event_socket_request($fp, "api {$command}"); + event_socket_request($fp, "api log notice {$command}"); - //show the response + //show the response message::add($text['label-event']." ".ucwords($cmd)."     ".$text['label-response'].htmlentities($response)); + } //close the connection - fclose($fp); + fclose($fp); } //redirect the user diff --git a/app/devices/device_download.php b/app/devices/device_download.php index ae70f8464b..f3569ae1be 100644 --- a/app/devices/device_download.php +++ b/app/devices/device_download.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2016 + Portions created by the Initial Developer are Copyright (C) 2008-2020 the Initial Developer. All Rights Reserved. Contributor(s): @@ -28,7 +28,6 @@ require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; - require_once "resources/paging.php"; //check permissions if (permission_exists('device_export')) { @@ -75,14 +74,40 @@ header("Content-Transfer-Encoding: binary"); } - //define possible columns in the array - $available_columns[] = 'device_uuid'; - $available_columns[] = 'domain_uuid'; - $available_columns[] = 'device_mac_address'; - $available_columns[] = 'device_label'; - $available_columns[] = 'device_template'; - $available_columns[] = 'device_description'; + $available_columns['devices'][] = 'device_uuid'; + $available_columns['devices'][] = 'device_profile_uuid'; + $available_columns['devices'][] = 'device_mac_address'; + $available_columns['devices'][] = 'device_label'; + $available_columns['devices'][] = 'device_vendor'; + $available_columns['devices'][] = 'device_template'; + $available_columns['devices'][] = 'device_enabled_date'; + $available_columns['devices'][] = 'device_username'; + $available_columns['devices'][] = 'device_password'; + $available_columns['devices'][] = 'device_uuid_alternate'; + $available_columns['devices'][] = 'device_provisioned_date'; + $available_columns['devices'][] = 'device_provisioned_method'; + $available_columns['devices'][] = 'device_provisioned_ip'; + $available_columns['devices'][] = 'device_enabled'; + $available_columns['devices'][] = 'device_description'; + + $available_columns['device_lines'][] = 'device_line_uuid'; + $available_columns['device_lines'][] = 'device_uuid'; + $available_columns['device_lines'][] = 'line_number'; + $available_columns['device_lines'][] = 'server_address'; + $available_columns['device_lines'][] = 'server_address_primary'; + $available_columns['device_lines'][] = 'server_address_secondary'; + $available_columns['device_lines'][] = 'outbound_proxy_primary'; + $available_columns['device_lines'][] = 'outbound_proxy_secondary'; + $available_columns['device_lines'][] = 'display_name'; + $available_columns['device_lines'][] = 'user_id'; + $available_columns['device_lines'][] = 'auth_id'; + $available_columns['device_lines'][] = 'password'; + $available_columns['device_lines'][] = 'sip_port'; + $available_columns['device_lines'][] = 'sip_transport'; + $available_columns['device_lines'][] = 'register_expires'; + $available_columns['device_lines'][] = 'shared_line'; + $available_columns['device_lines'][] = 'enabled'; //get the devices and send them as output $column_group = $_REQUEST["column_group"]; @@ -96,23 +121,56 @@ exit; } + //validate table names + foreach($column_group as $table_name => $columns) { + if (!isset($available_columns[$table_name])) { + unset($column_group[$table_name]); + } + } + //validate columns - foreach ($column_group as $index => $column_name) { - if (!in_array($column_name, $available_columns)) { - unset($column_group[$index]); + foreach($column_group as $table_name => $columns) { + foreach ($columns as $column_name) { + if (!in_array($column_name, $available_columns[$table_name])) { + unset($column_group[$table_name][$column_name]); + } } } //iterate columns if (is_array($column_group) && @sizeof($column_group) != 0) { - $column_names = implode(", ", $column_group); + + $column_names = implode(", ", $column_group['devices']); $sql = "select ".$column_names." from v_devices "; $sql .= " where domain_uuid = :domain_uuid "; $parameters['domain_uuid'] = $domain_uuid; $database = new database; $devices = $database->select($sql, $parameters, 'all'); unset($sql, $parameters, $column_names); - //print_r($extensions); + + foreach($column_group as $table_name => $columns) { + if ($table_name !== 'devices') { + $column_names = implode(", ", $columns); + $sql = "select ".$column_names." from v_".$table_name." "; + $sql .= " where domain_uuid = :domain_uuid "; + $parameters['domain_uuid'] = $domain_uuid; + $database = new database; + $$table_name = $database->select($sql, $parameters, 'all'); + $x = 0; + foreach($devices as $device) { + foreach($$table_name as $row) { + if ($device['device_uuid'] == $row['device_uuid']) { + foreach($row as $key => $value) { + $devices[$x][$key] = $value; + } + break; + } + } + $x++; + } + unset($sql, $parameters, $column_names); + } + } if (is_array($devices) && @sizeof($devices) != 0) { download_send_headers("device_export_".date("Y-m-d").".csv"); @@ -143,30 +201,44 @@ echo "
\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo "\n"; + echo $text['description-device_export']; + echo "

\n"; if (is_array($available_columns) && @sizeof($available_columns) != 0) { $x = 0; - foreach ($available_columns as $column_name) { - $list_row_onclick = "if (!this.checked) { document.getElementById('checkbox_all').checked = false; }"; - echo "\n"; - echo " \n"; - echo " "; - echo ""; - $x++; + foreach ($available_columns as $table_name => $columns) { + $table_name_label = ucwords(str_replace(['-','_',],' ', $table_name)); + echo "
\n"; + echo "".$table_name_label."\n"; + echo "
\n"; + echo "
\n"; - echo " \n"; - echo " ".$text['label-column_name']."
\n"; - echo " \n"; - echo " ".$column_name."
\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + foreach ($columns as $column_name) { + $list_row_onclick = "if (!this.checked) { document.getElementById('checkbox_all').checked = false; }"; + echo "\n"; + echo " \n"; + echo " "; + echo ""; + $x++; + } + echo "
\n"; + echo " \n"; + echo " ".$text['label-column_name']."
\n"; + echo " \n"; + echo " ".$column_name."
\n"; + echo "
\n"; + echo "\n"; } } + + //test the validation + //echo " \n"; + //echo " \n"; + //echo " \n"; - echo "
\n"; - echo "
\n"; echo "\n"; echo "\n"; diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index b9adc6d69d..f45281c94e 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -120,7 +120,6 @@ $device_firmware_version = $_POST["device_firmware_version"]; $device_enabled = $_POST["device_enabled"]; $device_template = $_POST["device_template"]; - $device_profile_uuid = $_POST["device_profile_uuid"]; $device_description = $_POST["device_description"]; //lines $device_lines = $_POST["device_lines"]; @@ -273,8 +272,8 @@ if (permission_exists('device_template')) { $array['devices'][0]['device_template'] = $device_template; } - if (permission_exists('device_profile_edit') && is_uuid($device_profile_uuid)) { - $array['devices'][0]['device_profile_uuid'] = $device_profile_uuid; + if (permission_exists('device_profile_edit')) { + $array['devices'][0]['device_profile_uuid'] = is_uuid($device_profile_uuid) ? $device_profile_uuid : null; } if (permission_exists('device_description')) { $array['devices'][0]['device_description'] = $device_description; @@ -284,11 +283,13 @@ $y = 0; foreach ($device_lines as $row) { if (strlen($row['line_number']) > 0) { + $new_line = false; if (is_uuid($row["device_line_uuid"])) { $device_line_uuid = $row["device_line_uuid"]; } else { $device_line_uuid = uuid(); + $new_line = true; } $array['devices'][0]['device_lines'][$y]['domain_uuid'] = $domain_uuid; $array['devices'][0]['device_lines'][$y]['device_uuid'] = $device_uuid; @@ -297,15 +298,23 @@ $array['devices'][0]['device_lines'][$y]['server_address'] = $row["server_address"]; if (permission_exists('device_line_outbound_proxy_primary')) { $array['devices'][0]['device_lines'][$y]['outbound_proxy_primary'] = $row["outbound_proxy_primary"]; + } else if ($new_line && isset($_SESSION['provision']['outbound_proxy_primary'])) { + $array['devices'][0]['device_lines'][$y]['outbound_proxy_primary'] = $_SESSION['provision']['outbound_proxy_primary']['text']; } if (permission_exists('device_line_outbound_proxy_secondary')) { $array['devices'][0]['device_lines'][$y]['outbound_proxy_secondary'] = $row["outbound_proxy_secondary"]; + } else if ($new_line && isset($_SESSION['provision']['outbound_proxy_secondary'])) { + $array['devices'][0]['device_lines'][$y]['outbound_proxy_secondary'] = $_SESSION['provision']['outbound_proxy_secondary']['text']; } if (permission_exists('device_line_server_address_primary')) { $array['devices'][0]['device_lines'][$y]['server_address_primary'] = $row["server_address_primary"]; + } else if ($new_line && isset($_SESSION['provision']['server_address_primary'])) { + $array['devices'][0]['device_lines'][$y]['server_address_primary'] = $_SESSION['provision']['server_address_primary']['text']; } if (permission_exists('device_line_server_address_secondary')) { $array['devices'][0]['device_lines'][$y]['server_address_secondary'] = $row["server_address_secondary"]; + } else if ($new_line && isset($_SESSION['provision']['server_address_secondary'])) { + $array['devices'][0]['device_lines'][$y]['server_address_secondary'] = $_SESSION['provision']['server_address_secondary']['text']; } $array['devices'][0]['device_lines'][$y]['display_name'] = $row["display_name"]; $array['devices'][0]['device_lines'][$y]['user_id'] = $row["user_id"]; @@ -616,20 +625,6 @@ } } -//get the sip profile name - $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); - if ($fp) { - $command = "sofia_contact */".$user_id."@".$server_address; - $contact_string = event_socket_request($fp, "api ".$command); - if (substr($contact_string, 0, 5) == "sofia") { - $contact_array = explode("/", $contact_string); - $sip_profile_name = $contact_array[1]; - } - else { - $sip_profile_name = 'internal'; - } - } - //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); @@ -807,7 +802,7 @@ echo button::create(['type'=>'button','label'=>$text['button-qr_code'],'icon'=>'qrcode','style'=>$button_margin,'onclick'=>"$('#qr_code_container').fadeIn(400);"]); unset($button_margin); } - echo button::create(['type'=>'button','label'=>$text['button-provision'],'icon'=>'fax','style'=>$button_margin,'link'=>PROJECT_PATH."/app/devices/cmd.php?cmd=check_sync&profile=".urlencode($sip_profile_name)."&user=".urlencode($user_id)."@".urlencode($server_address)."&domain=".urlencode($server_address)."&agent=".urlencode($device_vendor)]); + echo button::create(['type'=>'button','label'=>$text['button-provision'],'icon'=>'fax','style'=>$button_margin,'link'=>PROJECT_PATH."/app/devices/cmd.php?cmd=check_sync"."&user=".urlencode($user_id)."@".urlencode($server_address)."&domain=".urlencode($server_address)."&agent=".urlencode($device_vendor)]); unset($button_margin); if (permission_exists("device_files")) { //get the template directory @@ -1020,10 +1015,12 @@ $element['hidden'] = true; $element['visibility'] = "visibility:hidden;"; } + //add the primary key uuid if (is_uuid($row['device_line_uuid'])) { echo " \n"; } + //show each row in the array echo " \n"; echo " \n"; @@ -1047,10 +1044,7 @@ if (permission_exists('device_line_server_address_primary')) { echo " \n"; - if (is_uuid($_SESSION['provision']['server_address_primary']['uuid'])) { - echo " \n"; - } - else { + if (isset($_SESSION['provision']['server_address_primary']) && !isset($_SESSION['provision']['server_address_primary']['text'])) { echo " \n"; } + else { + echo " \n"; + } echo " \n"; } if (permission_exists('device_line_server_address_secondary')) { echo " \n"; - if (isset($_SESSION['provision']['server_address_secondary']['text'])) { - echo " \n"; - } - else { + if (isset($_SESSION['provision']['server_address_secondary']) && !isset($_SESSION['provision']['server_address_secondary']['text'])) { echo " \n"; } + else { + echo " \n"; + } echo " \n"; } if (permission_exists('device_line_outbound_proxy_primary')) { echo " \n"; - if (isset($_SESSION['provision']['outbound_proxy_primary']['text'])) { - echo " \n"; - } - else { + if (isset($_SESSION['provision']['outbound_proxy_primary']) && !isset($_SESSION['provision']['outbound_proxy_primary']['text'])) { echo " \n"; } + else { + echo " \n"; + } echo " \n"; } - + if (permission_exists('device_line_outbound_proxy_secondary')) { echo " \n"; - if (isset($_SESSION['provision']['outbound_proxy_secondary']['text'])) { - echo " \n"; - } - else { + if (isset($_SESSION['provision']['outbound_proxy_secondary']) && !isset($_SESSION['provision']['outbound_proxy_secondary']['text'])) { echo " \n"; } + else { + echo " \n"; + } echo " \n"; } @@ -1174,16 +1171,11 @@ echo " \n"; echo " \n"; - if (is_array($device_lines) && @sizeof($device_lines) > 1 && permission_exists('device_line_delete')) { - if (is_uuid($row['device_line_uuid'])) { - echo " \n"; - echo " \n"; - echo " \n"; - } - else { - echo " \n"; - } - echo " \n"; + if (is_array($device_lines) && @sizeof($device_lines) > 1 && permission_exists('device_line_delete') && is_uuid($row['device_line_uuid'])) { + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; } echo "\n"; diff --git a/app/devices/device_imports.php b/app/devices/device_imports.php index 07fee12cc1..72c7441986 100644 --- a/app/devices/device_imports.php +++ b/app/devices/device_imports.php @@ -66,25 +66,24 @@ //save the data to the csv file if (isset($_POST['data'])) { $file = $_SESSION['server']['temp']['dir']."/devices-".$_SESSION['domain_name'].".csv"; - file_put_contents($file, $_POST['data']); - $_SESSION['file'] = $file; - } - -//copy the csv file - //$_POST['submit'] == "Upload" && - if ( is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('device_imports')) { - if ($_POST['type'] == 'csv') { - move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['server']['temp']['dir'].'/'.$_FILES['ulfile']['name']); - $save_msg = "Uploaded file to ".$_SESSION['server']['temp']['dir']."/". htmlentities($_FILES['ulfile']['name']); - //system('chmod -R 744 '.$_SESSION['server']['temp']['dir'].'*'); - unset($_POST['txtCommand']); - $file = $_SESSION['server']['temp']['dir'].'/'.$_FILES['ulfile']['name']; + if (file_put_contents($file, $_POST['data'])) { $_SESSION['file'] = $file; } } +//copy the csv file + //$_POST['submit'] == "Upload" && + if ( is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('device_import')) { + if ($_POST['type'] == 'csv') { + $file = $_SESSION['server']['temp']['dir']."/devices-".$_SESSION['domain_name'].".csv"; + if (move_uploaded_file($_FILES['ulfile']['tmp_name'], $file)) { + $_SESSION['file'] = $file; + } + } + } + //get the schema - if (strlen($delimiter) > 0) { + if (strlen($delimiter) > 0 && file_exists($_SESSION['file'])) { //get the first line $line = fgets(fopen($_SESSION['file'], 'r')); $line_fields = explode($delimiter, $line); @@ -292,6 +291,12 @@ $result[$key] = preg_replace('{\D}', '', $result[$key]); } + //normalize the MAC address + if ($field_name == "device_mac_address") { + $result[$key] = strtolower($result[$key]); + $result[$key] = preg_replace('#[^a-fA-F0-9./]#', '', $result[$key]); + } + //build the data array if (strlen($table_name) > 0) { if (strlen($parent) == 0) { @@ -352,6 +357,12 @@ $database->save($array); //$message = $database->message; } + + if (strlen($_SESSION['provision']['path']['text']) > 0) { + $prov = new provision; + $prov->domain_uuid = $domain_uuid; + $response = $prov->write(); + } //send the redirect header header("Location: devices.php"); diff --git a/app/devices/device_profiles.php b/app/devices/device_profiles.php index 700de11edd..023983e145 100644 --- a/app/devices/device_profiles.php +++ b/app/devices/device_profiles.php @@ -49,6 +49,10 @@ $profiles = $_POST['profiles']; } +//get the search + $search = strtolower($_REQUEST["search"]); + $fields = strtolower($_REQUEST["fields"]); + //process the http post data by action if ($action != '' && is_array($profiles) && @sizeof($profiles) != 0) { switch ($action) { @@ -72,7 +76,7 @@ break; } - header('Location: device_profiles.php'.($search != '' ? '?search='.urlencode($search) : null)); + header('Location: device_profiles.php'.($search != '' ? '?search='.urlencode($search).'&fields='.urlencode($fields) : null)); exit; } @@ -81,11 +85,25 @@ $order = $_GET["order"]; //add the search term - $search = strtolower($_GET["search"]); if (strlen($search) > 0) { $sql_search = "and ("; $sql_search .= " lower(device_profile_name) like :search "; $sql_search .= " or lower(device_profile_description) like :search "; + if ($fields == 'all' || $fields == 'keys') { + $sql_search .= " or device_profile_uuid in ( "; + $sql_search .= " select dpk.device_profile_uuid from v_device_profile_keys as dpk "; + $sql_search .= " where dpk.profile_key_value like :search "; + $sql_search .= " or dpk.profile_key_label like :search "; + $sql_search .= " ) "; + } + if ($fields == 'all' || $fields == 'settings') { + $sql_search .= " or device_profile_uuid in ( "; + $sql_search .= " select dps.device_profile_uuid from v_device_profile_settings as dps "; + $sql_search .= " where dps.profile_setting_name like :search "; + $sql_search .= " or dps.profile_setting_value like :search "; + $sql_search .= " or dps.profile_setting_description like :search "; + $sql_search .= " ) "; + } $sql_search .= ") "; $parameters['search'] = '%'.$search.'%'; } @@ -103,7 +121,10 @@ //prepare to page the results $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; - $param = "&search=".$search; + if ($search) { + $param = "&search=".$search; + $param .= "&fields=".$fields; + } if ($_GET['show'] == "all" && permission_exists('device_profile_all')) { $param .= "&show=all"; } @@ -155,7 +176,15 @@ echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']); } } - echo ""; + + echo ""; + echo ""; echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]); echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'device_profiles.php','style'=>($search == '' ? 'display: none;' : null)]); if ($paging_controls_mini != '') { @@ -182,6 +211,7 @@ echo "
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; diff --git a/app/devices/devices.php b/app/devices/devices.php index ed9adcceb5..669585080e 100644 --- a/app/devices/devices.php +++ b/app/devices/devices.php @@ -51,6 +51,7 @@ //get the search $search = strtolower($_REQUEST["search"]); + $fields = strtolower($_REQUEST["fields"]); //process the http post data by action if ($action != '' && is_array($devices) && @sizeof($devices) != 0) { @@ -69,7 +70,7 @@ break; } - header('Location: devices.php'.($search != '' ? '?search='.urlencode($search) : null)); + header('Location: devices.php'.($search != '' ? '?search='.urlencode($search).'&fields='.urlencode($fields) : null)); exit; } @@ -126,6 +127,29 @@ $sql .= " or lower(d.device_description) like :search "; $sql .= " or lower(d.device_provisioned_method) like :search "; $sql .= " or lower(d.device_provisioned_ip) like :search "; + if ($fields == 'all' || $fields == 'lines') { + $sql .= " or d.device_uuid in ( "; + $sql .= " select dl.device_uuid from v_device_lines as dl "; + $sql .= " where dl.display_name like :search "; + $sql .= " or dl.user_id like :search "; + $sql .= " or dl.auth_id like :search "; + $sql .= " ) "; + } + if ($fields == 'all' || $fields == 'keys') { + $sql .= " or d.device_uuid in ( "; + $sql .= " select dk.device_uuid from v_device_keys as dk "; + $sql .= " where dk.device_key_value like :search "; + $sql .= " or dk.device_key_label like :search "; + $sql .= " ) "; + } + if ($fields == 'all' || $fields == 'settings') { + $sql .= " or d.device_uuid in ( "; + $sql .= " select ds.device_uuid from v_device_settings as ds "; + $sql .= " where ds.device_setting_subcategory like :search "; + $sql .= " or ds.device_setting_value like :search "; + $sql .= " or ds.device_setting_description like :search "; + $sql .= " ) "; + } $sql .= ") "; $parameters['search'] = '%'.strtolower($search).'%'; } @@ -135,11 +159,12 @@ //prepare to page the results $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; - if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) { - $param = "&search=".$search."&show=all"; - } - else { + if ($search) { $param = "&search=".$search; + $param .= "&fields=".$fields; + } + if ($_GET['show'] == "all" && permission_exists('device_all')) { + $param .= "&show=all"; } $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } @@ -155,7 +180,10 @@ } $sql .= "where ( "; $sql .= " d.device_uuid_alternate = d2.device_uuid "; - $sql .= " or d.device_uuid_alternate is null and d.device_uuid = d2.device_uuid "; + $sql .= " or ( "; + $sql .= " d.device_uuid_alternate is null and "; + $sql .= " d.device_uuid = d2.device_uuid "; + $sql .= " ) "; $sql .= ") "; if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) { $sql .= " and d.domain_uuid = d3.domain_uuid "; @@ -183,6 +211,29 @@ $sql .= " or lower(d.device_description) like :search "; $sql .= " or lower(d.device_provisioned_method) like :search "; $sql .= " or lower(d.device_provisioned_ip) like :search "; + if ($fields == 'all' || $fields == 'lines') { + $sql .= " or d.device_uuid in ( "; + $sql .= " select dl.device_uuid from v_device_lines as dl "; + $sql .= " where dl.display_name like :search "; + $sql .= " or dl.user_id like :search "; + $sql .= " or dl.auth_id like :search "; + $sql .= " ) "; + } + if ($fields == 'all' || $fields == 'keys') { + $sql .= " or d.device_uuid in ( "; + $sql .= " select dk.device_uuid from v_device_keys as dk "; + $sql .= " where dk.device_key_value like :search "; + $sql .= " or dk.device_key_label like :search "; + $sql .= " ) "; + } + if ($fields == 'all' || $fields == 'settings') { + $sql .= " or d.device_uuid in ( "; + $sql .= " select ds.device_uuid from v_device_settings as ds "; + $sql .= " where ds.device_setting_subcategory like :search "; + $sql .= " or ds.device_setting_value like :search "; + $sql .= " or ds.device_setting_description like :search "; + $sql .= " ) "; + } $sql .= ") "; $parameters['search'] = '%'.strtolower($search).'%'; } @@ -255,7 +306,15 @@ } } - echo ""; + echo ""; + echo ""; echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]); echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'devices.php','style'=>($search == '' ? 'display: none;' : null)]); if ($paging_controls_mini != '') { @@ -279,6 +338,7 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "
\n"; echo "\n"; diff --git a/app/devices/resources/classes/device.php b/app/devices/resources/classes/device.php index 3629450c0b..de813176cc 100644 --- a/app/devices/resources/classes/device.php +++ b/app/devices/resources/classes/device.php @@ -311,6 +311,12 @@ include "root.php"; //build the delete array foreach ($records as $x => $record) { if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + $sql = "update v_devices set device_uuid_alternate = null where device_uuid_alternate = :device_uuid_alternate; "; + $parameters['device_uuid_alternate'] = $record['uuid']; + $database = new database; + $database->execute($sql, $parameters); + unset($sql, $parameters); + $array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid']; $array['device_settings'][$x]['device_uuid'] = $record['uuid']; $array['device_lines'][$x]['device_uuid'] = $record['uuid']; diff --git a/app/dialplan_outbound/dialplan_outbound_add.php b/app/dialplan_outbound/dialplan_outbound_add.php index 58d0864f91..1274d864e8 100644 --- a/app/dialplan_outbound/dialplan_outbound_add.php +++ b/app/dialplan_outbound/dialplan_outbound_add.php @@ -392,7 +392,7 @@ if (strlen($dialplan_order) == 0) { $dialplan_order ='333'; } - $dialplan_context = $_SESSION['context']; + $dialplan_context = $_SESSION['domain_name']; $dialplan_continue = 'false'; $app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3'; @@ -684,6 +684,11 @@ } //end foreach } + //add the dialplan permission + $p = new permissions; + $p->add("dialplan_add", "temp"); + $p->add("dialplan_detail_add", "temp"); + //save to the data $database = new database; $database->app_name = 'outbound_routes'; @@ -699,6 +704,10 @@ $dialplans->uuid = $dialplan_uuid; $dialplans->xml(); + //remove the temporary permission + $p->delete("dialplan_add", "temp"); + $p->delete("dialplan_detail_add", "temp"); + //clear the cache $cache = new cache; $cache->delete("dialplan:".$dialplan_context); @@ -720,12 +729,13 @@ $sql = "select * from v_gateways "; $sql .= "where enabled = 'true' "; if (permission_exists('outbound_route_any_gateway')) { - $sql .= "order by domain_uuid, gateway "; + $sql .= "order by domain_uuid = :domain_uuid DESC, gateway "; } else { $sql .= "and domain_uuid = :domain_uuid "; - $parameters['domain_uuid'] = $domain_uuid; + } + $parameters['domain_uuid'] = $domain_uuid; $database = new database; $gateways = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); @@ -806,50 +816,49 @@ function type_onchange(dialplan_detail_type) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; if (permission_exists('dialplan_detail_delete')) { echo "\n"; + //enabled + echo "\n"; //tools if (permission_exists('dialplan_detail_delete')) { if (is_uuid($dialplan_detail_uuid)) { diff --git a/app/dialplans/dialplan_xml.php b/app/dialplans/dialplan_xml.php index 233561211e..2fea100426 100644 --- a/app/dialplans/dialplan_xml.php +++ b/app/dialplans/dialplan_xml.php @@ -92,8 +92,11 @@ $database->save($array); unset($array); - //clear the cache + //clear the cache $cache = new cache; + if ($dialplan_context == "\${domain_name}" or $dialplan_context == "global") { + $dialplan_context = "*"; + } $cache->delete("dialplan:".$dialplan_context); //save the message to a session variable @@ -320,4 +323,4 @@ //show the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/app/dialplans/dialplans.php b/app/dialplans/dialplans.php index 010cf6f179..576f9ec1db 100644 --- a/app/dialplans/dialplans.php +++ b/app/dialplans/dialplans.php @@ -148,7 +148,7 @@ $sql .= "and app_uuid <> 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4' "; $sql .= "and dialplan_context <> 'public' "; //hide outbound routes - $sql .= "and app_uuid <> '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3' "; + //$sql .= "and app_uuid <> '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3' "; } else { if ($app_uuid == 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4') { diff --git a/app/dialplans/resources/classes/dialplan.php b/app/dialplans/resources/classes/dialplan.php index b93c3f6049..8e480d9e91 100644 --- a/app/dialplans/resources/classes/dialplan.php +++ b/app/dialplans/resources/classes/dialplan.php @@ -1,3 +1,4 @@ + app_uuid = '742714e5-8cdf-32fd-462c-cbe7e3d655db'; $database->save($array); unset($array); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } //revoke temporary permissions $p->delete('dialplan_add', 'temp'); } @@ -342,6 +347,12 @@ $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_inline'] = null; } $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = $group; + if (isset($row2['@attributes']['enabled'])) { + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = $row2['@attributes']['enabled']; + } + else { + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; + } $y++; //increase the order number @@ -363,6 +374,12 @@ $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_inline'] = null; } $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = $group; + if (isset($row2['@attributes']['enabled'])) { + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = $row2['@attributes']['enabled']; + } + else { + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; + } $y++; //increase the order number @@ -414,6 +431,14 @@ $p->delete('dialplan_edit', 'temp'); $p->delete('dialplan_detail_add', 'temp'); $p->delete('dialplan_detail_edit', 'temp'); + + //add dialplan xml when the dialplan_xml is null + $this->source = 'details'; + $this->destination = 'database'; + $this->context = $domain['domain_name']; + $this->is_empty = 'dialplan_xml'; + $this->xml(); + } //foreach domains } @@ -575,7 +600,7 @@ $sql .= "dialplan_order asc "; $database = new database; $results = $database->select($sql, $parameters, 'all'); - if (is_array($result) && @sizeof($result) != 0) { + if (is_array($results) && @sizeof($results) != 0) { foreach ($results as $row) { $dialplans[$row["dialplan_uuid"]] = $row["dialplan_xml"]; } @@ -587,42 +612,43 @@ if ($this->source == "details") { //get the data using a join between the dialplans and dialplan details tables - $sql = "select "; - $sql .= "p.domain_uuid, p.dialplan_uuid, p.app_uuid, p.dialplan_context, p.dialplan_name, p.dialplan_number, "; - $sql .= "p.dialplan_continue, p.dialplan_order, p.dialplan_enabled, p.dialplan_description, "; - $sql .= "s.dialplan_detail_uuid, s.dialplan_detail_tag, s.dialplan_detail_type, s.dialplan_detail_data, "; - $sql .= "s.dialplan_detail_break, s.dialplan_detail_inline, s.dialplan_detail_group, s.dialplan_detail_order "; - $sql .= "from v_dialplans as p, v_dialplan_details as s "; - $sql .= "where p.dialplan_uuid = s.dialplan_uuid "; + $sql = "select \n"; + $sql .= "p.domain_uuid, p.dialplan_uuid, p.app_uuid, p.dialplan_context, p.dialplan_name, p.dialplan_number, \n"; + $sql .= "p.dialplan_continue, p.dialplan_order, p.dialplan_enabled, p.dialplan_description, \n"; + $sql .= "s.dialplan_detail_uuid, s.dialplan_detail_tag, s.dialplan_detail_type, s.dialplan_detail_data, \n"; + $sql .= "s.dialplan_detail_break, s.dialplan_detail_inline, s.dialplan_detail_group, s.dialplan_detail_order, s.dialplan_detail_enabled \n"; + $sql .= "from v_dialplans as p, v_dialplan_details as s \n"; + $sql .= "where p.dialplan_uuid = s.dialplan_uuid \n"; if ($this->is_empty == "dialplan_xml") { - $sql .= "and p.dialplan_xml is null "; + $sql .= "and p.dialplan_xml is null \n"; } if (isset($this->context)) { if ($this->context == "public" || substr($this->context, 0, 7) == "public@" || substr($this->context, -7) == ".public") { - $sql .= "and p.dialplan_context = :dialplan_context "; + $sql .= "and p.dialplan_context = :dialplan_context \n"; } else { - $sql .= "and (p.dialplan_context = :dialplan_context or p.dialplan_context = '\${domain_name}') "; + $sql .= "and (p.dialplan_context = :dialplan_context or p.dialplan_context = '\${domain_name}') \n"; } - $sql .= "and p.dialplan_enabled = 'true' "; + $sql .= "and p.dialplan_enabled = 'true' \n"; $parameters['dialplan_context'] = $this->context; } if (is_uuid($this->uuid)) { - $sql .= "and p.dialplan_uuid = :dialplan_uuid "; - $sql .= "and s.dialplan_uuid = :dialplan_uuid "; + $sql .= "and p.dialplan_uuid = :dialplan_uuid \n"; + $sql .= "and s.dialplan_uuid = :dialplan_uuid \n"; $parameters['dialplan_uuid'] = $this->uuid; } - $sql .= "order by "; - $sql .= "p.dialplan_order asc, "; - $sql .= "p.dialplan_name asc, "; - $sql .= "p.dialplan_uuid asc, "; - $sql .= "s.dialplan_detail_group asc, "; - $sql .= "case s.dialplan_detail_tag "; - $sql .= "when 'condition' then 1 "; - $sql .= "when 'action' then 2 "; - $sql .= "when 'anti-action' then 3 "; - $sql .= "else 100 end, "; - $sql .= "s.dialplan_detail_order asc "; + $sql .= "and (s.dialplan_detail_enabled = 'true' or s.dialplan_detail_enabled is null) \n"; + $sql .= "order by \n"; + $sql .= "p.dialplan_order asc, \n"; + $sql .= "p.dialplan_name asc, \n"; + $sql .= "p.dialplan_uuid asc, \n"; + $sql .= "s.dialplan_detail_group asc, \n"; + $sql .= "case s.dialplan_detail_tag \n"; + $sql .= "when 'condition' then 1 \n"; + $sql .= "when 'action' then 2 \n"; + $sql .= "when 'anti-action' then 3 \n"; + $sql .= "else 100 end, \n"; + $sql .= "s.dialplan_detail_order asc \n"; $database = new database; $results = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); @@ -1054,6 +1080,11 @@ } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-delete'].': '.@sizeof($array[$this->table])); @@ -1209,9 +1240,11 @@ } if (is_array($uuids) && @sizeof($uuids) != 0) { $sql = "select ".$this->uuid_prefix."uuid as uuid, ".$this->toggle_field." as toggle, dialplan_context from v_".$this->table." "; - $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; - $sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") "; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $sql .= "where ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") "; + if (!permission_exists('dialplan_all')) { + $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + } $database = new database; $rows = $database->select($sql, $parameters, 'all'); if (is_array($rows) && @sizeof($rows) != 0) { @@ -1257,6 +1290,11 @@ } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-toggle']); } diff --git a/app/dialplans/resources/switch/conf/dialplan/040_call_block.xml b/app/dialplans/resources/switch/conf/dialplan/040_call_block.xml index 6d144d73bb..a73a790960 100644 --- a/app/dialplans/resources/switch/conf/dialplan/040_call_block.xml +++ b/app/dialplans/resources/switch/conf/dialplan/040_call_block.xml @@ -1,6 +1,6 @@ - + diff --git a/app/dialplans/resources/switch/conf/dialplan/050_user_record.xml b/app/dialplans/resources/switch/conf/dialplan/050_user_record.xml index 0c3234a51c..cf3c9f8fb7 100644 --- a/app/dialplans/resources/switch/conf/dialplan/050_user_record.xml +++ b/app/dialplans/resources/switch/conf/dialplan/050_user_record.xml @@ -41,7 +41,8 @@ - + + diff --git a/app/dialplans/resources/switch/conf/dialplan/055_rtp_has_crypto.xml b/app/dialplans/resources/switch/conf/dialplan/055_rtp_has_crypto.xml new file mode 100644 index 0000000000..b1ec3070f8 --- /dev/null +++ b/app/dialplans/resources/switch/conf/dialplan/055_rtp_has_crypto.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/app/dialplans/resources/switch/conf/dialplan/080_default_caller_id.xml b/app/dialplans/resources/switch/conf/dialplan/080_default_caller_id.xml index c110bbad89..3a892a44ed 100644 --- a/app/dialplans/resources/switch/conf/dialplan/080_default_caller_id.xml +++ b/app/dialplans/resources/switch/conf/dialplan/080_default_caller_id.xml @@ -1,11 +1,15 @@ - + + + - + + + diff --git a/app/dialplans/resources/switch/conf/dialplan/470_valet_park_in.xml b/app/dialplans/resources/switch/conf/dialplan/470_valet_park_in.xml index e4fef5114b..128ea0074d 100644 --- a/app/dialplans/resources/switch/conf/dialplan/470_valet_park_in.xml +++ b/app/dialplans/resources/switch/conf/dialplan/470_valet_park_in.xml @@ -1,7 +1,7 @@ - + - + diff --git a/app/dialplans/resources/switch/conf/dialplan/475_valet_park_out.xml b/app/dialplans/resources/switch/conf/dialplan/475_valet_park_out.xml index a21095f58c..b51390a82c 100644 --- a/app/dialplans/resources/switch/conf/dialplan/475_valet_park_out.xml +++ b/app/dialplans/resources/switch/conf/dialplan/475_valet_park_out.xml @@ -1,8 +1,8 @@ - + - + - + diff --git a/app/dialplans/resources/switch/conf/dialplan/500_follow-me-destinations.xml b/app/dialplans/resources/switch/conf/dialplan/500_follow-me-destinations.xml index 26a9ddfa08..4bb6730aa2 100644 --- a/app/dialplans/resources/switch/conf/dialplan/500_follow-me-destinations.xml +++ b/app/dialplans/resources/switch/conf/dialplan/500_follow-me-destinations.xml @@ -2,6 +2,8 @@ + + diff --git a/app/dialplans/resources/switch/conf/dialplan/505_call-forward-all.xml b/app/dialplans/resources/switch/conf/dialplan/505_call-forward-all.xml index 23d6998112..d509a919a2 100644 --- a/app/dialplans/resources/switch/conf/dialplan/505_call-forward-all.xml +++ b/app/dialplans/resources/switch/conf/dialplan/505_call-forward-all.xml @@ -1,9 +1,11 @@ - - - - - - - + + + + + + + + + diff --git a/app/email_logs/email_test.php b/app/email_logs/email_test.php index e5431dc1f6..76187f2e00 100644 --- a/app/email_logs/email_test.php +++ b/app/email_logs/email_test.php @@ -35,63 +35,58 @@ $text = $language->get(); //send email - if (valid_email($_POST['to'])) { - //validate the token - $token = new token; - if (!$token->validate('/app/email_logs/email_logs.php')) { - //message::add($text['message-invalid_token'],'negative'); - echo ""; - echo "
\n"; - echo $text['message-invalid_token']; - echo "

\n"; - echo " \n"; - echo "
\n"; - exit; + //validate the token + $token = new token; + if (!$token->validate('/app/email_logs/email_logs.php')) { + //message::add($text['message-invalid_token'],'negative'); + echo ""; + echo "
\n"; + echo $text['message-invalid_token']; + echo "

\n"; + echo " \n"; + echo "
\n"; + exit; + } + + $recipient = check_str($_POST['to']); + + echo "".$text['header-settings']."\n"; + echo "

\n"; + ksort($_SESSION['email']); + foreach ($_SESSION['email'] as $name => $setting) { + foreach ($setting as $type => $value) { + if ($type == 'uuid') { $uuid = $value; continue; } + if ($name == 'smtp_password') { $value = '[REDACTED]'; } + if (permission_exists('default_setting_edit')) { + echo "".$name.': '.$value."
\n"; } - - $recipient = check_str($_POST['to']); - - echo "".$text['header-settings']."\n"; - echo "

\n"; - ksort($_SESSION['email']); - foreach ($_SESSION['email'] as $name => $setting) { - foreach ($setting as $type => $value) { - if ($type == 'uuid') { $uuid = $value; continue; } - if ($name == 'smtp_password') { $value = '[REDACTED]'; } - if (permission_exists('default_setting_edit')) { - echo "".$name.': '.$value."
\n"; - } - else { - echo $name.': '.$value."
\n"; - } + else { + echo $name.': '.$value."
\n"; } } - echo "

\n"; - - echo "".$text['header-connection']."\n"; - echo "

\n"; - - $eml_body = "Test Message

\n"; - $eml_body .= "This message is a test of the SMTP settings configured within your PBX.
\n"; - $eml_body .= "If you received this message, your current SMTP settings are valid.

\n"; - - ob_start(); - $sent = !send_email($recipient, 'Test Message', $eml_body, $eml_error, null, null, 3, 3) ? false : true; - $response = ob_get_clean(); - - echo $response; - - echo "

\n"; - - echo "".$text['header-result']."\n"; - echo "

\n"; - echo $sent ? "Message Sent Successfully
Receipient: ".$recipient."" : "Message Failed...
".$eml_error; - - } - else { - echo "Error: Invalid Recipient Address"; } + echo "

\n"; + + echo "".$text['header-connection']."\n"; + echo "

\n"; + + $eml_body = "Test Message

\n"; + $eml_body .= "This message is a test of the SMTP settings configured within your PBX.
\n"; + $eml_body .= "If you received this message, your current SMTP settings are valid.

\n"; + + ob_start(); + $sent = !send_email($recipient, 'Test Message', $eml_body, $eml_error, null, null, 3, 3) ? false : true; + $response = ob_get_clean(); + + echo $response; + + echo "

\n"; + + echo "".$text['header-result']."\n"; + echo "

\n"; + echo $sent ? "Message Sent Successfully
Receipient: ".$recipient."" : "Message Failed...
".$eml_error; + echo "
\n"; echo "
\n"; diff --git a/app/email_templates/email_template_edit.php b/app/email_templates/email_template_edit.php index 1efcb8be4c..0e395deee7 100644 --- a/app/email_templates/email_template_edit.php +++ b/app/email_templates/email_template_edit.php @@ -165,6 +165,13 @@ unset($sql, $parameters, $row); } +//load editor preferences/defaults + $setting_size = $_SESSION["editor"]["font_size"]["text"] != '' ? $_SESSION["editor"]["font_size"]["text"] : '12px'; + $setting_theme = $_SESSION["editor"]["theme"]["text"] != '' ? $_SESSION["editor"]["theme"]["text"] : 'cobalt'; + $setting_invisibles = $_SESSION["editor"]["invisibles"]["boolean"] != '' ? $_SESSION["editor"]["invisibles"]["boolean"] : 'false'; + $setting_indenting = $_SESSION["editor"]["indent_guides"]["boolean"] != '' ? $_SESSION["editor"]["indent_guides"]["boolean"] : 'false'; + $setting_numbering = $_SESSION["editor"]["line_numbers"]["boolean"] != '' ? $_SESSION["editor"]["line_numbers"]["boolean"] : 'true'; + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); @@ -173,6 +180,69 @@ $document['title'] = $text['title-email_template']; require_once "resources/header.php"; + echo "\n"; + + echo "\n"; + //show the content echo "\n"; @@ -180,7 +250,7 @@ echo "
".$text['title-email_template']."
\n"; echo "
\n"; echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'email_templates.php']); - echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save']); + echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','onclick'=>"set_value(); $('#frm').submit();"]); echo "
\n"; echo "
\n"; echo "\n"; @@ -236,7 +306,77 @@ echo " ".$text['label-template_body']."\n"; echo "\n"; echo "
\n"; @@ -327,6 +467,39 @@ echo ""; + echo "\n"; + echo "\n"; + //include the footer require_once "resources/footer.php"; diff --git a/app/email_templates/resources/images/icon_file.png b/app/email_templates/resources/images/icon_file.png new file mode 100644 index 0000000000..c8d71de0c4 Binary files /dev/null and b/app/email_templates/resources/images/icon_file.png differ diff --git a/app/email_templates/resources/images/icon_folder.png b/app/email_templates/resources/images/icon_folder.png new file mode 100644 index 0000000000..7efc21fe2e Binary files /dev/null and b/app/email_templates/resources/images/icon_folder.png differ diff --git a/app/email_templates/resources/images/icon_gear.png b/app/email_templates/resources/images/icon_gear.png new file mode 100644 index 0000000000..0fde59125d Binary files /dev/null and b/app/email_templates/resources/images/icon_gear.png differ diff --git a/app/email_templates/resources/images/icon_goto.png b/app/email_templates/resources/images/icon_goto.png new file mode 100644 index 0000000000..89f5d28531 Binary files /dev/null and b/app/email_templates/resources/images/icon_goto.png differ diff --git a/app/email_templates/resources/images/icon_indenting.png b/app/email_templates/resources/images/icon_indenting.png new file mode 100644 index 0000000000..c6d4c733f1 Binary files /dev/null and b/app/email_templates/resources/images/icon_indenting.png differ diff --git a/app/email_templates/resources/images/icon_invisibles.png b/app/email_templates/resources/images/icon_invisibles.png new file mode 100644 index 0000000000..9e2973bb6e Binary files /dev/null and b/app/email_templates/resources/images/icon_invisibles.png differ diff --git a/app/email_templates/resources/images/icon_numbering.png b/app/email_templates/resources/images/icon_numbering.png new file mode 100644 index 0000000000..305144c8d4 Binary files /dev/null and b/app/email_templates/resources/images/icon_numbering.png differ diff --git a/app/email_templates/resources/images/icon_replace.png b/app/email_templates/resources/images/icon_replace.png new file mode 100644 index 0000000000..4b2ec21788 Binary files /dev/null and b/app/email_templates/resources/images/icon_replace.png differ diff --git a/app/errors/app_config.php b/app/errors/app_config.php index 9382292f0d..928fe43483 100644 --- a/app/errors/app_config.php +++ b/app/errors/app_config.php @@ -46,4 +46,5 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Path to web server error log file."; $y++; -?> + +?> \ No newline at end of file diff --git a/app/errors/app_languages.php b/app/errors/app_languages.php index f3e6f204c6..aed6e8ef69 100644 --- a/app/errors/app_languages.php +++ b/app/errors/app_languages.php @@ -295,4 +295,4 @@ $text['error-open_file']['ru-ru'] = "Невозможно открыть фай $text['error-open_file']['sv-se'] = "Kan inte öppna fil!"; $text['error-open_file']['uk-ua'] = "Неможливо відкрити файл!"; -?> +?> \ No newline at end of file diff --git a/app/errors/app_menu.php b/app/errors/app_menu.php index e8aab7123f..c475a2758c 100644 --- a/app/errors/app_menu.php +++ b/app/errors/app_menu.php @@ -26,4 +26,4 @@ $apps[$x]['menu'][$y]['path'] = "/app/errors/errors.php"; $apps[$x]['menu'][$y]['groups'][] = "superadmin"; -?> +?> \ No newline at end of file diff --git a/app/extension_settings/app_config.php b/app/extension_settings/app_config.php new file mode 100755 index 0000000000..f73635a368 --- /dev/null +++ b/app/extension_settings/app_config.php @@ -0,0 +1,87 @@ + \ No newline at end of file diff --git a/app/extension_settings/app_defaults.php b/app/extension_settings/app_defaults.php new file mode 100755 index 0000000000..adadacce42 --- /dev/null +++ b/app/extension_settings/app_defaults.php @@ -0,0 +1,7 @@ + diff --git a/app/extension_settings/app_languages.php b/app/extension_settings/app_languages.php new file mode 100755 index 0000000000..24625e19ea --- /dev/null +++ b/app/extension_settings/app_languages.php @@ -0,0 +1,302 @@ + \ No newline at end of file diff --git a/app/extension_settings/extension_setting_edit.php b/app/extension_settings/extension_setting_edit.php new file mode 100755 index 0000000000..6254870e53 --- /dev/null +++ b/app/extension_settings/extension_setting_edit.php @@ -0,0 +1,375 @@ + + Portions created by the Initial Developer are Copyright (C) 2021 + the Initial Developer. All Rights Reserved. +*/ + +//includes + require_once "root.php"; + require_once "resources/require.php"; + require_once "resources/check_auth.php"; + +//check permissions + if (permission_exists('extension_setting_add') || permission_exists('extension_setting_edit')) { + //access granted + } + else { + echo "access denied"; + exit; + } + +//add multi-lingual support + $language = new text; + $text = $language->get(); + +//action add or update + if (is_uuid($_REQUEST["id"])) { + $action = "update"; + $extension_setting_uuid = $_REQUEST["id"]; + $id = $_REQUEST["id"]; + } + else { + $action = "add"; + } + +//get the extension id + if (is_uuid($_REQUEST["extension_setting_uuid"])) { + $extension_setting_uuid = $_REQUEST["extension_setting_uuid"]; + } + if (is_uuid($_REQUEST["extension_uuid"])) { + $extension_uuid = $_REQUEST["extension_uuid"]; + } + +//get http post variables and set them to php variables + if (is_array($_POST)) { + $domain_uuid = $_POST["domain_uuid"]; + $extension_setting_type = $_POST["extension_setting_type"]; + $extension_setting_name = $_POST["extension_setting_name"]; + $extension_setting_value = $_POST["extension_setting_value"]; + $extension_setting_enabled = $_POST["extension_setting_enabled"]; + $extension_setting_description = $_POST["extension_setting_description"]; + } + +//process the user data and save it to the database + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { + + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: extension_settings.php?id='.$extension_uuid); + exit; + } + + //process the http post data by submitted action + if ($_POST['action'] != '' && strlen($_POST['action']) > 0) { + + //prepare the array(s) + //send the array to the database class + switch ($_POST['action']) { + case 'copy': + if (permission_exists('extension_setting_add')) { + $obj = new database; + $obj->copy($array); + } + break; + case 'delete': + if (permission_exists('extension_setting_delete')) { + $obj = new database; + $obj->delete($array); + } + break; + case 'toggle': + if (permission_exists('extension_setting_update')) { + $obj = new database; + $obj->toggle($array); + } + break; + } + + //redirect the user + if (in_array($_POST['action'], array('copy', 'delete', 'toggle')) && is_uuid($id) && is_uuid($extension_uuid)) { + header('Location: extension_setting_edit.php?id='.$id.'&extension_uuid='.$extension_uuid); + exit; + } + } + + //check for all required data + $msg = ''; + //if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."
\n"; } + if (strlen($extension_setting_type) == 0) { $msg .= $text['message-required']." ".$text['label-extension_setting_type']."
\n"; } + if (strlen($extension_setting_name) == 0) { $msg .= $text['message-required']." ".$text['label-extension_setting_name']."
\n"; } + //if (strlen($extension_setting_value) == 0) { $msg .= $text['message-required']." ".$text['label-extension_setting_value']."
\n"; } + if (strlen($extension_setting_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-extension_setting_enabled']."
\n"; } + //if (strlen($extension_setting_description) == 0) { $msg .= $text['message-required']." ".$text['label-extension_setting_description']."
\n"; } + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persist_form_var.php"; + echo "
\n"; + echo "
\n"; - if (if_group("superadmin")) { - echo "\n"; - echo "\n"; - } + echo "\n"; + echo "\n"; + //set the onchange $onchange = ''; diff --git a/app/dialplans/app_config.php b/app/dialplans/app_config.php index e2eac554ec..9b71212293 100644 --- a/app/dialplans/app_config.php +++ b/app/dialplans/app_config.php @@ -226,5 +226,9 @@ $apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_detail_order"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_detail_enabled"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; ?> diff --git a/app/dialplans/dialplan_add.php b/app/dialplans/dialplan_add.php index 57e3f957ea..6076daaf49 100644 --- a/app/dialplans/dialplan_add.php +++ b/app/dialplans/dialplan_add.php @@ -80,7 +80,7 @@ } //set the default - if (strlen($dialplan_context) == 0) { $dialplan_context = $_SESSION['context']; } + if (strlen($dialplan_context) == 0) { $dialplan_context = $_SESSION['domain_name']; } //add or update data from http post if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { diff --git a/app/dialplans/dialplan_edit.php b/app/dialplans/dialplan_edit.php index 3fc41d263a..2f9812ae9d 100644 --- a/app/dialplans/dialplan_edit.php +++ b/app/dialplans/dialplan_edit.php @@ -232,6 +232,7 @@ $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_inline'] = $row["dialplan_detail_inline"]; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = ($row["dialplan_detail_group"] != '') ? $row["dialplan_detail_group"] : '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $row["dialplan_detail_order"]; + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = $row["dialplan_detail_enabled"]; } $y++; } @@ -267,8 +268,16 @@ //clear the cache $cache = new cache; + if ($dialplan_context == "\${domain_name}" or $dialplan_context == "global") { + $dialplan_context = "*"; + } $cache->delete("dialplan:".$dialplan_context); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set the message if ($action == "add") { message::add($text['message-add']); @@ -315,7 +324,10 @@ } //get the dialplan details in an array - $sql = "select * from v_dialplan_details "; + $sql = "select "; + $sql .= "domain_uuid, dialplan_uuid, dialplan_detail_uuid, dialplan_detail_tag, dialplan_detail_type, dialplan_detail_data, "; + $sql .= "dialplan_detail_break, dialplan_detail_inline, dialplan_detail_group, dialplan_detail_order, cast(dialplan_detail_enabled as text) "; + $sql .= "from v_dialplan_details "; $sql .= "where dialplan_uuid = :dialplan_uuid "; $sql .= "order by dialplan_detail_group asc, dialplan_detail_order asc"; $parameters['dialplan_uuid'] = $dialplan_uuid; @@ -403,6 +415,8 @@ $details[$group][$x]['dialplan_detail_inline'] = ''; $details[$group][$x]['dialplan_detail_group'] = $group; $details[$group][$x]['dialplan_detail_order'] = $dialplan_detail_order; + $details[$group][$x]['dialplan_detail_enabled'] = 'true'; + } } //sort the details array by group number @@ -740,6 +754,7 @@ echo "".$text['label-inline']."".$text['label-group']."".$text['label-order']."".$text['label-enabled']."\n"; echo " ".$text['label-delete']."\n"; @@ -760,6 +775,12 @@ $dialplan_detail_inline = $row['dialplan_detail_inline']; $dialplan_detail_group = $row['dialplan_detail_group']; $dialplan_detail_order = $row['dialplan_detail_order']; + $dialplan_detail_enabled = $row['dialplan_detail_enabled']; + + //default to enabled true + if (strlen($dialplan_detail_enabled) == 0) { + $dialplan_detail_enabled = 'true'; + } //no border on last row $no_border = ($index == 999) ? "border: none;" : null; @@ -959,6 +980,17 @@ echo " \n"; */ echo "\n"; + if ($element['hidden']) { + echo " \n"; + } + echo " \n"; + echo "\n"; - echo " \n"; + echo " \n"; + echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
\n"; echo "
\n"; echo $text['description-template_body']."\n"; echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; + return; + } + + //add the extension_setting_uuid + if (!is_uuid($extension_setting_uuid)) { + $extension_setting_uuid = uuid(); + } + + //prepare the array + $array['extension_settings'][0]['extension_setting_uuid'] = $extension_setting_uuid; + $array['extension_settings'][0]['extension_uuid'] = $extension_uuid; + $array['extension_settings'][0]['domain_uuid'] = $_SESSION['domain_uuid']; + //$array['extension_settings'][0]['domain_uuid'] = $domain_uuid; + $array['extension_settings'][0]['extension_setting_type'] = $extension_setting_type; + $array['extension_settings'][0]['extension_setting_name'] = $extension_setting_name; + $array['extension_settings'][0]['extension_setting_value'] = $extension_setting_value; + $array['extension_settings'][0]['extension_setting_enabled'] = $extension_setting_enabled; + $array['extension_settings'][0]['extension_setting_description'] = $extension_setting_description; + + //save the data + $database = new database; + $database->app_name = 'extension settings'; + $database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd'; + $database->save($array); + + //clear the cache + $sql = "select extension, number_alias, user_context from v_extensions "; + $sql .= "where extension_uuid = :extension_uuid "; + $parameters['extension_uuid'] = $extension_uuid; + $database = new database; + $extension = $database->select($sql, $parameters, 'row'); + $cache = new cache; + $cache->delete("directory:".$extension["extension"]."@".$extension["user_context"]); + $cache->delete("directory:".$extension["number_alias"]."@".$extension["user_context"]); + + //redirect the user + if (isset($action)) { + if ($action == "add") { + $_SESSION["message"] = $text['message-add']; + } + if ($action == "update") { + $_SESSION["message"] = $text['message-update']; + } + //header('Location: extension_settings.php'); + header('Location: extension_setting_edit.php?id='.urlencode($extension_setting_uuid).'&extension_uuid='.$extension_uuid); + return; + } + } + +//pre-populate the form + if (is_array($_GET) && $_POST["persistformvar"] != "true") { + $sql = "select "; + //$sql .= "extension_uuid, "; + //$sql .= "domain_uuid, "; + $sql .= "extension_setting_uuid, "; + $sql .= "extension_setting_type, "; + $sql .= "extension_setting_name, "; + $sql .= "extension_setting_value, "; + $sql .= "cast(extension_setting_enabled as text), "; + $sql .= "extension_setting_description "; + $sql .= "from v_extension_settings "; + $sql .= "where extension_setting_uuid = :extension_setting_uuid "; + //$sql .= "and domain_uuid = :domain_uuid "; + //$parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $parameters['extension_setting_uuid'] = $extension_setting_uuid; + $database = new database; + $row = $database->select($sql, $parameters, 'row'); + if (is_array($row) && @sizeof($row) != 0) { + if (is_uuid($row["extension_uuid"])) { + $extension_uuid = $row["extension_uuid"]; + } + //$domain_uuid = $row["domain_uuid"]; + $extension_setting_type = $row["extension_setting_type"]; + $extension_setting_name = $row["extension_setting_name"]; + $extension_setting_value = $row["extension_setting_value"]; + $extension_setting_enabled = $row["extension_setting_enabled"]; + $extension_setting_description = $row["extension_setting_description"]; + } + unset($sql, $parameters, $row); + } + +//create token + $object = new token; + $token = $object->create($_SERVER['PHP_SELF']); + +//show the header + $document['title'] = $text['title-extension_setting']; + require_once "resources/header.php"; + +//show the content + echo "
\n"; + echo "\n"; + + echo "
\n"; + echo "
".$text['title-extension_setting']."
\n"; + echo "
\n"; + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'extension_settings.php?id='.$extension_uuid]); + if ($action == 'update') { + if (permission_exists('_add')) { + echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]); + } + if (permission_exists('_delete')) { + echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; margin-right: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]); + } + } + echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','collapse'=>'hide-xs']); + echo "
\n"; + echo "
\n"; + echo "
\n"; + + echo $text['title_description-extension_settings']."\n"; + echo "

\n"; + + if ($action == 'update') { + if (permission_exists('extension_setting_add')) { + echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'copy','onclick'=>"modal_close();"])]); + } + if (permission_exists('extension_setting_delete')) { + echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]); + } + } + + echo "\n"; + + //echo "\n"; + //echo "\n"; + //echo "\n"; + //echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + //echo " ".$text['label-domain_uuid']."\n"; + //echo "\n"; + //echo " \n"; + //echo "
\n"; + //echo $text['description-domain_uuid']."\n"; + //echo "
\n"; + echo " ".$text['label-extension_setting_type']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-extension_setting_type']."\n"; + echo "
\n"; + echo " ".$text['label-extension_setting_name']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-extension_setting_name']."\n"; + echo "
\n"; + echo " ".$text['label-extension_setting_value']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-extension_setting_value']."\n"; + echo "
\n"; + echo " ".$text['label-extension_setting_enabled']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-extension_setting_enabled']."\n"; + echo "
\n"; + echo " ".$text['label-extension_setting_description']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-extension_setting_description']."\n"; + echo "
\n"; + echo "

\n"; + + echo "\n"; + echo "\n"; + + echo "
"; + +//include the footer + require_once "resources/footer.php"; + +?> diff --git a/app/extension_settings/extension_settings.php b/app/extension_settings/extension_settings.php new file mode 100755 index 0000000000..a2cd197a80 --- /dev/null +++ b/app/extension_settings/extension_settings.php @@ -0,0 +1,327 @@ + + Portions created by the Initial Developer are Copyright (C) 2021 + the Initial Developer. All Rights Reserved. +*/ + +//includes + require_once "root.php"; + require_once "resources/require.php"; + require_once "resources/check_auth.php"; + +//check permissions + if (permission_exists('extension_setting_view')) { + //access granted + } + else { + echo "access denied"; + exit; + } + +//add multi-lingual support + $language = new text; + $text = $language->get(); + +//get the http post data + if (is_array($_POST['extension_settings'])) { + $action = $_POST['action']; + $search = $_POST['search']; + $extension_settings = $_POST['extension_settings']; + } + +//action add or update + if (is_uuid($_REQUEST["id"])) { + $extension_uuid = $_REQUEST["id"]; + } + +//process the http post data by action + if ($action != '' && is_array($extension_settings) && @sizeof($extension_settings) != 0) { + + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: extension_settings.php'); + exit; + } + + //prepare the array + foreach($extension_settings as $row) { + $array['extension_settings'][$x]['checked'] = $row['checked']; + $array['extension_settings'][$x]['extension_setting_uuid'] = $row['extension_setting_uuid']; + $array['extension_settings'][$x]['extension_setting_enabled'] = $row['extension_setting_enabled']; + $x++; + } + + //prepare the database object + $database = new database; + $database->app_name = 'extension_settings'; + $database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd'; + + //send the array to the database class + switch ($action) { + case 'copy': + if (permission_exists('extension_setting_add')) { + $database->copy($array); + } + break; + case 'toggle': + if (permission_exists('extension_setting_edit')) { + $database->toggle($array); + } + break; + case 'delete': + if (permission_exists('extension_setting_delete')) { + $database->delete($array); + } + break; + } + + //redirect the user + header('Location: extension_settings.php?id='.urlencode($extension_uuid).'&'.($search != '' ? '?search='.urlencode($search) : null)); + exit; + } + +//get order and order by + $order_by = $_GET["order_by"]; + $order = $_GET["order"]; + +//add the search + if (isset($_GET["search"])) { + $search = strtolower($_GET["search"]); + } + +//get the count + $sql = "select count(extension_setting_uuid) "; + $sql .= "from v_extension_settings "; + $sql .= "where extension_uuid = :extension_uuid "; + if (isset($search)) { + $sql .= "and ("; + $sql .= " lower(extension_setting_type) like :search "; + $sql .= " or lower(extension_setting_name) like :search "; + $sql .= " or lower(extension_setting_description) like :search "; + $sql .= ") "; + $parameters['search'] = '%'.$search.'%'; + } + else { + $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; + if (isset($sql_search)) { + $sql .= "and ".$sql_search; + } + $parameters['domain_uuid'] = $domain_uuid; + } + $parameters['extension_uuid'] = $extension_uuid; + $database = new database; + $num_rows = $database->select($sql, $parameters, 'column'); + unset($sql, $parameters); + +//get the list + $sql = "select "; + //$sql .= "d.domain_name, "; + $sql .= "extension_setting_uuid, "; + $sql .= "extension_setting_type, "; + $sql .= "extension_setting_name, "; + $sql .= "extension_setting_value, "; + $sql .= "cast(extension_setting_enabled as text), "; + $sql .= "extension_setting_description "; + $sql .= "from v_extension_settings as e "; + //$sql .= ",v_domains as d "; + $sql .= "where extension_uuid = :extension_uuid "; + $sql .= "and (e.domain_uuid = :domain_uuid or e.domain_uuid is null) "; + //$sql .= "and d.domain_uuid = e.domain_uuid "; + if (isset($_GET["search"])) { + $sql .= "and ("; + $sql .= " lower(extension_setting_type) like :search "; + $sql .= " or lower(extension_setting_name) like :search "; + $sql .= " or lower(extension_setting_description) like :search "; + $sql .= ") "; + $parameters['search'] = '%'.$search.'%'; + } + + $sql .= order_by($order_by, $order, 'extension_setting_type', 'asc'); + $sql .= limit_offset($rows_per_page, $offset); + $parameters['extension_uuid'] = $extension_uuid; + $parameters['domain_uuid'] = $domain_uuid; + $database = new database; + $extension_settings = $database->select($sql, $parameters, 'all'); + unset($sql, $parameters); + +//create token + $object = new token; + $token = $object->create($_SERVER['PHP_SELF']); + +//additional includes + $document['title'] = $text['title-extension_settings']; + require_once "resources/header.php"; + +//show the content + echo "
\n"; + echo "
".$text['title-extension_settings']." (".$num_rows.")
\n"; + echo "
\n"; + + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_add','name'=>'btn_add','link'=>'/app/extensions/extension_edit.php?id='.$extension_uuid]); + + if (permission_exists('extension_setting_add')) { + echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','name'=>'btn_add','link'=>'extension_setting_edit.php?extension_uuid='.$extension_uuid]); + } + if (permission_exists('extension_setting_add') && $extension_settings) { + echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display:none;','onclick'=>"modal_open('modal-copy','btn_copy');"]); + } + if (permission_exists('extension_setting_edit') && $extension_settings) { + echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'id'=>'btn_toggle','name'=>'btn_toggle','style'=>'display:none;','onclick'=>"modal_open('modal-toggle','btn_toggle');"]); + } + if (permission_exists('extension_setting_delete') && $extension_settings) { + echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display:none;','onclick'=>"modal_open('modal-delete','btn_delete');"]); + } + echo "\n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + + if (permission_exists('extension_setting_add') && $extension_settings) { + echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]); + } + if (permission_exists('extension_setting_edit') && $extension_settings) { + echo modal::create(['id'=>'modal-toggle','type'=>'toggle','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_toggle','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('toggle'); list_form_submit('form_list');"])]); + } + if (permission_exists('extension_setting_delete') && $extension_settings) { + echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]); + } + + echo $text['title_description-extension_settings']."\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + if (is_array($extension_settings) && @sizeof($extension_settings) != 0) { + $x = 0; + foreach ($extension_settings as $row) { + $extension_setting_type = $row['extension_setting_type']; + $extension_setting_type = strtolower($extension_setting_type); + + $label_extension_setting_type = $row['extension_setting_type']; + $label_extension_setting_type = str_replace("_", " ", $label_extension_setting_type); + $label_extension_setting_type = str_replace("-", " ", $label_extension_setting_type); + $label_extension_setting_type = ucwords($label_extension_setting_type); + + if ($previous_extension_setting_type !== $row['extension_setting_type']) { + echo " "; + echo " \n"; + echo " "; + echo " "; + echo " \n"; + echo " "; + echo "\n"; + if (permission_exists('extension_setting_add') || permission_exists('extension_setting_edit') || permission_exists('extension_setting_delete')) { + echo " \n"; + } + //if ($_GET['show'] == 'all' && permission_exists('extension_setting_all')) { + // echo th_order_by('domain_name', $text['label-domain'], $order_by, $order); + //} + + //echo th_order_by('extension_setting_type', $text['label-extension_setting_type'], $order_by, $order); + //echo th_order_by('extension_setting_name', $text['label-extension_setting_name'], $order_by, $order); + //echo th_order_by('extension_setting_value', $text['label-extension_setting_value'], $order_by, $order); + //echo th_order_by('extension_setting_enabled', $text['label-extension_setting_enabled'], $order_by, $order, null, "class='center'"); + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + + echo " \n"; + if (permission_exists('extension_setting_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') { + echo " \n"; + } + echo "\n"; + + } + if (permission_exists('extension_setting_edit')) { + $list_row_url = "extension_setting_edit.php?id=".urlencode($row['extension_setting_uuid'])."&extension_uuid=".urlencode($extension_uuid); + } + echo "\n"; + if (permission_exists('extension_setting_add') || permission_exists('extension_setting_edit') || permission_exists('extension_setting_delete')) { + echo " \n"; + } + //if ($_GET['show'] == 'all' && permission_exists('extension_setting_all')) { + // echo " \n"; + //} + echo " \n"; + echo " \n"; + echo " \n"; + if (permission_exists('extension_setting_edit')) { + echo " \n"; + echo " \n"; + if (permission_exists('extension_setting_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') { + echo " \n"; + } + echo "\n"; + + //set the previous category + $previous_extension_setting_type = $row['extension_setting_type']; + $x++; + } + unset($extension_settings); + } + + echo "
 
".escape($label_extension_setting_type)."
\n"; + echo " \n"; + echo " ".$text['label-extension_setting_type']."".$text['label-extension_setting_name']."".$text['label-extension_setting_value']."".$text['label-extension_setting_enabled']."".$text['label-extension_setting_description']." 
\n"; + echo " \n"; + echo " \n"; + echo " ".escape($row['domain_name'])."".escape($row['extension_setting_type'])."".escape($row['extension_setting_name'])."".escape($row['extension_setting_value'])."\n"; + echo $text['label-'.$row['extension_setting_enabled']]; + } + echo " ".escape($row['extension_setting_description'])."\n"; + echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]); + echo "
\n"; + echo "
\n"; + echo "
".$paging_controls."
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + +//include the footer + require_once "resources/footer.php"; + +?> diff --git a/app/extension_settings/resources/classes/extension_settings.php b/app/extension_settings/resources/classes/extension_settings.php new file mode 100755 index 0000000000..0fe50b8889 --- /dev/null +++ b/app/extension_settings/resources/classes/extension_settings.php @@ -0,0 +1,276 @@ + + Portions created by the Initial Developer are Copyright (C) 2021 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ + +/** + * extension_settings class + * + * @method null delete + * @method null toggle + * @method null copy + */ +if (!class_exists('extension_settings')) { + class extension_settings { + + /** + * declare the variables + */ + private $app_name; + private $app_uuid; + private $name; + private $table; + private $toggle_field; + private $toggle_values; + private $description_field; + private $location; + + /** + * called when the object is created + */ + public function __construct() { + //assign the variables + $this->app_name = 'extension_settings'; + $this->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd'; + $this->name = 'extension_setting'; + $this->table = 'extension_settings'; + $this->toggle_field = 'extension_setting_enabled'; + $this->toggle_values = ['true','false']; + $this->description_field = 'extension_setting_description'; + $this->location = 'extension_settings.php'; + } + + /** + * called when there are no references to a particular object + * unset the variables used in the class + */ + public function __destruct() { + foreach ($this as $key => $value) { + unset($this->$key); + } + } + + /** + * delete rows from the database + */ + public function delete($records) { + if (permission_exists($this->name.'_delete')) { + + //add multi-lingual support + $language = new text; + $text = $language->get(); + + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: '.$this->location); + exit; + } + + //delete multiple records + if (is_array($records) && @sizeof($records) != 0) { + //build the delete array + $x = 0; + foreach ($records as $record) { + //add to the array + if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + $array[$this->table][$x][$this->name.'_uuid'] = $record['uuid']; + $array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid']; + } + + //increment the id + $x++; + } + + //delete the checked rows + if (is_array($array) && @sizeof($array) != 0) { + //execute delete + $database = new database; + $database->app_name = $this->app_name; + $database->app_uuid = $this->app_uuid; + $database->delete($array); + unset($array); + + //clear the cache + $sql = "select extension, number_alias, user_context from v_extensions "; + $sql .= "where extension_uuid = :extension_uuid "; + $parameters['extension_uuid'] = $extension_uuid; + $database = new database; + $extension = $database->select($sql, $parameters, 'row'); + $cache = new cache; + $cache->delete("directory:".$extension["extension"]."@".$extension["user_context"]); + $cache->delete("directory:".$extension["number_alias"]."@".$extension["user_context"]); + + //set message + message::add($text['message-delete']); + } + unset($records); + } + } + } + + /** + * toggle a field between two values + */ + public function toggle($records) { + if (permission_exists($this->name.'_edit')) { + + //add multi-lingual support + $language = new text; + $text = $language->get(); + + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: '.$this->location); + exit; + } + + //toggle the checked records + if (is_array($records) && @sizeof($records) != 0) { + //get current toggle state + foreach($records as $record) { + if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + $uuids[] = "'".$record['uuid']."'"; + } + } + if (is_array($uuids) && @sizeof($uuids) != 0) { + $sql = "select ".$this->name."_uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." "; + $sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") "; + $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $database = new database; + $rows = $database->select($sql, $parameters, 'all'); + if (is_array($rows) && @sizeof($rows) != 0) { + foreach ($rows as $row) { + $states[$row['uuid']] = $row['toggle']; + } + } + unset($sql, $parameters, $rows, $row); + } + + //build update array + $x = 0; + foreach($states as $uuid => $state) { + //create the array + $array[$this->table][$x][$this->name.'_uuid'] = $uuid; + $array[$this->table][$x][$this->toggle_field] = $state == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0]; + + //increment the id + $x++; + } + + //save the changes + if (is_array($array) && @sizeof($array) != 0) { + //save the array + $database = new database; + $database->app_name = $this->app_name; + $database->app_uuid = $this->app_uuid; + $database->save($array); + unset($array); + + //set message + message::add($text['message-toggle']); + } + unset($records, $states); + } + } + } + + /** + * copy rows from the database + */ + public function copy($records) { + if (permission_exists($this->name.'_add')) { + + //add multi-lingual support + $language = new text; + $text = $language->get(); + + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: '.$this->location); + exit; + } + + //copy the checked records + if (is_array($records) && @sizeof($records) != 0) { + + //get checked records + foreach($records as $record) { + if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + $uuids[] = "'".$record['uuid']."'"; + } + } + + //create the array from existing data + if (is_array($uuids) && @sizeof($uuids) != 0) { + $sql = "select * from v_".$this->table." "; + $sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") "; + $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $database = new database; + $rows = $database->select($sql, $parameters, 'all'); + if (is_array($rows) && @sizeof($rows) != 0) { + $x = 0; + foreach ($rows as $row) { + //copy data + $array[$this->table][$x] = $row; + + //add copy to the description + $array[$this->table][$x][$this->name.'_uuid'] = uuid(); + $array[$this->table][$x][$this->description_field] = trim($row[$this->description_field]).' ('.$text['label-copy'].')'; + + //increment the id + $x++; + } + } + unset($sql, $parameters, $rows, $row); + } + + //save the changes and set the message + if (is_array($array) && @sizeof($array) != 0) { + //save the array + $database = new database; + $database->app_name = $this->app_name; + $database->app_uuid = $this->app_uuid; + $database->save($array); + unset($array); + + //set message + message::add($text['message-copy']); + } + unset($records); + } + } + } + + } +} + +?> diff --git a/app/extension_settings/root.php b/app/extension_settings/root.php new file mode 100755 index 0000000000..6fdf32f37b --- /dev/null +++ b/app/extension_settings/root.php @@ -0,0 +1,90 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ + +// make sure the PATH_SEPARATOR is defined + umask(2); + if (!defined("PATH_SEPARATOR")) { + if (strpos($_ENV["OS"], "Win") !== false) { + define("PATH_SEPARATOR", ";"); + } else { + define("PATH_SEPARATOR", ":"); + } + } + + if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html'; + + // make sure the document_root is set + $_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]); + if(PHP_SAPI == 'cli'){ + chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME)); + $script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]); + $dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME)); + if (file_exists('/project_root.php')) { + $path = '/'; + } else { + $i = 1; + $path = ''; + while ($i < count($dirs)) { + $path .= '/' . $dirs[$i]; + if (file_exists($path. '/project_root.php')) { + break; + } + $i++; + } + } + $_SERVER["DOCUMENT_ROOT"] = $path; + }else{ + $_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]); + } + $_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]); +// try to detect if a project path is being used + if (!defined('PROJECT_PATH')) { + if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) { + define('PROJECT_PATH', '/fusionpbx'); + } elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) { + define('PROJECT_PATH', ''); + } else { + $dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME))); + $i = 1; + $path = $_SERVER["DOCUMENT_ROOT"]; + while ($i < count($dirs)) { + $path .= '/' . $dirs[$i]; + if (file_exists($path. '/project_root.php')) { + break; + } + $i++; + } + if(!file_exists($path. '/project_root.php')){ + die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance"); + } + $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); + define('PROJECT_PATH', $project_path); + } + $_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH); + set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]); + } + +?> \ No newline at end of file diff --git a/app/extensions/app_config.php b/app/extensions/app_config.php index ad73a13afb..1f7bee03d4 100644 --- a/app/extensions/app_config.php +++ b/app/extensions/app_config.php @@ -48,22 +48,9 @@ $apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${description}"; $y++; $apps[$x]['destinations'][$y]['type'] = "sql"; - $apps[$x]['destinations'][$y]['label'] = "loopback"; - $apps[$x]['destinations'][$y]['name'] = "extensions"; - $apps[$x]['destinations'][$y]['sql'] = "select extension_uuid, extension, number_alias, user_context as context, description from v_extensions "; - $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and enabled = 'true' "; - $apps[$x]['destinations'][$y]['order_by'] = "number_alias, extension asc"; - $apps[$x]['destinations'][$y]['field']['extension_uuid'] = "extension_uuid"; - $apps[$x]['destinations'][$y]['field']['destination'] = "number_alias,extension"; - $apps[$x]['destinations'][$y]['field']['context'] = "user_context"; - $apps[$x]['destinations'][$y]['field']['description'] = "description"; - $apps[$x]['destinations'][$y]['select_value']['user_contact'] = "loopback/\${destination}/\${context}"; - $apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${description}"; - $y++; - $apps[$x]['destinations'][$y]['type'] = "sql"; $apps[$x]['destinations'][$y]['label'] = "call_groups"; $apps[$x]['destinations'][$y]['name'] = "extensions"; - $apps[$x]['destinations'][$y]['sql']['pgsql'] = "select extension_uuid, distinct(unnest(string_to_array(call_group, ','))) as destination from v_extensions "; + $apps[$x]['destinations'][$y]['sql']['pgsql'] = "select distinct(unnest(string_to_array(call_group, ','))) as destination from v_extensions "; $apps[$x]['destinations'][$y]['sql']['sqlite'] = "select distinct(call_group) as destination from v_extensions"; $apps[$x]['destinations'][$y]['sql']['mysql'] = "select distinct(call_group) as destination from v_extensions"; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and call_group <> '' and enabled = 'true' "; @@ -97,6 +84,10 @@ $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "extension_extension"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "number_alias"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; //$apps[$x]['permissions'][$y]['groups'][] = "admin"; @@ -169,6 +160,8 @@ $apps[$x]['permissions'][$y]['name'] = "emergency_caller_id_number"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "emergency_caller_id_select"; + $y++; $apps[$x]['permissions'][$y]['name'] = "extension_user_record"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; @@ -213,6 +206,26 @@ $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "user"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "extension_directory"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $apps[$x]['permissions'][$y]['groups'][] = "user"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "extension_limit"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $apps[$x]['permissions'][$y]['groups'][] = "user"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "extension_call_group"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $apps[$x]['permissions'][$y]['groups'][] = "user"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "extension_hold_music"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $apps[$x]['permissions'][$y]['groups'][] = "user"; //default settings @@ -578,12 +591,6 @@ $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_follow_me"; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "follow_me_uuid"; $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_caller_id_uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_enabled"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; diff --git a/app/extensions/app_languages.php b/app/extensions/app_languages.php index 4aad443c58..5b4801b597 100644 --- a/app/extensions/app_languages.php +++ b/app/extensions/app_languages.php @@ -1150,8 +1150,8 @@ $text['label-hold_music']['de-ch'] = "Wartemusik"; //copied from de-de $text['label-hold_music']['de-de'] = "Wartemusik"; $text['label-hold_music']['es-cl'] = "Música en Espera"; $text['label-hold_music']['es-mx'] = "Música en Espera"; //copied from es-cl -$text['label-hold_music']['fr-ca'] = "Musique de Garde"; //copied from fr-fr -$text['label-hold_music']['fr-fr'] = "Musique de Garde"; +$text['label-hold_music']['fr-ca'] = "Musique d'attente"; //copied from fr-fr +$text['label-hold_music']['fr-fr'] = "Musique d'attente"; $text['label-hold_music']['he-il'] = "מוסיקה בהמתנה"; $text['label-hold_music']['it-it'] = "Musica di Attesa"; $text['label-hold_music']['nl-nl'] = "Wachtmuziek"; @@ -2460,8 +2460,8 @@ $text['description-hold_music']['de-ch'] = "Wählen Sie die Wartemusik Kategorie $text['description-hold_music']['de-de'] = "Wählen Sie die Wartemusik Kategorie."; $text['description-hold_music']['es-cl'] = "Ingrese la categoría de música en espera aquí"; $text['description-hold_music']['es-mx'] = "Ingrese la categoría de música en espera aquí"; //copied from es-cl -$text['description-hold_music']['fr-ca'] = "Choisir la musique de garde."; //copied from fr-fr -$text['description-hold_music']['fr-fr'] = "Choisir la musique de garde."; +$text['description-hold_music']['fr-ca'] = "Choisir la musique d'attente'."; //copied from fr-fr +$text['description-hold_music']['fr-fr'] = "Choisir la musique d'attente."; $text['description-hold_music']['he-il'] = ""; $text['description-hold_music']['it-it'] = "Seleziona la categoria di Musica d'attesa."; $text['description-hold_music']['nl-nl'] = "Kies Wachtmuziek hier."; @@ -2746,8 +2746,8 @@ $text['description-dial_string']['ru-ru'] = "Местоположение кон $text['description-dial_string']['sv-se'] = "Plats för enheten."; $text['description-dial_string']['uk-ua'] = ""; -$text['description-cidr']['en-us'] = "Enter the CIDR here."; -$text['description-cidr']['en-gb'] = "Enter the CIDR here."; +$text['description-cidr']['en-us'] = "Enter allowed address/ranges in CIDR notation (comma separated)."; +$text['description-cidr']['en-gb'] = "Enter allowed address/ranges in CIDR notation (comma separated)."; $text['description-cidr']['ar-eg'] = ""; $text['description-cidr']['de-at'] = "Geben Sie hier die Beschränkung der IP Adresse an (z.B. 1.2.3.4/32)"; //copied from de-de $text['description-cidr']['de-ch'] = "Geben Sie hier die Beschränkung der IP Adresse an (z.B. 1.2.3.4/32)"; //copied from de-de diff --git a/app/extensions/extension_download.php b/app/extensions/extension_download.php index 4ade0e978c..04292c47df 100644 --- a/app/extensions/extension_download.php +++ b/app/extensions/extension_download.php @@ -92,7 +92,6 @@ $available_columns[] = 'follow_me_uuid'; $available_columns[] = 'enabled'; $available_columns[] = 'description'; - $available_columns[] = 'forward_caller_id_uuid'; $available_columns[] = 'absolute_codec_string'; $available_columns[] = 'forward_user_not_registered_destination'; $available_columns[] = 'forward_user_not_registered_enabled'; @@ -210,4 +209,4 @@ //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index e32e24f1ea..89a6319d1f 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -76,7 +76,16 @@ if (count($_POST) > 0) { //get the values from the HTTP POST and save them as PHP variables - $extension = str_replace(' ','-',$_POST["extension"]); + if ($action == 'add' || permission_exists("extension_extension")) { + $extension = str_replace(' ','-',$_POST["extension"]); + } + else { //lookup extension based on submitted uuid + $sql = "select extension from v_extensions where extension_uuid = :extension_uuid"; + $parameters['extension_uuid'] = $extension_uuid; + $database = new database; + $extension = $database->select($sql, $parameters, 'column'); + unset($sql, $parameters); + } $number_alias = $_POST["number_alias"]; $password = $_POST["password"]; @@ -133,6 +142,24 @@ $voicemail_id = null; } + $cidrs = preg_split("/[\s,]+/", $cidr); + $ips = array(); + foreach ($cidrs as $ipaddr){ + $cx = strpos($ipaddr, '/'); + if ($cx){ + $subnet = (int)(substr($ipaddr, $cx+1)); + $ipaddr = substr($ipaddr, 0, $cx); + } + else{ + $subnet = 32; + } + + if(($addr = inet_pton($ipaddr)) !== false){ + $ips[] = $ipaddr.'/'.$subnet; + } + } + $cidr = implode(',',$ips); + //change toll allow delimiter $toll_allow = str_replace(',',':', $toll_allow); @@ -267,15 +294,6 @@ return; } - //set the default user context - if (permission_exists("extension_user_context")) { - //allow a user assigned to super admin to change the user_context - } - else { - //if the user_context was not set then set the default value - $user_context = $_SESSION['domain_name']; - } - //prevent users from bypassing extension limit by using range if ($_SESSION['limit']['extensions']['numeric'] != '') { if ($total_extensions + $range > $_SESSION['limit']['extensions']['numeric']){ @@ -396,13 +414,24 @@ if (permission_exists("emergency_caller_id_number")) { $array["extensions"][$i]["emergency_caller_id_number"] = $emergency_caller_id_number; } - $array["extensions"][$i]["directory_first_name"] = $directory_first_name; - $array["extensions"][$i]["directory_last_name"] = $directory_last_name; - $array["extensions"][$i]["directory_visible"] = $directory_visible; - $array["extensions"][$i]["directory_exten_visible"] = $directory_exten_visible; - $array["extensions"][$i]["limit_max"] = $limit_max; - $array["extensions"][$i]["limit_destination"] = $limit_destination; - $array["extensions"][$i]["user_context"] = $user_context; + if (permission_exists("extension_directory")) { + $array["extensions"][$i]["directory_first_name"] = $directory_first_name; + $array["extensions"][$i]["directory_last_name"] = $directory_last_name; + $array["extensions"][$i]["directory_visible"] = $directory_visible; + $array["extensions"][$i]["directory_exten_visible"] = $directory_exten_visible; + } + if (permission_exists("extension_limit")) { + $array["extensions"][$i]["limit_max"] = $limit_max; + $array["extensions"][$i]["limit_destination"] = $limit_destination; + } + if (permission_exists("extension_user_context")) { + $array["extensions"][$i]["user_context"] = $user_context; + } + else { + if ($action == "add") { + $array["extensions"][$i]["user_context"] = $_SESSION['domain_name']; + } + } if (permission_exists('extension_missed_call')) { $array["extensions"][$i]["missed_call_app"] = $missed_call_app; $array["extensions"][$i]["missed_call_data"] = $missed_call_data; @@ -413,12 +442,16 @@ if (strlen($call_timeout) > 0) { $array["extensions"][$i]["call_timeout"] = $call_timeout; } - $array["extensions"][$i]["call_group"] = $call_group; + if (permission_exists("extension_call_group")) { + $array["extensions"][$i]["call_group"] = $call_group; + } $array["extensions"][$i]["call_screen_enabled"] = $call_screen_enabled; if (permission_exists('extension_user_record')) { $array["extensions"][$i]["user_record"] = $user_record; } - $array["extensions"][$i]["hold_music"] = $hold_music; + if (permission_exists('extension_hold_music')) { + $array["extensions"][$i]["hold_music"] = $hold_music; + } $array["extensions"][$i]["auth_acl"] = $auth_acl; if (permission_exists("extension_cidr")) { $array["extensions"][$i]["cidr"] = $cidr; @@ -535,6 +568,7 @@ $array["voicemails"][$i]["voicemail_enabled"] = $voicemail_enabled; $array["voicemails"][$i]["voicemail_description"] = $description; $array["voicemails"][$i]["voicemail_tutorial"] = $voicemail_tutorial; + $array["voicemails"][$i]["voicemail_transcription_enabled"] = $_SESSION['voicemail']['transcription_enabled_default']['boolean'] ?: false; } } @@ -622,11 +656,24 @@ } //clear the cache + if (!permission_exists("extension_user_context") && $action == "update") { + $sql = "select user_context from v_extensions "; + $sql .= "where extension_uuid = :extension_uuid "; + $parameters['extension_uuid'] = $extension_uuid; + $database = new database; + $user_context = $database->select($sql, $parameters, 'column'); + } $cache = new cache; $cache->delete("directory:".$extension."@".$user_context); if (permission_exists('number_alias') && strlen($number_alias) > 0) { $cache->delete("directory:".$number_alias."@".$user_context); } + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + } //set the message and redirect @@ -802,6 +849,19 @@ $destinations = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); +//get the emergency destinations + if (permission_exists('emergency_caller_id_select')) { + $sql = "select * from v_destinations "; + $sql .= "where domain_uuid = :domain_uuid "; + $sql .= "and destination_type = 'inbound' "; + $sql .= "and destination_type_emergency = 1 "; + $sql .= "order by destination_number asc "; + $parameters['domain_uuid'] = $domain_uuid; + $database = new database; + $emergency_destinations = $database->select($sql, $parameters, 'all'); + unset($sql, $parameters); + } + //change toll allow delimiter $toll_allow = str_replace(':',',', $toll_allow); @@ -836,7 +896,7 @@ echo " document.iform.range_to.disabled = endis;\n"; echo "}\n"; echo "\n"; - if (permission_exists(extension_advanced)) { + if (permission_exists('extension_advanced')) { echo "function show_advanced_config() {\n"; echo " $('#show_advanced_box').slideToggle();\n"; echo " $('#show_advanced').slideToggle();\n"; @@ -884,12 +944,13 @@ echo button::create(['type'=>'button','label'=>$text['button-call_forward'],'icon'=>'project-diagram','style'=>$button_margin,'link'=>'../calls/call_edit.php?id='.urlencode($extension_uuid)]); unset($button_margin); } + if (permission_exists('extension_setting_view')) { + echo button::create(['type'=>'button','label'=>$text['button-settings'],'icon'=>$_SESSION['theme']['button_icon_settings'],'id'=>'btn_settings','style'=>'','link'=>PROJECT_PATH.'/app/extension_settings/extension_settings.php?id='.urlencode($extension_uuid)]); + } if (permission_exists('extension_copy')) { echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','style'=>'margin-left: 15px;','onclick'=>"copy_extension();"]); } - if (permission_exists('domain_setting_view') && file_exists(PROJECT_PATH.'/app/extension_settings/app_config.php')) { - echo button::create(['type'=>'button','label'=>$text['button-settings'],'icon'=>$_SESSION['theme']['button_icon_settings'],'id'=>'btn_settings','style'=>'','link'=>PROJECT_PATH.'/app/extension_settings/extension_settings.php?id='.urlencode($extension_uuid)]); - } + } echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','style'=>'margin-left: 15px;','onclick'=>'submit_form();']); echo "
\n"; @@ -903,10 +964,15 @@ echo " ".$text['label-extension']."\n"; echo "\n"; echo "\n"; - echo " \n"; - echo " \n"; //help defeat browser auto-fill - echo "
\n"; - echo $text['description-extension']."\n"; + if ($action == "add" || permission_exists("extension_extension")) { + echo " \n"; + echo " \n"; //help defeat browser auto-fill + echo "
\n"; + echo $text['description-extension']."\n"; + } + else { + echo escape($extension); + } echo "\n"; echo "\n"; @@ -1300,7 +1366,31 @@ echo " ".$text['label-emergency_caller_id_name']."\n"; echo "\n"; echo "\n"; - if (permission_exists('outbound_caller_id_select')) { + if (permission_exists('emergency_caller_id_select')) { + if (count($emergency_destinations) > 0) { + echo " \n"; + } + else { + echo " \n"; + } + } + elseif (permission_exists('outbound_caller_id_select')) { if (count($destinations) > 0) { echo " \n"; + //echo " \n"; Don't allow no selection when validating emergency numbers this way + foreach ($emergency_destinations as &$row) { + $tmp = $row["destination_caller_id_number"]; + if(strlen($tmp) == 0){ + $tmp = $row["destination_number"]; + } + if(strlen($tmp) > 0){ + if ($emergency_caller_id_number == $tmp) { + echo " \n"; + } + else { + echo " \n"; + } + } + } + echo " \n"; + } + else { + echo " \n"; + } + } + elseif (permission_exists('outbound_caller_id_select')) { if (count($destinations) > 0) { echo " \n"; } echo "
\n"; - if (permission_exists('outbound_caller_id_select') && count($destinations) > 0) { + if (permission_exists('emergency_caller_id_select') && count($emergency_destinations) > 0){ + echo $text['description-emergency_caller_id_number-select']."\n"; + } + elseif (permission_exists('outbound_caller_id_select') && count($destinations) > 0) { echo $text['description-emergency_caller_id_number-select']."\n"; } else { @@ -1382,89 +1499,93 @@ echo "\n"; } - echo "\n"; - echo "\n"; - echo " ".$text['label-directory_full_name']."\n"; - echo "\n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo $text['description-directory_full_name']."\n"; - echo "\n"; - echo "\n"; + if (permission_exists("extension_directory")) { + echo "\n"; + echo "\n"; + echo " ".$text['label-directory_full_name']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo $text['description-directory_full_name']."\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo " ".$text['label-directory_visible']."\n"; - echo "\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo "
\n"; - echo $text['description-directory_visible']."\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo " ".$text['label-directory_visible']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo "
\n"; + echo $text['description-directory_visible']."\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo " ".$text['label-directory_exten_visible']."\n"; - echo "\n"; - echo "\n"; - echo " \n"; + if ($directory_exten_visible == "true") { + echo " \n"; + } + else { + echo " \n"; + } + if ($directory_exten_visible == "false") { + echo " \n"; + } + else { + echo " \n"; + } + echo " \n"; + echo "
\n"; + echo "
\n"; + echo $text['description-directory_exten_visible']."\n"; + echo "\n"; + echo "\n"; } - else { - echo " \n"; - } - if ($directory_exten_visible == "false") { - echo " \n"; - } - else { - echo " \n"; - } - echo " \n"; - echo "
\n"; - echo "
\n"; - echo $text['description-directory_exten_visible']."\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo " ".$text['label-limit_max']."\n"; - echo "\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-limit_max']."\n"; - echo "\n"; - echo "\n"; + if (permission_exists("extension_limit")) { + echo "\n"; + echo "\n"; + echo " ".$text['label-limit_max']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-limit_max']."\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo " ".$text['label-limit_destination']."\n"; - echo "\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-limit_destination']."\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo " ".$text['label-limit_destination']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-limit_destination']."\n"; + echo "\n"; + echo "\n"; + } if (permission_exists('voicemail_edit') && is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) { echo "\n"; @@ -1593,30 +1714,32 @@ echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo " ".$text['label-call_group']."\n"; - echo "\n"; - echo "\n"; - if (is_array($_SESSION['call group']['name'])) { - echo " \n"; + echo " \n"; + foreach ($_SESSION['call group']['name'] as $name) { + if ($name == $call_group) { + echo " \n"; + } + else { + echo " \n"; + } } + echo " \n"; + } else { + echo " \n"; } - echo " \n"; - } else { - echo " \n"; + echo "
\n"; + echo $text['description-call_group']."\n"; + echo "\n"; + echo "\n"; } - echo "
\n"; - echo $text['description-call_group']."\n"; - echo "\n"; - echo "\n"; if (permission_exists('extension_call_screen')) { echo "\n"; @@ -1683,7 +1806,7 @@ echo "\n"; } - if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/music_on_hold')) { + if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/music_on_hold') && permission_exists('extension_hold_music')) { echo "\n"; echo "\n"; echo " ".$text['label-hold_music']."\n"; diff --git a/app/extensions/extensions.php b/app/extensions/extensions.php index aea7b296d5..ed109b7f04 100644 --- a/app/extensions/extensions.php +++ b/app/extensions/extensions.php @@ -79,6 +79,16 @@ $order_by = $_GET["order_by"]; $order = $_GET["order"]; +//get total extension count for domain +if (is_numeric($_SESSION['limit']['extensions']['numeric'])) { + $sql = "select count(*) from v_extensions "; + $sql .= "where domain_uuid = :domain_uuid "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $database = new database; + $total_extensions = $database->select($sql, $parameters, 'column'); + unset($sql, $parameters); +} + //add the search term $search = strtolower($_GET["search"]); if (strlen($search) > 0) { @@ -101,15 +111,7 @@ $parameters['search'] = '%'.$search.'%'; } -//get total extension count for domain - if (is_numeric($_SESSION['limit']['extensions']['numeric'])) { - $sql = "select count(*) from v_extensions "; - $sql .= "where domain_uuid = :domain_uuid "; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; - $total_extensions = $database->select($sql, $parameters, 'column'); - unset($sql, $parameters); - } + //get total extension count $sql = "select count(*) from v_extensions where true "; diff --git a/app/extensions/resources/classes/extension.php b/app/extensions/resources/classes/extension.php index 29e97884c9..8ee14f4a84 100644 --- a/app/extensions/resources/classes/extension.php +++ b/app/extensions/resources/classes/extension.php @@ -625,12 +625,12 @@ if (!class_exists('extension')) { $this->delete_voicemail && permission_exists('voicemail_delete') && is_array($voicemail_ids) - && @sizeof($voicemail_ids) + && @sizeof($voicemail_ids) != 0 ) { //retrieve voicemail uuids $sql = "select voicemail_uuid as uuid from v_voicemails "; $sql .= "where domain_uuid = :domain_uuid "; - $sql .= "and voicemail_id in (".implode(',', $voicemail_ids).") "; + $sql .= "and voicemail_id in ('".implode("','", $voicemail_ids)."') "; $parameters['domain_uuid'] = $_SESSION['domain_uuid']; $database = new database; $rows = $database->select($sql, $parameters, 'all'); @@ -683,6 +683,11 @@ if (!class_exists('extension')) { $this->xml(); } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-delete']); @@ -787,6 +792,11 @@ if (!class_exists('extension')) { } unset($extensions); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-toggle']); diff --git a/app/fanvil/app_config.php b/app/fanvil/app_config.php index dd6f792bab..c4fe460dab 100644 --- a/app/fanvil/app_config.php +++ b/app/fanvil/app_config.php @@ -655,334 +655,6 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "EGS Syslog Server Port"; $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "68feb973-be9a-42ac-94a1-54263dfde589"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_lldp_tx_enable"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = " LLDP Transmit. 0-Disabled, 1-Enabled"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "f0d1dd5b-7130-428c-bddb-a975d85587f5"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_lldp_refresh"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "60"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "LLDP Refresh Timer. Default 60 seconds"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "10af1d27-ef61-4c7c-94cf-8db797a84ebc"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_lldp_learn"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Use LLDP learned information such as voip vlan"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b4cc791a-5389-4e1f-9f87-e8394b399d64"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_enable_vlan"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable VLAN Support. 0 - NO, 1 - Yes"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "16d74bd9-7f44-4780-a202-3cfcbaa6ef5a"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_lan_port_vlan"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "256"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Default VLAN for phone LAN port."; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "530564ac-17aa-4167-b047-bf764250d91a"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_pc_port_vlan"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Default VLAN for phone PC port."; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "2b72e19b-2437-45c0-9df5-4fef6ac078c6"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_enable_diffserv"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable DiffServ(DSCP) Support. 0 - NO, 1 - Yes"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "86081f7e-af03-41b9-a5af-b5593182c9ff"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_qos_rtp_voice"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Layer 2 QoS 802.1p Priority Value for RTP Voice media"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8050cfbd-44d1-46db-b553-2cc0defd5fc2"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_qos_rtp_video"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Layer 2 QoS 802.1p Priority Value for RTP Video media"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "ddf89377-7303-435c-917a-bdd32579cf36"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_qos_sip"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Layer 2 QoS 802.1p Priority Value for SIP signaling"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b6a89aa6-2e21-489c-8f1f-e819e6ced17b"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_dscp_rtp_voice"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "46"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Layer 3 QoS DSCP Value for RTP Voice media"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "9a22bd5b-c2b0-4c06-bd19-63ef58837011"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_dscp_rtp_video"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "46"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Layer 3 QoS DSCP Value for RTP Video media"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "94effa7d-8c0f-4cca-b617-9d2d24748aa7"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_dscp_sip"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "-1"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Layer 3 QoS DSCP Value for SIP signaling (Disabled by default)"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "49f2ff3f-0628-44fa-a8d2-82cb38fbaf98"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_video_codec"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "H264"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable video codec on sip lines (Only h264 currently supported)"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "be8c1341-3cb6-4aa8-bef5-642ff11199e8"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_syslog_enable"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable Syslog server"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8281507b-80fa-450a-94b7-6f58a7a9e6e1"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_syslog_server"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0.0.0.0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Syslog Server ip"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "db7595a1-318b-49d8-86a6-8ff4b44e30f5"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_syslog_server_port"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "514"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Syslog Server Port number"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "67a916be-35df-44f1-ab12-81756fd1f911"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_default_answer_mode"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "2"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Answer call as audio only or audio with video. 1-Audio, 2-Video"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "bbbdf01c-d760-43cf-958d-e47c54dd3997"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_default_dial_mode"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Dial call as audio only or audio with video. 1-Audio, 2-Video Note: If you set this to video, then video is offered in the first invite which can cause your call to hang or not complete if going through a sip trunk provider."; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "37ddabf0-8d7c-494f-b381-5bc4e3048bff"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_enable_auto_upgrade"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable firmware auto upgrade 0 - NO, 1 - Yes"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5a2a79c3-befb-4b7a-998d-3f0bfc9fcde4"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_upgrade_server_1"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "https://server.yourdomain.com/app/fanvil/resources/firmware"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Auto upgrade firmware server 1."; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "de60a8fb-628a-4ee3-a76a-ff3e0a7f045f"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_upgrade_server_2"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "https://server2.yourdomain.com/app/fanvil/resources/firmware"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Auto upgrade firmware server 2."; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "09134520-647a-4a86-bffd-d927aff2b33b"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_upgrade_interval"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "24"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Check for firmware every X hours."; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3ca2b12b-21f1-4a6d-a0eb-8670105c77d9"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_i20s"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "i20S2.1.1.3664T20180809203309.z"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = " Filename of the i20S firmware ROM"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "d07be0b3-a34b-4739-a227-766231e5bb52"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_i23s"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "i23S2.1.1.3664T20180809204215.z"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = " Filename of the i23S firmware ROM"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "6e0d313d-e44a-446f-9274-99e778d87cf5"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_i30"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "i302.1.1.3664T20180809203614.z"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = " Filename of the i30 firmware ROM"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "a3cf0c35-4f92-4607-84a6-b06b29d67134"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_i31s"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "i31S2.1.1.3664T20180809203916.z"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = " Filename of the i31S firmware ROM"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "235ccea6-5ed0-45ff-a03f-d0cbc6ebaf01"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_x2p"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "x2-mono2.8.0.6251T20181017203533.z"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = " Filename of the X2P firmware ROM"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8912437c-7142-4a85-b4aa-f83c1e50ad30"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_x3"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "x3s2.8.0.6251T20181017202549.z"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = " Filename of the X3S/G firmware ROM"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "756059c7-b754-4285-be22-0d51c82d62b3"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_x4"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "x42.8.0.6251T20181017202853.z"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = " Filename of the X4/G firmware ROM"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "122ba840-7dee-4c8e-a93c-739681b4b1d4"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_x5s"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "x5s-6900-P0.13.3-1.8.0-2698T2018-09-30-15.23.04.z"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = " Filename of the X5S firmware ROM"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "32635e1c-dcb8-44e1-a0c4-5209b4f84392"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_firmware_x6"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "x6-6914-P0.13.3-1.8.0-2697T2018-09-30-15.10.00.z"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = " Filename of the X6 firmware ROM"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "4b7f56f3-31a9-46dd-b588-35b253024b1f"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_egs_switch_mode"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "0 - Monostable, 1 - Bistable"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "316ce083-69ba-4932-be02-845d3ed8f585"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_egs_enable_card_reader"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable RFID Card Reader. 0 - NO, 1 - Yes"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7226d18c-7d49-449b-be7b-8cfb46c1ddb3"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_egs_enable_indoor_open"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Use indoor switch to unlock the door. 0 - NO, 1 - Yes"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "83dce10f-6254-490c-af89-a2a004890c47"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_egs_enable_access_table"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Default: Enabled. 0 - NO, 1 - Yes"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "d4ffbf45-5abe-4ef3-9cf7-f222257d5633"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_egs_opening_door_code_remote"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "*"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Default: *"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c51013fc-765e-4758-99a9-2738cfe9a7dd"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_egs_opening_door_code_local"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "6789"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Default: 6789"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "0c5fe247-0361-4c69-a247-d14b5417e53e"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_egs_enable_syslog"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable EGS Syslog. 0 - NO, 1 - Yes"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "1a74a177-49fc-432e-b10e-39c7d0c7ddc4"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_egs_log_server"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0.0.0.0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "EGS Syslog Server. Hostname or IP"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3fb2a87b-89b1-4d53-923d-c1478aec4f58"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_egs_log_port"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "514"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "EGS Syslog Server Port"; - $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "108f26c5-568d-4cc0-af94-097ecb600b8f"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "fanvil_provision_url"; diff --git a/app/fax/app_config.php b/app/fax/app_config.php index c6bb87aa7d..5df9f1f9fa 100644 --- a/app/fax/app_config.php +++ b/app/fax/app_config.php @@ -175,6 +175,10 @@ $apps[$x]['permissions'][$y]['name'] = "fax_destinations"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "fax_extension_view_domain"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; //default settings $y=0; diff --git a/app/fax/app_languages.php b/app/fax/app_languages.php index 914cc3685d..751e3ddf2d 100644 --- a/app/fax/app_languages.php +++ b/app/fax/app_languages.php @@ -303,8 +303,8 @@ $text['option-fax-resolution-superfine']['de-ch'] = "Superfein"; //copied from d $text['option-fax-resolution-superfine']['de-de'] = "Superfein"; $text['option-fax-resolution-superfine']['es-cl'] = "Superfino"; $text['option-fax-resolution-superfine']['es-mx'] = "Superfino"; //copied from es-cl -$text['option-fax-resolution-superfine']['fr-ca'] = "Superfin"; //copied from fr-fr -$text['option-fax-resolution-superfine']['fr-fr'] = "Superfin"; +$text['option-fax-resolution-superfine']['fr-ca'] = "Superfine"; //copied from fr-fr +$text['option-fax-resolution-superfine']['fr-fr'] = "Superfine"; $text['option-fax-resolution-superfine']['he-il'] = ""; $text['option-fax-resolution-superfine']['it-it'] = "Superfine"; $text['option-fax-resolution-superfine']['nl-nl'] = ""; @@ -324,8 +324,8 @@ $text['option-fax-resolution-normal']['de-ch'] = "Normal"; //copied from de-de $text['option-fax-resolution-normal']['de-de'] = "Normal"; $text['option-fax-resolution-normal']['es-cl'] = "Normal"; $text['option-fax-resolution-normal']['es-mx'] = "Normal"; //copied from es-cl -$text['option-fax-resolution-normal']['fr-ca'] = "Normal"; //copied from fr-fr -$text['option-fax-resolution-normal']['fr-fr'] = "Normal"; +$text['option-fax-resolution-normal']['fr-ca'] = "Normale"; //copied from fr-fr +$text['option-fax-resolution-normal']['fr-fr'] = "Normale"; $text['option-fax-resolution-normal']['he-il'] = ""; $text['option-fax-resolution-normal']['it-it'] = "Normale"; $text['option-fax-resolution-normal']['nl-nl'] = ""; @@ -492,8 +492,8 @@ $text['label-sent']['de-ch'] = "Gesendet"; //copied from de-de $text['label-sent']['de-de'] = "Gesendet"; $text['label-sent']['es-cl'] = "Enviado"; $text['label-sent']['es-mx'] = "Enviado"; //copied from es-cl -$text['label-sent']['fr-ca'] = "Envoyé"; //copied from fr-fr -$text['label-sent']['fr-fr'] = "Envoyé"; +$text['label-sent']['fr-ca'] = "Envoyés"; //copied from fr-fr +$text['label-sent']['fr-fr'] = "Envoyés"; $text['label-sent']['he-il'] = ""; $text['label-sent']['it-it'] = "Spedito"; $text['label-sent']['nl-nl'] = ""; @@ -1017,8 +1017,8 @@ $text['label-fax_files']['de-ch'] = "Fax Dateien"; //copied from de-de $text['label-fax_files']['de-de'] = "Fax Dateien"; $text['label-fax_files']['es-cl'] = "Facsímil del Archivo(s)"; $text['label-fax_files']['es-mx'] = "Facsímil del Archivo(s)"; //copied from es-cl -$text['label-fax_files']['fr-ca'] = "Télécopieur Fichier(s)"; //copied from fr-fr -$text['label-fax_files']['fr-fr'] = "Télécopieur Fichier(s)"; +$text['label-fax_files']['fr-ca'] = "Fichier(s) à Télécopier"; //copied from fr-fr +$text['label-fax_files']['fr-fr'] = "Fichier(s) à Télécopier"; $text['label-fax_files']['he-il'] = ""; $text['label-fax_files']['it-it'] = "File(s) FAX"; $text['label-fax_files']['nl-nl'] = ""; @@ -1332,8 +1332,8 @@ $text['label-fax-subject']['de-ch'] = "Betreff"; //copied from de-de $text['label-fax-subject']['de-de'] = "Betreff"; $text['label-fax-subject']['es-cl'] = "Asunto"; $text['label-fax-subject']['es-mx'] = "Asunto"; //copied from es-cl -$text['label-fax-subject']['fr-ca'] = "Sujet"; //copied from fr-fr -$text['label-fax-subject']['fr-fr'] = "Sujet"; +$text['label-fax-subject']['fr-ca'] = "Objet"; //copied from fr-fr +$text['label-fax-subject']['fr-fr'] = "Objet"; $text['label-fax-subject']['he-il'] = "נושא"; $text['label-fax-subject']['it-it'] = "Oggetto"; $text['label-fax-subject']['nl-nl'] = ""; @@ -1542,8 +1542,8 @@ $text['label-fax-footer']['de-ch'] = "Fußzeile"; //copied from de-de $text['label-fax-footer']['de-de'] = "Fußzeile"; $text['label-fax-footer']['es-cl'] = "Pie de Página"; $text['label-fax-footer']['es-mx'] = "Pie de Página"; //copied from es-cl -$text['label-fax-footer']['fr-ca'] = "Footer"; //copied from fr-fr -$text['label-fax-footer']['fr-fr'] = "Footer"; +$text['label-fax-footer']['fr-ca'] = "Bas de page"; //copied from fr-fr +$text['label-fax-footer']['fr-fr'] = "Bas de page"; $text['label-fax-footer']['he-il'] = "תחתית עמוד"; $text['label-fax-footer']['it-it'] = "PiÃè di pagina"; $text['label-fax-footer']['nl-nl'] = ""; @@ -2697,8 +2697,8 @@ $text['description-fax_files']['de-ch'] = "Wählen Sie die Datei(en) zum senden. $text['description-fax_files']['de-de'] = "Wählen Sie die Datei(en) zum senden."; $text['description-fax_files']['es-cl'] = "Seleccione el archivo a subir y enviar como fax."; $text['description-fax_files']['es-mx'] = "Seleccione el archivo a subir y enviar como fax."; //copied from es-cl -$text['description-fax_files']['fr-ca'] = "Choisir un fichier à télécharger pour être émis en tant que Fax."; //copied from fr-fr -$text['description-fax_files']['fr-fr'] = "Choisir un fichier à télécharger pour être émis en tant que Fax."; +$text['description-fax_files']['fr-ca'] = "Choisir un fichier à télécharger pour émettre en tant que Fax."; //copied from fr-fr +$text['description-fax_files']['fr-fr'] = "Choisir un fichier à télécharger pour émettre en tant que Fax."; $text['description-fax_files']['he-il'] = ""; $text['description-fax_files']['it-it'] = "Scegli i/il file da caricare e spedire."; $text['description-fax_files']['nl-nl'] = ""; @@ -3537,8 +3537,8 @@ $text['description-2']['de-ch'] = "Um ein Fax zu senden, laden Sie eine PDF oder $text['description-2']['de-de'] = "Um ein Fax zu senden, laden Sie eine PDF oder eine TIF Datei hoch. Um ein Deckblatt zu generieren, geben Sie einen Betreff und/oder eine Nachricht unten an."; $text['description-2']['es-cl'] = "Para enviar un fax, cargar un archivo PDF o TIF. Para generar una hoja de presentación, escriba un asunto y / o mensaje a continuación."; $text['description-2']['es-mx'] = "Para enviar un fax, cargar un archivo PDF o TIF. Para generar una hoja de presentación, escriba un asunto y / o mensaje a continuación."; //copied from es-cl -$text['description-2']['fr-ca'] = "Pour envoyer un fax, télécharger un fichier PDF ou TIF. Pour générer une feuille de couverture, entrer un sujet et / ou un message ci-dessous."; //copied from fr-fr -$text['description-2']['fr-fr'] = "Pour envoyer un fax, télécharger un fichier PDF ou TIF. Pour générer une feuille de couverture, entrer un sujet et / ou un message ci-dessous."; +$text['description-2']['fr-ca'] = "Pour envoyer un fax, téléchargez un fichier PDF ou TIF. Pour générer une feuille de couverture, entrez un sujet et / ou un message ci-dessous."; //copied from fr-fr +$text['description-2']['fr-fr'] = "Pour envoyer un fax, téléchargez un fichier PDF ou TIF. Pour générer une feuille de couverture, entrez un sujet et / ou un message ci-dessous."; $text['description-2']['he-il'] = ""; $text['description-2']['it-it'] = "Per spedire un fax, carica un PDF o un TIF. Per generare una copertina, inserisci un oggetto e/o un Messaggio qui sotto."; $text['description-2']['nl-nl'] = ""; @@ -3747,8 +3747,8 @@ $text['button-preview']['de-ch'] = "Vorschau"; //copied from de-de $text['button-preview']['de-de'] = "Vorschau"; $text['button-preview']['es-cl'] = "Prevista"; $text['button-preview']['es-mx'] = "Prevista"; //copied from es-cl -$text['button-preview']['fr-ca'] = "Pré-Visualisation"; //copied from fr-fr -$text['button-preview']['fr-fr'] = "Pré-Visualisation"; +$text['button-preview']['fr-ca'] = "Aperçu"; //copied from fr-fr +$text['button-preview']['fr-fr'] = "Aperçu"; $text['button-preview']['he-il'] = "תצוגה מקדימה"; $text['button-preview']['it-it'] = "Anteprima"; $text['button-preview']['nl-nl'] = ""; diff --git a/app/fax/fax.php b/app/fax/fax.php index d5e3e22ded..486172ff07 100644 --- a/app/fax/fax.php +++ b/app/fax/fax.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2019 + Portions created by the Initial Developer are Copyright (C) 2008-2021 the Initial Developer. All Rights Reserved. Contributor(s): @@ -75,37 +75,51 @@ $order_by = $_GET["order_by"]; $order = $_GET["order"]; -//add the search term - $search = strtolower($_GET["search"]); - if (strlen($search) > 0) { - $sql_search = "and ("; - $sql_search .= "lower(fax_name) like :search "; - $sql_search .= "or lower(fax_email) like :search "; - $sql_search .= "or lower(fax_extension) like :search "; - $sql_search .= "or lower(fax_destination_number) like :search "; - $sql_search .= "or lower(fax_caller_id_name) like :search "; - $sql_search .= "or lower(fax_caller_id_number) like :search "; - $sql_search .= "or lower(fax_forward_number) like :search "; - $sql_search .= "or lower(fax_description) like :search "; - $sql_search .= ") "; - $parameters['search'] = '%'.$search.'%'; +//add the search + if (isset($_GET["search"])) { + $search = strtolower($_GET["search"]); } //get record counts - if (if_group("superadmin") || if_group("admin")) { - //show all fax extensions - $sql = "select count(*) from v_fax as f "; + if (permission_exists('fax_extension_view_domain')) { + //count the fax extensions + $sql = "select count(f.fax_uuid) from v_fax as f "; $sql .= "where f.domain_uuid = :domain_uuid "; - $sql .= $sql_search; + if (isset($search)) { + $sql = "and ("; + $sql .= " lower(fax_name) like :search "; + $sql .= " or lower(fax_email) like :search "; + $sql .= " or lower(fax_extension) like :search "; + $sql .= " or lower(fax_destination_number) like :search "; + $sql .= " or lower(fax_caller_id_name) like :search "; + $sql .= " or lower(fax_caller_id_number) like :search "; + $sql .= " or lower(fax_forward_number) like :search "; + $sql .= " or lower(fax_description) like :search "; + $sql .= ") "; + $parameters['search'] = '%'.$search.'%'; + } $parameters['domain_uuid'] = $_SESSION['domain_uuid']; } else { - //show only assigned fax extensions - $sql = "select count(*) from v_fax as f, v_fax_users as u "; + //ciount the assigned fax extensions + $sql = "select count(f.fax_uuid) "; + $sql .= "from v_fax as f, v_fax_users as u "; $sql .= "where f.fax_uuid = u.fax_uuid "; $sql .= "and f.domain_uuid = :domain_uuid "; $sql .= "and u.user_uuid = :user_uuid "; - $sql .= $sql_search; + if (isset($search)) { + $sql = "and ("; + $sql .= " lower(fax_name) like :search "; + $sql .= " or lower(fax_email) like :search "; + $sql .= " or lower(fax_extension) like :search "; + $sql .= " or lower(fax_destination_number) like :search "; + $sql .= " or lower(fax_caller_id_name) like :search "; + $sql .= " or lower(fax_caller_id_number) like :search "; + $sql .= " or lower(fax_forward_number) like :search "; + $sql .= " or lower(fax_description) like :search "; + $sql .= ") "; + $parameters['search'] = '%'.$search.'%'; + } $parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['user_uuid'] = $_SESSION['user_uuid']; } @@ -120,10 +134,54 @@ list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true); $offset = $rows_per_page * $page; -//get records - $sql = str_replace('count(*)', '*', $sql); +//get fax extensions + if (permission_exists('fax_extension_view_domain')) { + //show all fax extensions + $sql = "select f.fax_uuid, fax_extension, fax_prefix, fax_name, fax_email, fax_description "; + $sql .= "from v_fax as f "; + $sql .= "where f.domain_uuid = :domain_uuid "; + if (isset($search)) { + $sql = "and ("; + $sql .= " lower(fax_name) like :search "; + $sql .= " or lower(fax_email) like :search "; + $sql .= " or lower(fax_extension) like :search "; + $sql .= " or lower(fax_destination_number) like :search "; + $sql .= " or lower(fax_caller_id_name) like :search "; + $sql .= " or lower(fax_caller_id_number) like :search "; + $sql .= " or lower(fax_forward_number) like :search "; + $sql .= " or lower(fax_description) like :search "; + $sql .= ") "; + $parameters['search'] = '%'.$search.'%'; + } + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + } + else { + //show only assigned fax extensions + $sql = "select f.fax_uuid, fax_extension, fax_prefix, fax_name, fax_email, fax_description "; + $sql .= "from v_fax as f, v_fax_users as u "; + $sql .= "where f.fax_uuid = u.fax_uuid "; + $sql .= "and f.domain_uuid = :domain_uuid "; + $sql .= "and u.user_uuid = :user_uuid "; + if (isset($search)) { + $sql = "and ("; + $sql .= " lower(fax_name) like :search "; + $sql .= " or lower(fax_email) like :search "; + $sql .= " or lower(fax_extension) like :search "; + $sql .= " or lower(fax_destination_number) like :search "; + $sql .= " or lower(fax_caller_id_name) like :search "; + $sql .= " or lower(fax_caller_id_number) like :search "; + $sql .= " or lower(fax_forward_number) like :search "; + $sql .= " or lower(fax_description) like :search "; + $sql .= ") "; + $parameters['search'] = '%'.$search.'%'; + } + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $parameters['user_uuid'] = $_SESSION['user_uuid']; + } $sql .= order_by($order_by, $order, 'f.fax_name', 'asc'); $sql .= limit_offset($rows_per_page, $offset); +//echo $sql."\n"; +//view_array($parameters); $database = new database; $result = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index 992fc212b1..ae11e2bdc1 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -278,7 +278,9 @@ //prep authorized senders if (sizeof($fax_email_outbound_authorized_senders) > 0) { foreach ($fax_email_outbound_authorized_senders as $sender_num => $sender) { - if ($sender == '' || !valid_email($sender)) { unset($fax_email_outbound_authorized_senders[$sender_num]); } + if ($sender == '' || (substr_count($sender, '@') == 1 && !valid_email($sender)) || substr_count($sender, '.') == 0) { + unset($fax_email_outbound_authorized_senders[$sender_num]); + } } $fax_email_outbound_authorized_senders = strtolower(implode(',', $fax_email_outbound_authorized_senders)); } @@ -356,6 +358,12 @@ //revoke temp permissions $p->delete('fax_add', 'temp'); $p->delete('fax_edit', 'temp'); + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + } //get the dialplan_uuid diff --git a/app/fax/fax_emails.php b/app/fax/fax_emails.php index 943e6516b4..d39859eff3 100644 --- a/app/fax/fax_emails.php +++ b/app/fax/fax_emails.php @@ -170,9 +170,9 @@ if (is_array($result) && @sizeof($result) != 0) { $metadata[0]['from'] = strtolower($tmp[0]['mailbox']."@".$tmp[0]['host']); //check sender - $sender_authorized = false; - if (in_array($metadata[0]['from'],$authorized_senders)) { $sender_authorized = true; } - + $sender_email = $metadata[0]['from']; + $sender_domain = explode('@', $sender_email)[1]; + $sender_authorized = in_array($sender_email, $authorized_senders) || in_array($sender_domain, $authorized_senders) ? true : false; if ($sender_authorized) { //add multi-lingual support diff --git a/app/fax/fax_files.php b/app/fax/fax_files.php index dca315d10d..f4a806b8ef 100644 --- a/app/fax/fax_files.php +++ b/app/fax/fax_files.php @@ -75,7 +75,7 @@ //get fax extension if (is_uuid($_GET["id"])) { $fax_uuid = $_GET["id"]; - if (if_group("superadmin") || if_group("admin")) { + if (permission_exists('fax_extension_view_domain')) { //show all fax extensions $sql = "select fax_name, fax_extension from v_fax "; $sql .= "where domain_uuid = :domain_uuid "; @@ -102,7 +102,7 @@ $fax_extension = $row["fax_extension"]; } else { - if (!if_group("superadmin") && !if_group("admin")) { + if (!permission_exists('fax_extension_view_domain')) { echo "access denied"; exit; } @@ -115,7 +115,6 @@ //download the fax if ($_GET['a'] == "download") { - session_cache_limiter('public'); //test to see if it is in the inbox or sent directory. if ($_GET['type'] == "fax_inbox") { if (file_exists($fax_dir.'/'.$_GET['ext'].'/inbox/'.$_GET['filename'])) { @@ -349,19 +348,12 @@ $page_height = 11.7; $page_size = 'a4'; } - //generate pdf (a work around, as tiff2pdf improperly inverts the colors) - $cmd_tif2pdf = "tiff2pdf -i -u i -p ".$page_size." -w ".$page_width." -l ".$page_height." -f -o ".$dir_fax_temp.'/'.$file_name.".pdf ".$dir_fax.'/'.$file_name.".tif"; - //echo $cmd_tif2pdf."
"; + //generate pdf from tif + $cmd_tif2pdf = "tiff2pdf -u i -p ".$page_size." -w ".$page_width." -l ".$page_height." -f -o ".$dir_fax.'/'.$file_name.".pdf ".$dir_fax.'/'.$file_name.".tif"; exec($cmd_tif2pdf); - chdir($dir_fax_temp); - $cmd_pdf2tif = "gs -q -sDEVICE=tiffg3 -r".$gs_r." -g".$gs_g." -dNOPAUSE -sOutputFile=".$file_name."_temp.tif -- ".$file_name.".pdf -c quit"; - //echo $cmd_pdf2tif."
"; - exec($cmd_pdf2tif); //convert pdf to tif - @unlink($dir_fax_temp.'/'.$file_name.".pdf"); - $cmd_tif2pdf = "tiff2pdf -i -u i -p ".$page_size." -w ".$page_width." -l ".$page_height." -f -o ".$dir_fax.'/'.$file_name.".pdf ".$dir_fax_temp.'/'.$file_name."_temp.tif"; - //echo $cmd_tif2pdf."
"; - exec($cmd_tif2pdf); - @unlink($dir_fax_temp.'/'.$file_name."_temp.tif"); + //clean up temporary files, if any + if (file_exists($dir_fax_temp.'/'.$file_name.'.pdf')) { @unlink($dir_fax_temp.'/'.$file_name.'.pdf'); } + if (file_exists($dir_fax_temp.'/'.$file_name.'.tif')) { @unlink($dir_fax_temp.'/'.$file_name.'.tif'); } } if ($_REQUEST['box'] == 'inbox' && permission_exists('fax_inbox_view')) { @@ -417,4 +409,4 @@ //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/app/fax/fax_files_remote.php b/app/fax/fax_files_remote.php index 8fd24acd68..773b1ba1e3 100644 --- a/app/fax/fax_files_remote.php +++ b/app/fax/fax_files_remote.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2021 the Initial Developer. All Rights Reserved. Contributor(s): @@ -51,7 +51,7 @@ //get fax server uuid, set connection parameters if (is_uuid($fax_uuid)) { - if (if_group("superadmin") || if_group("admin")) { + if (permission_exists('fax_extension_view')) { //show all fax extensions $sql = "select * from v_fax "; $sql .= "where domain_uuid = :domain_uuid "; @@ -86,7 +86,7 @@ $fax_email_inbound_subject_tag = $row["fax_email_inbound_subject_tag"]; } else { - if (!if_group("superadmin") && !if_group("admin")) { + if (!permission_exists('fax_extension_view')) { echo "access denied"; exit; } diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index 867d24e57f..b45bbcab5a 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -25,6 +25,7 @@ James Rose Luis Daniel Lucio Quiroz Errol Samuels + Corey Moullas */ if (!isset($included)) { $included = false; } @@ -59,7 +60,7 @@ if (!$included) { //pre-populate the form if (is_uuid($_REQUEST['id']) && $_POST["persistformvar"] != "true") { $fax_uuid = $_REQUEST["id"]; - if (if_group("superadmin") || if_group("admin")) { + if (permission_exists('fax_extension_view_domain')) { //show all fax extensions $sql = "select fax_uuid, fax_extension, fax_caller_id_name, fax_caller_id_number, "; $sql .= "fax_toll_allow, accountcode, fax_send_greeting "; @@ -95,7 +96,7 @@ if (!$included) { $fax_send_greeting = $row["fax_send_greeting"]; } else { - if (!if_group("superadmin") && !if_group("admin")) { + if (!permission_exists('fax_extension_view_domain')) { echo "access denied"; exit; } @@ -369,7 +370,9 @@ if (!function_exists('fax_split_dtmf')) { $fax_name = str_replace("=", "_", $fax_name); $attachment_file_name = $_files['name'][$index]; - rename($dir_fax_temp.'/'.$attachment_file_name, $dir_fax_temp.'/'.$fax_name.'.'.$fax_file_extension); + if ($attachment_file_name != $fax_name.'.'.$fax_file_extension) { + rename($dir_fax_temp.'/'.$attachment_file_name, $dir_fax_temp.'/'.$fax_name.'.'.$fax_file_extension); + } unset($attachment_file_name); if (!$included) { @@ -394,12 +397,8 @@ if (!function_exists('fax_split_dtmf')) { if (file_exists($dir_fax_temp.'/'.$fax_name.'.pdf')) { chdir($dir_fax_temp); - //$cmd = gs_cmd("-q -sDEVICE=psmono -r".$gs_r." -g".$gs_g." -dNOPAUSE -dBATCH -dSAFER -sOutputFile=".correct_path($fax_name).".pdf -- ".correct_path($fax_name).".pdf -c quit"); - // echo($cmd . "
\n"); - //exec($cmd); - //convert pdf to tif - $cmd = gs_cmd("-q -sDEVICE=tiffg32d -r".$gs_r." -g".$gs_g." -dBATCH -dPDFFitPage -dNOPAUSE -sOutputFile=".correct_path($fax_name).".tif -- ".correct_path($fax_name).".pdf -c quit"); + $cmd = gs_cmd("-q -r".$gs_r." -g".$gs_g." -dBATCH -dPDFFitPage -dSAFER -dNOPAUSE -dBATCH -sOutputFile=".correct_path($fax_name).".tif -sDEVICE=tiffg4 -Ilib stocht.ps -c \"{ .75 gt { 1 } { 0 } ifelse} settransfer\" -- ".correct_path($fax_name).".pdf -c quit"); // echo($cmd . "
\n"); exec($cmd); @unlink($dir_fax_temp.'/'.$fax_name.'.pdf'); @@ -660,41 +659,14 @@ if (!function_exists('fax_split_dtmf')) { @unlink($tif_file); } - //generate pdf (a work around, as tiff2pdf was improperly inverting the colors) + //generate pdf from tif $cmd = 'tiff2pdf -u i -p '.$fax_page_size. ' -w '.$page_width. ' -l '.$page_height. ' -f -o '. correct_path($dir_fax_temp.'/'.$fax_instance_uuid.'.pdf').' '. correct_path($dir_fax_temp.'/'.$fax_instance_uuid.'.tif'); - // echo($cmd . "
\n"); exec($cmd); - - chdir($dir_fax_temp); - - //$cmd = gs_cmd("-q -sDEVICE=psmono -r".$gs_r." -g".$gs_g." -dNOPAUSE -dBATCH -dSAFER -sOutputFile=".correct_path($fax_instance_uuid).".pdf -- ".correct_path($fax_instance_uuid).".pdf -c quit"); - // echo($cmd . "
\n"); - //exec($cmd); - - //convert pdf to tif - $cmd = gs_cmd('-q -sDEVICE=tiffg32d -r'.$gs_r.' -g'.$gs_g.' -dBATCH -dPDFFitPage -dNOPAUSE -sOutputFile='. - correct_path($fax_instance_uuid.'_temp.tif'). - ' -- '.$fax_instance_uuid.'.pdf -c quit'); - // echo($cmd . "
\n"); - exec($cmd); - - @unlink($dir_fax_temp.'/'.$fax_instance_uuid.".pdf"); - - $cmd = 'tiff2pdf -u i -p '.$fax_page_size. - ' -w '.$page_width. - ' -l '.$page_height. - ' -f -o '. - correct_path($dir_fax_temp.'/'.$fax_instance_uuid.'.pdf').' '. - correct_path($dir_fax_temp.'/'.$fax_instance_uuid.'_temp.tif'); - // echo($cmd . "
\n"); - exec($cmd); - - @unlink($dir_fax_temp.'/'.$fax_instance_uuid."_temp.tif"); } else { if (!$included) { @@ -768,16 +740,16 @@ if (!function_exists('fax_split_dtmf')) { //send the fax $fax_file = $dir_fax_temp."/".$fax_instance_uuid.".tif"; - $dial_string = "for_fax=1,"; - $dial_string .= "accountcode='" . $fax_accountcode . "',"; - $dial_string .= "sip_h_X-accountcode='" . $fax_accountcode . "',"; - $dial_string .= "domain_uuid=" . $_SESSION["domain_uuid"] . ","; - $dial_string .= "domain_name=" . $_SESSION["domain_name"] . ","; - $dial_string .= "origination_caller_id_name='" . $fax_caller_id_name . "',"; - $dial_string .= "origination_caller_id_number='" . $fax_caller_id_number . "',"; - $dial_string .= "fax_ident='" . $fax_caller_id_number . "',"; - $dial_string .= "fax_header='" . $fax_caller_id_name . "',"; - $dial_string .= "fax_file='" . $fax_file . "',"; + $tmp_dial_string = "for_fax=1,"; + $tmp_dial_string .= "accountcode='" . $fax_accountcode . "',"; + $tmp_dial_string .= "sip_h_X-accountcode='" . $fax_accountcode . "',"; + $tmp_dial_string .= "domain_uuid=" . $_SESSION["domain_uuid"] . ","; + $tmp_dial_string .= "domain_name=" . $_SESSION["domain_name"] . ","; + $tmp_dial_string .= "origination_caller_id_name='" . $fax_caller_id_name . "',"; + $tmp_dial_string .= "origination_caller_id_number='" . $fax_caller_id_number . "',"; + $tmp_dial_string .= "fax_ident='" . $fax_caller_id_number . "',"; + $tmp_dial_string .= "fax_header='" . $fax_caller_id_name . "',"; + $tmp_dial_string .= "fax_file='" . $fax_file . "',"; foreach ($fax_numbers as $fax_number) { $fax_number = trim($fax_number); @@ -803,6 +775,7 @@ if (!function_exists('fax_split_dtmf')) { } if ($fax_send_mode != 'queue') { + $dial_string = $tmp_dial_string; $dial_string .= $fax_variables; $dial_string .= "mailto_address='" . $mailto_address . "',"; $dial_string .= "mailfrom_address='" . $mailfrom_address . "',"; @@ -827,6 +800,7 @@ if (!function_exists('fax_split_dtmf')) { } else { // enqueue $wav_file = ''; //! @todo add custom message + $dial_string = $tmp_dial_string; $response = fax_enqueue($fax_uuid, $fax_file, $wav_file, $mailto_address, $fax_uri, $fax_dtmf, $dial_string); } } @@ -927,8 +901,7 @@ if (!$included) { echo "
\n"; echo "
\n"; echo "
\n"; - - echo $text['description-2']." ".(if_group('superadmin') ? $text['description-3'] : null)."\n"; + echo $text['description-2']." ".(permission_exists('fax_extension_view_domain') ? $text['description-3'] : null)."\n"; echo "

\n"; echo "\n"; @@ -1185,4 +1158,4 @@ function showgrid($pdf) { } */ -?> \ No newline at end of file +?> diff --git a/app/fax/resources/classes/fax.php b/app/fax/resources/classes/fax.php index c5b12b7c11..c34bf2ed54 100644 --- a/app/fax/resources/classes/fax.php +++ b/app/fax/resources/classes/fax.php @@ -162,7 +162,7 @@ if (!class_exists('fax')) { $dialplan["dialplan_uuid"] = $this->dialplan_uuid; $dialplan["dialplan_name"] = ($this->fax_name != '') ? $this->fax_name : format_phone($this->destination_number); $dialplan["dialplan_number"] = $this->fax_extension; - $dialplan["dialplan_context"] = $_SESSION['context']; + $dialplan["dialplan_context"] = $_SESSION['domain_name']; $dialplan["dialplan_continue"] = "false"; $dialplan["dialplan_xml"] = $dialplan_xml; $dialplan["dialplan_order"] = "310"; @@ -195,7 +195,7 @@ if (!class_exists('fax')) { //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION['context']); + $cache->delete("dialplan:".$_SESSION['domain_name']); //return the dialplan_uuid return $dialplan_response; @@ -346,7 +346,12 @@ if (!class_exists('fax')) { //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } //set message message::add($text['message-delete']); @@ -646,7 +651,7 @@ if (!class_exists('fax')) { //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); //set message message::add($text['message-copy']); diff --git a/app/fifo/fifo_add.php b/app/fifo/fifo_add.php index ffbe66fbf9..0f34fb5987 100644 --- a/app/fifo/fifo_add.php +++ b/app/fifo/fifo_add.php @@ -103,7 +103,7 @@ $queue_name = $extension_name."@\${domain_name}"; $app_uuid = '16589224-c876-aeb3-f59f-523a1c0801f7'; $dialplan_uuid = uuid(); - $dialplan_context = $_SESSION['context']; + $dialplan_context = $_SESSION['domain_name']; $domain_uuid = $_SESSION['domain_uuid']; $dialplan_detail_order = 0; @@ -406,7 +406,7 @@ //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); //redirect the user message::add($text['message-add']); diff --git a/app/follow_me/app_config.php b/app/follow_me/app_config.php index a09aff8c7e..cd25312375 100644 --- a/app/follow_me/app_config.php +++ b/app/follow_me/app_config.php @@ -99,8 +99,6 @@ $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "user"; $apps[$x]['permissions'][$y]['groups'][] = "agent"; - $y++; - $apps[$x]['permissions'][$y]['name'] = "follow_me_caller_id"; //default settings $y=0; @@ -153,15 +151,6 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_caller_id_uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; - $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign"; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_destinations"; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "destination_uuid"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_ignore_busy"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; diff --git a/app/gateways/app_config.php b/app/gateways/app_config.php index 5486038064..8cddfbb9c4 100644 --- a/app/gateways/app_config.php +++ b/app/gateways/app_config.php @@ -197,6 +197,14 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "ping_min"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "ping_max"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "caller_id_in_from"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; diff --git a/app/gateways/app_languages.php b/app/gateways/app_languages.php index c7fef8b760..75a4823a4f 100644 --- a/app/gateways/app_languages.php +++ b/app/gateways/app_languages.php @@ -484,6 +484,48 @@ $text['label-ping']['ru-ru'] = "Пинг"; $text['label-ping']['sv-se'] = "Ping"; $text['label-ping']['uk-ua'] = "Пінг"; +$text['label-ping_min']['en-us'] = "Ping Min"; +$text['label-ping_min']['en-gb'] = ""; +$text['label-ping_min']['ar-eg'] = ""; +$text['label-ping_min']['de-at'] = ""; +$text['label-ping_min']['de-ch'] = ""; +$text['label-ping_min']['de-de'] = ""; +$text['label-ping_min']['es-cl'] = ""; +$text['label-ping_min']['es-mx'] = ""; +$text['label-ping_min']['fr-ca'] = ""; +$text['label-ping_min']['fr-fr'] = ""; +$text['label-ping_min']['he-il'] = ""; +$text['label-ping_min']['it-it'] = ""; +$text['label-ping_min']['nl-nl'] = ""; +$text['label-ping_min']['pl-pl'] = ""; +$text['label-ping_min']['pt-br'] = ""; +$text['label-ping_min']['pt-pt'] = ""; +$text['label-ping_min']['ro-ro'] = ""; +$text['label-ping_min']['ru-ru'] = ""; +$text['label-ping_min']['sv-se'] = ""; +$text['label-ping_min']['uk-ua'] = ""; + +$text['label-ping_max']['en-us'] = "Ping Max"; +$text['label-ping_max']['en-gb'] = ""; +$text['label-ping_max']['ar-eg'] = ""; +$text['label-ping_max']['de-at'] = ""; +$text['label-ping_max']['de-ch'] = ""; +$text['label-ping_max']['de-de'] = ""; +$text['label-ping_max']['es-cl'] = ""; +$text['label-ping_max']['es-mx'] = ""; +$text['label-ping_max']['fr-ca'] = ""; +$text['label-ping_max']['fr-fr'] = ""; +$text['label-ping_max']['he-il'] = ""; +$text['label-ping_max']['it-it'] = ""; +$text['label-ping_max']['nl-nl'] = ""; +$text['label-ping_max']['pl-pl'] = ""; +$text['label-ping_max']['pt-br'] = ""; +$text['label-ping_max']['pt-pt'] = ""; +$text['label-ping_max']['ro-ro'] = ""; +$text['label-ping_max']['ru-ru'] = ""; +$text['label-ping_max']['sv-se'] = ""; +$text['label-ping_max']['uk-ua'] = ""; + $text['label-password']['en-us'] = "Password"; $text['label-password']['en-gb'] = "Password"; $text['label-password']['ar-eg'] = "كلمة السر"; diff --git a/app/gateways/gateway_copy.php b/app/gateways/gateway_copy.php index 8cbd42a76f..81072b678f 100644 --- a/app/gateways/gateway_copy.php +++ b/app/gateways/gateway_copy.php @@ -75,12 +75,14 @@ $channels = $row["channels"]; $caller_id_in_from = $row["caller_id_in_from"]; $supress_cng = $row["supress_cng"]; + $sip_cid_type = $row["sip_cid_type"]; $extension_in_contact = $row["extension_in_contact"]; $effective_caller_id_name = $row["effective_caller_id_name"]; $effective_caller_id_number = $row["effective_caller_id_number"]; $outbound_caller_id_name = $row["outbound_caller_id_name"]; $outbound_caller_id_number = $row["outbound_caller_id_number"]; $context = $row["context"]; + $profile = $row["profile"]; $enabled = $row["enabled"]; $description = $row["description"]." (".$text['label-copy'].")"; } @@ -118,8 +120,10 @@ //$array['gateways'][0]['channels'] = $channels; $array['gateways'][0]['caller_id_in_from'] = $caller_id_in_from; $array['gateways'][0]['supress_cng'] = $supress_cng; + $array['gateways'][0]['sip_cid_type'] = $sip_cid_type; $array['gateways'][0]['extension_in_contact'] = $extension_in_contact; $array['gateways'][0]['context'] = $context; + $array['gateways'][0]['profile'] = $profile; $array['gateways'][0]['enabled'] = $enabled; $array['gateways'][0]['description'] = $description; diff --git a/app/gateways/gateway_edit.php b/app/gateways/gateway_edit.php index 17dda4f7f2..ec1eff8424 100644 --- a/app/gateways/gateway_edit.php +++ b/app/gateways/gateway_edit.php @@ -94,6 +94,8 @@ $retry_seconds = $_POST["retry_seconds"]; $extension = $_POST["extension"]; $ping = $_POST["ping"]; + $ping_min = $_POST["ping_min"]; + $ping_max = $_POST["ping_max"]; $channels = $_POST["channels"]; $caller_id_in_from = $_POST["caller_id_in_from"]; $supress_cng = $_POST["supress_cng"]; @@ -178,6 +180,8 @@ $array['gateways'][$x]["retry_seconds"] = $retry_seconds; $array['gateways'][$x]["extension"] = $extension; $array['gateways'][$x]["ping"] = $ping; + $array['gateways'][$x]["ping_min"] = $ping_min; + $array['gateways'][$x]["ping_max"] = $ping_max; $array['gateways'][$x]["channels"] = $channels; $array['gateways'][$x]["caller_id_in_from"] = $caller_id_in_from; $array['gateways'][$x]["supress_cng"] = $supress_cng; @@ -279,6 +283,8 @@ $retry_seconds = $row["retry_seconds"]; $extension = $row["extension"]; $ping = $row["ping"]; + $ping_min = $row["ping_min"]; + $ping_max = $row["ping_max"]; $channels = $row["channels"]; $caller_id_in_from = $row["caller_id_in_from"]; $supress_cng = $row["supress_cng"]; @@ -706,6 +712,28 @@ echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if (permission_exists('gateway_channels')) { echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo " \n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " "; echo " "; diff --git a/app/vars/app_languages.php b/app/vars/app_languages.php index f58f1efa22..5770bac89a 100644 --- a/app/vars/app_languages.php +++ b/app/vars/app_languages.php @@ -274,8 +274,8 @@ $text['description-variables_advanced']['ru-ru'] = "Определите зде $text['description-variables_advanced']['sv-se'] = "Definiera preprocessor variabler här. Kan nås i xml konfigurationen med $."; $text['description-variables_advanced']['uk-ua'] = "Задайте змінні препроцесора тут. Вони будуть доступними в конфігурації XML з символом $."; -$text['description-variables']['en-us'] = "Define preprocessor variables here."; -$text['description-variables']['en-gb'] = "Define preprocessor variables here."; +$text['description-variables']['en-us'] = "Define preprocessor variables here. A switch restart is required for changes to take effect."; +$text['description-variables']['en-gb'] = "Define preprocessor variables here. A switch restart is required for changes to take effect."; $text['description-variables']['ar-eg'] = ""; $text['description-variables']['de-at'] = "Definieren Sie Preprozessor Variablen."; //copied from de-de $text['description-variables']['de-ch'] = "Definieren Sie Preprozessor Variablen."; //copied from de-de diff --git a/app/voicemails/app_config.php b/app/voicemails/app_config.php index 60a2d41e43..595ff12c8a 100644 --- a/app/voicemails/app_config.php +++ b/app/voicemails/app_config.php @@ -34,9 +34,10 @@ $apps[$x]['destinations'][$y]['type'] = "sql"; $apps[$x]['destinations'][$y]['label'] = "voicemails"; $apps[$x]['destinations'][$y]['name'] = "voicemails"; - $apps[$x]['destinations'][$y]['sql'] = "select voicemail_id as destination, '*99' || voicemail_id as extension, voicemail_description as description from v_voicemails"; + $apps[$x]['destinations'][$y]['sql'] = "select voicemail_uuid, voicemail_id as destination, '*99' || voicemail_id as extension, voicemail_description as description from v_voicemails"; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and voicemail_enabled = 'true' "; $apps[$x]['destinations'][$y]['order_by'] = "voicemail_id asc "; + $apps[$x]['destinations'][$y]['field']['voicemail_uuid'] = "voicemail_uuid"; $apps[$x]['destinations'][$y]['field']['destination'] = "voicemail_id"; $apps[$x]['destinations'][$y]['field']['extension'] = "voicemail_id"; $apps[$x]['destinations'][$y]['field']['description'] = "voicemail_description"; @@ -85,10 +86,6 @@ $apps[$x]['permissions'][$y]['groups'][] = "user"; $apps[$x]['permissions'][$y]['groups'][] = "agent"; $y++; - $apps[$x]['permissions'][$y]['name'] = "voicemail_message_edit"; - $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; - $apps[$x]['permissions'][$y]['groups'][] = "admin"; - $y++; $apps[$x]['permissions'][$y]['name'] = "voicemail_message_delete"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; @@ -296,6 +293,15 @@ $apps[$x]['default_settings'][$y]['default_setting_value'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Voicemail enabled default value."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3f74cd0b-7f2e-4504-ac02-8755e0364a1e"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "voicemail"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "transcription_enabled_default"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Transcription enabled default value."; + //schema details $y=0; @@ -317,7 +323,7 @@ $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary"; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_id"; - $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the voicemail id."; $z++; diff --git a/app/voicemails/app_defaults.php b/app/voicemails/app_defaults.php index fb39d834a5..18c0433c58 100644 --- a/app/voicemails/app_defaults.php +++ b/app/voicemails/app_defaults.php @@ -27,30 +27,67 @@ //process this only one time if ($domains_processed == 1) { - // process change from using macros to phrases - $languages_path = $_SESSION['switch']['phrases']['dir']; - if ($languages_path != '' && file_exists($languages_path)) { - $folder_contents = scandir($languages_path); + // define initial, get current, define correct languages folder paths + $switch_configuration_dir = $_SESSION['switch']['conf']['dir'] != '' ? $_SESSION['switch']['conf']['dir'] : '/etc/freeswitch'; + $switch_phrases_dir_initial = $switch_configuration_dir.'/lang'; + $switch_phrases_dir_current = $_SESSION['switch']['phrases']['dir']; + $switch_phrases_dir_correct = $switch_configuration_dir.'/languages'; + + // ensure switch using languages (not lang) folder + if ($switch_phrases_dir_current == $switch_phrases_dir_initial) { + // rename languages folder, if necessary + if (file_exists($switch_phrases_dir_current) && !file_exists($switch_phrases_dir_correct)) { + rename($switch_phrases_dir_current, $switch_phrases_dir_correct); + } + // update default setting value + if (file_exists($switch_phrases_dir_correct)) { + // session + $_SESSION['switch']['phrases']['dir'] = $switch_phrases_dir_correct; + // database + $sql = "update v_default_settings "; + $sql .= "set default_setting_value = '".$switch_phrases_dir_correct."', "; + $sql .= "default_setting_enabled = true "; + $sql .= "where default_setting_category = 'switch' "; + $sql .= "and default_setting_subcategory = 'phrases' "; + $sql .= "and default_setting_name = 'dir' "; + $database = new database; + $database->execute($sql); + unset($sql); + } + + } + + if (file_exists($switch_phrases_dir_correct)) { + // update language path in main switch xml file + if (file_exists($switch_configuration_dir.'/freeswitch.xml')) { + $switch_xml_content = file_get_contents($switch_configuration_dir.'/freeswitch.xml'); + $switch_xml_content = str_replace('data="lang/', 'data="languages/', $switch_xml_content); + @file_put_contents($switch_configuration_dir.'/freeswitch.xml', $switch_xml_content); + } + $folder_contents = scandir($switch_phrases_dir_correct); if (is_array($folder_contents) && @sizeof($folder_contents) != 0) { foreach ($folder_contents as $language_abbreviation) { if ($language_abbreviation == '.' || $language_abbreviation == '..') { continue; } - // adjust language xml to include all xml phrase files in the vm folder - $language_xml_path = $languages_path.'/'.$language_abbreviation.'/'.$language_abbreviation.'.xml'; + // adjust language xml file to include all xml phrase files in the vm folder + $language_xml_path = $switch_phrases_dir_correct.'/'.$language_abbreviation.'/'.$language_abbreviation.'.xml'; if (file_exists($language_xml_path)) { $language_xml_content = file_get_contents($language_xml_path); $language_xml_content = str_replace('data="vm/sounds.xml"', 'data="vm/*.xml"', $language_xml_content); @file_put_contents($language_xml_path, $language_xml_content); } - // copy voicemail.xml to language/xx/vm folders + // copy voicemail.xml to languages/xx/vm folders $voicemail_xml_source = $_SERVER['PROJECT_ROOT'].'/app/voicemails/resources/switch/languages/'.$language_abbreviation.'/vm/voicemail.xml'; - $voicemail_xml_target = $languages_path.'/'.$language_abbreviation.'/vm/voicemail.xml'; + $voicemail_xml_target = $switch_phrases_dir_correct.'/'.$language_abbreviation.'/vm/voicemail.xml'; if (!file_exists($voicemail_xml_target)) { copy($voicemail_xml_source, $voicemail_xml_target); } } } } - unset($languages_path, $folder_contents, $language_abbreviation, $language_xml_path, $language_xml_content, $voicemail_xml_source, $voicemail_xml_target); + + // clear variables + unset($switch_configuration_dir, $switch_phrases_dir_initial, $switch_phrases_dir_current, $switch_phrases_dir_correct); + unset($switch_xml_content, $folder_contents, $language_abbreviation, $language_xml_path, $language_xml_content, $voicemail_xml_source, $voicemail_xml_target); } diff --git a/app/voicemails/resources/classes/voicemail.php b/app/voicemails/resources/classes/voicemail.php index 63773b2699..8390206ee0 100644 --- a/app/voicemails/resources/classes/voicemail.php +++ b/app/voicemails/resources/classes/voicemail.php @@ -364,6 +364,11 @@ $p->delete('voicemail_destination_delete', 'temp'); $p->delete('voicemail_greeting_delete', 'temp'); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-delete']); } @@ -544,6 +549,11 @@ $database->save($array); unset($array); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-toggle']); } diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php index 4316b4af68..aa6e20fa1b 100644 --- a/app/voicemails/voicemail_edit.php +++ b/app/voicemails/voicemail_edit.php @@ -137,6 +137,8 @@ //get a new voicemail_uuid if ($action == "add" && permission_exists('voicemail_add')) { $voicemail_uuid = uuid(); + //If adding a mailbox, set the default transcribe behavior + $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; } //add common array fields @@ -244,6 +246,11 @@ $obj->voicemail_destinations_delete($voicemail_destinations_delete); } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message if ($action == "add" && permission_exists('voicemail_add')) { message::add($text['message-add']); @@ -300,7 +307,7 @@ //set defaults if (strlen($voicemail_local_after_email) == 0) { $voicemail_local_after_email = "true"; } if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = "true"; } - if (strlen($voicemail_transcription_enabled) == 0) { $voicemail_transcription_enabled = "false"; } + if (strlen($voicemail_transcription_enabled) == 0) { $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean'] ?: "false"; } if (strlen($voicemail_tutorial) == 0) { $voicemail_tutorial = "false"; } //get the greetings list diff --git a/app/voicemails/voicemail_messages.php b/app/voicemails/voicemail_messages.php index 9a7ee5a80b..457514f7a6 100644 --- a/app/voicemails/voicemail_messages.php +++ b/app/voicemails/voicemail_messages.php @@ -178,7 +178,7 @@ $voicemails = $vm->messages(); //count messages - $new_messages = 0; + $new_messages = $num_rows = 0; if (is_array($voicemails) && @sizeof($voicemails) != 0) { foreach ($voicemails as $voicemail) { if (is_array($voicemail['messages'])) { diff --git a/app/voicemails/voicemails.php b/app/voicemails/voicemails.php index 17e1c6e838..18ef21370c 100644 --- a/app/voicemails/voicemails.php +++ b/app/voicemails/voicemails.php @@ -79,6 +79,16 @@ } } } + else { + $voicemail = new voicemail; + $rows = $voicemail->voicemails(); + if (is_array($rows) && @sizeof($rows) != 0) { + foreach ($rows as $row) { + $voicemail_uuids[]['voicemail_uuid'] = $row['voicemail_uuid']; + } + } + unset($voicemail, $rows, $row); + } //get order and order by $order_by = $_GET["order_by"]; diff --git a/app/xml_cdr/app_config.php b/app/xml_cdr/app_config.php index c01ccef3cc..3cd481481d 100644 --- a/app/xml_cdr/app_config.php +++ b/app/xml_cdr/app_config.php @@ -39,6 +39,7 @@ $y++; $apps[$x]['permissions'][$y]['name'] = "xml_cdr_domain"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; $y++; $apps[$x]['permissions'][$y]['name'] = "xml_cdr_add"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; @@ -196,6 +197,12 @@ $apps[$x]['permissions'][$y]['name'] = "xml_cdr_lose_race"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "xml_cdr_enterprise_leg"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "xml_cdr_cc_agent_leg"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "xml_cdr_archive"; //$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; @@ -206,6 +213,14 @@ $apps[$x]['permissions'][$y]['name'] = "xml_cdr_export"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "xml_cdr_export_csv"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "xml_cdr_export_pdf"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; //default settings $y=0; @@ -525,6 +540,12 @@ $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(1)"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "The leg of the call a or b."; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "originating_leg_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Originating Leg UUID. Used to identify legs of an enterprise ring group - and exclude them "; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "pdd_ms"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "numeric"; $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "numeric"; @@ -543,6 +564,12 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Save the last application data."; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_message"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "boolean"; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "missed_call"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "boolean"; $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; diff --git a/app/xml_cdr/app_languages.php b/app/xml_cdr/app_languages.php index 366fd4a3f5..be989695a1 100644 --- a/app/xml_cdr/app_languages.php +++ b/app/xml_cdr/app_languages.php @@ -1562,8 +1562,8 @@ $text['label-hangup_cause']['de-ch'] = "Hangup Ursache"; //copied from de-de $text['label-hangup_cause']['de-de'] = "Hangup Ursache"; $text['label-hangup_cause']['es-cl'] = "Causa Colgar"; $text['label-hangup_cause']['es-mx'] = "Causa Colgar"; //copied from es-cl -$text['label-hangup_cause']['fr-ca'] = "Parce hangup"; //copied from fr-fr -$text['label-hangup_cause']['fr-fr'] = "Parce hangup"; +$text['label-hangup_cause']['fr-ca'] = "Cause de raccrochage"; //copied from fr-fr +$text['label-hangup_cause']['fr-fr'] = "Cause de raccrochage"; $text['label-hangup_cause']['he-il'] = ""; $text['label-hangup_cause']['it-it'] = "Causa Chiusura Chiamata"; $text['label-hangup_cause']['nl-nl'] = ""; @@ -1982,8 +1982,8 @@ $text['label-caller_id_number']['de-ch'] = "Anrufer Nummer"; //copied from de-de $text['label-caller_id_number']['de-de'] = "Anrufer Nummer"; $text['label-caller_id_number']['es-cl'] = "Número CID"; $text['label-caller_id_number']['es-mx'] = "Número CID"; //copied from es-cl -$text['label-caller_id_number']['fr-ca'] = "Nombre de l'Appelant"; //copied from fr-fr -$text['label-caller_id_number']['fr-fr'] = "Nombre de l'Appelant"; +$text['label-caller_id_number']['fr-ca'] = "Numéro de l'Appelant"; //copied from fr-fr +$text['label-caller_id_number']['fr-fr'] = "Numéro de l'Appelant"; $text['label-caller_id_number']['he-il'] = ""; $text['label-caller_id_number']['it-it'] = "Numero CID"; $text['label-caller_id_number']['nl-nl'] = ""; @@ -2402,8 +2402,8 @@ $text['label-order']['de-ch'] = "Order"; $text['label-order']['de-de'] = "Order"; $text['label-order']['es-cl'] = "Order"; $text['label-order']['es-mx'] = "Order"; -$text['label-order']['fr-ca'] = "Order"; -$text['label-order']['fr-fr'] = "Order"; +$text['label-order']['fr-ca'] = "Ordre"; +$text['label-order']['fr-fr'] = "Ordre"; $text['label-order']['he-il'] = "Order"; $text['label-order']['it-it'] = "Order"; $text['label-order']['nl-nl'] = "Order"; @@ -2696,8 +2696,8 @@ $text['description-tta']['de-ch'] = "Zeit zu beantworten"; //copied from de-de $text['description-tta']['de-de'] = "Zeit zu beantworten"; $text['description-tta']['es-cl'] = "Hora de contestar"; $text['description-tta']['es-mx'] = "Hora de contestar"; //copied from es-cl -$text['description-tta']['fr-ca'] = "Le temps de répondre"; //copied from fr-fr -$text['description-tta']['fr-fr'] = "Le temps de répondre"; +$text['description-tta']['fr-ca'] = "Temps de réponse"; //copied from fr-fr +$text['description-tta']['fr-fr'] = "Temps de réponse"; $text['description-tta']['he-il'] = "הגיע הזמן לענות"; $text['description-tta']['it-it'] = "Tempo per rispondere"; $text['description-tta']['nl-nl'] = "Tijd om te antwoorden"; @@ -2898,4 +2898,4 @@ $text['button-advanced_search']['ru-ru'] = "Расширенный поиск"; $text['button-advanced_search']['sv-se'] = "Avancerad"; $text['button-advanced_search']['uk-ua'] = ""; -?> \ No newline at end of file +?> diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 840a17800e..4f488c1002 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -145,10 +145,12 @@ if (!class_exists('xml_cdr')) { $this->fields[] = "record_path"; $this->fields[] = "record_name"; $this->fields[] = "leg"; + $this->fields[] = "originating_leg_uuid"; $this->fields[] = "pdd_ms"; $this->fields[] = "rtp_audio_in_mos"; $this->fields[] = "last_app"; $this->fields[] = "last_arg"; + $this->fields[] = "voicemail_message"; $this->fields[] = "cc_side"; $this->fields[] = "cc_member_uuid"; $this->fields[] = "cc_queue_joined_epoch"; @@ -186,50 +188,37 @@ if (!class_exists('xml_cdr')) { $this->fields(); $field_count = sizeof($this->fields); - $row_count = sizeof($this->array); //$field_count = sizeof($this->fields); - $i = 0; if (isset($this->array)) { foreach ($this->array as $row) { - $sql = "insert into v_xml_cdr ("; - $f = 1; - if (isset($this->fields)) { - foreach ($this->fields as $field) { - $field = preg_replace('#[^a-zA-Z0-9_\-]#', '', $field); - if ($field_count == $f) { - $sql .= "$field "; - } - else { - $sql .= "$field, "; - } - $f++; - } - } - $sql .= ")\n"; - $sql .= "values \n"; - $sql .= "("; - $f = 1; + //build the array if (isset($this->fields)) { foreach ($this->fields as $field) { $field = preg_replace('#[^a-zA-Z0-9_\-]#', '', $field); if (isset($row[$field]) && strlen($row[$field]) > 0) { - $sql .= ":".$field." \n"; - $parameters[$field] = $row[$field]; + $array['xml_cdr'][0][$field] = $row[$field]; } - else { - $sql .= "null\n"; - } - if ($field_count != $f) { - $sql .= ","; - } - $f++; } } - $sql .= ")"; + + //add the temporary permission + $p = new permissions; + $p->add("xml_cdr_add", "temp"); + $p->add("xml_cdr_edit", "temp"); + + //save the call details record to the database $database = new database; - $database->execute($sql, $parameters); - unset($sql, $parameters); - $i++; + $database->app_name = 'xml_cdr'; + $database->app_uuid = '4a085c51-7635-ff03-f67b-86e834422848'; + $database->domain_uuid = $domain_uuid; + $database->save($array, false); + //$message = $database->message; + //print_r($message); + + //remove the temporary permission + $p->delete("xml_cdr_add", "temp"); + $p->delete("xml_cdr_edit", "temp"); + unset($array); } } @@ -329,7 +318,7 @@ if (!class_exists('xml_cdr')) { //set missed calls $missed_call = 'false'; - if (strlen($xml->variables->answer_stamp) == 0) { + if ($xml->variables->cc_side != "agent" && strlen($xml->variables->originating_leg_uuid) == 0 && $xml->variables->call_direction != 'outbound' && strlen($xml->variables->answer_stamp) == 0) { $missed_call = 'true'; } if ($xml->variables->missed_call == 'true') { @@ -403,6 +392,14 @@ if (!class_exists('xml_cdr')) { $this->array[$key]['last_app'] = urldecode($xml->variables->last_app); $this->array[$key]['last_arg'] = urldecode($xml->variables->last_arg); + //voicemail message success + if ($xml->variables->voicemail_action == "save" && $xml->variables->voicemail_message_seconds > 0){ + $this->array[$key]['voicemail_message'] = "true"; + } + else { //if ($xml->variables->voicemail_action == "save") { + $this->array[$key]['voicemail_message'] = "false"; + } + //conference $this->array[$key]['conference_name'] = urldecode($xml->variables->conference_name); $this->array[$key]['conference_uuid'] = urldecode($xml->variables->conference_uuid); @@ -417,6 +414,9 @@ if (!class_exists('xml_cdr')) { //store the call leg $this->array[$key]['leg'] = $leg; + //store the originating leg uuid + $this->array[$key]['originating_leg_uuid'] = urldecode($xml->variables->originating_leg_uuid); + //store post dial delay, in milliseconds $this->array[$key]['pdd_ms'] = urldecode($xml->variables->progress_mediamsec) + urldecode($xml->variables->progressmsec); @@ -443,7 +443,7 @@ if (!class_exists('xml_cdr')) { if (strlen($domain_name) == 0) { $presence_id = urldecode($xml->variables->presence_id); if (strlen($presence_id) > 0) { - $presence_array = explode($presence_id); + $presence_array = explode($presence_id, '%40'); $domain_name = $presence_array[1]; } } @@ -510,7 +510,12 @@ if (!class_exists('xml_cdr')) { $record_length = urldecode($xml->variables->record_seconds); } elseif (strlen($xml->variables->record_name) > 0) { - $record_path = urldecode($xml->variables->record_path); + if (isset($xml->variables->record_path)) { + $record_path = urldecode($xml->variables->record_path); + } + else { + $record_path = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/archive/'.$start_year.'/'.$start_month.'/'.$start_day; + } $record_name = urldecode($xml->variables->record_name); $record_length = urldecode($xml->variables->duration); } @@ -577,7 +582,7 @@ if (!class_exists('xml_cdr')) { } } - // Last check + //last check if (!isset($record_name) || is_null ($record_name) || (strlen($record_name) == 0)) { $bridge_uuid = urldecode($xml->variables->bridge_uuid); $path = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/archive/'.$start_year.'/'.$start_month.'/'.$start_day; @@ -600,6 +605,13 @@ if (!class_exists('xml_cdr')) { } } + //debug information + //echo "line: ".__line__; + //echo "record_path: ".$record_path."\n"; + //echo "record_name: ".$record_name."\n"; + //echo "record_length: ".$record_length."\n"; + //exit; + //add the call recording if (isset($record_path) && isset($record_name) && file_exists($record_path.'/'.$record_name) && $record_length > 0) { //add to the xml cdr table @@ -628,8 +640,8 @@ if (!class_exists('xml_cdr')) { $database->app_name = 'call_recordings'; $database->app_uuid = '56165644-598d-4ed8-be01-d960bcb8ffed'; $database->domain_uuid = $domain_uuid; - $database->save($array); - $message = $database->message; + $database->save($array, false); + //$message = $database->message; //remove the temporary permission $p->delete("call_recording_add", "temp"); @@ -649,11 +661,11 @@ if (!class_exists('xml_cdr')) { } //get the extension_uuid and then add it to the database fields array - if (strlen($xml->variables->extension_uuid) > 0) { + if (isset($xml->variables->extension_uuid)) { $this->array[$key]['extension_uuid'] = urldecode($xml->variables->extension_uuid); } else { - if (strlen($xml->variables->dialed_user) > 0) { + if (isset($domain_uuid) && isset($xml->variables->dialed_user)) { $sql = "select extension_uuid from v_extensions "; $sql .= "where domain_uuid = :domain_uuid "; $sql .= "and (extension = :dialed_user or number_alias = :dialed_user) "; @@ -664,7 +676,7 @@ if (!class_exists('xml_cdr')) { $this->array[$key]['extension_uuid'] = $extension_uuid; unset($parameters); } - if (strlen($xml->variables->referred_by_user) > 0) { + if (isset($domain_uuid) && isset($xml->variables->referred_by_user)) { $sql = "select extension_uuid from v_extensions "; $sql .= "where domain_uuid = :domain_uuid "; $sql .= "and (extension = :referred_by_user or number_alias = :referred_by_user) "; @@ -675,12 +687,12 @@ if (!class_exists('xml_cdr')) { $this->array[$key]['extension_uuid'] = $extension_uuid; unset($parameters); } - if (strlen($xml->variables->last_sent_callee_id_number) > 0) { + if (isset($domain_uuid) && isset($xml->variables->last_sent_callee_id_number)) { $sql = "select extension_uuid from v_extensions "; $sql .= "where domain_uuid = :domain_uuid "; - $sql .= "and (extension = :callee_id_number or number_alias = :last_sent_callee_id_number) "; + $sql .= "and (extension = :last_sent_callee_id_number or number_alias = :last_sent_callee_id_number) "; $parameters['domain_uuid'] = $domain_uuid; - $parameters['callee_id_number'] = $xml->variables->callee_id_number; + $parameters['last_sent_callee_id_number'] = $xml->variables->last_sent_callee_id_number; $database = new database; $extension_uuid = $database->select($sql, $parameters, 'column'); $this->array[$key]['extension_uuid'] = $extension_uuid; @@ -919,13 +931,13 @@ if (!class_exists('xml_cdr')) { if (strlen($this->start_stamp_begin) > 0 || strlen($this->start_stamp_end) > 0) { unset($this->quick_select); if (strlen($this->start_stamp_begin) > 0 && strlen($this->start_stamp_end) > 0) { - $sql_date_range .= " and start_stamp between :start_stamp_begin and :start_stamp_end \n"; + $sql_date_range = " and start_stamp between :start_stamp_begin and :start_stamp_end \n"; $parameters['start_stamp_begin'] = $this->start_stamp_begin.':00.000'; $parameters['start_stamp_end'] = $this->start_stamp_end.':59.999'; } else { if (strlen($this->start_stamp_begin) > 0) { - $sql_date_range .= "and start_stamp >= :start_stamp_begin \n"; + $sql_date_range = "and start_stamp >= :start_stamp_begin \n"; $parameters['start_stamp_begin'] = $this->start_stamp_begin.':00.000'; } if (strlen($this->start_stamp_end) > 0) { @@ -936,13 +948,13 @@ if (!class_exists('xml_cdr')) { } else { switch ($this->quick_select) { - case 1: $sql_date_range .= "and start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 week"))."' \n"; break; //last 7 days - case 2: $sql_date_range .= "and start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 hour"))."' \n"; break; //last hour - case 3: $sql_date_range .= "and start_stamp >= '".date('Y-m-d')." "."00:00:00.000' \n"; break; //today - case 4: $sql_date_range .= "and start_stamp between '".date('Y-m-d',strtotime("-1 day"))." "."00:00:00.000' and '".date('Y-m-d',strtotime("-1 day"))." "."23:59:59.999' \n"; break; //yesterday - case 5: $sql_date_range .= "and start_stamp >= '".date('Y-m-d',strtotime("this week"))." "."00:00:00.000' \n"; break; //this week - case 6: $sql_date_range .= "and start_stamp >= '".date('Y-m-')."01 "."00:00:00.000' \n"; break; //this month - case 7: $sql_date_range .= "and start_stamp >= '".date('Y-')."01-01 "."00:00:00.000' \n"; break; //this year + case 1: $sql_date_range = "and start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 week"))."' \n"; break; //last 7 days + case 2: $sql_date_range = "and start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 hour"))."' \n"; break; //last hour + case 3: $sql_date_range = "and start_stamp >= '".date('Y-m-d')." "."00:00:00.000' \n"; break; //today + case 4: $sql_date_range = "and start_stamp between '".date('Y-m-d',strtotime("-1 day"))." "."00:00:00.000' and '".date('Y-m-d',strtotime("-1 day"))." "."23:59:59.999' \n"; break; //yesterday + case 5: $sql_date_range = "and start_stamp >= '".date('Y-m-d',strtotime("this week"))." "."00:00:00.000' \n"; break; //this week + case 6: $sql_date_range = "and start_stamp >= '".date('Y-m-')."01 "."00:00:00.000' \n"; break; //this month + case 7: $sql_date_range = "and start_stamp >= '".date('Y-')."01-01 "."00:00:00.000' \n"; break; //this year } } @@ -970,7 +982,10 @@ if (!class_exists('xml_cdr')) { $sql .= "filter ( \n"; $sql .= " where c.extension_uuid = e.extension_uuid \n"; $sql .= " and missed_call = true \n"; - if (!permission_exists('xml_cdr_lose_race')) { + if (!permission_exists('xml_cdr_enterprise_leg')) { + $sql .= " and originating_leg_uuid is null \n"; + } + elseif (!permission_exists('xml_cdr_lose_race')) { $sql .= " and hangup_cause <> 'LOSE_RACE' \n"; } if ($this->include_internal) { @@ -1026,7 +1041,10 @@ if (!class_exists('xml_cdr')) { $sql .= "count(*) \n"; $sql .= "filter ( \n"; $sql .= " where c.extension_uuid = e.extension_uuid \n"; - if (!permission_exists('xml_cdr_lose_race')) { + if (!permission_exists('xml_cdr_enterprise_leg')) { + $sql .= " and originating_leg_uuid is null \n"; + } + elseif (!permission_exists('xml_cdr_lose_race')) { $sql .= " and hangup_cause <> 'LOSE_RACE' \n"; } if ($this->include_internal) { @@ -1077,6 +1095,7 @@ if (!class_exists('xml_cdr')) { $sql .= " direction, \n"; $sql .= " start_stamp, \n"; $sql .= " hangup_cause, \n"; + $sql .= " originating_leg_uuid, \n"; $sql .= " billsec \n"; $sql .= " from v_xml_cdr \n"; if (!($_GET['show'] === 'all' && permission_exists('xml_cdr_all'))) { @@ -1211,7 +1230,7 @@ if (!class_exists('xml_cdr')) { // If the range starts with an '-' we start from the beginning // If not, we forward the file pointer // And make sure to get the end byte if spesified - if ($range0 == '-') { + if ($range == '-') { // The n-number of the last bytes is requested $c_start = $size - substr($range, 1); } diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index 1ccdf7187c..6230f8c030 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -198,6 +198,14 @@ $database->fields['last_app'] = urldecode($xml->variables->last_app); $database->fields['last_arg'] = urldecode($xml->variables->last_arg); + //voicemail message success + if ($xml->variables->voicemail_action == "save" && $xml->variables->voicemail_message_seconds > 0){ + $database->fields['voicemail_message'] = "true"; + } + elseif ($xml->variables->voicemail_action == "save") { + $database->fields['voicemail_message'] = "false"; + } + //conference $database->fields['conference_name'] = urldecode($xml->variables->conference_name); $database->fields['conference_uuid'] = urldecode($xml->variables->conference_uuid); @@ -211,7 +219,7 @@ //set missed calls $database->fields['missed_call'] = 'false'; - if (strlen($xml->variables->answer_stamp) == 0) { + if ($xml->variables->cc_side != "agent" && strlen($xml->variables->originating_leg_uuid) == 0 && $xml->variables->call_direction != 'outbound' && strlen($xml->variables->answer_stamp) == 0) { $database->fields['missed_call'] = 'true'; } if ($xml->variables->missed_call == 'true') { @@ -292,7 +300,7 @@ if (strlen($domain_name) == 0) { $presence_id = urldecode($xml->variables->presence_id); if (strlen($presence_id) > 0) { - $presence_array = explode($presence_id); + $presence_array = explode($presence_id, '%40'); $domain_name = $presence_array[1]; } } @@ -509,11 +517,12 @@ $p->add("call_recording_add", "temp"); $p->add("call_recording_edit", "temp"); + //save the call recording to the database $recording_database = new database; $recording_database->app_name = 'call_recordings'; $recording_database->app_uuid = '56165644-598d-4ed8-be01-d960bcb8ffed'; $recording_database->domain_uuid = $domain_uuid; - $recording_database->save($recordings); + $recording_database->save($recordings, false); //$message = $recording_database->message; unset($recordings, $i); diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index 3de3cee14f..adf9c25588 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -188,8 +188,12 @@ echo button::create(['type'=>'button','label'=>$text['button-export'],'icon'=>$_SESSION['theme']['button_icon_export'],'onclick'=>"toggle_select('export_format'); this.blur();"]); echo ""; } if (!$archive_request && permission_exists('xml_cdr_delete')) { @@ -758,7 +762,7 @@ } //recording if (permission_exists('xml_cdr_recording') && (permission_exists('xml_cdr_recording_play') || permission_exists('xml_cdr_recording_download'))) { - if ($record_path != '' && file_exists($record_path.'/'.$record_name)) { + if ($record_path != '') { $content .= " \n"; + $content .= " \n"; } //duration if (permission_exists('xml_cdr_duration')) { @@ -819,11 +823,7 @@ } $content .= "\n"; - //show the leg b only to those with the permission - if (!permission_exists('xml_cdr_lose_race') && $row['hangup_cause'] == 'LOSE_RACE') { - $content = ''; - } if ($row['leg'] == 'a') { echo $content; } diff --git a/app/xml_cdr/xml_cdr_details.php b/app/xml_cdr/xml_cdr_details.php index dee13f107e..3e76933f16 100644 --- a/app/xml_cdr/xml_cdr_details.php +++ b/app/xml_cdr/xml_cdr_details.php @@ -387,9 +387,17 @@ //foreach($array["variables"] as $key => $value) { if (is_array($array["app_log"]["application"])) { - foreach ($array["app_log"]["application"] as $row) { - $app_name = $row["@attributes"]["app_name"]; - $app_data = urldecode($row["@attributes"]["app_data"]); + foreach ($array["app_log"]["application"] as $key=>$row) { + //single app + if ($key === "@attributes") { + $app_name = $row["app_name"]; + $app_data = urldecode($row["app_data"]); + } + //multiple apps + else { + $app_name = $row["@attributes"]["app_name"]; + $app_data = urldecode($row["@attributes"]["app_data"]); + } echo "\n"; echo " \n"; echo " \n"; diff --git a/app/xml_cdr/xml_cdr_export.php b/app/xml_cdr/xml_cdr_export.php index df0c0f78f6..96a12d26f7 100644 --- a/app/xml_cdr/xml_cdr_export.php +++ b/app/xml_cdr/xml_cdr_export.php @@ -51,7 +51,7 @@ $export_format = $_REQUEST['export_format']; //export the csv - if ($export_format == 'csv') { + if (permission_exists('xml_cdr_export_csv') && $export_format == 'csv') { //define file name if ($_GET['show'] == 'all' && permission_exists('xml_cdr_all')) { @@ -104,7 +104,7 @@ } //export as a PDF - if ($export_format == 'pdf') { + if (permission_exists('xml_cdr_export_pdf') && $export_format == 'pdf') { //load pdf libraries require_once "resources/tcpdf/tcpdf.php"; @@ -192,7 +192,7 @@ $data_body[$p] .= ''; $data_body[$p] .= ''; $total['tta'] += ($fields['tta'] > 0) ? $fields['tta'] : 0; - $data_body[$p] .= ''; + $data_body[$p] .= ''; $seconds = ($fields['hangup_cause'] == "ORIGINATOR_CANCEL") ? $fields['duration'] : round(($fields['billmsec'] / 1000), 0, PHP_ROUND_HALF_UP); $total['duration'] += $seconds; $data_body[$p] .= ''; diff --git a/app/xml_cdr/xml_cdr_import_update.php b/app/xml_cdr/xml_cdr_import_update.php deleted file mode 100644 index b308b64604..0000000000 --- a/app/xml_cdr/xml_cdr_import_update.php +++ /dev/null @@ -1,157 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2008-2012 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J Crane -*/ - -//check the permission - if(defined('STDIN')) { - $document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]); - preg_match("/^(.*)\/mod\/.*$/", $document_root, $matches); - $document_root = $matches[1]; - set_include_path($document_root); - require_once "resources/require.php"; - $_SERVER["DOCUMENT_ROOT"] = $document_root; - } - else { - echo "access denied"; - exit; - } - -//determine where the xml cdr will be archived - $sql = "select * from v_vars "; - $sql .= "where domain_uuid = '1' "; - $sql .= "and var_name = 'xml_cdr_archive' "; - $row = $db->query($sql)->fetch(); - $var_value = trim($row["var_value"]); - switch ($var_value) { - case "dir": - $xml_cdr_archive = 'dir'; - break; - case "db": - $xml_cdr_archive = 'db'; - break; - case "none": - $xml_cdr_archive = 'none'; - break; - default: - $xml_cdr_archive = 'dir'; - break; - } - -//get the list of installed apps from the core and mod directories - if ($xml_cdr_archive == "db") { - //get the xml cdr list - $sql = "select xml_cdr, uuid from v_xml_cdr "; - $sql .= "where waitsec is null "; - //$sql .= "limit 5000 "; - //start the transaction - $db->beginTransaction(); - //loop through the results - $x = 0; - foreach ($db->query($sql,PDO::FETCH_ASSOC) as $row) { - //get the values from the db - $uuid = $row['uuid']; - $xml_string = $row['xml_cdr']; - //save each set of records and begin a new transaction - if ($x > 5000) { - //save the transaction - $db->commit(); - //start the transaction - $db->beginTransaction(); - //reset the count - $x = 0; - } - //parse the xml to get the call detail record info - try { - $xml = simplexml_load_string($xml_string); - } - catch(Exception $e) { - echo $e->getMessage(); - } - //get the values from the xml and set at variables - $uuid = urldecode($xml->variables->uuid); - $waitsec = urldecode($xml->variables->waitsec); - //update the database - if (strlen($waitsec) > 0) { - $sql = "update v_xml_cdr "; - $sql .= "set waitsec = '$waitsec' "; - $sql .= "where uuid = '$uuid' "; - echo $sql."\n"; - $db->exec($sql); - $x++; - } - } - //save the transaction - $db->commit(); - //echo finished - echo "completed\n"; - } - if ($xml_cdr_archive == "dir") { - $xml_cdr_list = glob($_SESSION['switch']['log']['dir']."/xml_cdr/archive/*/*/*/*.xml"); - echo "count: ".count($xml_cdr_list)."\n"; - //print_r($xml_cdr_list); - $x = 0; - //start the transaction - $db->beginTransaction(); - //loop through the xml cdr records - foreach ($xml_cdr_list as $xml_cdr) { - //save each set of records and begin a new transaction - if ($x > 5000) { - //save the transaction - $db->commit(); - //start the transaction - $db->beginTransaction(); - //reset the count - $x = 0; - } - //get the xml cdr string - $xml_string = file_get_contents($xml_cdr); - //parse the xml to get the call detail record info - try { - $xml = simplexml_load_string($xml_string); - } - catch(Exception $e) { - echo $e->getMessage(); - } - //get the values from the xml and set at variables - $uuid = urldecode($xml->variables->uuid); - $waitsec = urldecode($xml->variables->waitsec); - //update the database - //if ($num_rows == "0" && strlen($waitsec) > 0) { - if (strlen($waitsec) > 0) { - $sql = "update v_xml_cdr "; - $sql .= "set waitsec = '$waitsec' "; - $sql .= "where uuid = '$uuid' "; - echo $sql."\n"; - $db->exec($sql); - $x++; - } - } - //save the transaction - $db->commit(); - //echo finished - echo "completed\n"; - } - -?> diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index bb10bfb56e..d7255167d8 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -242,6 +242,7 @@ $sql .= "c.source_number, \n"; $sql .= "c.destination_number, \n"; $sql .= "c.leg, \n"; + $sql .= "c.cc_side, \n"; //$sql .= "(c.xml is not null or c.json is not null) as raw_data_exists, \n"; //$sql .= "c.json, \n"; if (is_array($_SESSION['cdr']['field'])) { @@ -416,6 +417,13 @@ $sql .= "and hangup_cause like :hangup_cause "; $parameters['hangup_cause'] = '%'.$hangup_cause.'%'; } + elseif (!permission_exists('xml_cdr_lose_race') && !permission_exists('xml_cdr_enterprise_leg')) { + $sql .= "and hangup_cause != 'LOSE_RACE' "; + } + //exclude enterprise ring group legs + if (!permission_exists('xml_cdr_enterprise_leg')) { + $sql .= "and originating_leg_uuid IS NULL "; + } if (strlen($call_result) > 0) { switch ($call_result) { case 'answered': @@ -429,10 +437,20 @@ break; case 'cancelled': if ($direction == 'inbound' || $direction == 'local' || $call_result == 'missed') { - $sql = "and (answer_stamp is null and bridge_uuid is null and sip_hangup_disposition <> 'send_refuse') "; + $sql .= " + and (( + answer_stamp is null + and bridge_uuid is null + and sip_hangup_disposition <> 'send_refuse' + ) + or ( + answer_stamp is not null + and bridge_uuid is null + and voicemail_message = false + ))"; } else if ($direction == 'outbound') { - $sql = "and (answer_stamp is null and bridge_uuid is not null) "; + $sql .= "and (answer_stamp is null and bridge_uuid is not null) "; } else { $sql .= " @@ -446,10 +464,17 @@ direction = 'outbound' and answer_stamp is null and bridge_uuid is not null + ) + or ( + (direction = 'inbound' or direction = 'local') + and answer_stamp is not null + and bridge_uuid is null + and voicemail_message = false ))"; } break; - default: //failed + default: + $sql .= "and (answer_stamp is null and bridge_uuid is null and duration = 0) "; //$sql .= "and (answer_stamp is null and bridge_uuid is null and billsec = 0 and sip_hangup_disposition = 'send_refuse') "; } } @@ -506,6 +531,10 @@ $sql .= "and (c.record_path is null or c.record_name is null) "; } } + //show agent originated legs only to those with the permission + if (!permission_exists('xml_cdr_cc_agent_leg')) { + $sql .= "and (cc_side is null or cc_side != 'agent') "; + } //end where if (strlen($order_by) > 0) { $sql .= order_by($order_by, $order); @@ -533,7 +562,7 @@ $database->password = $_SESSION['cdr']['archive_database_password']['text']; } $result = $database->select($sql, $parameters, 'all'); - $result_count = (count($result) ? count($result) : 0); + $result_count = is_array($result) ? sizeof($result) : 0; unset($database, $sql, $parameters); //return the paging diff --git a/app/xml_cdr/xml_cdr_statistics.php b/app/xml_cdr/xml_cdr_statistics.php index f05ebdccbb..554fc73048 100644 --- a/app/xml_cdr/xml_cdr_statistics.php +++ b/app/xml_cdr/xml_cdr_statistics.php @@ -314,7 +314,7 @@ echo " \n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo "\n"; diff --git a/app/xml_cdr/xml_cdr_statistics_inc.php b/app/xml_cdr/xml_cdr_statistics_inc.php index 6d48f28174..e695b8e67c 100644 --- a/app/xml_cdr/xml_cdr_statistics_inc.php +++ b/app/xml_cdr/xml_cdr_statistics_inc.php @@ -153,7 +153,7 @@ $parameters['domain_uuid'] = $_SESSION['domain_uuid']; } if ($missed == true) { - $sql_where_ands[] = "billsec = '0'"; + $sql_where_ands[] = "missed_call = true "; } if (strlen($start_epoch) > 0 && strlen($stop_epoch) > 0) { $sql_where_ands[] = "start_epoch between :start_epoch and :stop_epoch"; @@ -280,6 +280,15 @@ $sql_where_ands[] = "leg = :leg"; $parameters['leg'] = $leg; } + //Exclude enterprise ring group legs + if (!permission_exists('xml_cdr_enterprise_leg')) { + $sql_where_ands[] .= "originating_leg_uuid IS NULL"; + } + //If you can't see lose_race, don't run stats on it + elseif (!permission_exists('xml_cdr_lose_race')) { + $sql_where_ands[] = "hangup_cause != 'LOSE_RACE'"; + } + //if not admin or superadmin, only show own calls if (!permission_exists('xml_cdr_domain')) { @@ -345,7 +354,7 @@ //get the call volume between a start end end time in seconds function get_call_volume_between($start, $end, $where, $parameters) { - $sql = "select count(*) as count, sum(billsec) as seconds from v_xml_cdr "; + $sql = "select count(*) as count, sum(billsec) as seconds, sum(answer_stamp - start_stamp) as tta from v_xml_cdr "; $sql .= $where." "; $sql .= "start_epoch between :start and :end "; $parameters['start'] = $start; @@ -356,6 +365,7 @@ return array( 'volume' => $row['count'], 'seconds' => $row['seconds'], + 'tta' => $row['tta'], ); } return false; @@ -375,14 +385,13 @@ $stats[$i]['volume'] = $stat_range ? $stat_range['volume'] : 0; $stats[$i]['seconds'] = $stat_range ? $stat_range['seconds'] : 0; $stats[$i]['minutes'] = $stats[$i]['seconds'] / 60; - $stats[$i]['avg_sec'] = $stats[$i]['volume'] == 0 ? 0 : $stats[$i]['seconds'] / $stats[$i]['volume']; if ($missed) { //we select only missed calls at first place - no reasons to select it again $stats[$i]['missed'] = $stats[$i]['volume']; } else { - $where = $sql_where."billsec = '0' and "; + $where = $sql_where."missed_call = true and "; $stat_range = get_call_volume_between($stats[$i]['start_epoch'], $stats[$i]['stop_epoch'], $where, $parameters); $stats[$i]['missed'] = $stat_range ? $stat_range['volume'] : 0; } @@ -399,6 +408,9 @@ //answer / seizure ratio $stats[$i]['asr'] = $stats[$i]['volume'] == 0 ? 0 : ($success_volume / $stats[$i]['volume'] * 100); + //average time to answer + $stats[$i]['avg_tta'] = $stats[$i]['volume'] == 0 ? 0 : round($stat_range['tta'] / $success_volume); + //average length of call $stats[$i]['aloc'] = $success_volume == 0 ? 0 : $stats[$i]['minutes'] / $success_volume; } diff --git a/app/yealink/app_config.php b/app/yealink/app_config.php index 410d47d97b..73f74ff29e 100644 --- a/app/yealink/app_config.php +++ b/app/yealink/app_config.php @@ -263,6 +263,14 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Filename of the CP860 firmware ROM"; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "2d167eaf-dbfb-423d-a073-feb66e1434bd"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_firmware_cp920"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "cp920-78.85.0.5.rom"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Filename of the CP920 firmware ROM"; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7a769f2f-2833-4b90-9789-ff96a4723773"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_firmware_cp960"; @@ -359,6 +367,38 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Filename of the T46S firmware ROM"; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "6b70cfeb-2124-42dc-ba8b-6cd77da3fa5f"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_firmware_t53w"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "T53W(T53)-95.84.0.125.rom"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Filename of the T53w firmware ROM"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "83e51b20-2d8d-4437-889d-dc97d9810fb5"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_firmware_t54s"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "T54S(T52S)-70.82.0.20.rom"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Filename of the T54s firmware ROM"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "84be24be-d03d-49cf-bc9e-79fb19e04718"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_firmware_t54w"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "T54W-96.84.0.125.rom"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Filename of the T54w firmware ROM"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "27ae0140-7ea1-44e5-892c-d59a24b0ad22"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_firmware_t57w"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "T57W-97.84.0.125.rom"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Filename of the T57w firmware ROM"; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "0276b965-0ef6-493a-bdd0-b9786bf8aad7"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_firmware_t48g"; @@ -527,14 +567,6 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "http://localhost/all,delete all the customized ring tones"; $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7af991ec-ddb9-4942-a05d-d1acc529fef5"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_ringtone_url"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "custom.wav"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Before using this parameter, you should store the desired ring tone (custom.wav) to the provisioning server"; - $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "95862d61-18ac-41b5-ac69-467e0ef3afd7"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_remote_phonebook_1_name"; @@ -567,6 +599,14 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable phone to query the contact names from the remote phonebook when receiving incoming calls. 0-Disabled (default), 1-Enabled;"; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "1a703585-bee8-4b77-8e5b-7f1fb29958ff"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_local_directory_enable"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable the Local Directory."; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "765e18d9-9440-42be-a858-2c0ef90ee50f"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_ring_text_1"; @@ -859,7 +899,7 @@ $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_trust_certificates"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Required trusted certificate for provisioning."; $y++; @@ -1166,5 +1206,60 @@ $apps[$x]['default_settings'][$y]['default_setting_value'] = ""; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "PC port VLAN enable Set 1 = ON 0 = OFF."; - + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "fe946865-b2a4-47a0-92f7-9b2b879be8ef"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_lock_enable"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Configure the keypad lock type; 0-Disabled (default), 1-Enable. If needing remove pin lock, set value=0 and enabled=true, reprovision. Then you can set enabled=false and reprovision again for full removal and disablement."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c9020c9e-ffb8-4755-9bf8-e3c9344cd129"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_lock_key_type"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Configure the keypad lock type;0-All Keys(default), 1-Function Key, 2-Menu Key"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "d3ebfed3-13a8-44b6-bed9-6eaeb6ba7bf6"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_lock_pin"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "123"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Configure the unlock password for the phone. The default value is 123."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b4e7451c-ff42-4269-8404-5434a6303013"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_emergency_number"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "911,110,112"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Configure the emergency number, each separated by a comma. The default value is 911,110,112."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "76efe175-8701-4222-b022-552c43e647cf"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_lock_timeout"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Configures the interval (in seconds) to automatically lock the IP phone. It ranges from 0 to 3600, the default value is 0."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "1549a926-fcb5-4384-a237-83aa77170e5a"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_summer_time"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "It configures Daylight Saving Time (DST) feature. 0-Disabled, 1-Enabled, 2-Automatic"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "2bcfc683-8731-4eb1-b79e-a4fb94ede2c9"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "yealink_dst_type"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "It configures the Daylight Saving Time (DST) type. (It works only if “local_time.summer_time” is set to 1 (Enabled)). 0-DST by Date, 1-DST by Week"; ?> diff --git a/core/authentication/resources/classes/authentication.php b/core/authentication/resources/classes/authentication.php index a6b50bad9f..6b7fd340d5 100644 --- a/core/authentication/resources/classes/authentication.php +++ b/core/authentication/resources/classes/authentication.php @@ -102,7 +102,7 @@ class authentication { } //add user logs - if (file_exists($_SERVER["PROJECT_ROOT"]."/app/user_logs/app_config.php")) { + if (file_exists($_SERVER["PROJECT_ROOT"]."/core/user_logs/app_config.php")) { user_logs::add($result); } diff --git a/core/authentication/resources/classes/plugins/database.php b/core/authentication/resources/classes/plugins/database.php index ceb6405596..df85e1e936 100644 --- a/core/authentication/resources/classes/plugins/database.php +++ b/core/authentication/resources/classes/plugins/database.php @@ -30,13 +30,15 @@ class plugin_database { $user_authorized = false; //check the username and password if they don't match then redirect to the login - $sql = "select * from v_users "; + $sql = "select u.user_uuid, u.contact_uuid, u.username, u.password, u.salt, u.api_key, u.domain_uuid, d.domain_name "; + $sql .= "from v_users as u, v_domains as d "; + $sql .= "where u.domain_uuid = d.domain_uuid "; if (strlen($this->key) > 30) { - $sql .= "where api_key = :api_key "; + $sql .= "and u.api_key = :api_key "; $parameters['api_key'] = $this->key; } else { - $sql .= "where lower(username) = lower(:username) "; + $sql .= "and lower(u.username) = lower(:username) "; $parameters['username'] = $this->username; } if ($_SESSION["users"]["unique"]["text"] === "global") { @@ -44,7 +46,7 @@ class plugin_database { } else { //unique username - per domain - $sql .= "and domain_uuid = :domain_uuid "; + $sql .= "and u.domain_uuid = :domain_uuid "; $parameters['domain_uuid'] = $this->domain_uuid; } $sql .= "and (user_enabled = 'true' or user_enabled is null) "; @@ -56,7 +58,7 @@ class plugin_database { if ($_SESSION["users"]["unique"]["text"] === "global" && $row["domain_uuid"] !== $this->domain_uuid) { //set the domain_uuid $this->domain_uuid = $row["domain_uuid"]; - $this->domain_name = $_SESSION['domains'][$this->domain_uuid]['domain_name']; + $this->domain_name = $row["domain_name"]; //set the domain session variables $_SESSION["domain_uuid"] = $this->domain_uuid; diff --git a/core/default_settings/app_config.php b/core/default_settings/app_config.php index a5e72052f8..e53c918856 100644 --- a/core/default_settings/app_config.php +++ b/core/default_settings/app_config.php @@ -82,7 +82,7 @@ $apps[$x]['default_settings'][$y]['default_setting_category'] = "domain"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "time_zone"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "name"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = ""; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "UTC"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; $y++; @@ -222,6 +222,14 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Display a Reset Password link on the login box (requires smtp_host be defined)."; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "a21a002c-c065-411c-ae56-3d33a09f64b4"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "login"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "password_reset_domain"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = ""; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the domain to use in the Password Reset link sent via email."; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "962ac32c-74ce-4cce-b1d9-89f4d921493d"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "login"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "domain_name_visible"; diff --git a/core/default_settings/app_defaults.php b/core/default_settings/app_defaults.php index ebdf9f35b5..23d08e041d 100644 --- a/core/default_settings/app_defaults.php +++ b/core/default_settings/app_defaults.php @@ -487,6 +487,21 @@ unset($sql, $parameters); } + //set domain > time_zone to UTC if not set + $sql = "update v_default_settings set "; + $sql .= "default_setting_value = 'UTC', "; + $sql .= "default_setting_enabled = 'true' "; + $sql .= "where ( "; + $sql .= " default_setting_value is null or "; + $sql .= " default_setting_value = '' "; + $sql .= ") "; + $sql .= "and default_setting_category = 'domain' "; + $sql .= "and default_setting_subcategory = 'time_zone' "; + $sql .= "and default_setting_name = 'name' "; + $database = new database; + $database->execute($sql); + unset($sql); + } ?> diff --git a/core/default_settings/app_languages.php b/core/default_settings/app_languages.php index cbf8cff21e..306f738929 100644 --- a/core/default_settings/app_languages.php +++ b/core/default_settings/app_languages.php @@ -835,6 +835,60 @@ $text['label-base64']['pt-br'] = "Base64"; $text['label-base64']['pt-pt'] = "Base64"; $text['label-base64']['ro-ro'] = "Base64"; +$text['label-dynamic']['en-us'] = "Dynamic"; +$text['label-dynamic']['en-gb'] = "Dynamic"; +$text['label-dynamic']['ar-eg'] = "Dynamic"; +$text['label-dynamic']['de-at'] = "Dynamic"; +$text['label-dynamic']['de-ch'] = "Dynamic"; +$text['label-dynamic']['de-de'] = "Dynamic"; +$text['label-dynamic']['es-cl'] = "Dynamic"; +$text['label-dynamic']['es-mx'] = "Dynamic"; +$text['label-dynamic']['fr-ca'] = "Dynamic"; +$text['label-dynamic']['fr-fr'] = "Dynamic"; +$text['label-dynamic']['he-il'] = "Dynamic"; +$text['label-dynamic']['it-it'] = "Dynamic"; +$text['label-dynamic']['nl-nl'] = "Dynamic"; +$text['label-dynamic']['pl-pl'] = "Dynamic"; +$text['label-dynamic']['pt-br'] = "Dynamic"; +$text['label-dynamic']['pt-pt'] = "Dynamic"; +$text['label-dynamic']['ro-ro'] = "Dynamic"; + +$text['label-single']['en-us'] = "Single"; +$text['label-single']['en-gb'] = "Single"; +$text['label-single']['ar-eg'] = "Single"; +$text['label-single']['de-at'] = "Single"; +$text['label-single']['de-ch'] = "Single"; +$text['label-single']['de-de'] = "Single"; +$text['label-single']['es-cl'] = "Single"; +$text['label-single']['es-mx'] = "Single"; +$text['label-single']['fr-ca'] = "Single"; +$text['label-single']['fr-fr'] = "Single"; +$text['label-single']['he-il'] = "Single"; +$text['label-single']['it-it'] = "Single"; +$text['label-single']['nl-nl'] = "Single"; +$text['label-single']['pl-pl'] = "Single"; +$text['label-single']['pt-br'] = "Single"; +$text['label-single']['pt-pt'] = "Single"; +$text['label-single']['ro-ro'] = "Single"; + +$text['label-multiple']['en-us'] = "Multiple"; +$text['label-multiple']['en-gb'] = "Multiple"; +$text['label-multiple']['ar-eg'] = "Multiple"; +$text['label-multiple']['de-at'] = "Multiple"; +$text['label-multiple']['de-ch'] = "Multiple"; +$text['label-multiple']['de-de'] = "Multiple"; +$text['label-multiple']['es-cl'] = "Multiple"; +$text['label-multiple']['es-mx'] = "Multiple"; +$text['label-multiple']['fr-ca'] = "Multiple"; +$text['label-multiple']['fr-fr'] = "Multiple"; +$text['label-multiple']['he-il'] = "Multiple"; +$text['label-multiple']['it-it'] = "Multiple"; +$text['label-multiple']['nl-nl'] = "Multiple"; +$text['label-multiple']['pl-pl'] = "Multiple"; +$text['label-multiple']['pt-br'] = "Multiple"; +$text['label-multiple']['pt-pt'] = "Multiple"; +$text['label-multiple']['ro-ro'] = "Multiple"; + $text['header-default_settings']['en-us'] = "Default Settings"; $text['header-default_settings']['en-gb'] = "Default Settings"; $text['header-default_settings']['ar-eg'] = ""; diff --git a/core/default_settings/default_setting_edit.php b/core/default_settings/default_setting_edit.php index ee527970a0..9dde93d365 100644 --- a/core/default_settings/default_setting_edit.php +++ b/core/default_settings/default_setting_edit.php @@ -211,7 +211,7 @@ //pre-populate the form if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { $default_setting_uuid = $_GET["id"]; - $sql = "select default_setting_uuid, default_setting_category, default_setting_subcategory, default_setting_name, default_setting_value, cast(default_setting_enabled as text), default_setting_description "; + $sql = "select default_setting_uuid, default_setting_category, default_setting_subcategory, default_setting_name, default_setting_value, default_setting_order, cast(default_setting_enabled as text), default_setting_description "; $sql .= "from v_default_settings "; $sql .= "where default_setting_uuid = :default_setting_uuid "; $parameters['default_setting_uuid'] = $default_setting_uuid; @@ -642,6 +642,13 @@ echo " \n"; echo " \n"; } + elseif ($category == "users" && $subcategory == "username_format" && $name == "text" ) { + echo " \n"; + } elseif ($category == "voicemail" && $subcategory == "voicemail_file" && $name == "text" ) { echo " \n"; } + elseif ($category == "destinations" && $subcategory == "dialplan_details" && $name == "boolean" ) { + echo " \n"; + } + elseif ($category == "destinations" && $subcategory == "dialplan_mode" && $name == "text" ) { + echo " \n"; + } + elseif ($category == "destinations" && $subcategory == "select_mode" && $name == "text" ) { + echo " \n"; + } + elseif ($category == "destinations" && $subcategory == "unique" && $name == "boolean" ) { + echo " \n"; + } elseif (is_json($default_setting_value)) { echo " \n"; } @@ -734,8 +765,8 @@ echo " ".$text['label-description']."\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/core/default_settings/default_settings.php b/core/default_settings/default_settings.php index 7b88cc0761..b47cb8586d 100644 --- a/core/default_settings/default_settings.php +++ b/core/default_settings/default_settings.php @@ -128,10 +128,40 @@ $default_settings = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); +//get default setting categories + $sql = "select "; + $sql .= "distinct(d1.default_setting_category), "; + $sql .= "( "; + $sql .= " select "; + $sql .= " count(d2.default_setting_category) "; + $sql .= " from v_default_settings as d2 "; + $sql .= " where d2.default_setting_category = d1.default_setting_category "; + if (isset($search) && strlen($search) > 0) { + $sql .= " and ("; + $sql .= " lower(d2.default_setting_category) like :search "; + $sql .= " or lower(d2.default_setting_subcategory) like :search "; + $sql .= " or lower(d2.default_setting_name) like :search "; + $sql .= " or lower(d2.default_setting_value) like :search "; + $sql .= " or lower(d2.default_setting_description) like :search "; + $sql .= " ) "; + $parameters['search'] = '%'.$search.'%'; + } + $sql .= ") as quantity "; + $sql .= "from v_default_settings as d1 "; + $sql .= "order by d1.default_setting_category asc "; + $database = new database; + $rows = $database->select($sql, $parameters, 'all'); + if (is_array($rows) && @sizeof($rows) != 0) { + foreach ($rows as $row) { + $default_setting_categories[$row['default_setting_category']] += $row['quantity']; + } + } + unset($sql, $rows, $row); + //get the list of categories - if (is_array($default_settings) && @sizeof($default_settings) != 0) { - foreach ($default_settings as $default_setting) { - $category = strtolower($default_setting['default_setting_category']); + if (is_array($default_setting_categories) && @sizeof($default_setting_categories) != 0) { + foreach ($default_setting_categories as $default_setting_category => $quantity) { + $category = strtolower($default_setting_category); switch ($category) { case "api" : $category = "API"; break; case "cdr" : $category = "CDR"; break; @@ -142,11 +172,11 @@ $category = str_replace("-", " ", $category); $category = ucwords($category); } - $categories[$default_setting['default_setting_category']]['formatted'] = $category; - $categories[$default_setting['default_setting_category']]['count']++; + $categories[$default_setting_category]['formatted'] = $category; + $categories[$default_setting_category]['count'] = $quantity; } ksort($categories); - unset($default_setting, $category); + unset($default_setting_categories, $default_setting_category, $category); } //create token @@ -180,7 +210,7 @@ //show the content echo "
\n"; - echo "
".$text['title-default_settings']." (".$num_rows.")
\n"; + echo "
".$text['title-default_settings']." (".number_format($num_rows).")
\n"; echo "
\n"; echo button::create(['label'=>$text['button-reload'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'button_reload','link'=>'default_settings_reload.php'.($search != '' ? '?search='.urlencode($search) : null),'style'=>'margin-right: 15px;']); if (permission_exists('default_setting_add')) { @@ -209,17 +239,18 @@ if (is_array($categories) && @sizeof($categories) != 0) { echo ""; } echo ""; - echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? '' : null)]); - //echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]); - //echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'default_settings.php','style'=>($search == '' ? 'display: none;' : null)]); + echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]); + echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'default_settings.php','style'=>($search == '' ? 'display: none;' : null)]); if ($paging_controls_mini != '') { echo "".$paging_controls_mini."\n"; } @@ -368,9 +399,18 @@ echo " ".(img_spacer('15px', '15px', 'background: '.escape($row['default_setting_value']).'; margin-right: 4px; vertical-align: middle; border: 1px solid '.(color_adjust($row['default_setting_value'], -0.18)).'; padding: -1px;')); echo "".escape($row['default_setting_value'])."\n"; } + else if ($category == 'users' && $subcategory == 'username_format' && $name == 'text') { + echo " ".$text['option-username_format_'.$row['default_setting_value']]."\n"; + } else if ($category == 'recordings' && $subcategory == 'storage_type' && $name == 'text') { echo " ".$text['label-'.$row['default_setting_value']]."\n"; } + else if ($category == 'destinations' && $subcategory == 'dialplan_mode' && $name == 'text') { + echo " ".$text['label-'.$row['default_setting_value']]."\n"; + } + else if ($category == 'destinations' && $subcategory == 'select_mode' && $name == 'text') { + echo " ".$text['label-'.$row['default_setting_value']]."\n"; + } else { echo " ".escape($row['default_setting_value'])."\n"; } @@ -407,14 +447,7 @@ echo "\n"; echo "\n"; -//focus on category selector - echo "\n"; - //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/core/default_settings/resources/classes/default_settings.php b/core/default_settings/resources/classes/default_settings.php index 727f4b8107..a3401d9b5f 100644 --- a/core/default_settings/resources/classes/default_settings.php +++ b/core/default_settings/resources/classes/default_settings.php @@ -269,7 +269,7 @@ if (!class_exists('default_settings')) { $array['domain_settings'][$x]['domain_setting_name'] = $default_setting_name; $array['domain_settings'][$x]['domain_setting_value'] = $default_setting_value; $array['domain_settings'][$x]['domain_setting_order'] = $default_setting_order; - $array['domain_settings'][$x]['domain_setting_enabled'] = $default_setting_enabled; + $array['domain_settings'][$x]['domain_setting_enabled'] = $default_setting_enabled ?: 0; $array['domain_settings'][$x]['domain_setting_description'] = $default_setting_description; //insert diff --git a/core/domain_settings/app_languages.php b/core/domain_settings/app_languages.php index ce58731acf..abd72c85c4 100644 --- a/core/domain_settings/app_languages.php +++ b/core/domain_settings/app_languages.php @@ -610,6 +610,60 @@ $text['label-12-hour']['ru-ru'] = "12-часовой"; $text['label-12-hour']['sv-se'] = "12-timmars"; $text['label-12-hour']['uk-ua'] = "12-годинний"; +$text['label-dynamic']['en-us'] = "Dynamic"; +$text['label-dynamic']['en-gb'] = "Dynamic"; +$text['label-dynamic']['ar-eg'] = "Dynamic"; +$text['label-dynamic']['de-at'] = "Dynamic"; +$text['label-dynamic']['de-ch'] = "Dynamic"; +$text['label-dynamic']['de-de'] = "Dynamic"; +$text['label-dynamic']['es-cl'] = "Dynamic"; +$text['label-dynamic']['es-mx'] = "Dynamic"; +$text['label-dynamic']['fr-ca'] = "Dynamic"; +$text['label-dynamic']['fr-fr'] = "Dynamic"; +$text['label-dynamic']['he-il'] = "Dynamic"; +$text['label-dynamic']['it-it'] = "Dynamic"; +$text['label-dynamic']['nl-nl'] = "Dynamic"; +$text['label-dynamic']['pl-pl'] = "Dynamic"; +$text['label-dynamic']['pt-br'] = "Dynamic"; +$text['label-dynamic']['pt-pt'] = "Dynamic"; +$text['label-dynamic']['ro-ro'] = "Dynamic"; + +$text['label-single']['en-us'] = "Single"; +$text['label-single']['en-gb'] = "Single"; +$text['label-single']['ar-eg'] = "Single"; +$text['label-single']['de-at'] = "Single"; +$text['label-single']['de-ch'] = "Single"; +$text['label-single']['de-de'] = "Single"; +$text['label-single']['es-cl'] = "Single"; +$text['label-single']['es-mx'] = "Single"; +$text['label-single']['fr-ca'] = "Single"; +$text['label-single']['fr-fr'] = "Single"; +$text['label-single']['he-il'] = "Single"; +$text['label-single']['it-it'] = "Single"; +$text['label-single']['nl-nl'] = "Single"; +$text['label-single']['pl-pl'] = "Single"; +$text['label-single']['pt-br'] = "Single"; +$text['label-single']['pt-pt'] = "Single"; +$text['label-single']['ro-ro'] = "Single"; + +$text['label-multiple']['en-us'] = "Multiple"; +$text['label-multiple']['en-gb'] = "Multiple"; +$text['label-multiple']['ar-eg'] = "Multiple"; +$text['label-multiple']['de-at'] = "Multiple"; +$text['label-multiple']['de-ch'] = "Multiple"; +$text['label-multiple']['de-de'] = "Multiple"; +$text['label-multiple']['es-cl'] = "Multiple"; +$text['label-multiple']['es-mx'] = "Multiple"; +$text['label-multiple']['fr-ca'] = "Multiple"; +$text['label-multiple']['fr-fr'] = "Multiple"; +$text['label-multiple']['he-il'] = "Multiple"; +$text['label-multiple']['it-it'] = "Multiple"; +$text['label-multiple']['nl-nl'] = "Multiple"; +$text['label-multiple']['pl-pl'] = "Multiple"; +$text['label-multiple']['pt-br'] = "Multiple"; +$text['label-multiple']['pt-pt'] = "Multiple"; +$text['label-multiple']['ro-ro'] = "Multiple"; + $text['header-settings']['en-us'] = "Settings"; $text['header-settings']['en-gb'] = "Settings"; $text['header-settings']['ar-eg'] = ""; diff --git a/core/domain_settings/domain_setting_edit.php b/core/domain_settings/domain_setting_edit.php index 22b8a3c122..5fd1e5dbc3 100644 --- a/core/domain_settings/domain_setting_edit.php +++ b/core/domain_settings/domain_setting_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2020 + Portions created by the Initial Developer are Copyright (C) 2008-2021 the Initial Developer. All Rights Reserved. Contributor(s): @@ -325,7 +325,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true" && is_uuid($_GET["id"])) { $domain_setting_uuid = $_GET["id"]; - $sql = "select domain_setting_uuid, domain_setting_category, domain_setting_subcategory, domain_setting_name, domain_setting_value, cast(domain_setting_enabled as text), domain_setting_description "; + $sql = "select domain_setting_uuid, domain_setting_category, domain_setting_subcategory, domain_setting_name, domain_setting_value, domain_setting_order, cast(domain_setting_enabled as text), domain_setting_description "; $sql .= "from v_domain_settings "; $sql .= "where domain_uuid = :domain_uuid "; $sql .= "and domain_setting_uuid = :domain_setting_uuid "; @@ -695,6 +695,13 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; } + elseif ($category == "users" && $subcategory == "username_format" && $name == "text" ) { + echo " \n"; + } elseif ($category == "voicemail" && $subcategory == "voicemail_file" && $name == "text" ) { echo " \n"; } + elseif ($category == "destinations" && $subcategory == "dialplan_details" && $name == "boolean" ) { + echo " \n"; + } + elseif ($category == "destinations" && $subcategory == "dialplan_mode" && $name == "text" ) { + echo " \n"; + } + elseif ($category == "destinations" && $subcategory == "select_mode" && $name == "text" ) { + echo " \n"; + } + elseif ($category == "destinations" && $subcategory == "unique" && $name == "boolean" ) { + echo " \n"; + } elseif (is_json($row['domain_setting_value'])) { echo " \n"; } @@ -789,7 +820,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " ".$text['label-description']."\n"; echo "\n"; echo "
\n"; diff --git a/core/domain_settings/domain_settings.php b/core/domain_settings/domain_settings.php index 530af44112..ed4d245101 100644 --- a/core/domain_settings/domain_settings.php +++ b/core/domain_settings/domain_settings.php @@ -332,9 +332,18 @@ echo " ".(img_spacer('15px', '15px', 'background: '.escape($row['domain_setting_value']).'; margin-right: 4px; vertical-align: middle; border: 1px solid '.(color_adjust($row['domain_setting_value'], -0.18)).'; padding: -1px;')); echo "".escape($row['domain_setting_value'])."\n"; } + else if ($category == 'users' && $subcategory == 'username_format' && $name == 'text') { + echo " ".$text['option-username_format_'.$row['domain_setting_value']]."\n"; + } else if ($category == 'recordings' && $subcategory == 'storage_type' && $name == 'text') { echo " ".$text['label-'.$row['domain_setting_value']]."\n"; } + else if ($category == 'destinations' && $subcategory == 'dialplan_mode' && $name == 'text') { + echo " ".$text['label-'.$row['domain_setting_value']]."\n"; + } + else if ($category == 'destinations' && $subcategory == 'select_mode' && $name == 'text') { + echo " ".$text['label-'.$row['domain_setting_value']]."\n"; + } else { echo " ".escape($row['domain_setting_value'])."\n"; } diff --git a/core/domain_settings/resources/classes/domain_settings.php b/core/domain_settings/resources/classes/domain_settings.php index f4d810cd71..35a510349d 100644 --- a/core/domain_settings/resources/classes/domain_settings.php +++ b/core/domain_settings/resources/classes/domain_settings.php @@ -276,7 +276,7 @@ if (!class_exists('domain_settings')) { $array['domain_settings'][0]['domain_setting_name'] = $domain_setting_name; $array['domain_settings'][0]['domain_setting_value'] = $domain_setting_value; $array['domain_settings'][0]['domain_setting_order'] = $domain_setting_order; - $array['domain_settings'][0]['domain_setting_enabled'] = $domain_setting_enabled; + $array['domain_settings'][0]['domain_setting_enabled'] = $domain_setting_enabled ?: 0; $array['domain_settings'][0]['domain_setting_description'] = $domain_setting_description; //insert diff --git a/core/domains/domain_edit.php b/core/domains/domain_edit.php index 5f4e7e3757..c01851ba87 100644 --- a/core/domains/domain_edit.php +++ b/core/domains/domain_edit.php @@ -500,8 +500,6 @@ //clear the domains session array to update it unset($_SESSION["domains"]); - unset($_SESSION["domain_uuid"]); - unset($_SESSION["domain_name"]); unset($_SESSION['domain']); unset($_SESSION['switch']); diff --git a/core/domains/domains.php b/core/domains/domains.php index 1f1ca5a62f..22deeb6767 100644 --- a/core/domains/domains.php +++ b/core/domains/domains.php @@ -233,6 +233,7 @@ echo th_order_by('domain_name', $text['label-domain'], $order_by, $order); } echo th_order_by('domain_name', $text['label-domain_name'], $order_by, $order); + echo ""; echo th_order_by('domain_enabled', $text['label-domain_enabled'], $order_by, $order, null, "class='center'"); echo " \n"; if (permission_exists('domain_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') { @@ -264,15 +265,23 @@ echo " ".escape($row['domain_name']); } echo " \n"; + echo " \n"; if (permission_exists('domain_edit')) { echo " \n"; } else { echo " \n"; } - echo " \n"; echo " \n"; if (permission_exists('domain_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') { echo " \n"; echo "\n"; diff --git a/core/groups/group_permissions.php b/core/groups/group_permissions.php index 8fb203056f..23378c8860 100644 --- a/core/groups/group_permissions.php +++ b/core/groups/group_permissions.php @@ -94,6 +94,9 @@ } } +//get the view preference + $view = $_REQUEST['view']; + //get the http post data if (is_array($_POST['group_permissions'])) { $action = $_POST['action']; @@ -122,11 +125,13 @@ $sql .= " v_group_permissions as g \n"; $sql .= " on p.permission_name = g.permission_name \n"; $sql .= " and group_name = :group_name \n"; + $sql .= " and g.group_uuid = :group_uuid \n"; if (isset($sql_search)) { $sql .= "where ".$sql_search; } $sql .= " order by p.application_name, p.permission_name asc "; $parameters['group_name'] = $group_name; + $parameters['group_uuid'] = $group_uuid; $database = new database; $group_permissions = $database->select($sql, $parameters, 'all'); @@ -231,7 +236,7 @@ $token = new token; if (!$token->validate($_SERVER['PHP_SELF'])) { message::add($text['message-invalid_token'],'negative'); - header('Location: group_permissions.php?group_uuid='.urlencode($group_uuid).'&search='.urlencode($search)); + header('Location: group_permissions.php?group_uuid='.urlencode($group_uuid).($view ? '&view='.urlencode($view) : null).($search ? '&search='.urlencode($search) : null)); exit; } @@ -262,10 +267,6 @@ exit; } -//get order and order by - //$order_by = $_GET["order_by"]; - //$order = $_GET["order"]; - //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']); @@ -285,7 +286,13 @@ } echo "\n"; echo "\n"; - echo ""; + echo "\n"; + echo ""; echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','collapse'=>'hide-sm-dn','style'=>($search != '' ? 'display: none;' : null)]); echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','collapse'=>'hide-sm-dn','link'=>'group_permissions.php?group_uuid='.urlencode($group_uuid),'style'=>($search == '' ? 'display: none;' : null)]); if (permission_exists('group_permission_edit')) { @@ -302,6 +309,7 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; + echo " ".$text['label-ping_min']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-ping_min']."\n"; + echo "
\n"; + echo " ".$text['label-ping_max']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-ping_max']."\n"; + echo "
\n"; diff --git a/app/gateways/resources/classes/gateways.php b/app/gateways/resources/classes/gateways.php index 38236b3269..d0aec16895 100644 --- a/app/gateways/resources/classes/gateways.php +++ b/app/gateways/resources/classes/gateways.php @@ -553,7 +553,7 @@ if (!class_exists('gateways')) { //add new gateways to session variables if (is_array($gateways) && @sizeof($gateways) != 0) { - foreach ($gateways as $gateway_uuid -> $gateway) { + foreach ($gateways as $gateway_uuid => $gateway) { $_SESSION['gateways'][$gateway_uuid] = $gateway['name']; } } @@ -580,4 +580,4 @@ if (!class_exists('gateways')) { } } -?> \ No newline at end of file +?> diff --git a/app/grandstream/app_config.php b/app/grandstream/app_config.php index cb735d8a6f..278802ec7f 100644 --- a/app/grandstream/app_config.php +++ b/app/grandstream/app_config.php @@ -38,6 +38,14 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Call Waiting 0-default, 1-enabled, 2-disable."; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3efa97d6-a35a-4371-b3db-efca7ef9b9b5"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_call_waiting_ring"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Call waiting ringing instead of playing call waiting tone when call waiting is on. 0-disabled (default), 1-enabled"; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3a8841f3-e1c0-4eb1-abd3-068a3e3701a5"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_gxp_time_zone"; @@ -282,7 +290,7 @@ $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_dial_plan"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = '{\+x+|x+|*x+|*++|\p\a\r\k\+*x+|\f\l\o\w\+*x+}'; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{\+x+|x+|*x+|*++||\p\a\r\k\+*x+|\p\a\r\k\+x+|\f\l\o\w\+*x+|**x+}'; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Define the digits that are allowed to be called."; $y++; @@ -302,6 +310,22 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Bluetooth Handsfree - 0 - Off, 1 - On"; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5bc527d0-6f83-403b-a6c0-574540cfa9a6"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_headset_type"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Headset Type. 0 - Normal, 1 - Plantronics EHS. Default is 0"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "522ee640-5e24-4058-95ed-605bd982ec33"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_headset_key_mode"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "HEADSET Key Mode. 0 - Default Mode, 1 - Toggle Headset/Speaker. Default is 0"; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "453ec939-ef61-4ecd-ad0a-31905153efd8"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_auto_attended_transfer"; @@ -406,6 +430,14 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "BLF Call-pickup. 0 - Auto, 1 - Force BLF Call-pickup by prefix, 2 - Disabled. Default is 0"; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "53a9f955-d199-44f5-a97d-eed636348da5"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_blf_remote_status"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Hide BLF Remote Status. Default 0 - Not hidden, 1 - Hidden"; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "09ed1352-2594-4eb8-b3f8-93cdaabe6302"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_active_backlight_timeout"; @@ -614,37 +646,108 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Ring Timeout (in seconds). Default is 60 (30-3600)"; $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "06a35172-1bea-4611-87d0-9d66475ae709"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_wallpaper_source"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "0 - Default, 1 - Download, 2-USB(for GXP2140/2160/2170 only), 3 - Uploaded, 4 - Color Background"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7ee552de-4634-4d61-8869-e0f5230858fa"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_display_language"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "Auto"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Display Language. See provision profile for codes."; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "19604f85-b643-4b92-8e28-9c09c34cf559"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_blind_xfer_blf"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable Blind Transfer to BLF Yes=1, No=0. Default=0"; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "82b7076b-e596-49e8-b535-af86e21e0453"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_ip_address_mode"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "IP Address Mode. 0 - DHCP, 1 - Static IP, 2 - PPPoE. Default is 0"; - $y++; - + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "06a35172-1bea-4611-87d0-9d66475ae709"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_wallpaper_source"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "0 - Default, 1 - Download, 2-USB(for GXP2140/2160/2170 only), 3 - Uploaded, 4 - Color Background"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7ee552de-4634-4d61-8869-e0f5230858fa"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_display_language"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "Auto"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Display Language. See provision profile for codes."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "19604f85-b643-4b92-8e28-9c09c34cf559"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_blind_xfer_blf"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable Blind Transfer to BLF Yes=1, No=0. Default=0"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "82b7076b-e596-49e8-b535-af86e21e0453"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_ip_address_mode"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "IP Address Mode. 0 - DHCP, 1 - Static IP, 2 - PPPoE. Default is 0"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "6ab26457-fcc8-414e-8ac5-ae681f114974"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_speaker_ring_volume"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "5"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Number: 0-7. Default is 5."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "6f3f3390-2b69-4898-a4d9-e62249d58d58"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_feature_key_sync"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enabled: 1, Disabled: 0 Defaults to 0. Valid for firmware higher than 1.0.9.202 for the GXP series and all firmwares GRP phones."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "a6c84c0b-a7f1-4457-8afb-b64af601597d"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_wifi_enable"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = ""; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Configure the WiFi radio on supported phones. If disabled allow the device to manage itself"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "f7fdbe09-0d4a-4d06-b70b-e25cdf1b3376"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_wifi_essid"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = ""; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Configure the WiFi ESSID on supported phones"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "2edaa516-d87e-410f-8ddc-1cc468dabd2e"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_wifi_password"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = ""; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Configure the WiFi password on supported phones"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7b525ca5-96ae-4104-ad6c-c929f85c30dc"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_wifi_hidden_security"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "None"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Configure the security to use when connecting to a hidden SSID. Valid values: None, WEP, WPA/WPA2_PSK, 802.1X_EAP"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "032e7e44-2f61-4d62-ba64-00199a51b4f6"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_dhcp_option_override"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Allow DHCP Option 43 and Option 66 to override server. 0 - No, 1 - Yes, 2 - Prefer, fallback when failed. Default is 1. option 2 not on all phones"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b91d347a-4705-4798-92d4-a3a98916f330"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_dhcp_option_additional_override"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Additional Override DHCP Option. 0 - None, 1 - Option 150, 2 - Option 160. Default is 0. option will be effective only when grandstream_dhcp_option_override is enabled"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "12d023f4-9fdf-4f4b-830b-f311fcaa2503"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_dhcp_option_override_sip_server"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Allow DHCP Option 120 to Override SIP Server. 0 - No, 1 - Yes. Default is 0"; + $y++; ?> diff --git a/app/ivr_menus/app_config.php b/app/ivr_menus/app_config.php index b5b4229262..88d5f857aa 100644 --- a/app/ivr_menus/app_config.php +++ b/app/ivr_menus/app_config.php @@ -48,7 +48,8 @@ $y++; $apps[$x]['destinations'][$y]['type'] = "sql"; $apps[$x]['destinations'][$y]['label'] = "ivr_menus_sub"; - $apps[$x]['destinations'][$y]['name'] = "ivr_menus"; + $apps[$x]['destinations'][$y]['name'] = "ivr_menus_sub"; + $apps[$x]['destinations'][$y]['sql'] = "select ivr_menu_name as name, ivr_menu_uuid as uuid from v_ivr_menus "; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and ivr_menu_enabled = 'true' "; $apps[$x]['destinations'][$y]['order_by'] = "ivr_menu_extension asc"; $apps[$x]['destinations'][$y]['field']['name'] = "ivr_menu_name"; @@ -59,24 +60,21 @@ $y++; $apps[$x]['destinations'][$y]['type'] = 'array'; $apps[$x]['destinations'][$y]['label'] = 'ivr_menus_other'; - $apps[$x]['destinations'][$y]['name'] = 'ivr_menus'; + $apps[$x]['destinations'][$y]['name'] = 'ivr_menus_other'; $apps[$x]['destinations'][$y]['field']['name'] = 'name'; $apps[$x]['destinations'][$y]['field']['destination'] = 'destination'; $apps[$x]['destinations'][$y]['select_value']['ivr'] = "\${name}:"; $apps[$x]['destinations'][$y]['select_label'] = "\${name}"; $z=0; - $apps[$x]['destinations'][$y]['result']['data'][$z]['label'] = 'top'; - $apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'menu-top'; - $apps[$x]['destinations'][$y]['result']['data'][$z]['application'] = 'menu-top'; + $apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'top'; + $apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = 'menu-top'; $z++; - $apps[$x]['destinations'][$y]['result']['data'][$z]['label'] = 'back'; - $apps[$x]['destinations'][$y]['result']['data'][$z]['label'] = 'back'; - $apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'menu-back'; + $apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'back'; + $apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = 'menu-back'; $z++; - $apps[$x]['destinations'][$y]['result']['data'][$z]['label'] = 'exit'; - $apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'menu-exit'; + $apps[$x]['destinations'][$y]['result']['data'][$z]['name'] = 'exit'; + $apps[$x]['destinations'][$y]['result']['data'][$z]['destination'] = 'menu-exit'; //menu-say-phrase - //menu-play-sound //permission details $y=0; @@ -122,6 +120,14 @@ $apps[$x]['permissions'][$y]['name'] = "ivr_menu_destinations"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "ivr_menus_sub_destinations"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "ivr_menus_other_destinations"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; //default settings $y=0; @@ -149,6 +155,38 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "1012fd92-acf9-4ce9-89da-f02d4cd0e794"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "ivr_menu"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "confirm_attempts"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "028bab4e-60e3-48d0-8892-4f678c8b72af"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "ivr_menu"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "inter_digit_timeout"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "2000"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Digit timeout in milliseconds"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "f5829fb7-8bd6-4c42-af16-565882fad7ca"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "ivr_menu"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "max_failures"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "46dc3c7b-8a8d-4957-b4bd-27708c933af9"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "ivr_menu"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "max_timeouts"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "26984efd-2445-4ac9-b459-bb7bda4217c6"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "limit"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "ivr_menus"; @@ -223,6 +261,14 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_dialect"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_voice"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_greet_long"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; @@ -239,6 +285,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_pin_number"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_confirm_macro"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; diff --git a/app/ivr_menus/app_defaults.php b/app/ivr_menus/app_defaults.php index 92b44ff490..4075d60551 100644 --- a/app/ivr_menus/app_defaults.php +++ b/app/ivr_menus/app_defaults.php @@ -52,14 +52,37 @@ if ($domains_processed == 1) { } } if (is_array($array) && @sizeof($array) != 0) { + + $p = new permissions; + $p->add('ivr_menu_edit', 'temp'); + $database = new database; $database->app_name = 'ivr_menus'; $database->app_uuid = 'a5788e9b-58bc-bd1b-df59-fff5d51253ab'; $database->save($array); unset($array); + + $p->delete('ivr_menu_edit', 'temp'); } } + //use the ivr_menu_language to update the language dialect and voice + $sql = "update v_ivr_menus set "; + if ($db_type == 'pgsql') { + $sql .= "ivr_menu_language = split_part(ivr_menu_language, '/', 1), "; + $sql .= "ivr_menu_dialect = split_part(ivr_menu_language, '/', 2), "; + $sql .= "ivr_menu_voice = split_part(ivr_menu_language, '/', 3) "; + } + elseif ($db_type == 'mysql') { + $sql .= "ivr_menu_language = SUBSTRING_INDEX(SUBSTRING_INDEX(ivr_menu_language, '/', 1), '/', -1), "; + $sql .= "ivr_menu_dialect = SUBSTRING_INDEX(SUBSTRING_INDEX(ivr_menu_language, '/', 2), '/', -1), "; + $sql .= "ivr_menu_voice = SUBSTRING_INDEX(SUBSTRING_INDEX(ivr_menu_language, '/', 3), '/', -1) "; + } + $sql .= "where ivr_menu_language like '%/%/%'; "; + $database = new database; + $ivr_menus = $database->select($sql, null, 'all'); + unset($sql); + } ?> diff --git a/app/ivr_menus/app_languages.php b/app/ivr_menus/app_languages.php index 62e135c59f..d87b6b46ac 100644 --- a/app/ivr_menus/app_languages.php +++ b/app/ivr_menus/app_languages.php @@ -9,8 +9,8 @@ $text['title-option_edit']['de-ch'] = "Optionen der Automatischen Vermittlung be $text['title-option_edit']['de-de'] = "Optionen der Automatischen Vermittlung bearbeiten"; $text['title-option_edit']['es-cl'] = "Editar Menú IVR"; $text['title-option_edit']['es-mx'] = "Editar Menú IVR"; //copied from es-cl -$text['title-option_edit']['fr-ca'] = "Menu SVI Editer un Option"; //copied from fr-fr -$text['title-option_edit']['fr-fr'] = "Menu SVI Editer un Option"; +$text['title-option_edit']['fr-ca'] = "Menu RVI Editer un Option"; //copied from fr-fr +$text['title-option_edit']['fr-fr'] = "Menu RVI Editer un Option"; $text['title-option_edit']['he-il'] = ""; $text['title-option_edit']['it-it'] = "Modifica Opzioni Menu IVR"; $text['title-option_edit']['nl-nl'] = "IVR meni optie bewerken"; @@ -30,7 +30,7 @@ $text['title-option_add']['de-ch'] = "Optionen der Automatischen Vermittlung hin $text['title-option_add']['de-de'] = "Optionen der Automatischen Vermittlung hinzufügen"; $text['title-option_add']['es-cl'] = "Agregar Menú IVR"; $text['title-option_add']['es-mx'] = "Agregar Menú IVR"; //copied from es-cl -$text['title-option_add']['fr-ca'] = "Menu SVI Ajouter une Option"; //copied from fr-fr +$text['title-option_add']['fr-ca'] = "Menu RVI Ajouter une Option"; //copied from fr-fr $text['title-option_add']['fr-fr'] = "Menu SVI Ajouter une Option"; $text['title-option_add']['he-il'] = ""; $text['title-option_add']['it-it'] = "Inserisci Opzione Menu IVR"; @@ -51,7 +51,7 @@ $text['title-ivr_menus']['de-ch'] = "Automatische Vermittlungen"; //copied from $text['title-ivr_menus']['de-de'] = "Automatische Vermittlungen"; $text['title-ivr_menus']['es-cl'] = "Menus IVR"; $text['title-ivr_menus']['es-mx'] = "Menus IVR"; //copied from es-cl -$text['title-ivr_menus']['fr-ca'] = "Menus SVI"; //copied from fr-fr +$text['title-ivr_menus']['fr-ca'] = "Menus RVI"; //copied from fr-fr $text['title-ivr_menus']['fr-fr'] = "Menus SVI"; $text['title-ivr_menus']['he-il'] = ""; $text['title-ivr_menus']['it-it'] = "Menu IVR"; @@ -72,7 +72,7 @@ $text['title-ivr_menu']['de-ch'] = "Automatische Vermittlung"; //copied from de- $text['title-ivr_menu']['de-de'] = "Automatische Vermittlung"; $text['title-ivr_menu']['es-cl'] = "Menú IVR"; $text['title-ivr_menu']['es-mx'] = "Menú IVR"; //copied from es-cl -$text['title-ivr_menu']['fr-ca'] = "Menu SVI"; //copied from fr-fr +$text['title-ivr_menu']['fr-ca'] = "Menu RVI"; //copied from fr-fr $text['title-ivr_menu']['fr-fr'] = "Menu SVI"; $text['title-ivr_menu']['he-il'] = ""; $text['title-ivr_menu']['it-it'] = "Menu IVR"; @@ -93,7 +93,7 @@ $text['title-ivr_menus_sub']['de-ch'] = "Automatische Vermittlungen - Sub"; //co $text['title-ivr_menus_sub']['de-de'] = "Automatische Vermittlungen - Sub"; $text['title-ivr_menus_sub']['es-cl'] = "Menus IVR - Sub"; $text['title-ivr_menus_sub']['es-mx'] = "Menus IVR - Sub"; //copied from es-cl -$text['title-ivr_menus_sub']['fr-ca'] = "Menus SVI - Sub"; //copied from fr-fr +$text['title-ivr_menus_sub']['fr-ca'] = "Menus RVI - Sub"; //copied from fr-fr $text['title-ivr_menus_sub']['fr-fr'] = "Menus SVI - Sub"; $text['title-ivr_menus_sub']['he-il'] = ""; $text['title-ivr_menus_sub']['it-it'] = "Menu IVR - Sub"; @@ -114,8 +114,8 @@ $text['title-ivr_menus_other']['de-ch'] = "Automatische Vermittlungen - Other"; $text['title-ivr_menus_other']['de-de'] = "Automatische Vermittlungen - Other"; $text['title-ivr_menus_other']['es-cl'] = "Menus IVR - Other"; $text['title-ivr_menus_other']['es-mx'] = "Menus IVR - Other"; //copied from es-cl -$text['title-ivr_menus_other']['fr-ca'] = "Menus SVI - Other"; //copied from fr-fr -$text['title-ivr_menus_other']['fr-fr'] = "Menus SVI - Other"; +$text['title-ivr_menus_other']['fr-ca'] = "Menus RVI - Autre"; //copied from fr-fr +$text['title-ivr_menus_other']['fr-fr'] = "Menus SVI - Autre"; $text['title-ivr_menus_other']['he-il'] = ""; $text['title-ivr_menus_other']['it-it'] = "Menu IVR - Other"; $text['title-ivr_menus_other']['nl-nl'] = "IVR Sub - menu"; @@ -198,7 +198,7 @@ $text['message-maximum_ivr_menus']['de-ch'] = "Maximale Anzahl an Automatischen $text['message-maximum_ivr_menus']['de-de'] = "Maximale Anzahl an Automatischen Vermittlungen:"; $text['message-maximum_ivr_menus']['es-cl'] = "Máxima IVR Menús Animales:"; $text['message-maximum_ivr_menus']['es-mx'] = "Máxima IVR Menús Animales:"; //copied from es-cl -$text['message-maximum_ivr_menus']['fr-ca'] = "Menus Maximale SVI Admis:"; //copied from fr-fr +$text['message-maximum_ivr_menus']['fr-ca'] = "Menus Maximale RVI Admis:"; $text['message-maximum_ivr_menus']['fr-fr'] = "Menus Maximale SVI Admis:"; $text['message-maximum_ivr_menus']['he-il'] = ""; $text['message-maximum_ivr_menus']['it-it'] = "Massimo Menu IVR:"; @@ -631,6 +631,27 @@ $text['label-destination']['ru-ru'] = "Место назначения"; $text['label-destination']['sv-se'] = "Destination"; $text['label-destination']['uk-ua'] = ""; +$text['label-pin_number']['en-us'] = "Pin Number"; +$text['label-pin_number']['en-gb'] = "Pin Number"; +$text['label-pin_number']['ar-eg'] = ""; +$text['label-pin_number']['de-at'] = "PIN Nummer"; //copied from de-de +$text['label-pin_number']['de-ch'] = "PIN Nummer"; //copied from de-de +$text['label-pin_number']['de-de'] = "PIN Nummer"; +$text['label-pin_number']['es-cl'] = "Número Pin"; +$text['label-pin_number']['es-mx'] = "Número Pin"; //copied from es-cl +$text['label-pin_number']['fr-ca'] = "Code Pin"; //copied from fr-fr +$text['label-pin_number']['fr-fr'] = "Code Pin"; +$text['label-pin_number']['he-il'] = ""; +$text['label-pin_number']['it-it'] = "PIN"; +$text['label-pin_number']['nl-nl'] = "PIN"; +$text['label-pin_number']['pl-pl'] = ""; +$text['label-pin_number']['pt-br'] = "Código Pin"; //copied from pt-pt +$text['label-pin_number']['pt-pt'] = "Código Pin"; +$text['label-pin_number']['ro-ro'] = ""; +$text['label-pin_number']['ru-ru'] = "PIN Номер"; +$text['label-pin_number']['sv-se'] = "Pin Nummer"; +$text['label-pin_number']['uk-ua'] = ""; + $text['label-comfirm_macro']['en-us'] = "Confirm Macro"; $text['label-comfirm_macro']['en-gb'] = "Confirm Macro"; $text['label-comfirm_macro']['ar-eg'] = ""; @@ -765,7 +786,7 @@ $text['header-option_edit']['de-ch'] = "Optionen der Automatischen Vermittlung b $text['header-option_edit']['de-de'] = "Optionen der Automatischen Vermittlung bearbeiten"; $text['header-option_edit']['es-cl'] = "Editar Menú IVR"; $text['header-option_edit']['es-mx'] = "Editar Menú IVR"; //copied from es-cl -$text['header-option_edit']['fr-ca'] = "Menu SVI Editer un Option"; //copied from fr-fr +$text['header-option_edit']['fr-ca'] = "Menu RVI Editer un Option"; $text['header-option_edit']['fr-fr'] = "Menu SVI Editer un Option"; $text['header-option_edit']['he-il'] = ""; $text['header-option_edit']['it-it'] = "Modificare Opzioni Menu IVR"; @@ -786,7 +807,7 @@ $text['header-option_add']['de-ch'] = "Optionen der Automatischen Vermittlung hi $text['header-option_add']['de-de'] = "Optionen der Automatischen Vermittlung hinzufügen"; $text['header-option_add']['es-cl'] = "Agregar Menú IVR"; $text['header-option_add']['es-mx'] = "Agregar Menú IVR"; //copied from es-cl -$text['header-option_add']['fr-ca'] = "Menu SVI Ajouter une Option"; //copied from fr-fr +$text['header-option_add']['fr-ca'] = "Menu RVI Ajouter une Option"; //copied from fr-fr $text['header-option_add']['fr-fr'] = "Menu SVI Ajouter une Option"; $text['header-option_add']['he-il'] = ""; $text['header-option_add']['it-it'] = "Inserire Opzioni Menu IVR"; @@ -807,7 +828,7 @@ $text['header-ivr_menus']['de-ch'] = "Automatische Vermittlungen"; //copied from $text['header-ivr_menus']['de-de'] = "Automatische Vermittlungen"; $text['header-ivr_menus']['es-cl'] = "Menus IVR"; $text['header-ivr_menus']['es-mx'] = "Menus IVR"; //copied from es-cl -$text['header-ivr_menus']['fr-ca'] = "Menus SVI"; //copied from fr-fr +$text['header-ivr_menus']['fr-ca'] = "Menus RVI"; $text['header-ivr_menus']['fr-fr'] = "Menus SVI"; $text['header-ivr_menus']['he-il'] = ""; $text['header-ivr_menus']['it-it'] = "Menu IVR"; @@ -828,7 +849,7 @@ $text['header-ivr_menu']['de-ch'] = "Automatische Vermittlung"; //copied from de $text['header-ivr_menu']['de-de'] = "Automatische Vermittlung"; $text['header-ivr_menu']['es-cl'] = "Menú IVR"; $text['header-ivr_menu']['es-mx'] = "Menú IVR"; //copied from es-cl -$text['header-ivr_menu']['fr-ca'] = "Menu SVI"; //copied from fr-fr +$text['header-ivr_menu']['fr-ca'] = "Menu RVI"; $text['header-ivr_menu']['fr-fr'] = "Menu SVI"; $text['header-ivr_menu']['he-il'] = ""; $text['header-ivr_menu']['it-it'] = "Menu IVR"; @@ -1038,7 +1059,7 @@ $text['description-name']['de-ch'] = "Geben Sie den Namen der Automatischen Verm $text['description-name']['de-de'] = "Geben Sie den Namen der Automatischen Vermittlung an"; $text['description-name']['es-cl'] = "Ingrese un nombre para el menú IVR."; $text['description-name']['es-mx'] = "Ingrese un nombre para el menú IVR."; //copied from es-cl -$text['description-name']['fr-ca'] = "Choisir un nom pour le menu SVI"; //copied from fr-fr +$text['description-name']['fr-ca'] = "Choisir un nom pour le menu RVI"; $text['description-name']['fr-fr'] = "Choisir un nom pour le menu SVI"; $text['description-name']['he-il'] = ""; $text['description-name']['it-it'] = "Inserire un nome per l'IVR."; @@ -1101,7 +1122,7 @@ $text['description-ivr_menus']['de-ch'] = "Die Automatische Vermittlung spielt e $text['description-ivr_menus']['de-de'] = "Die Automatische Vermittlung spielt eine Aufnahme oder eine vordefinierte Phrase ab von welcher der Anrufe seine Optionen wählt. Jede Option hat ein entsprechendes Ziel. Das Ziel kann eine Nebenstelle, eine Mailbox eine andere Automatische Vermittlung, Rufgruppen, Fax Server und weitere Funktionen sein."; $text['description-ivr_menus']['es-cl'] = "El menú IVR reproduce una grabación o una frase predefinida que presenta opciones para elegir. Cada opción corresponde a un destino. Los destinos pueden ser extensiones, correo de voz, IVR, grupos, fax entre otros."; $text['description-ivr_menus']['es-mx'] = "El menú IVR reproduce una grabación o una frase predefinida que presenta opciones para elegir. Cada opción corresponde a un destino. Los destinos pueden ser extensiones, correo de voz, IVR, grupos, fax entre otros."; //copied from es-cl -$text['description-ivr_menus']['fr-ca'] = "Le Menu SVI joue un guide vocal ou un texte prédéfini qui présente à l'appelant des options à choisir. Chaque option est configurée avec une destination correspondante. Ces destnations peuvent être des extensions, messageries vocales, d'autres menus SVI, groupes d'appel, Fax, ou autres."; //copied from fr-fr +$text['description-ivr_menus']['fr-ca'] = "Le Menu RVI joue un guide vocal ou un texte prédéfini qui présente à l'appelant des options à choisir. Chaque option est configurée avec une destination correspondante. Ces destnations peuvent être des extensions, messageries vocales, d'autres menus RVI, groupes d'appel, Fax, ou autres."; $text['description-ivr_menus']['fr-fr'] = "Le Menu SVI joue un guide vocal ou un texte prédéfini qui présente à l'appelant des options à choisir. Chaque option est configurée avec une destination correspondante. Ces destnations peuvent être des extensions, messageries vocales, d'autres menus SVI, groupes d'appel, Fax, ou autres."; $text['description-ivr_menus']['he-il'] = ""; $text['description-ivr_menus']['it-it'] = "Il Menu IVR suona al chiamante una registrazione o una frase che illustra le opzioni selezionabili. Ciascuna opzione ha una destinazione corrispondente. Le destinazioni possono essere interni, caselle vocali, altri IVR, gruppi di squillo, FAX virtuali, etc."; @@ -1122,7 +1143,7 @@ $text['description-ivr_menu']['de-ch'] = "Die Automatische Vermittlung spielt ei $text['description-ivr_menu']['de-de'] = "Die Automatische Vermittlung spielt eine Aufnahme oder eine vordefinierte Phrase ab von welcher der Anrufe seine Optionen wählt. Jede Option hat ein entsprechendes Ziel. Das Ziel kann eine Nebenstelle, eine Mailbox eine andere Automatische Vermittlung, Rufgruppen, Fax Server und weitere Funktionen sein."; $text['description-ivr_menu']['es-cl'] = "El menú IVR reproduce una grabación o una frase predefinida que presenta opciones para elegir. Cada opción corresponde a un destino. Los destinos pueden ser extensiones, correo de voz, IVR, grupos, fax entre otros."; $text['description-ivr_menu']['es-mx'] = "El menú IVR reproduce una grabación o una frase predefinida que presenta opciones para elegir. Cada opción corresponde a un destino. Los destinos pueden ser extensiones, correo de voz, IVR, grupos, fax entre otros."; //copied from es-cl -$text['description-ivr_menu']['fr-ca'] = "Le Menu SVI joue un guide vocal ou un texte prédéfini qui présente à l'appelant des options à choisir. Chaque option est configurée avec une destination correspondante. Ces destnations peuvent être des extensions, messageries vocales, d'autres menus SVI, groupes d'appel, Fax, ou autres."; //copied from fr-fr +$text['description-ivr_menu']['fr-ca'] = "Le Menu RVI joue un guide vocal ou un texte prédéfini qui présente à l'appelant des options à choisir. Chaque option est configurée avec une destination correspondante. Ces destnations peuvent être des extensions, messageries vocales, d'autres menus RVI, groupes d'appel, Fax, ou autres."; //copied from fr-fr $text['description-ivr_menu']['fr-fr'] = "Le Menu SVI joue un guide vocal ou un texte prédéfini qui présente à l'appelant des options à choisir. Chaque option est configurée avec une destination correspondante. Ces destnations peuvent être des extensions, messageries vocales, d'autres menus SVI, groupes d'appel, Fax, ou autres."; $text['description-ivr_menu']['he-il'] = ""; $text['description-ivr_menu']['it-it'] = "Il Menu IVR suona al chiamante una registrazione o una frase che illustra le opzioni selezionabili. Ciascuna opzione ha una destinazione corrispondente. Le destinazioni possono essere interni, caselle vocali, altri IVR, gruppi di squillo, FAX virtuali, etc."; @@ -1269,7 +1290,7 @@ $text['description-exit_action']['de-ch'] = "Wählen Sie eine Aktion bei Verlass $text['description-exit_action']['de-de'] = "Wählen Sie eine Aktion bei Verlassen der Automatischen Vermittlung."; $text['description-exit_action']['es-cl'] = "Seleccione la acción de salida a ser realizada si el IVR existe."; $text['description-exit_action']['es-mx'] = "Seleccione la acción de salida a ser realizada si el IVR existe."; //copied from es-cl -$text['description-exit_action']['fr-ca'] = "Choisir l'action à executer en sortie si on sort du SVI par ailleurs qu'un des choix proposé."; //copied from fr-fr +$text['description-exit_action']['fr-ca'] = "Choisir l'action à executer en sortie si on sort du RVI par ailleurs qu'un des choix proposé."; //copied from fr-fr $text['description-exit_action']['fr-fr'] = "Choisir l'action à executer en sortie si on sort du SVI par ailleurs qu'un des choix proposé."; $text['description-exit_action']['he-il'] = ""; $text['description-exit_action']['it-it'] = "Scegliere l'azione da compiere quando si esce dall'IVR."; @@ -1311,7 +1332,7 @@ $text['description-direct_dial']['de-ch'] = "Definieren Sie ob Anrufer direkt zu $text['description-direct_dial']['de-de'] = "Definieren Sie ob Anrufer direkt zu Nebenstellen durchwählen können."; $text['description-direct_dial']['es-cl'] = "Define si quienes llaman pueden marcar directamente a las extensiones y códigos."; $text['description-direct_dial']['es-mx'] = "Define si quienes llaman pueden marcar directamente a las extensiones y códigos."; //copied from es-cl -$text['description-direct_dial']['fr-ca'] = "Défini si on peut appeler directement le SVI via une extension."; //copied from fr-fr +$text['description-direct_dial']['fr-ca'] = "Défini si on peut appeler directement le RVI via une extension."; //copied from fr-fr $text['description-direct_dial']['fr-fr'] = "Défini si on peut appeler directement le SVI via une extension."; $text['description-direct_dial']['he-il'] = ""; $text['description-direct_dial']['it-it'] = "Definire se i chiamanti possono chiamare direttamente gli interni registrati."; @@ -1366,6 +1387,27 @@ $text['description-destination']['ru-ru'] = "Выберите пункт наз $text['description-destination']['sv-se'] = "Välj destination."; $text['description-destination']['uk-ua'] = ""; +$text['description-pin_number']['en-us'] = "Optional pin number to secure access to the menu."; +$text['description-pin_number']['en-gb'] = "Optional pin number to secure access to the menu."; +$text['description-pin_number']['ar-eg'] = ""; +$text['description-pin_number']['de-at'] = ""; +$text['description-pin_number']['de-ch'] = ""; +$text['description-pin_number']['de-de'] = ""; +$text['description-pin_number']['es-cl'] = ""; +$text['description-pin_number']['es-mx'] = ""; +$text['description-pin_number']['fr-ca'] = ""; +$text['description-pin_number']['fr-fr'] = ""; +$text['description-pin_number']['he-il'] = ""; +$text['description-pin_number']['it-it'] = ""; +$text['description-pin_number']['nl-nl'] = ""; +$text['description-pin_number']['pl-pl'] = ""; +$text['description-pin_number']['pt-br'] = ""; +$text['description-pin_number']['pt-pt'] = ""; +$text['description-pin_number']['ro-ro'] = ""; +$text['description-pin_number']['ru-ru'] = ""; +$text['description-pin_number']['sv-se'] = ""; +$text['description-pin_number']['uk-ua'] = ""; + $text['description-comfirm_macro']['en-us'] = "Enter the confirm macro."; $text['description-comfirm_macro']['en-gb'] = "Enter the confirm macro."; $text['description-comfirm_macro']['ar-eg'] = ""; diff --git a/app/ivr_menus/ivr_menu_copy.php b/app/ivr_menus/ivr_menu_copy.php index 21cd68476f..22dc134b87 100644 --- a/app/ivr_menus/ivr_menu_copy.php +++ b/app/ivr_menus/ivr_menu_copy.php @@ -57,7 +57,7 @@ $database = new database; $ivr_menus = $database->select($sql, $parameters, 'all'); if (!is_array($ivr_menus)) { - echo "access denied 63"; + echo "access denied"; exit; } unset($sql, $parameters); @@ -84,6 +84,11 @@ $ivr_menu_name = $ivr_menus[$x]['ivr_menu_name']; $ivr_menu_extension = $ivr_menus[$x]['ivr_menu_extension']; $ivr_menu_ringback = $ivr_menus[$x]['ivr_menu_ringback']; + $ivr_menu_language = $ivr_menus[$x]['ivr_menu_language']; + $ivr_menu_dialect = $ivr_menus[$x]['ivr_menu_dialect']; + $ivr_menu_voice = $ivr_menus[$x]['ivr_menu_voice']; + $ivr_menu_cid_prefix = $ivr_menus[$x]['ivr_menu_cid_prefix']; + $ivr_menu_context = $ivr_menus[$x]['ivr_menu_context']; $ivr_menu_description = $ivr_menus[$x]['ivr_menu_description'].' ('.$text['label-copy'].')'; //prepare the ivr menu array @@ -107,12 +112,23 @@ //build the xml dialplan $dialplan_xml = "\n"; $dialplan_xml .= " \n"; + $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; + $dialplan_xml .= " \n"; + if (strlen($ivr_menu_language) > 0) { + $dialplan_xml .= " \n"; + $dialplan_xml .= " \n"; + $dialplan_xml .= " \n"; + } $dialplan_xml .= " \n"; + if (strlen($ivr_menu_cid_prefix) > 0) { + $dialplan_xml .= " \n"; + $dialplan_xml .= " \n"; + } $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; @@ -123,7 +139,7 @@ $dialplan[$x]["dialplan_uuid"] = $dialplan_uuid; $dialplan[$x]["dialplan_name"] = $ivr_menu_name; $dialplan[$x]["dialplan_number"] = $ivr_menu_extension; - $dialplan[$x]["dialplan_context"] = $_SESSION["context"]; + $dialplan[$x]["dialplan_context"] = $ivr_menu_context; $dialplan[$x]["dialplan_continue"] = "false"; $dialplan[$x]["dialplan_xml"] = $dialplan_xml; $dialplan[$x]["dialplan_order"] = "101"; @@ -156,7 +172,7 @@ //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$ivr_menu_context); //set message message::add($text['message-copy']); diff --git a/app/ivr_menus/ivr_menu_edit.php b/app/ivr_menus/ivr_menu_edit.php index a45b7c0a94..14e58916d3 100644 --- a/app/ivr_menus/ivr_menu_edit.php +++ b/app/ivr_menus/ivr_menu_edit.php @@ -112,6 +112,7 @@ $ivr_menu_options = $_POST["ivr_menu_options"]; $ivr_menu_invalid_sound = $_POST["ivr_menu_invalid_sound"]; $ivr_menu_exit_sound = $_POST["ivr_menu_exit_sound"]; + $ivr_menu_pin_number = $_POST["ivr_menu_pin_number"]; $ivr_menu_confirm_macro = $_POST["ivr_menu_confirm_macro"]; $ivr_menu_confirm_key = $_POST["ivr_menu_confirm_key"]; $ivr_menu_tts_engine = $_POST["ivr_menu_tts_engine"]; @@ -248,6 +249,12 @@ $dialplan_uuid = uuid(); } + //seperate the language components into language, dialect and voice + $language_array = explode("/",$ivr_menu_language); + $ivr_menu_language = $language_array[0]; + $ivr_menu_dialect = $language_array[1]; + $ivr_menu_voice = $language_array[2]; + //prepare the array $array['ivr_menus'][0]["ivr_menu_uuid"] = $ivr_menu_uuid; $array['ivr_menus'][0]["domain_uuid"] = $domain_uuid; @@ -256,10 +263,13 @@ $array['ivr_menus'][0]["ivr_menu_extension"] = $ivr_menu_extension; $array['ivr_menus'][0]["ivr_menu_parent_uuid"] = $ivr_menu_parent_uuid; $array['ivr_menus'][0]["ivr_menu_language"] = $ivr_menu_language; + $array['ivr_menus'][0]["ivr_menu_dialect"] = $ivr_menu_dialect; + $array['ivr_menus'][0]["ivr_menu_voice"] = $ivr_menu_voice; $array['ivr_menus'][0]["ivr_menu_greet_long"] = $ivr_menu_greet_long; $array['ivr_menus'][0]["ivr_menu_greet_short"] = $ivr_menu_greet_short; $array['ivr_menus'][0]["ivr_menu_invalid_sound"] = $ivr_menu_invalid_sound; $array['ivr_menus'][0]["ivr_menu_exit_sound"] = $ivr_menu_exit_sound; + $array['ivr_menus'][0]["ivr_menu_pin_number"] = $ivr_menu_pin_number; $array['ivr_menus'][0]["ivr_menu_confirm_macro"] = $ivr_menu_confirm_macro; $array['ivr_menus'][0]["ivr_menu_confirm_key"] = $ivr_menu_confirm_key; $array['ivr_menus'][0]["ivr_menu_tts_engine"] = $ivr_menu_tts_engine; @@ -318,8 +328,6 @@ } //build the xml dialplan - $ivr_menu_language = explode("/",$_POST["ivr_menu_language"]); - $dialplan_xml = "\n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; @@ -328,10 +336,10 @@ $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; - if (isset($_POST["ivr_menu_language"])) { - $dialplan_xml .= " \n"; - $dialplan_xml .= " \n"; - $dialplan_xml .= " \n"; + if (strlen($ivr_menu_language) > 0) { + $dialplan_xml .= " \n"; + $dialplan_xml .= " \n"; + $dialplan_xml .= " \n"; } $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; @@ -340,6 +348,10 @@ $dialplan_xml .= " \n"; } else { + if (strlen($ivr_menu_cid_prefix) > 0) { + $dialplan_xml .= " \n"; + $dialplan_xml .= " \n"; + } $dialplan_xml .= " \n"; } @@ -456,6 +468,7 @@ $ivr_menu_greet_short = $row["ivr_menu_greet_short"]; $ivr_menu_invalid_sound = $row["ivr_menu_invalid_sound"]; $ivr_menu_exit_sound = $row["ivr_menu_exit_sound"]; + $ivr_menu_pin_number = $row["ivr_menu_pin_number"]; $ivr_menu_confirm_macro = $row["ivr_menu_confirm_macro"]; $ivr_menu_confirm_key = $row["ivr_menu_confirm_key"]; $ivr_menu_tts_engine = $row["ivr_menu_tts_engine"]; @@ -531,15 +544,40 @@ if (strlen($ivr_menu_ringback) == 0) { $ivr_menu_ringback = 'local_stream://default'; } if (strlen($ivr_menu_invalid_sound) == 0) { $ivr_menu_invalid_sound = 'ivr/ivr-that_was_an_invalid_entry.wav'; } //if (strlen($ivr_menu_confirm_key) == 0) { $ivr_menu_confirm_key = '#'; } - if (strlen($ivr_menu_language_code) == 0) { $ivr_menu_language_code = 'en'; } - if (strlen($ivr_menu_dialect) == 0) { $ivr_menu_dialect = 'us'; } - if (strlen($ivr_menu_voice) == 0) { $ivr_menu_voice = 'callie'; } if (strlen($ivr_menu_tts_engine) == 0) { $ivr_menu_tts_engine = 'flite'; } if (strlen($ivr_menu_tts_voice) == 0) { $ivr_menu_tts_voice = 'rms'; } - if (strlen($ivr_menu_confirm_attempts) == 0) { $ivr_menu_confirm_attempts = '1'; } - if (strlen($ivr_menu_inter_digit_timeout) == 0) { $ivr_menu_inter_digit_timeout = '2000'; } - if (strlen($ivr_menu_max_failures) == 0) { $ivr_menu_max_failures = '1'; } - if (strlen($ivr_menu_max_timeouts) == 0) { $ivr_menu_max_timeouts = '1'; } + if (strlen($ivr_menu_confirm_attempts) == 0) { + if (strlen($_SESSION['ivr_menu']['confirm_attempts']['numeric']) > 0) { + $ivr_menu_confirm_attempts = $_SESSION['ivr_menu']['confirm_attempts']['numeric']; + } + else { + $ivr_menu_confirm_attempts = '1'; + } + } + if (strlen($ivr_menu_inter_digit_timeout) == 0) { + if (strlen($_SESSION['ivr_menu']['inter_digit_timeout']['numeric']) > 0) { + $ivr_menu_inter_digit_timeout = $_SESSION['ivr_menu']['inter_digit_timeout']['numeric']; + } + else { + $ivr_menu_inter_digit_timeout = '2000'; + } + } + if (strlen($ivr_menu_max_failures) == 0) { + if (strlen($_SESSION['ivr_menu']['max_failures']['numeric']) > 0) { + $ivr_menu_max_failures = $_SESSION['ivr_menu']['max_failures']['numeric']; + } + else { + $ivr_menu_max_failures = '1'; + } + } + if (strlen($ivr_menu_max_timeouts) == 0) { + if (strlen($_SESSION['ivr_menu']['max_timeouts']['numeric']) > 0) { + $ivr_menu_max_timeouts = $_SESSION['ivr_menu']['max_timeouts']['numeric']; + } + else { + $ivr_menu_max_timeouts = '1'; + } + } if (strlen($ivr_menu_digit_len) == 0) { $ivr_menu_digit_len = '5'; } if (strlen($ivr_menu_direct_dial) == 0) { $ivr_menu_direct_dial = 'false'; } if (!isset($ivr_menu_context)) { $ivr_menu_context = $_SESSION['domain_name']; } @@ -579,7 +617,7 @@ //get the sound files $file = new file; - $sound_files = $file->sounds(); + $sound_files = $file->sounds($ivr_menu_language, $ivr_menu_dialect, $ivr_menu_voice); //create token $object = new token; @@ -680,25 +718,17 @@ echo "\n"; echo "
\n"; + echo " ".$text['label-pin_number']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-pin_number']."\n"; + echo "
\n"; echo " ".$text['label-comfirm_macro']."\n"; diff --git a/app/ivr_menus/resources/classes/ivr_menu.php b/app/ivr_menus/resources/classes/ivr_menu.php index 40a46246fb..f9f33ce966 100644 --- a/app/ivr_menus/resources/classes/ivr_menu.php +++ b/app/ivr_menus/resources/classes/ivr_menu.php @@ -52,9 +52,9 @@ if (!class_exists('ivr_menu')) { public function __construct() { //assign private variables - $this->app_name = 'ivr_menus'; - $this->app_uuid = 'a5788e9b-58bc-bd1b-df59-fff5d51253ab'; - $this->list_page = 'ivr_menus.php'; + $this->app_name = 'ivr_menus'; + $this->app_uuid = 'a5788e9b-58bc-bd1b-df59-fff5d51253ab'; + $this->list_page = 'ivr_menus.php'; } @@ -170,6 +170,11 @@ if (!class_exists('ivr_menu')) { } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-delete']); } @@ -324,11 +329,16 @@ if (!class_exists('ivr_menu')) { //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION['domain_name']); foreach ($ivr_menus as $ivr_menu_uuid => $ivr_menu) { $cache->delete("configuration:ivr.conf:".$ivr_menu_uuid); } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-toggle']); } @@ -467,7 +477,7 @@ if (!class_exists('ivr_menu')) { //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION['domain_name']); //set message message::add($text['message-copy']); diff --git a/app/ivr_menus/resources/functions/ivr_menu_xml.php b/app/ivr_menus/resources/functions/ivr_menu_xml.php index 6178d5c5a9..ee5de986e7 100644 --- a/app/ivr_menus/resources/functions/ivr_menu_xml.php +++ b/app/ivr_menus/resources/functions/ivr_menu_xml.php @@ -82,6 +82,7 @@ $ivr_menu_max_timeouts = $row["ivr_menu_max_timeouts"]; $ivr_menu_digit_len = $row["ivr_menu_digit_len"]; $ivr_menu_direct_dial = $row["ivr_menu_direct_dial"]; + $ivr_menu_context = $row["ivr_menu_context"]; $ivr_menu_enabled = $row["ivr_menu_enabled"]; $ivr_menu_description = $row["ivr_menu_description"]; @@ -159,7 +160,7 @@ unset($sub_sql, $sub_result, $sub_row); if ($ivr_menu_direct_dial == "true") { - $tmp .= " \n"; + $tmp .= " \n"; } $tmp .= " \n"; $tmp .= "\n"; diff --git a/app/log_viewer/app_config.php b/app/log_viewer/app_config.php index c4aeecef9f..e9328c4553 100644 --- a/app/log_viewer/app_config.php +++ b/app/log_viewer/app_config.php @@ -41,4 +41,4 @@ $apps[$x]['permissions'][$y]['name'] = "log_path_view"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; -?> +?> \ No newline at end of file diff --git a/app/log_viewer/app_languages.php b/app/log_viewer/app_languages.php index 67f56abbf6..9700f8c408 100644 --- a/app/log_viewer/app_languages.php +++ b/app/log_viewer/app_languages.php @@ -294,4 +294,4 @@ $text['label-display']['ru-ru'] = "Display"; $text['label-display']['sv-se'] = "Display"; $text['label-display']['uk-ua'] = "Display"; -?> +?> \ No newline at end of file diff --git a/app/log_viewer/app_menu.php b/app/log_viewer/app_menu.php index 2835d993e6..a344a0746d 100644 --- a/app/log_viewer/app_menu.php +++ b/app/log_viewer/app_menu.php @@ -26,4 +26,4 @@ $apps[$x]['menu'][$y]['path'] = "/app/log_viewer/log_viewer.php"; $apps[$x]['menu'][$y]['groups'][] = "superadmin"; -?> +?> \ No newline at end of file diff --git a/app/log_viewer/log_viewer.php b/app/log_viewer/log_viewer.php index 613d4ed627..1fae25ec91 100644 --- a/app/log_viewer/log_viewer.php +++ b/app/log_viewer/log_viewer.php @@ -296,4 +296,4 @@ //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/app/music_on_hold/music_on_hold_edit.php b/app/music_on_hold/music_on_hold_edit.php index c76d64a9d1..c32a7c3bdc 100644 --- a/app/music_on_hold/music_on_hold_edit.php +++ b/app/music_on_hold/music_on_hold_edit.php @@ -365,7 +365,7 @@ */ //recordings $tmp_selected = false; - $sql = "select * from v_recordings where domain_uuid = :domain_uuid "; + $sql = "select recording_name, recording_filename from v_recordings where domain_uuid = :domain_uuid "; $parameters['domain_uuid'] = $domain_uuid; $database = new database; $recordings = $database->select($sql, $parameters, 'all'); @@ -510,4 +510,4 @@ //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/app/phrases/phrase_edit.php b/app/phrases/phrase_edit.php index 6550540cda..72dcb1394f 100644 --- a/app/phrases/phrase_edit.php +++ b/app/phrases/phrase_edit.php @@ -174,6 +174,11 @@ $cache = new cache; $cache->delete("languages:".$phrase_language.".".$phrase_uuid); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //send a redirect message::add($text['message-add']); header("Location: phrase_edit.php?id=".$phrase_uuid); @@ -240,6 +245,11 @@ $cache = new cache; $cache->delete("languages:".$phrase_language.".".$phrase_uuid); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //send a redirect message::add($text['message-update']); header("Location: phrase_edit.php?id=".$phrase_uuid); @@ -286,8 +296,8 @@ unset($sql, $parameters); } -//get the recordings - $sql = "select * from v_recordings "; +//get the recording names from the database. + $sql = "select recording_name, recording_filename from v_recordings "; $sql .= "where domain_uuid = :domain_uuid "; $sql .= "order by recording_name asc "; $parameters['domain_uuid'] = $_SESSION['domain_uuid']; diff --git a/app/phrases/phrases.php b/app/phrases/phrases.php index 2e281f9126..52c48517e7 100644 --- a/app/phrases/phrases.php +++ b/app/phrases/phrases.php @@ -54,21 +54,21 @@ if (permission_exists('phrase_add')) { $obj = new phrases; $obj->copy($phrases); - save_phrases_xml(); + //save_phrases_xml(); } break; case 'toggle': if (permission_exists('phrase_edit')) { $obj = new phrases; $obj->toggle($phrases); - save_phrases_xml(); + //save_phrases_xml(); } break; case 'delete': if (permission_exists('phrase_delete')) { $obj = new phrases; $obj->delete($phrases); - save_phrases_xml(); + //save_phrases_xml(); } break; } diff --git a/app/phrases/resources/classes/phrases.php b/app/phrases/resources/classes/phrases.php index 2fcbc013bd..4ad96c540d 100644 --- a/app/phrases/resources/classes/phrases.php +++ b/app/phrases/resources/classes/phrases.php @@ -152,6 +152,11 @@ if (!class_exists('phrases')) { $cache->delete("languages:".$phrase_language); } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-delete']); } @@ -302,6 +307,11 @@ if (!class_exists('phrases')) { $cache->delete("languages:".$phrase_language); } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-toggle']); } diff --git a/app/polycom/app_config.php b/app/polycom/app_config.php index 9bd5c06df3..e1038f8544 100644 --- a/app/polycom/app_config.php +++ b/app/polycom/app_config.php @@ -46,7 +46,7 @@ $apps[$x]['default_settings'][$y]['default_setting_value'] = "[*]xxxx|[2-9]11|0T|011xxx.T|[0-1][2-9]xxxxxxxxx|[2-9]xxxxxxxxx|[1-9]xxT|**x.T"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Digit Timeouts"; - $y++; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "a6f7cd49-23a6-42c5-8e77-d1ebbd274884"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_digitmap_timeout"; @@ -348,7 +348,158 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_provision_cert_validate"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Require Provisioning Cert Validation 0=Disabled - 1=Enabled "; - + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5f80d126-eae1-41af-8c47-5d118ef7be50"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_display_language"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = ""; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "French_Canada, Portuguese_Portugal, DTGerman_Germany, Null (default) to US English."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3de149e1-f61a-4d07-9bfe-177299dd625b"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_platform_profile_cipher_suite"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "ALL:!aNULL:!eNULL:!IDEA:!MEDIUM:!LOW:!ADH:!LOW:!EXP:!DH:!AECDH:!PSK:!SRP:!MD5:!RC4:@STRENGTH"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enter the cipher suites to use for TLS Platform Profile 1"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "d8e53e24-fbb4-4cbd-bce1-dd793d92e789"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_dns_server"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = ""; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the primary server to which the phone directs DNS queries."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "094f626b-5891-4a0c-a390-49c221fcb197"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_dns_alt_server"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = ""; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the secondary server to which the phone directs DNS queries."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "ba9ad978-5c38-467b-9630-f417690b1303"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_diversion_header"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "0 (default) - If set to 0, the diversion header is not displayed. 1 - If set to 1, the diversion header is displayed if received."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3351d37d-e9b8-4c5c-96e7-0f232893895c"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_keep_alive"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "The keep-alive interval in seconds."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "808a4cb8-054a-416a-b473-804b84822385"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_boot_server_option"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "Default"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Default, Custom or Static"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "355b778a-1c6c-4ed4-ae7b-6db37b6f139a"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_lldp_enabled"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Phone attempts to determine its VLAN ID and negotiate power through LLDP. 0 - disabled. 1 - enabled"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "b19aea7a-5f3e-455c-94fe-b6b4f895a7ca"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_cdp_enabled"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "phone attempts to determine its VLAN ID and negotiate power through CDP. 0 - disabled. 1 - enabled"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "95a35bbe-3410-432a-b318-fbd6a490a56c"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_dhcp_vlan_discovery"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "Fixed"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Disabled, Fixed or Custom"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "f402600f-c31a-471f-95e4-28b5e8c1c42b"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_pagination_enabled"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "1"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "0 (default) – Disables the pagination feature. 1 – Enables the pagination feature."; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "fc0c17d4-bd64-4523-ac16-4f3b3da181e9"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_softkey_newcall"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Newcall Softkey 1=enabled 0=disable"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "97eae52e-0a66-4a97-83d0-922eaa919f86"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_softkey_directories"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Directories Softkey 1=enabled 0=disable"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "9b854a6b-10dc-4de6-a268-dc17a6f0750a"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_homescreen_forward"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Home Screen Forward option 1=enabled 0=disable"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8cc668ef-9c94-4f43-b287-b6dcdfaebcd3"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_homescreen_directories"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Home Screen Directories option 1=enabled 0=disable"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5bd3bf50-6d8f-42eb-85ca-c463c9c1d63d"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_homescreen_do_not_disturb"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Home Screen Do Not Disturb option 1=enabled 0=disable"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "a16eda84-d585-41f5-921e-bd8d3382458d"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_basic_call_management_redundant"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Enable to display redundant call management functions for the soft keys. 1 (default) - Enabled. 0 - Disabled"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5f7e8466-2c82-4092-aa19-bc8af99d05b5"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_pickup_enable"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Pickup softkey 0=Disabled - 1=Enabled "; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "eabcfacc-64be-457a-ad7f-1d53e27e9eaf"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_pickup_enable"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Pick up softkey 0=Disabled - 1=Enabled "; ?> diff --git a/app/provision/index.php b/app/provision/index.php index 037df0b9ff..c2e9874493 100644 --- a/app/provision/index.php +++ b/app/provision/index.php @@ -137,108 +137,23 @@ } //get the domain_uuid - $sql = "select device_uuid, domain_uuid from v_devices "; + $sql = "select d.device_uuid, d.domain_uuid, n.domain_name "; + $sql .= "from v_devices as d, v_domains as n "; $sql .= "where device_mac_address = :mac "; + $sql .= "and d.domain_uuid = n.domain_uuid; "; $parameters['mac'] = $mac; $database = new database; $row = $database->select($sql, $parameters, 'row'); if (is_array($row)) { - $domain_uuid = $row['domain_uuid']; $device_uuid = $row['device_uuid']; + $domain_uuid = $row['domain_uuid']; + $domain_name = $row['domain_name']; $_SESSION['domain_uuid'] = $domain_uuid; } unset($sql, $parameters); //get the domain_name and domain_uuid - if ($_SESSION['provision']['http_domain_filter']['boolean'] == "false") { - - //get the domain name - $domain_name = $_SESSION['domains'][$domain_uuid]['domain_name']; - - //get the default settings - $sql = "select * from v_default_settings "; - $sql .= "where default_setting_enabled = 'true' "; - $sql .= "order by default_setting_order asc "; - $database = new database; - $result = $database->select($sql, null, 'all'); - //unset the previous settings - if (is_array($result) && @sizeof($result) != 0) { - foreach ($result as $row) { - unset($_SESSION[$row['default_setting_category']]); - } - //set the settings as a session - foreach ($result as $row) { - $name = $row['default_setting_name']; - $category = $row['default_setting_category']; - $subcategory = $row['default_setting_subcategory']; - if (strlen($subcategory) == 0) { - if ($name == "array") { - $_SESSION[$category][] = $row['default_setting_value']; - } - else { - $_SESSION[$category][$name] = $row['default_setting_value']; - } - } - else { - if ($name == "array") { - $_SESSION[$category][$subcategory][] = $row['default_setting_value']; - } - else { - $_SESSION[$category][$subcategory]['uuid'] = $row['default_setting_uuid']; - $_SESSION[$category][$subcategory][$name] = $row['default_setting_value']; - } - } - } - } - unset($sql, $result, $row); - - //get the domains settings - if (is_uuid($domain_uuid)) { - $sql = "select * from v_domain_settings "; - $sql .= "where domain_uuid = :domain_uuid "; - $sql .= "and domain_setting_enabled = 'true' "; - $sql .= "order by domain_setting_order asc "; - $parameters['domain_uuid'] = $domain_uuid; - $database = new database; - $result = $database->select($sql, $parameters, 'all'); - //unset the arrays that domains are overriding - if (is_array($result) && @sizeof($result) != 0) { - foreach ($result as $row) { - $name = $row['domain_setting_name']; - $category = $row['domain_setting_category']; - $subcategory = $row['domain_setting_subcategory']; - if ($name == "array") { - unset($_SESSION[$category][$subcategory]); - } - } - //set the settings as a session - foreach ($result as $row) { - $name = $row['domain_setting_name']; - $category = $row['domain_setting_category']; - $subcategory = $row['domain_setting_subcategory']; - if (strlen($subcategory) == 0) { - //$$category[$name] = $row['domain_setting_value']; - if ($name == "array") { - $_SESSION[$category][] = $row['domain_setting_value']; - } - else { - $_SESSION[$category][$name] = $row['domain_setting_value']; - } - } - else { - //$$category[$subcategory][$name] = $row['domain_setting_value']; - if ($name == "array") { - $_SESSION[$category][$subcategory][] = $row['domain_setting_value']; - } - else { - $_SESSION[$category][$subcategory][$name] = $row['domain_setting_value']; - } - } - } - } - } - } - else { + if ($_SESSION['provision']['http_domain_filter']['boolean'] == "true") { //get the domain_name $domain_array = explode(":", $_SERVER["HTTP_HOST"]); $domain_name = $domain_array[0]; @@ -252,6 +167,89 @@ unset($sql, $parameters); } +//get the default settings + $sql = "select * from v_default_settings "; + $sql .= "where default_setting_enabled = 'true' "; + $sql .= "order by default_setting_order asc "; + $database = new database; + $result = $database->select($sql, null, 'all'); + //unset the previous settings + if (is_array($result) && @sizeof($result) != 0) { + foreach ($result as $row) { + unset($_SESSION[$row['default_setting_category']]); + } + //set the settings as a session + foreach ($result as $row) { + $name = $row['default_setting_name']; + $category = $row['default_setting_category']; + $subcategory = $row['default_setting_subcategory']; + if (strlen($subcategory) == 0) { + if ($name == "array") { + $_SESSION[$category][] = $row['default_setting_value']; + } + else { + $_SESSION[$category][$name] = $row['default_setting_value']; + } + } + else { + if ($name == "array") { + $_SESSION[$category][$subcategory][] = $row['default_setting_value']; + } + else { + $_SESSION[$category][$subcategory]['uuid'] = $row['default_setting_uuid']; + $_SESSION[$category][$subcategory][$name] = $row['default_setting_value']; + } + } + } + } + unset($sql, $result, $row); + +//get the domains settings + if (is_uuid($domain_uuid)) { + $sql = "select * from v_domain_settings "; + $sql .= "where domain_uuid = :domain_uuid "; + $sql .= "and domain_setting_enabled = 'true' "; + $sql .= "order by domain_setting_order asc "; + $parameters['domain_uuid'] = $domain_uuid; + $database = new database; + $result = $database->select($sql, $parameters, 'all'); + //unset the arrays that domains are overriding + if (is_array($result) && @sizeof($result) != 0) { + foreach ($result as $row) { + $name = $row['domain_setting_name']; + $category = $row['domain_setting_category']; + $subcategory = $row['domain_setting_subcategory']; + if ($name == "array") { + unset($_SESSION[$category][$subcategory]); + } + } + //set the settings as a session + foreach ($result as $row) { + $name = $row['domain_setting_name']; + $category = $row['domain_setting_category']; + $subcategory = $row['domain_setting_subcategory']; + if (strlen($subcategory) == 0) { + //$$category[$name] = $row['domain_setting_value']; + if ($name == "array") { + $_SESSION[$category][] = $row['domain_setting_value']; + } + else { + $_SESSION[$category][$name] = $row['domain_setting_value']; + } + } + else { + //$$category[$subcategory][$name] = $row['domain_setting_value']; + if ($name == "array") { + $_SESSION[$category][$subcategory][] = $row['domain_setting_value']; + } + else { + $_SESSION[$category][$subcategory][$name] = $row['domain_setting_value']; + } + } + } + } + } + //build the provision array foreach($_SESSION['provision'] as $key=>$val) { if (strlen($val['var']) > 0) { $value = $val['var']; } diff --git a/app/provision/resources/classes/provision.php b/app/provision/resources/classes/provision.php index 0d87cf90ce..43dfec1b31 100644 --- a/app/provision/resources/classes/provision.php +++ b/app/provision/resources/classes/provision.php @@ -295,11 +295,12 @@ include "root.php"; $provision = array(); if (is_array($_SESSION['provision'])) { foreach ($_SESSION['provision'] as $key => $val) { - if (strlen($val['var']) > 0) { $value = $val['var']; } - if (strlen($val['text']) > 0) { $value = $val['text']; } - if (strlen($val['boolean']) > 0) { $value = $val['boolean']; } - if (strlen($val['numeric']) > 0) { $value = $val['numeric']; } - if (strlen($value) > 0) { $provision[$key] = $value; } + if (isset($val['var'])) { $value = $val['var']; } + elseif (isset($val['text'])) { $value = $val['text']; } + elseif (isset($val['boolean'])) { $value = $val['boolean']; } + elseif (isset($val['numeric'])) { $value = $val['numeric']; } + elseif (is_array($val) && !is_uuid($val['uuid'])) { $value = $val; } + if (isset($value)) { $provision[$key] = $value; } unset($value); } } @@ -460,6 +461,9 @@ include "root.php"; $templates['HW GXP1620'] = 'grandstream/gxp16xx'; $templates['HW GXP1625'] = 'grandstream/gxp16xx'; $templates['HW GXP1630'] = 'grandstream/gxp16xx'; + $templates['HW GXP1760W'] = 'grandstream/gxp17xx'; + $templates['HW GXP1780'] = 'grandstream/gxp17xx'; + $templates['HW GXP1782'] = 'grandstream/gxp17xx'; $templates['HW GXP2124'] = 'grandstream/gxp2124'; $templates['HW GXP2130'] = 'grandstream/gxp2130'; $templates['HW GXP2135'] = 'grandstream/gxp2135'; @@ -1196,11 +1200,12 @@ include "root.php"; $provision = array(); if (is_array($_SESSION['provision'])) { foreach ($_SESSION['provision'] as $key => $val) { - if (strlen($val['var']) > 0) { $value = $val['var']; } - if (strlen($val['text']) > 0) { $value = $val['text']; } - if (strlen($val['boolean']) > 0) { $value = $val['boolean']; } - if (strlen($val['numeric']) > 0) { $value = $val['numeric']; } - if (strlen($value) > 0) { $provision[$key] = $value; } + if (isset($val['var'])) { $value = $val['var']; } + elseif (isset($val['text'])) { $value = $val['text']; } + elseif (isset($val['boolean'])) { $value = $val['boolean']; } + elseif (isset($val['numeric'])) { $value = $val['numeric']; } + elseif (is_array($val) && !is_uuid($val['uuid'])) { $value = $val; } + if (isset($value)) { $provision[$key] = $value; } unset($value); } } diff --git a/app/recordings/app_config.php b/app/recordings/app_config.php index a0f039be2c..81ebbcfbab 100644 --- a/app/recordings/app_config.php +++ b/app/recordings/app_config.php @@ -16,8 +16,8 @@ $apps[$x]['description']['de-de'] = "Aufnahmen verwalten. Diese werden hauptsächlich für Anrufzentralen (IVR) verwendet."; $apps[$x]['description']['es-cl'] = "Administrador de grabaciones, utilizadas primordialmente con un IVR"; $apps[$x]['description']['es-mx'] = ""; - $apps[$x]['description']['fr-ca'] = ""; - $apps[$x]['description']['fr-fr'] = "Gestion des enregistrements principalement utilisés dans les IVR"; + $apps[$x]['description']['fr-ca'] = "Gestion des guides vocaux principalement utilisés dans les RVI"; + $apps[$x]['description']['fr-fr'] = "Gestion des guides vocaux principalement utilisés dans les RVI"; $apps[$x]['description']['he-il'] = ""; $apps[$x]['description']['it-it'] = ""; $apps[$x]['description']['nl-nl'] = "Beheer opnamen met name gebruikt in een IVR."; @@ -92,8 +92,7 @@ $apps[$x]['default_settings'][$y]['default_setting_value'] = "base64"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; - - $y=0; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "960828e1-8d6b-4381-86c4-fa03fce4276a"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "recordings"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "recording_max_length"; diff --git a/app/recordings/app_languages.php b/app/recordings/app_languages.php index fb7c7d59d3..231178c9fb 100644 --- a/app/recordings/app_languages.php +++ b/app/recordings/app_languages.php @@ -9,8 +9,8 @@ $text['title-edit']['de-ch'] = "Aufnahmen"; //copied from de-de $text['title-edit']['de-de'] = "Aufnahmen"; $text['title-edit']['es-cl'] = "Grabación"; $text['title-edit']['es-mx'] = "Grabación"; //copied from es-cl -$text['title-edit']['fr-ca'] = "Guide"; //copied from fr-fr -$text['title-edit']['fr-fr'] = "Guide"; +$text['title-edit']['fr-ca'] = "Guides vocaux"; +$text['title-edit']['fr-fr'] = "Guides vocaux"; $text['title-edit']['he-il'] = "קובץ מדיה"; $text['title-edit']['it-it'] = "Registrazioni Audio"; $text['title-edit']['nl-nl'] = "Opname"; @@ -30,8 +30,8 @@ $text['title-add']['de-ch'] = "Aufnahme hinzufügen"; //copied from de-de $text['title-add']['de-de'] = "Aufnahme hinzufügen"; $text['title-add']['es-cl'] = "Agregar Grabación"; $text['title-add']['es-mx'] = "Agregar Grabación"; //copied from es-cl -$text['title-add']['fr-ca'] = "Ajouter un Guide"; //copied from fr-fr -$text['title-add']['fr-fr'] = "Ajouter un Guide"; +$text['title-add']['fr-ca'] = "Ajouter un guide vocal"; //copied from fr-fr +$text['title-add']['fr-fr'] = "Ajouter un guide vocal"; $text['title-add']['he-il'] = "הוסף קבצי מדיה"; $text['title-add']['it-it'] = "Inserire Registrazione"; $text['title-add']['nl-nl'] = "Voeg opname toe"; @@ -51,8 +51,8 @@ $text['title-recordings']['de-ch'] = "Aufnahmen"; //copied from de-de $text['title-recordings']['de-de'] = "Aufnahmen"; $text['title-recordings']['es-cl'] = "Grabaciones"; $text['title-recordings']['es-mx'] = "Grabaciones"; //copied from es-cl -$text['title-recordings']['fr-ca'] = "Guides Vocaux"; //copied from fr-fr -$text['title-recordings']['fr-fr'] = "Guides Vocaux"; +$text['title-recordings']['fr-ca'] = "Guides vocaux"; //copied from fr-fr +$text['title-recordings']['fr-fr'] = "Guides vocaux"; $text['title-recordings']['he-il'] = "קבצי מדיה"; $text['title-recordings']['it-it'] = "Registrazioni"; $text['title-recordings']['nl-nl'] = "Opnamen"; @@ -72,8 +72,8 @@ $text['message-uploaded']['de-ch'] = "Datei hochgeladen"; //copied from de-de $text['message-uploaded']['de-de'] = "Datei hochgeladen"; $text['message-uploaded']['es-cl'] = "Subida de Archivos"; $text['message-uploaded']['es-mx'] = "Subida de Archivos"; //copied from es-cl -$text['message-uploaded']['fr-ca'] = "Fichier Téléchargé"; //copied from fr-fr -$text['message-uploaded']['fr-fr'] = "Fichier Téléchargé"; +$text['message-uploaded']['fr-ca'] = "Fichier téléchargé"; //copied from fr-fr +$text['message-uploaded']['fr-fr'] = "Fichier téléchargé"; $text['message-uploaded']['he-il'] = "הקובץ הועלה"; $text['message-uploaded']['it-it'] = "File Caricato"; $text['message-uploaded']['nl-nl'] = "Bestand opsturen"; @@ -114,8 +114,8 @@ $text['label-upload']['de-ch'] = "Dateipfad"; //copied from de-de $text['label-upload']['de-de'] = "Dateipfad"; $text['label-upload']['es-cl'] = "Archivo a subir"; $text['label-upload']['es-mx'] = "Archivo a subir"; //copied from es-cl -$text['label-upload']['fr-ca'] = "Fichier à déposer"; //copied from fr-fr -$text['label-upload']['fr-fr'] = "Fichier à déposer"; +$text['label-upload']['fr-ca'] = "Chemin du fichier"; //copied from fr-fr +$text['label-upload']['fr-fr'] = "Chemin du fichier"; $text['label-upload']['he-il'] = "נתיב הקובץ"; $text['label-upload']['it-it'] = "Percorso File"; $text['label-upload']['nl-nl'] = "Bestandspad"; @@ -240,8 +240,8 @@ $text['label-file_size']['de-ch'] = "Dateigröße"; //copied from de-de $text['label-file_size']['de-de'] = "Dateigröße"; $text['label-file_size']['es-cl'] = "Tamaño del archivo"; $text['label-file_size']['es-mx'] = "Tamaño del archivo"; //copied from es-cl -$text['label-file_size']['fr-ca'] = "Taille de Fichier"; //copied from fr-fr -$text['label-file_size']['fr-fr'] = "Taille de Fichier"; +$text['label-file_size']['fr-ca'] = "Taille du fichier"; //copied from fr-fr +$text['label-file_size']['fr-fr'] = "Taille du fichier"; $text['label-file_size']['he-il'] = "גודל קובץ"; $text['label-file_size']['it-it'] = "Dimensioni File"; $text['label-file_size']['nl-nl'] = "Bestandsomvang"; @@ -261,8 +261,8 @@ $text['label-size']['de-ch'] = "Dateigröße"; //copied from de-de $text['label-size']['de-de'] = "Dateigröße"; $text['label-size']['es-cl'] = "Tamaño del archivo"; $text['label-size']['es-mx'] = "Tamaño del archivo"; //copied from es-cl -$text['label-size']['fr-ca'] = "Taille de Fichier"; //copied from fr-fr -$text['label-size']['fr-fr'] = "Taille de Fichier"; +$text['label-size']['fr-ca'] = "Taille du fichier"; //copied from fr-fr +$text['label-size']['fr-fr'] = "Taille du fichier"; $text['label-size']['he-il'] = "גודל"; $text['label-size']['it-it'] = "Dimensioni File"; $text['label-size']['nl-nl'] = "Afmetingen"; @@ -366,8 +366,8 @@ $text['header']['de-ch'] = "Aufnahme hochladen"; //copied from de-de $text['header']['de-de'] = "Aufnahme hochladen"; $text['header']['es-cl'] = "Subir Grabación"; $text['header']['es-mx'] = "Subir Grabación"; //copied from es-cl -$text['header']['fr-ca'] = "Télécharger Enregistrement"; //copied from fr-fr -$text['header']['fr-fr'] = "Télécharger Enregistrement"; +$text['header']['fr-ca'] = "Télécharger l'enregistrement"; //copied from fr-fr +$text['header']['fr-fr'] = "Télécharger l'enregistrement"; $text['header']['he-il'] = "העלאת הקלטה"; $text['header']['it-it'] = "Caricare Registrazione"; $text['header']['nl-nl'] = "Opsturen opname"; @@ -387,8 +387,8 @@ $text['description-recording']['de-ch'] = "Ein Name für die Aufnahme."; //copie $text['description-recording']['de-de'] = "Ein Name für die Aufnahme."; $text['description-recording']['es-cl'] = "Nombre de la grabación."; $text['description-recording']['es-mx'] = "Nombre de la grabación."; //copied from es-cl -$text['description-recording']['fr-ca'] = "Nom de l'enregistrement (non parsé)."; //copied from fr-fr -$text['description-recording']['fr-fr'] = "Nom de l'enregistrement (non parsé)."; +$text['description-recording']['fr-ca'] = "Nom de l'enregistrement (non analysé)."; //copied from fr-fr +$text['description-recording']['fr-fr'] = "Nom de l'enregistrement (non analysé)."; $text['description-recording']['he-il'] = "שם להקלטה לא מנותח."; $text['description-recording']['it-it'] = "Un nome per la registrazione (non parsato)."; $text['description-recording']['nl-nl'] = "Een naam voor de opname (niet gecontroleerd)."; diff --git a/app/recordings/app_menu.php b/app/recordings/app_menu.php index f0d3e45c06..9bcb6ed611 100644 --- a/app/recordings/app_menu.php +++ b/app/recordings/app_menu.php @@ -8,8 +8,8 @@ $apps[$x]['menu'][$y]['title']['de-de'] = "Aufnahmen"; $apps[$x]['menu'][$y]['title']['es-cl'] = "Grabaciones"; $apps[$x]['menu'][$y]['title']['es-mx'] = ""; - $apps[$x]['menu'][$y]['title']['fr-ca'] = ""; - $apps[$x]['menu'][$y]['title']['fr-fr'] = "Guides Vocaux"; + $apps[$x]['menu'][$y]['title']['fr-ca'] = "Guides vocaux"; + $apps[$x]['menu'][$y]['title']['fr-fr'] = "Guides vocaux"; $apps[$x]['menu'][$y]['title']['he-il'] = ""; $apps[$x]['menu'][$y]['title']['it-it'] = "Registrazioni Audio"; $apps[$x]['menu'][$y]['title']['nl-nl'] = "Opnamen"; diff --git a/app/recordings/recording_edit.php b/app/recordings/recording_edit.php index d6c8ddb329..7091696773 100644 --- a/app/recordings/recording_edit.php +++ b/app/recordings/recording_edit.php @@ -55,10 +55,18 @@ $recording_name = $_POST["recording_name"]; $recording_description = $_POST["recording_description"]; - //clean the recording filename and name - $recording_filename = str_replace(" ", "_", $recording_filename); - $recording_filename = str_replace("'", "", $recording_filename); - $recording_name = str_replace("'", "", $recording_name); + //sanitize recording filename and name + $recording_filename_ext = strtolower(pathinfo($recording_filename, PATHINFO_EXTENSION)); + if (!in_array($recording_filename_ext, ['wav','mp3','ogg'])) { + $recording_filename = pathinfo($recording_filename, PATHINFO_FILENAME); + $recording_filename = str_replace('.', '', $recording_filename); + } + $recording_filename = str_replace("\\", '', $recording_filename); + $recording_filename = str_replace('/', '', $recording_filename); + $recording_filename = str_replace('..', '', $recording_filename); + $recording_filename = str_replace(' ', '_', $recording_filename); + $recording_filename = str_replace("'", '', $recording_filename); + $recording_name = str_replace("'", '', $recording_name); } if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { @@ -140,7 +148,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true") { $recording_uuid = $_GET["id"]; - $sql = "select * from v_recordings "; + $sql = "select recording_name, recording_filename, recording_description from v_recordings "; $sql .= "where domain_uuid = :domain_uuid "; $sql .= "and recording_uuid = :recording_uuid "; $parameters['domain_uuid'] = $domain_uuid; @@ -229,4 +237,4 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/app/recordings/recordings.php b/app/recordings/recordings.php index 941c7a374d..05ca5ac758 100644 --- a/app/recordings/recordings.php +++ b/app/recordings/recordings.php @@ -128,6 +128,11 @@ //move the uploaded files move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$recording_filename); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set the message message::add($text['message-uploaded'].": ".htmlentities($recording_filename)); diff --git a/app/recordings/resources/classes/switch_recordings.php b/app/recordings/resources/classes/switch_recordings.php index 6806c47086..77549ab6f0 100644 --- a/app/recordings/resources/classes/switch_recordings.php +++ b/app/recordings/resources/classes/switch_recordings.php @@ -76,7 +76,7 @@ if (!class_exists('switch_recordings')) { * list recordings */ public function list_recordings() { - $sql = "select recording_uuid, recording_filename, recording_base64 "; + $sql = "select recording_uuid, recording_filename "; $sql .= "from v_recordings "; $sql .= "where domain_uuid = :domain_uuid "; $parameters['domain_uuid'] = $this->domain_uuid; @@ -151,6 +151,11 @@ if (!class_exists('switch_recordings')) { } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-delete']); } @@ -162,4 +167,4 @@ if (!class_exists('switch_recordings')) { } //class } -?> \ No newline at end of file +?> diff --git a/app/registrations/registrations.php b/app/registrations/registrations.php index ece59bf31e..97527b380d 100644 --- a/app/registrations/registrations.php +++ b/app/registrations/registrations.php @@ -191,13 +191,28 @@ foreach ($registrations as $row) { $matches = preg_grep('/'.$search.'/i', $row); if ($matches != false) { + + //prepare the user variable $user = explode('@', $row['user']); if ($user[1] == $_SESSION['domains'][$_SESSION['domain_uuid']]['domain_name']) { - $user = "".escape($row['user'])."".escape($user[0])."@..."; + $user = "".escape($row['user'])."".escape($user[0]).""; } else { $user = escape($row['user']); } + + //reformat the status + $patterns = array(); + $patterns[] = '/(\d{4})-(\d{2})-(\d{2})/'; + $patterns[] = '/(\d{2}):(\d{2}):(\d{2})/'; + $patterns[] = '/unknown/'; + $patterns[] = '/exp\(/'; + $patterns[] = '/\(/'; + $patterns[] = '/\)/'; + $patterns[] = '/\s+/'; + $status = preg_replace($patterns, ' ', $row['status']); + + //show the content echo "
\n"; echo " \n"; @@ -207,14 +222,14 @@ echo " \n"; echo " \n"; echo " ".$user."".escape($row['agent'])."".$user."".escape($row['agent'])."".escape(explode('"',$row['contact'])[1])."".escape($row['network-port'])."".escape($row['host'])."".escape($row['status'])."".escape($status)."".escape($row['ping-time'])."".escape($row['sip_profile_name'])."\n"; diff --git a/app/ring_groups/resources/classes/ring_groups.php b/app/ring_groups/resources/classes/ring_groups.php index 3e4d8405eb..1677f30538 100644 --- a/app/ring_groups/resources/classes/ring_groups.php +++ b/app/ring_groups/resources/classes/ring_groups.php @@ -166,6 +166,11 @@ if (!class_exists('ring_groups')) { } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-delete']); } @@ -335,6 +340,11 @@ if (!class_exists('ring_groups')) { } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-toggle']); } diff --git a/app/ring_groups/ring_group_edit.php b/app/ring_groups/ring_group_edit.php index 61d67811a4..3e0bd9b8cc 100644 --- a/app/ring_groups/ring_group_edit.php +++ b/app/ring_groups/ring_group_edit.php @@ -324,8 +324,12 @@ $array['ring_groups'][0]["ring_group_greeting"] = $ring_group_greeting; $array['ring_groups'][0]["ring_group_strategy"] = $ring_group_strategy; $array["ring_groups"][0]["ring_group_call_timeout"] = $ring_group_call_timeout; - $array["ring_groups"][0]["ring_group_caller_id_name"] = $ring_group_caller_id_name; - $array["ring_groups"][0]["ring_group_caller_id_number"] = $ring_group_caller_id_number; + if (permission_exists('ring_group_caller_id_name')) { + $array["ring_groups"][0]["ring_group_caller_id_name"] = $ring_group_caller_id_name; + } + if (permission_exists('ring_group_caller_id_number')) { + $array["ring_groups"][0]["ring_group_caller_id_number"] = $ring_group_caller_id_number; + } if (permission_exists('ring_group_cid_name_prefix')) { $array["ring_groups"][0]["ring_group_cid_name_prefix"] = $ring_group_cid_name_prefix; } @@ -435,6 +439,11 @@ $cache = new cache; $cache->delete("dialplan:".$ring_group_context); + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set the message if ($action == "add") { //save the message to a session variable diff --git a/app/ring_groups/ring_group_forward.php b/app/ring_groups/ring_group_forward.php index 8eeab78fdb..3161c4fc87 100644 --- a/app/ring_groups/ring_group_forward.php +++ b/app/ring_groups/ring_group_forward.php @@ -24,6 +24,7 @@ Mark J Crane James Rose */ + //includes require_once "root.php"; require_once "resources/require.php"; @@ -43,6 +44,15 @@ $language = new text; $text = $language->get($_SESSION['domain']['language']['code'], 'app/ring_groups'); +//get the list + if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) { + $domain_uuid = $_SESSION['domain_uuid']; + } + else { + //show only assigned ring groups + $domain_uuid = $_SESSION['user']['domain_uuid']; + } + //get variables used to control the order $order_by = $_GET["order_by"]; $order = $_GET["order"]; @@ -75,7 +85,6 @@ //build array if (is_uuid($row['ring_group_uuid'])) { $array['ring_groups'][$x]['ring_group_uuid'] = $row['ring_group_uuid']; - $array['ring_groups'][$x]['domain_uuid'] = $_SESSION['domain_uuid']; $array['ring_groups'][$x]['ring_group_forward_enabled'] = $row['ring_group_forward_enabled'] == 'true' && $row['ring_group_forward_destination'] != '' ? 'true' : 'false'; $array['ring_groups'][$x]['ring_group_forward_destination'] = $row['ring_group_forward_destination']; } @@ -118,7 +127,7 @@ $sql .= "where r.ring_group_uuid = u.ring_group_uuid "; $sql .= "and r.domain_uuid = :domain_uuid "; $sql .= "and u.user_uuid = :user_uuid "; - $parameters['domain_uuid'] = $_SESSION['user']['domain_uuid']; + $parameters['domain_uuid'] = $domain_uuid; $parameters['user_uuid'] = $_SESSION['user']['user_uuid']; } $database = new database; @@ -144,7 +153,8 @@ } else { //show only assigned ring groups - $sql = "select r.ring_group_name, r.ring_group_uuid, r.ring_group_extension, r.ring_group_forward_destination, r.ring_group_forward_enabled, r.ring_group_description from v_ring_groups as r, v_ring_group_users as u "; + $sql = "select r.ring_group_name, r.ring_group_uuid, r.ring_group_extension, r.ring_group_forward_destination, "; + $sql .= "r.ring_group_forward_enabled, r.ring_group_description from v_ring_groups as r, v_ring_group_users as u "; $sql .= "where r.ring_group_uuid = u.ring_group_uuid "; $sql .= "and r.domain_uuid = :domain_uuid "; $sql .= "and u.user_uuid = :user_uuid "; diff --git a/app/scripts/resources/scripts/app/call_block/index.lua b/app/scripts/resources/scripts/app/call_block/index.lua index 9e10fc4ddd..7e82784060 100644 --- a/app/scripts/resources/scripts/app/call_block/index.lua +++ b/app/scripts/resources/scripts/app/call_block/index.lua @@ -44,8 +44,10 @@ if (session:ready()) then --session:setAutoHangup(false); domain_uuid = session:getVariable("domain_uuid"); + call_direction = session:getVariable("call_direction"); caller_id_name = session:getVariable("caller_id_name"); caller_id_number = session:getVariable("caller_id_number"); + destination_number = session:getVariable("destination_number"); context = session:getVariable("context"); call_block = session:getVariable("call_block"); extension_uuid = session:getVariable("extension_uuid"); @@ -90,23 +92,48 @@ assert(dbh:connected()); --check to see if the call should be blocked - sql = "select * from v_call_block "; - sql = sql .. "where domain_uuid = :domain_uuid "; - sql = sql .. "and call_block_enabled = 'true' "; - sql = sql .. "and ( "; - sql = sql .. " (call_block_name = :call_block_name and call_block_number = :call_block_number) "; - sql = sql .. " or (call_block_name is null and call_block_number = :call_block_number) "; - sql = sql .. " or (call_block_name = :call_block_name and call_block_number is null) "; - sql = sql .. ") "; + sql = "select * from v_call_block\n"; + sql = sql .. "where (domain_uuid = :domain_uuid or domain_uuid is null) \n"; + sql = sql .. "and call_block_enabled = 'true' \n"; + sql = sql .. "and call_block_direction = :call_block_direction \n"; + sql = sql .. "and ( \n"; + sql = sql .. " (\n"; + sql = sql .. " call_block_name = :call_block_name \n"; + sql = sql .. " and ( \n"; + sql = sql .. " '+' || call_block_country_code || call_block_number = :call_block_number \n"; + sql = sql .. " or call_block_country_code || call_block_number = :call_block_number \n"; + sql = sql .. " or call_block_number = :call_block_number \n"; + sql = sql .. " ) \n"; + sql = sql .. " ) \n"; + sql = sql .. " or (\n"; + sql = sql .. " call_block_name is null \n"; + sql = sql .. " and ( \n"; + sql = sql .. " '+' || call_block_country_code || call_block_number = :call_block_number \n"; + sql = sql .. " or call_block_country_code || call_block_number = :call_block_number \n"; + sql = sql .. " or call_block_number = :call_block_number \n"; + sql = sql .. " ) \n"; + sql = sql .. " ) \n"; + sql = sql .. " or (call_block_name = :call_block_name and call_block_number is null) \n"; + sql = sql .. ") \n"; if (extension_uuid == nil) then sql = sql .. "and extension_uuid is null "; else sql = sql .. "and (extension_uuid is null or extension_uuid = :extension_uuid) "; end if (extension_uuid ~= nil) then - params = {domain_uuid = domain_uuid, call_block_name = caller_id_name, call_block_number = caller_id_number, extension_uuid = extension_uuid}; + if (call_direction == 'inbound') then + params = {domain_uuid = domain_uuid, call_block_direction = call_direction, call_block_name = caller_id_name, call_block_number = caller_id_number, extension_uuid = extension_uuid}; + end + if (call_direction == 'outbound') then + params = {domain_uuid = domain_uuid, call_block_direction = call_direction, call_block_name = caller_id_name, call_block_number = destination_number, extension_uuid = extension_uuid}; + end else - params = {domain_uuid = domain_uuid, call_block_name = caller_id_name, call_block_number = caller_id_number}; + if (call_direction == 'inbound') then + params = {domain_uuid = domain_uuid, call_block_direction = call_direction, call_block_name = caller_id_name, call_block_number = caller_id_number}; + end + if (call_direction == 'outbound') then + params = {domain_uuid = domain_uuid, call_block_direction = call_direction, call_block_name = caller_id_name, call_block_number = destination_number}; + end end if (debug["sql"]) then freeswitch.consoleLog("notice", "[dialplan] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n"); diff --git a/app/scripts/resources/scripts/app/fax/resources/scripts/queue/exec.lua b/app/scripts/resources/scripts/app/fax/resources/scripts/queue/exec.lua index 89c9864572..c2ca5fad26 100644 --- a/app/scripts/resources/scripts/app/fax/resources/scripts/queue/exec.lua +++ b/app/scripts/resources/scripts/app/fax/resources/scripts/queue/exec.lua @@ -8,7 +8,7 @@ -- p - pause 500 ms -- P - pause 1000 ms -- --- example: pause 5 sec dial 008 pause 2 sec paly greeting +-- example: pause 5 sec dial 008 pause 2 sec play greeting -- PPPPP008@300PP -- diff --git a/app/scripts/resources/scripts/app/fax/resources/scripts/queue/retry.lua b/app/scripts/resources/scripts/app/fax/resources/scripts/queue/retry.lua index e35f97d85d..f168ea1182 100644 --- a/app/scripts/resources/scripts/app/fax/resources/scripts/queue/retry.lua +++ b/app/scripts/resources/scripts/app/fax/resources/scripts/queue/retry.lua @@ -223,8 +223,8 @@ fax_file = fax_file or dbh.NULL; fax_ecm_used = fax_ecm_used or dbh.NULL; fax_local_station_id = fax_local_station_id or dbh.NULL; - fax_document_transferred_pages = fax_document_transferred_pages or "'0'"; - fax_document_total_pages = fax_document_total_pages or "'0'"; + fax_document_transferred_pages = fax_document_transferred_pages or '0'; + fax_document_total_pages = fax_document_total_pages or '0'; fax_image_resolution = fax_image_resolution or dbh.NULL; fax_image_size = fax_image_size or dbh.NULL; fax_bad_rows = fax_bad_rows or dbh.NULL; diff --git a/app/scripts/resources/scripts/app/feature_event/index.lua b/app/scripts/resources/scripts/app/feature_event/index.lua index d0d38d3930..95ec5edf72 100644 --- a/app/scripts/resources/scripts/app/feature_event/index.lua +++ b/app/scripts/resources/scripts/app/feature_event/index.lua @@ -16,7 +16,7 @@ -- -- The Initial Developer of the Original Code is -- Mark J Crane --- Copyright (C) 2013 - 2014 +-- Copyright (C) 2013 - 2021 -- the Initial Developer. All Rights Reserved. -- -- Contributor(s): @@ -72,11 +72,11 @@ end --get the events - --if (user == nil) then + --if (user == nil) then --serialize the data for the console --freeswitch.consoleLog("notice","[events] " .. event:serialize("xml") .. "\n"); --freeswitch.consoleLog("notice","[evnts] " .. event:serialize("json") .. "\n"); - + --get the event variables user = event:getHeader("user"); host = event:getHeader("host"); @@ -87,7 +87,7 @@ action_name = event:getHeader("Action-Name"); action_value = event:getHeader("Action-Value") ring_count = event:getHeader("ringCount") - + --send to the log --freeswitch.consoleLog("notice","[events] user: " .. user .. "\n"); --freeswitch.consoleLog("notice","[events] host: " .. host .. "\n"); @@ -96,7 +96,7 @@ --if (action_name ~= nil) then freeswitch.consoleLog("notice","[events] action_name: " .. action_name .. "\n"); end --if (action_value ~= nil) then freeswitch.consoleLog("notice","[events] action_value: " .. action_value .. "\n"); end --end - + --get the domain uuid from the host local sql = "select * from v_domains "; sql = sql .. "where domain_name = :domain_name "; @@ -112,19 +112,20 @@ if (user ~= nil and domain_name ~= nil) then do_not_disturb, forward_all_enabled, forward_all_destination, forward_busy_enabled, forward_busy_destination, forward_no_answer_enabled, forward_no_answer_destination, call_timeout = notify.get_db_values(user, domain_name) end - + --get sip profile if (user ~= nil and host ~= nil) then - sip_profile = notify.get_profile(user, host); + sip_profiles = notify.get_profiles(user, host); end - + --DND - + if (sip_profiles ~= nil) then --DND enabled - if (feature_action == "SetDoNotDisturb" and feature_enabled == "true" and sip_profile ~= nil) then + if (feature_action == "SetDoNotDisturb" and feature_enabled == "true") then --set a variable dial_string = "error/user_busy"; do_not_disturb = "true"; + --update the extension sql = "update v_extensions set "; sql = sql .. "do_not_disturb = :do_not_disturb, "; @@ -152,16 +153,16 @@ dbh:query(sql, params); end end - + --send notify to the phone - notify.dnd(user, host, sip_profile, do_not_disturb); - + notify.dnd(user, host, sip_profiles, do_not_disturb); end --DND disabled - if (feature_action == "SetDoNotDisturb" and feature_enabled == "false" and sip_profile ~= nil ) then + if (feature_action == "SetDoNotDisturb" and feature_enabled == "false") then --set a variable do_not_disturb = "false"; + --update the extension sql = "update v_extensions set "; sql = sql .. "do_not_disturb = :do_not_disturb, "; @@ -176,61 +177,24 @@ dbh:query(sql, params); --send notify to the phone - notify.dnd(user, host, sip_profile, do_not_disturb); - + notify.dnd(user, host, sip_profiles, do_not_disturb); + end --Call Forward - + --Call Formward All enabled - if (feature_action == "SetCallForward" and feature_enabled == "true" and action_name == "forward_immediate" and sip_profile ~= nil) then + if (feature_action == "SetCallForward" and feature_enabled == "true" and action_name == "forward_immediate") then --set a variable forward_all_destination = action_value; forward_all_enabled = "true"; forward_immediate_destination = action_value; forward_immediate_enabled = "true"; - - --get the caller_id for outbound call - local forward_caller_id = "" - if not empty(forward_caller_id_uuid) then - local sql = "select destination_number, destination_description,".. - "destination_caller_id_number, destination_caller_id_name " .. - "from v_destinations where domain_uuid = :domain_uuid and " .. - "destination_type = 'inbound' and destination_uuid = :destination_uuid"; - local params = {domain_uuid = domain_uuid; destination_uuid = forward_caller_id_uuid} - if (debug["sql"]) then - freeswitch.consoleLog("notice", "[feature_event] "..sql.."; params:" .. json.encode(params) .. "\n"); - end - local row = dbh:first_row(sql, params) - if row then - local caller_id_number = row.destination_caller_id_number - if empty(caller_id_number) then - caller_id_number = row.destination_number - end - - local caller_id_name = row.destination_caller_id_name - if empty(caller_id_name) then - caller_id_name = row.destination_description - end - - if not empty(caller_id_number) then - forward_caller_id = forward_caller_id .. - ",outbound_caller_id_number=" .. caller_id_number .. - ",origination_caller_id_number=" .. caller_id_number - end - - if not empty(caller_id_name) then - forward_caller_id = forward_caller_id .. - ",outbound_caller_id_name=" .. caller_id_name .. - ",origination_caller_id_name=" .. caller_id_name - end - end - end - + --set the dial string if feature_enabled == "true" then local destination_extension, destination_number_alias - + --used for number_alias to get the correct user local sql = "select extension, number_alias from v_extensions "; sql = sql .. "where domain_uuid = :domain_uuid "; @@ -244,56 +208,56 @@ destination_extension = row.extension; destination_number_alias = row.number_alias or ''; end); - + if (destination_user ~= nil) then cmd = "user_exists id ".. destination_user .." "..domain_name; else cmd = "user_exists id ".. forward_all_destination .." "..domain_name; end local user_exists = trim(api:executeString(cmd)); - end - - --update the extension - sql = "update v_extensions set "; - sql = sql .. "do_not_disturb = 'false', "; - sql = sql .. "forward_all_enabled = 'true', "; - sql = sql .. "forward_all_destination = :forward_all_destination, "; - sql = sql .. "dial_string = null "; - sql = sql .. "where domain_uuid = :domain_uuid "; - sql = sql .. "and extension_uuid = :extension_uuid "; - local params = {domain_uuid = domain_uuid, extension_uuid = extension_uuid, forward_all_destination = forward_all_destination}; - if (debug["sql"]) then - freeswitch.consoleLog("notice", "[feature_event] "..sql.."; params:" .. json.encode(params) .. "\n"); - end - dbh:query(sql, params); - - --update follow me - if (follow_me_uuid ~= nil) then - if (string.len(follow_me_uuid) > 0) then - local sql = "update v_follow_me set "; - sql = sql .. "follow_me_enabled = 'false' "; - sql = sql .. "where domain_uuid = :domain_uuid "; - sql = sql .. "and follow_me_uuid = :follow_me_uuid "; - local params = {domain_uuid = domain_uuid, follow_me_uuid = follow_me_uuid}; - if (debug["sql"]) then - freeswitch.consoleLog("notice", "[feature_event] "..sql.."; params:" .. json.encode(params) .. "\n"); - end - dbh:query(sql, params); + + --update the extension + sql = "update v_extensions set "; + sql = sql .. "do_not_disturb = 'false', "; + sql = sql .. "forward_all_enabled = 'true', "; + sql = sql .. "forward_all_destination = :forward_all_destination, "; + sql = sql .. "dial_string = null "; + sql = sql .. "where domain_uuid = :domain_uuid "; + sql = sql .. "and extension_uuid = :extension_uuid "; + local params = {domain_uuid = domain_uuid, extension_uuid = extension_uuid, forward_all_destination = forward_all_destination}; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[feature_event] "..sql.."; params:" .. json.encode(params) .. "\n"); + end + dbh:query(sql, params); + + --update follow me + if (follow_me_uuid ~= nil) then + if (string.len(follow_me_uuid) > 0) then + local sql = "update v_follow_me set "; + sql = sql .. "follow_me_enabled = 'false' "; + sql = sql .. "where domain_uuid = :domain_uuid "; + sql = sql .. "and follow_me_uuid = :follow_me_uuid "; + local params = {domain_uuid = domain_uuid, follow_me_uuid = follow_me_uuid}; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[feature_event] "..sql.."; params:" .. json.encode(params) .. "\n"); end + dbh:query(sql, params); end - - --send notify to the phone - notify.forward_immediate(user, host, sip_profile, forward_immediate_enabled, forward_immediate_destination); + end + + --send notify to the phone + notify.forward_immediate(user, host, sip_profiles, forward_immediate_enabled, forward_immediate_destination); end --Call Formward All disable - if (feature_action == "SetCallForward" and feature_enabled == "false" and action_name == "forward_immediate" and sip_profile ~= nil) then + if (feature_action == "SetCallForward" and feature_enabled == "false" and action_name == "forward_immediate") then --set a variable forward_all_destination = action_value; forward_all_enabled = "false"; forward_immediate_enabled = "false"; forward_immediate_destination = action_value; + --update the extension sql = "update v_extensions set "; sql = sql .. "do_not_disturb = 'false', "; @@ -311,19 +275,20 @@ freeswitch.consoleLog("notice", "[feature_event] "..sql.."; params:" .. json.encode(params) .. "\n"); end dbh:query(sql, params); - - --send notify to the phone - if (forward_immediate_destination == nil) then - forward_immediate_destination = " "; - end - notify.forward_immediate(user, host, sip_profile, forward_immediate_enabled, forward_immediate_destination); + + --send notify to the phone + if (forward_immediate_destination == nil) then + forward_immediate_destination = " "; + end + notify.forward_immediate(user, host, sip_profiles, forward_immediate_enabled, forward_immediate_destination); end - + --Call Formward BUSY enable - if (feature_action == "SetCallForward" and feature_enabled == "true" and action_name == "forward_busy" and sip_profile ~= nil) then + if (feature_action == "SetCallForward" and feature_enabled == "true" and action_name == "forward_busy") then --set a variable forward_busy_destination = action_value; forward_busy_enabled = "true"; + --update the extension sql = "update v_extensions set "; sql = sql .. "do_not_disturb = 'false', "; @@ -336,16 +301,17 @@ freeswitch.consoleLog("notice", "[feature_event] "..sql.."; params:" .. json.encode(params) .. "\n"); end dbh:query(sql, params); - + --send notify to the phone - notify.forward_busy(user, host, sip_profile, forward_busy_enabled, forward_busy_destination); + notify.forward_busy(user, host, sip_profiles, forward_busy_enabled, forward_busy_destination); end - + --Call Formward BUSY disable - if (feature_action == "SetCallForward" and feature_enabled == "false" and action_name == "forward_busy" and sip_profile ~= nil) then + if (feature_action == "SetCallForward" and feature_enabled == "false" and action_name == "forward_busy") then --set a variable forward_busy_destination = action_value; forward_busy_enabled = "false"; + --update the extension sql = "update v_extensions set "; sql = sql .. "do_not_disturb = 'false', "; @@ -362,17 +328,18 @@ freeswitch.consoleLog("notice", "[feature_event] "..sql.."; params:" .. json.encode(params) .. "\n"); end dbh:query(sql, params); - + --send notify to the phone - notify.forward_busy(user, host, sip_profile, forward_busy_enabled, forward_busy_destination); + notify.forward_busy(user, host, sip_profiles, forward_busy_enabled, forward_busy_destination); end --Call Formward NO ANSWER enable - if (feature_action == "SetCallForward" and feature_enabled == "true" and action_name == "forward_no_answer" and sip_profile ~= nil) then + if (feature_action == "SetCallForward" and feature_enabled == "true" and action_name == "forward_no_answer") then --set a variable forward_no_answer_destination = action_value; forward_no_answer_enabled = "true"; call_timeout = ring_count * 6; + --update the extension sql = "update v_extensions set "; sql = sql .. "do_not_disturb = 'false', "; @@ -388,14 +355,15 @@ dbh:query(sql, params); --send notify to the phone - notify.forward_no_answer(user, host, sip_profile, forward_no_answer_enabled, forward_no_answer_destination, ring_count); + notify.forward_no_answer(user, host, sip_profiles, forward_no_answer_enabled, forward_no_answer_destination, ring_count); end - + --Call Formward NO ANSWER disable - if (feature_action == "SetCallForward" and feature_enabled == "false" and action_name == "forward_no_answer" and sip_profile ~= nil) then + if (feature_action == "SetCallForward" and feature_enabled == "false" and action_name == "forward_no_answer") then --set a variable forward_no_answer_destination = action_value; forward_no_answer_enabled = "false"; + --update the extension sql = "update v_extensions set "; sql = sql .. "do_not_disturb = 'false', "; @@ -414,28 +382,28 @@ dbh:query(sql, params); --send notify to the phone - notify.forward_no_answer(user, host, sip_profile, forward_no_answer_enabled, forward_no_answer_destination, ring_count); + notify.forward_no_answer(user, host, sip_profiles, forward_no_answer_enabled, forward_no_answer_destination, ring_count); end --No feature event (phone boots): Send all values if (feature_enabled == nil) then --Do Not Disturb - --notify.dnd(user, host, sip_profile, do_not_disturb); + --notify.dnd(user, host, sip_profiles, do_not_disturb); --Forward all - forward_immediate_enabled = forward_all_enabled; - forward_immediate_destination = forward_all_destination; - --notify.forward_immediate(user, host, sip_profile, forward_immediate_enabled, forward_immediate_destination); + forward_immediate_enabled = forward_all_enabled; + forward_immediate_destination = forward_all_destination; + --notify.forward_immediate(user, host, sip_profiles, forward_immediate_enabled, forward_immediate_destination); --Forward busy - --notify.forward_busy(user, host, sip_profile, forward_busy_enabled, forward_busy_destination); + --notify.forward_busy(user, host, sip_profiles, forward_busy_enabled, forward_busy_destination); --Forward No Answer - ring_count = math.ceil (call_timeout / 6); - --notify.forward_no_answer(user, host, sip_profile, forward_no_answer_enabled, forward_no_answer_destination, ring_count); + ring_count = math.ceil (call_timeout / 6); + --notify.forward_no_answer(user, host, sip_profiles, forward_no_answer_enabled, forward_no_answer_destination, ring_count); notify.init(user, host, - sip_profile, + sip_profiles, forward_immediate_enabled, forward_immediate_destination, forward_busy_enabled, @@ -445,9 +413,9 @@ ring_count, do_not_disturb); end - --- feature_event_notify.init(user, host, sip_profile, forward_immediate_enabled, forward_immediate_destination, forward_busy_enabled, forward_busy_destination, forward_no_answer_enabled, forward_no_answer_destination, ring_count, do_not_disturb) - + +-- feature_event_notify.init(user, host, sip_profiles, forward_immediate_enabled, forward_immediate_destination, forward_busy_enabled, forward_busy_destination, forward_no_answer_enabled, forward_no_answer_destination, ring_count, do_not_disturb) + end --clear the cache if (feature_enabled ~= nil) then cache.del("directory:"..user.."@"..host) diff --git a/app/scripts/resources/scripts/app/feature_event/resources/functions/feature_event_notify.lua b/app/scripts/resources/scripts/app/feature_event/resources/functions/feature_event_notify.lua index e5769cada0..3cc4c1b34c 100644 --- a/app/scripts/resources/scripts/app/feature_event/resources/functions/feature_event_notify.lua +++ b/app/scripts/resources/scripts/app/feature_event/resources/functions/feature_event_notify.lua @@ -39,7 +39,6 @@ function feature_event_notify.get_db_values(user, domain_name) forward_no_answer_destination = row.forward_no_answer_destination; forward_user_not_registered_enabled = row.forward_user_not_registered_enabled; forward_user_not_registered_destination = row.forward_user_not_registered_destination; - forward_caller_id_uuid = row.forward_caller_id_uuid; toll_allow = row.toll_allow call_timeout = row.call_timeout --freeswitch.consoleLog("NOTICE", "[feature_event] extension "..row.extension.."\n"); @@ -57,22 +56,36 @@ function feature_event_notify.get_db_values(user, domain_name) return do_not_disturb, forward_all_enabled, forward_all_destination, forward_busy_enabled, forward_busy_destination, forward_no_answer_enabled, forward_no_answer_destination, call_timeout end -function feature_event_notify.get_profile(user, host) +---@return table, nil +function feature_event_notify.get_profiles(user, domain) --includes - require "resources.functions.explode" require "resources.functions.trim" - - local account = user.."@"..host + + local account = user.."@"..domain --create the api object api = freeswitch.API(); local sofia_contact = trim(api:executeString("sofia_contact */"..account)); - local array = explode("/", sofia_contact); - local sip_profile = array[2]; - return sip_profile + --get all profiles for the user account + local profile_iterator = string.gmatch(sofia_contact, "sofia/([^,]+)/[^,]+"); + + --remove any duplicates and check if we have any profiles + local unique_profiles = {} + local has_profile = false + for profile in profile_iterator do + has_profile = true + unique_profiles[profile] = 1 + end + + -- return nil if we have no profiles + if not has_profile then return nil end + + return unique_profiles end -function feature_event_notify.dnd(user, host, sip_profile, do_not_disturb) - --set the event and send it + +function feature_event_notify.dnd(user, host, sip_profiles, do_not_disturb) + --set the event and send it to each profile + for sip_profile, _ in pairs(sip_profiles) do local event = freeswitch.Event("SWITCH_EVENT_PHONE_FEATURE") event:addHeader("profile", sip_profile) event:addHeader("user", user) @@ -81,11 +94,14 @@ function feature_event_notify.dnd(user, host, sip_profile, do_not_disturb) event:addHeader("Feature-Event", "DoNotDisturbEvent") event:addHeader("doNotDisturbOn", do_not_disturb) --freeswitch.consoleLog("notice","[events] " .. event:serialize("xml") .. "\n"); + freeswitch.msleep(200); event:fire() + end end -function feature_event_notify.forward_immediate(user, host, sip_profile, forward_immediate_enabled, forward_immediate_destination) - --set the event and send it +function feature_event_notify.forward_immediate(user, host, sip_profiles, forward_immediate_enabled, forward_immediate_destination) + --set the event and send it to each profile + for sip_profile, _ in pairs(sip_profiles) do local event = freeswitch.Event("SWITCH_EVENT_PHONE_FEATURE") event:addHeader("profile", sip_profile) event:addHeader("user", user) @@ -95,11 +111,14 @@ function feature_event_notify.forward_immediate(user, host, sip_profile, forward event:addHeader("forward_immediate_enabled", forward_immediate_enabled) event:addHeader("forward_immediate", forward_immediate_destination); freeswitch.consoleLog("notice","[events] " .. event:serialize("xml") .. "\n"); + freeswitch.msleep(200); event:fire() + end end -function feature_event_notify.forward_busy(user, host, sip_profile, forward_busy_enabled, forward_busy_destination) - --set the event and send it +function feature_event_notify.forward_busy(user, host, sip_profiles, forward_busy_enabled, forward_busy_destination) + --set the event and send it to each profile + for sip_profile, _ in pairs(sip_profiles) do local event = freeswitch.Event("SWITCH_EVENT_PHONE_FEATURE") event:addHeader("profile", sip_profile) event:addHeader("user", user) @@ -108,11 +127,14 @@ function feature_event_notify.forward_busy(user, host, sip_profile, forward_busy event:addHeader("Feature-Event", "ForwardingEvent") event:addHeader("forward_busy", forward_busy_destination) event:addHeader("forward_busy_enabled", forward_busy_enabled) + freeswitch.msleep(200); event:fire() + end end -function feature_event_notify.forward_no_answer(user, host, sip_profile, forward_no_answer_enabled, forward_no_answer_destination, ring_count) - --set the event and send it +function feature_event_notify.forward_no_answer(user, host, sip_profiles, forward_no_answer_enabled, forward_no_answer_destination, ring_count) + --set the event and send it to each profile + for sip_profile, _ in pairs(sip_profiles) do local event = freeswitch.Event("SWITCH_EVENT_PHONE_FEATURE") event:addHeader("profile", sip_profile) event:addHeader("user", user) @@ -122,11 +144,14 @@ function feature_event_notify.forward_no_answer(user, host, sip_profile, forward event:addHeader("forward_no_answer", forward_no_answer_destination) event:addHeader("forward_no_answer_enabled", forward_no_answer_enabled) event:addHeader("ringCount", ring_count) + freeswitch.msleep(200); event:fire() + end end -function feature_event_notify.init(user, host, sip_profile, forward_immediate_enabled, forward_immediate_destination, forward_busy_enabled, forward_busy_destination, forward_no_answer_enabled, forward_no_answer_destination, ring_count, do_not_disturb) - --set the event and send it +function feature_event_notify.init(user, host, sip_profiles, forward_immediate_enabled, forward_immediate_destination, forward_busy_enabled, forward_busy_destination, forward_no_answer_enabled, forward_no_answer_destination, ring_count, do_not_disturb) + --set the event and send it to each profile + for sip_profile, _ in pairs(sip_profiles) do local event = freeswitch.Event("SWITCH_EVENT_PHONE_FEATURE") event:addHeader("profile", sip_profile) event:addHeader("user", user) @@ -143,7 +168,9 @@ function feature_event_notify.init(user, host, sip_profile, forward_immediate_en event:addHeader("ringCount", ring_count) event:addHeader("Feature-Event", "DoNotDisturbEvent") event:addHeader("doNotDisturbOn", do_not_disturb) + freeswitch.msleep(200); event:fire() + end end return feature_event_notify diff --git a/app/scripts/resources/scripts/app/follow_me/index.lua b/app/scripts/resources/scripts/app/follow_me/index.lua index 6bf3b04bb7..5713d65a4d 100644 --- a/app/scripts/resources/scripts/app/follow_me/index.lua +++ b/app/scripts/resources/scripts/app/follow_me/index.lua @@ -28,6 +28,7 @@ if (session:ready()) then domain_name = session:getVariable("domain_name"); domain_uuid = session:getVariable("domain_uuid"); + uuid = session:getVariable("uuid"); destination_number = session:getVariable("destination_number"); caller_id_name = session:getVariable("caller_id_name"); caller_id_number = session:getVariable("caller_id_number"); @@ -80,18 +81,23 @@ cmd = "user_data ".. destination_number .."@" ..domain_name.." var toll_allow"; toll_allow = api:executeString(cmd); --freeswitch.consoleLog("notice", "[follow me][call forward all] " .. destination_number .. " toll_allow is ".. toll_allow .."\n"); + + --get the extensions accountcode + cmd = "user_data ".. destination_number .."@" ..domain_name.." var accountcode"; + accountcode = api:executeString(cmd); --get the new destination cmd = "user_data ".. destination_number .."@" ..domain_name.." var forward_all_destination"; destination_number = api:executeString(cmd); + --freeswitch.consoleLog("notice", "[follow me][call forward all] " .. count .. " " .. cmd .. " ".. destination_number .."\n"); count = count + 1; if (count < 5) then - count, destination_number = get_forward_all(count, destination_number, domain_name); + count, destination_number, toll_allow, accountcode = get_forward_all(count, destination_number, domain_name); end end end - return count, destination_number, toll_allow; + return count, destination_number, toll_allow, accountcode; end --get the forward busy @@ -116,7 +122,7 @@ end --select data from the database - local sql = "select follow_me_uuid, toll_allow "; + local sql = "select follow_me_uuid, toll_allow, accountcode "; sql = sql .. "from v_extensions "; sql = sql .. "where domain_uuid = :domain_uuid "; sql = sql .. "and ( "; @@ -130,13 +136,14 @@ status = dbh:query(sql, params, function(row) follow_me_uuid = row["follow_me_uuid"]; extension_toll_allow = row["toll_allow"]; + accountcode = row["accountcode"]; end); --dbh:query(sql, params, function(row); --get the follow me data if (follow_me_uuid ~= nil) then local sql = "select cid_name_prefix, cid_number_prefix, "; - sql = sql .. "follow_me_enabled, follow_me_caller_id_uuid, follow_me_ignore_busy "; + sql = sql .. "follow_me_enabled, follow_me_ignore_busy "; sql = sql .. "from v_follow_me "; sql = sql .. "where domain_uuid = :domain_uuid "; sql = sql .. "and follow_me_uuid = :follow_me_uuid; "; @@ -148,7 +155,6 @@ caller_id_name_prefix = row["cid_name_prefix"]; caller_id_number_prefix = row["cid_number_prefix"]; follow_me_enabled = row["follow_me_enabled"]; - follow_me_caller_id_uuid = row["follow_me_caller_id_uuid"]; follow_me_ignore_busy = row["follow_me_ignore_busy"]; end); --dbh:query(sql, params, function(row); @@ -176,7 +182,7 @@ end --follow the forwards - count, destination_number, toll_allow = get_forward_all(0, row.destination_number, domain_name); + count, destination_number, toll_allow, accountcode = get_forward_all(0, row.destination_number, domain_name); --update values row['destination_number'] = destination_number @@ -200,6 +206,7 @@ --set the values external = "true"; row['user_exists'] = "false"; + row['accountcode'] = accountcode; --add the row to the destinations array destinations[x] = row; end @@ -262,6 +269,7 @@ group_confirm_key = row.group_confirm_key; group_confirm_file = row.group_confirm_file; toll_allow = row.toll_allow; + accountcode = row.accountcode; user_exists = row.user_exists; --follow the forwards @@ -322,8 +330,23 @@ --get the extension_uuid cmd = "user_data ".. destination_number .."@"..domain_name.." var extension_uuid"; extension_uuid = trim(api:executeString(cmd)); + + local record_session = ""; + --if session is already recording then skip + if (session:getVariable("record_session") ~= "true") then + local cmd = "user_data "..destination_number.."@"..domain_name.." var user_record"; + local user_record = api:executeString(cmd); + if (user_record == "all" or user_record == call_direction) then + local recordings_dir = session:getVariable("recordings_dir"); + local record_ext = session:getVariable("record_ext") or "wav"; + local record_name = uuid.."."..record_ext; + local record_path = recordings_dir .. "/" .. domain_name .. "/archive/" .. os.date("%Y/%b/%d"); + record_session = ",api_on_answer='uuid_record "..uuid.." start ".. record_path .. "/" .. record_name .. "',record_path='".. record_path .."',record_name="..record_name; + end + end + --send to user - local dial_string_to_user = "[sip_invite_domain="..domain_name..",call_direction="..call_direction..","..group_confirm..","..timeout_name.."="..destination_timeout..","..delay_name.."="..destination_delay..",dialed_extension=" .. row.destination_number .. ",extension_uuid="..extension_uuid .. "]user/" .. row.destination_number .. "@" .. domain_name; + local dial_string_to_user = "[sip_invite_domain="..domain_name..",call_direction="..call_direction..","..group_confirm..","..timeout_name.."="..destination_timeout..","..delay_name.."="..destination_delay..",dialed_extension=" .. row.destination_number .. ",extension_uuid="..extension_uuid..record_session.."]user/" .. row.destination_number .. "@" .. domain_name; dial_string = dial_string_to_user; elseif (tonumber(destination_number) == nil) then --sip uri @@ -340,23 +363,6 @@ toll_allow = ''; end - --get the destination caller id name and number - if (follow_me_caller_id_uuid and follow_me_caller_id_uuid ~= '') then - local sql = "select destination_uuid, destination_number, destination_description, destination_caller_id_name, destination_caller_id_number "; - sql = sql .. "from v_destinations "; - sql = sql .. "where domain_uuid = :domain_uuid "; - sql = sql .. "and destination_uuid = :destination_uuid "; - sql = sql .. "order by destination_number asc "; - local params = {domain_uuid = domain_uuid, destination_uuid = follow_me_caller_id_uuid}; - if (debug["sql"]) then - freeswitch.consoleLog("notice", "SQL:" .. sql .. "; params: " .. json.encode(params) .. "\n"); - end - status = dbh:query(sql, params, function(field) - caller_id_name = field["destination_caller_id_name"]; - caller_id_number = field["destination_caller_id_number"]; - end); - end - --check if the user exists if tonumber(caller_id_number) ~= nil then cmd = "user_exists id ".. caller_id_number .." "..domain_name; @@ -387,7 +393,7 @@ --set the destination dial string -- have to double destination_delay here due a FS bug requiring a 50% delay value for internal extensions, but not external calls. destination_delay = destination_delay * 2; - dial_string = "[ignore_early_media=true,toll_allow=".. toll_allow ..",".. caller_id ..",sip_invite_domain="..domain_name..",domain_uuid="..domain_uuid..",call_direction="..call_direction..","..group_confirm..","..timeout_name.."="..destination_timeout..","..delay_name.."="..destination_delay.."]"..route_bridge + dial_string = "[ignore_early_media=true,toll_allow=".. toll_allow ..",accountcode="..accountcode..",".. caller_id ..",sip_invite_domain="..domain_name..",domain_uuid="..domain_uuid..",call_direction="..call_direction..","..group_confirm..","..timeout_name.."="..destination_timeout..","..delay_name.."="..destination_delay.."]"..route_bridge end --add a delimiter between destinations diff --git a/app/scripts/resources/scripts/app/provision/index.lua b/app/scripts/resources/scripts/app/provision/index.lua index 3256e785d7..05a2c78e58 100644 --- a/app/scripts/resources/scripts/app/provision/index.lua +++ b/app/scripts/resources/scripts/app/provision/index.lua @@ -193,6 +193,7 @@ event:addHeader('content-type', 'application/simple-message-summary'); --check sync event:addHeader('event-string', 'check-sync;reboot='..reboot); + --event:addHeader('event-string', 'resync'); --send the event event:fire(); end); @@ -249,6 +250,7 @@ event:addHeader('content-type', 'application/simple-message-summary'); --check sync event:addHeader('event-string', 'check-sync;reboot='..reboot); + --event:addHeader('event-string', 'resync'); --send the event event:fire(); end diff --git a/app/scripts/resources/scripts/app/ring_groups/index.lua b/app/scripts/resources/scripts/app/ring_groups/index.lua index 1b9251b4a7..61d72800cb 100644 --- a/app/scripts/resources/scripts/app/ring_groups/index.lua +++ b/app/scripts/resources/scripts/app/ring_groups/index.lua @@ -305,7 +305,7 @@ if (missed_call_app == "email") then --prepare the email address mail_to = missed_call_data; - + --set the sounds path for the language, dialect and voice default_language = session:getVariable("default_language"); default_dialect = session:getVariable("default_dialect"); @@ -325,6 +325,7 @@ if (debug["sql"]) then freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n"); end + dbh = Database.new('system'); dbh:query(sql, params, function(row) subject = row["template_subject"]; body = row["template_body"]; @@ -882,6 +883,9 @@ end end + --release dbh before bridge + dbh:release(); + --session execute if (session:ready()) then --set the variables @@ -1006,6 +1010,7 @@ session:execute(ring_group_timeout_app, ring_group_timeout_data); end else + dbh = Database.new('system'); local sql = "SELECT ring_group_timeout_app, ring_group_timeout_data FROM v_ring_groups "; sql = sql .. "where ring_group_uuid = :ring_group_uuid"; local params = {ring_group_uuid = ring_group_uuid}; diff --git a/app/scripts/resources/scripts/app/voicemail/resources/functions/forward_add_intro.lua b/app/scripts/resources/scripts/app/voicemail/resources/functions/forward_add_intro.lua index cb0526115d..9ba01371e2 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/functions/forward_add_intro.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/functions/forward_add_intro.lua @@ -48,8 +48,9 @@ --record your message at the tone press any key or stop talking to end the recording if (session:ready()) then - --session:sayPhrase("voicemail_record_greeting", "", "en") session:execute("playback", "phrase:voicemail_record_greeting"); + session:execute("sleep", "1000"); + session:streamFile("tone_stream://L=1;%(1000, 0, 640)"); end --set the file full path diff --git a/app/scripts/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua b/app/scripts/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua index 831202b0ad..0b0afd52e7 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/functions/listen_to_recording.lua @@ -46,27 +46,27 @@ session:execute("playback", "phrase:voicemail_say_message_number:" .. message_status .. ":" .. message_number); end end - --say the caller id number - if (session:ready() and caller_id_number ~= nil) then - if (vm_say_caller_id_number ~= nil) then - if (vm_say_caller_id_number == "true") then - session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-from.wav"); - session:say(caller_id_number, default_language, "name_spelled", "iterated"); - end - end + --say the caller id number first (default) + if ( + session:ready() and + caller_id_number ~= nil and ( + vm_say_caller_id_number == nil or + vm_say_caller_id_number == "true" + )) then + session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-from.wav"); + session:say(caller_id_number, default_language, "name_spelled", "iterated"); end - --say the message date - if (session:ready()) then - if (string.len(dtmf_digits) == 0) then - if (vm_say_date_time ~= nil) then - if (vm_say_date_time == "true") then - if (current_time_zone ~= nil) then - session:execute("set", "timezone="..current_time_zone..""); - end - session:say(created_epoch, default_language, "current_date_time", "pronounced"); - end - end + --say the message date first (default) + if ( + session:ready() and + string.len(dtmf_digits) == 0 and ( + vm_say_date_time == nil or + vm_say_date_time == "true" + )) then + if (current_time_zone ~= nil) then + session:execute("set", "timezone="..current_time_zone..""); end + session:say(created_epoch, default_language, "current_date_time", "pronounced"); end --get the recordings from the database if (storage_type == "base64") then @@ -156,10 +156,31 @@ os.remove(voicemail_dir.."/"..voicemail_id.."/intro_"..uuid.."."..vm_message_ext); os.remove(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid.."."..vm_message_ext); end - + --say the caller id number last (optional) + if ( + session:ready() and + caller_id_number ~= nil and + vm_say_caller_id_number ~= nil and + vm_say_caller_id_number == "last" + ) then + session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-from.wav"); + session:say(caller_id_number, default_language, "name_spelled", "iterated"); + end + --say the message date last (optional) + if ( + session:ready() and + string.len(dtmf_digits) == 0 and + vm_say_date_time ~= nil and + vm_say_date_time == "last" + ) then + if (current_time_zone ~= nil) then + session:execute("set", "timezone="..current_time_zone..""); + end + session:say(created_epoch, default_language, "current_date_time", "pronounced"); + end --post listen options - if (session:ready()) then - if (string.len(dtmf_digits) == 0) then + if (session:ready()) then + if (string.len(dtmf_digits) == 0) then dtmf_digits = session:playAndGetDigits(1, 1, max_tries, digit_timeout, "#", "phrase:voicemail_listen_file_options:1:2:5:7:8:9:0", "", "\\d+"); end end @@ -172,7 +193,7 @@ --process the dtmf if (session:ready()) then if (dtmf_digits == "1") then - listen_to_recording(message_number, uuid, created_epoch, caller_id_name, caller_id_number); + listen_to_recording(message_number, uuid, created_epoch, caller_id_name, caller_id_number, message_status); elseif (dtmf_digits == "2") then message_saved(voicemail_id, uuid); session:execute("playback", "phrase:voicemail_ack:saved"); diff --git a/app/scripts/resources/scripts/app/voicemail/resources/functions/mwi_notify.lua b/app/scripts/resources/scripts/app/voicemail/resources/functions/mwi_notify.lua index f274ddffc5..39936cbdc3 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/functions/mwi_notify.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/functions/mwi_notify.lua @@ -12,6 +12,11 @@ array = explode("/", sofia_contact); sip_profile = array[2]; + --debug info + --freeswitch.consoleLog("NOTICE", "sofia_contact */"..account.."\n"); + --freeswitch.consoleLog("NOTICE", "sip_profile="..sip_profile.."\n"); + --freeswitch.consoleLog("NOTICE", "sofia_contact="..sofia_contact.."\n"); + --set the variables new_messages = tonumber(new_messages) or 0 saved_messages = tonumber(saved_messages) or 0 diff --git a/app/scripts/resources/scripts/app/voicemail/resources/functions/play_greeting.lua b/app/scripts/resources/scripts/app/voicemail/resources/functions/play_greeting.lua index e4a67f498d..43480ee639 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/functions/play_greeting.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/functions/play_greeting.lua @@ -85,17 +85,17 @@ if saved then --play the greeting - dtmf_digits = session:playAndGetDigits(min_digits, max_digits, tries, timeout, "#", voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav", "", ".*", max_timeout); + dtmf_digits = session:playAndGetDigits(0, max_digits, tries, timeout, "#", voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav", "", ".*", max_timeout); --session:execute("playback",voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"); --delete the greeting (retain local for better responsiveness) --os.remove(voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"); end elseif (storage_type == "http_cache") then - dtmf_digits = session:playAndGetDigits(min_digits, max_digits, tries, timeout, "#", voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav", "", ".*", max_timeout); + dtmf_digits = session:playAndGetDigits(0, max_digits, tries, timeout, "#", voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav", "", ".*", max_timeout); --session:execute("playback",storage_path.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"); else - dtmf_digits = session:playAndGetDigits(min_digits, max_digits, tries, timeout, "#", voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav", "",".*", max_timeout); + dtmf_digits = session:playAndGetDigits(0, max_digits, tries, timeout, "#", voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav", "",".*", max_timeout); --session:execute("playback",voicemail_dir.."/"..voicemail_id.."/greeting_"..greeting_id..".wav"); end @@ -110,7 +110,7 @@ else voicemail_id_say = voicemail_id; end - dtmf_digits = session:playAndGetDigits(0, 1, 1, 200, "#", "phrase:voicemail_play_greeting:" .. voicemail_id_say, "", "\\d+"); + dtmf_digits = session:playAndGetDigits(0, 1, 1, 200, "#", "phrase:voicemail_play_greeting:" .. voicemail_id_say, "", ".*"); end end end diff --git a/app/scripts/resources/scripts/app/voicemail/resources/functions/record_message.lua b/app/scripts/resources/scripts/app/voicemail/resources/functions/record_message.lua index 7943ff2355..09c5a92cb6 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/functions/record_message.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/functions/record_message.lua @@ -277,73 +277,71 @@ end end end - - if (transcribe_provider == "google") then - local api_key = settings:get('voicemail', 'google_key', 'text') or ''; - local transcription_server = settings:get('voicemail', 'google_url', 'text') or ''; - if (api_key ~= '') then - transcribe_cmd = [[sox ]]..file_path..[[ ]]..file_path..[[.flac && echo "{ 'config': { 'languageCode': 'en-US', 'enableWordTimeOffsets': false }, 'audio': { 'content': '`base64 -w 0 ]]..file_path..[[.flac`' } }" | curl -X POST -H "Content-Type: application/json" -d @- "]]..transcription_server..[[:recognize?key=]]..api_key..[[" && rm -f ]]..file_path..[[.flac]] -end + if (transcribe_provider == "google") then + local api_key = settings:get('voicemail', 'google_key', 'text') or ''; + local transcription_server = settings:get('voicemail', 'google_url', 'text') or ''; + if (api_key ~= '') then + transcribe_cmd = [[sox ]]..file_path..[[ ]]..file_path..[[.flac trim 0 00:59 && echo "{ 'config': { 'languageCode': ']]..transcribe_language..[[', 'enableWordTimeOffsets': false , 'enableAutomaticPunctuation': true , 'alternativeLanguageCodes': ']]..transcribe_alternate_language..[[' }, 'audio': { 'content': '`base64 -w 0 ]]..file_path..[[.flac`' } }" | curl -X POST -H "Content-Type: application/json" -d @- "]]..transcription_server..[[:recognize?key=]]..api_key..[[" && rm -f ]]..file_path..[[.flac]] + end - local handle = io.popen(transcribe_cmd); - local transcribe_result = handle:read("*a"); - transcribe_result = transcribe_result:gsub('%%HESITATION ', ''); - handle:close(); - if (debug["info"]) then - freeswitch.consoleLog("notice", "[voicemail] CMD: " .. transcribe_cmd .. "\n"); - freeswitch.consoleLog("notice", "[voicemail] RESULT: " .. transcribe_result .. "\n"); - end + local handle = io.popen(transcribe_cmd); + local transcribe_result = handle:read("*a"); + transcribe_result = transcribe_result:gsub('%%HESITATION ', ''); + handle:close(); + if (debug["info"]) then + freeswitch.consoleLog("notice", "[voicemail] CMD: " .. transcribe_cmd .. "\n"); + freeswitch.consoleLog("notice", "[voicemail] RESULT: " .. transcribe_result .. "\n"); + end - --Trancribe request can fail - if (transcribe_result == '') then - freeswitch.consoleLog("notice", "[voicemail] TRANSCRIPTION: (null) \n"); - return '' - else - status, transcribe_json = pcall(JSON.decode, transcribe_result); - if not status then - if (debug["info"]) then - freeswitch.consoleLog("notice", "[voicemail] error decoding google json\n"); - end - return ''; - end - end - - if (transcribe_json["results"] ~= nil) then - --Transcription - if (transcribe_json["results"][1]["alternatives"][1]["transcript"] ~= nil) then - transcription = ''; - for key, row in pairs(transcribe_json["results"]) do - transcription = transcription .. row["alternatives"][1]["transcript"]; - end - if (debug["info"]) then - freeswitch.consoleLog("notice", "[voicemail] TRANSCRIPTION: " .. transcription .. "\n"); - end - else - if (debug["info"]) then - freeswitch.consoleLog("notice", "[voicemail] TRANSCRIPTION: (null) \n"); - end - return ''; + --Trancribe request can fail + if (transcribe_result == '') then + freeswitch.consoleLog("notice", "[voicemail] TRANSCRIPTION: (null) \n"); + return '' + else + status, transcribe_json = pcall(JSON.decode, transcribe_result); + if not status then + if (debug["info"]) then + freeswitch.consoleLog("notice", "[voicemail] error decoding google json\n"); end - --Confidence - if (transcribe_json["results"][1]["alternatives"][1]["confidence"]) then - if (debug["info"]) then - freeswitch.consoleLog("notice", "[voicemail] CONFIDENCE: " .. transcribe_json["results"][1]["alternatives"][1]["confidence"] .. "\n"); - end - confidence = transcribe_json["results"][1]["alternatives"][1]["confidence"]; - else - if (debug["info"]) then - freeswitch.consoleLog("notice", "[voicemail] CONFIDENCE: (null) \n"); - end + return ''; + end + end + if (transcribe_json["results"] ~= nil) then + --Transcription + if (transcribe_json["results"][1]["alternatives"][1]["transcript"] ~= nil) then + transcription = ''; + for key, row in pairs(transcribe_json["results"]) do + transcription = transcription .. row["alternatives"][1]["transcript"]; + end + if (debug["info"]) then + freeswitch.consoleLog("notice", "[voicemail] TRANSCRIPTION: " .. transcription .. "\n"); end - return transcription; else if (debug["info"]) then - freeswitch.consoleLog("notice", "[voicemail] TRANSCRIPTION: json error \n"); + freeswitch.consoleLog("notice", "[voicemail] TRANSCRIPTION: (null) \n"); end return ''; end + --Confidence + if (transcribe_json["results"][1]["alternatives"][1]["confidence"]) then + if (debug["info"]) then + freeswitch.consoleLog("notice", "[voicemail] CONFIDENCE: " .. transcribe_json["results"][1]["alternatives"][1]["confidence"] .. "\n"); + end + confidence = transcribe_json["results"][1]["alternatives"][1]["confidence"]; + else + if (debug["info"]) then + freeswitch.consoleLog("notice", "[voicemail] CONFIDENCE: (null) \n"); + end + end + return transcription; + else + if (debug["info"]) then + freeswitch.consoleLog("notice", "[voicemail] TRANSCRIPTION: json error \n"); + end + return ''; end + end if (transcribe_provider == "custom") then local transcription_server = settings:get('voicemail', 'transcription_server', 'text') or ''; @@ -396,9 +394,9 @@ end local message_max_length = settings:get('voicemail', 'message_max_length', 'numeric') or 300; local message_silence_threshold = settings:get('voicemail', 'message_silence_threshold', 'numeric') or 200; local message_silence_seconds = settings:get('voicemail', 'message_silence_seconds', 'numeric') or 3; - transcribe_enabled = settings:get('voicemail', 'transcribe_enabled', 'boolean') or "false"; + local email_queue_enabled = settings:get('email_queue', 'enabled', 'boolean') or "false"; local transcribe_provider = settings:get('voicemail', 'transcribe_provider', 'text') or ''; - local email_method = settings:get('email', 'method', 'text') or "smtp"; + transcribe_enabled = settings:get('voicemail', 'transcribe_enabled', 'boolean') or "false"; --debug information if (debug["info"]) then @@ -522,13 +520,14 @@ end --play the beep dtmf_digits = ''; + session:execute("playback","silence_stream://200"); session:streamFile("tone_stream://L=1;%(1000, 0, 640)"); --start epoch start_epoch = os.time(); --if using the email queue disable inline transcription - if (email_method == 'queue') then + if (email_queue_enabled == 'true') then transcribe_enabled = 'false'; end @@ -588,7 +587,7 @@ end --if the recording is below the minimal length then re-record the message if (message_length > 2) then - --continue + session:setVariable("voicemail_message_seconds", message_length); else if (session:ready()) then --your recording is below the minimal acceptable length, please try again diff --git a/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua b/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua index b7941aa6ee..ea144fdb93 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua @@ -32,8 +32,8 @@ function send_email(id, uuid) local db = dbh or Database.new('system') local settings = Settings.new(db, domain_name, domain_uuid) - local email_method = settings:get('email', 'method', 'text'); local transcribe_enabled = settings:get('voicemail', 'transcribe_enabled', 'boolean'); + local email_queue_enabled = settings:get('email_queue', 'enabled', 'boolean') or "false"; --get voicemail message details local sql = [[SELECT * FROM v_voicemails @@ -48,6 +48,7 @@ --voicemail_password = row["voicemail_password"]; --greeting_id = row["greeting_id"]; voicemail_mail_to = row["voicemail_mail_to"]; + voicemail_transcription_enabled = row["voicemail_transcription_enabled"]; voicemail_file = row["voicemail_file"]; voicemail_local_after_email = row["voicemail_local_after_email"]; voicemail_description = row["voicemail_description"]; @@ -135,7 +136,7 @@ sql = sql .. "WHERE (domain_uuid = :domain_uuid or domain_uuid is null) "; sql = sql .. "AND template_language = :template_language "; sql = sql .. "AND template_category = 'voicemail' " - if (transcribe_enabled == 'true') then + if (transcribe_enabled == 'true' and voicemail_transcription_enabled == 'true') then sql = sql .. "AND template_subcategory = 'transcription' " else sql = sql .. "AND template_subcategory = 'default' " @@ -184,6 +185,7 @@ subject = subject:gsub("${voicemail_description}", voicemail_description); subject = subject:gsub("${voicemail_name_formatted}", voicemail_name_formatted); subject = subject:gsub("${domain_name}", domain_name); + subject = subject:gsub("${new_messages}", new_messages); subject = trim(subject); subject = '=?utf-8?B?'..base64.encode(subject)..'?='; @@ -202,7 +204,9 @@ body = body:gsub("${voicemail_name_formatted}", voicemail_name_formatted); body = body:gsub("${domain_name}", domain_name); body = body:gsub("${sip_to_user}", id); - body = body:gsub("${origination_callee_id_name}", origination_callee_id_name); + if (origination_callee_id_name ~= nil) then + body = body:gsub("${origination_callee_id_name}", origination_callee_id_name); + end body = body:gsub("${dialed_user}", id); if (voicemail_file == "attach") then body = body:gsub("${message}", text['label-attached']); @@ -228,7 +232,7 @@ end --whether to keep the voicemail message and details local after email - if (string.len(voicemail_mail_to) > 2 and email_method ~= 'queue') then + if (string.len(voicemail_mail_to) > 2 and email_queue_enabled == 'false') then if (voicemail_local_after_email == "false") then --delete the voicemail message details local sql = [[DELETE FROM v_voicemail_messages diff --git a/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi.lua b/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi.lua index 149ddc2757..f676b13fff 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi.lua @@ -76,6 +76,7 @@ FROM v_voicemail_messages as m, v_voicemails as v, v_domains as d WHERE v.voicemail_uuid = m.voicemail_uuid AND v.domain_uuid = d.domain_uuid + AND v.voicemail_enabled = 'true' GROUP BY v.voicemail_id, v.voicemail_uuid, v.domain_uuid, d.domain_name;]]; if (debug["sql"]) then freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n"); diff --git a/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi_notify.lua b/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi_notify.lua new file mode 100644 index 0000000000..fdc83fcdc3 --- /dev/null +++ b/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi_notify.lua @@ -0,0 +1,22 @@ + +--get the argv values + voicemail_id = argv[1]; + domain_name = argv[2]; + new_messages = argv[3] or '0'; + saved_messages = argv[4] or '0'; + +--include the lua script + require "resources.functions.config"; + +--send MWI NOTIFY message + require "app.voicemail.resources.functions.mwi_notify"; + +--debug info + --freeswitch.consoleLog("NOTICE", "voicemail_id="..voicemail_id.."\n"); + --freeswitch.consoleLog("NOTICE", "domain_name="..domain_name.."\n"); + --freeswitch.consoleLog("NOTICE", "new_messages="..new_messages.."\n"); + --freeswitch.consoleLog("NOTICE", "saved_messages="..saved_messages.."\n"); + +--send the message waiting event + mwi_notify(voicemail_id..'@'..domain_name, domain_name, new_messages, saved_messages); + diff --git a/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi_subscribe.lua b/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi_subscribe.lua index f261f5a955..3c9aa2abee 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi_subscribe.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/scripts/mwi_subscribe.lua @@ -13,18 +13,18 @@ local vm_message_count do local vm_to_uuid_sql = [[SELECT v.voicemail_uuid FROM v_voicemails as v inner join v_domains as d on v.domain_uuid = d.domain_uuid -WHERE v.voicemail_id = :voicemail_id and d.domain_name = :domain_name]] +WHERE v.voicemail_enabled = 'true' and v.voicemail_id = :voicemail_id and d.domain_name = :domain_name]] local vm_messages_sql = [[SELECT ( SELECT count(*) FROM v_voicemail_messages - WHERE voicemail_uuid = %s + WHERE voicemail_uuid = :voicemail_uuid AND (message_status is null or message_status = '') ) as new_messages, ( SELECT count(*) FROM v_voicemail_messages - WHERE voicemail_uuid = %s + WHERE voicemail_uuid = :voicemail_uuid AND message_status = 'saved' ) as saved_messages ]] @@ -42,38 +42,32 @@ function vm_message_count(account, use_cache) local dbh = Database.new('system') if not dbh then return end + -- Get the UUID from the cache if enabled/supported local uuid if use_cache and cache.support() then - local uuid = cache.get('voicemail_uuid:' .. account) - if not uuid then - uuid = dbh:first_value(vm_to_uuid_sql, { - voicemail_id = id, domain_name = domain_name - }) + uuid = cache.get('voicemail_uuid:' .. account) + end - if uuid and #uuid > 0 then - cache.set('voicemail_uuid:' .. account, uuid, 3600) - end + -- If no UUID cached or if cache is not enabled/supported get the UUID from the database + if not uuid then + uuid = dbh:first_value(vm_to_uuid_sql, { + voicemail_id = id, domain_name = domain_name + }) + + if uuid and #uuid > 0 and use_cache and cache.support() then + cache.set('voicemail_uuid:' .. account, uuid, 3600) end end + -- Get the count of unread and read messages from the database if there is a valid voicemail account local row if uuid and #uuid > 0 then - local sql = string.format(vm_messages_sql, ":voicemail_uuid", ":voicemail_uuid") - row = dbh:first_row(sql, {voicemail_uuid = uuid}) - else - local uuid_sql = '(' .. vm_to_uuid_sql .. ')' - - local sql = string.format(vm_messages_sql, - uuid_sql, uuid_sql - ) - - row = dbh:first_row(sql, { - voicemail_id = id, domain_name = domain_name - }) + row = dbh:first_row(vm_messages_sql, {voicemail_uuid = uuid}) end dbh:release() + -- This condition can be hit if the voicemail box is either disabled or non-existent if not row then return end return row.new_messages, row.saved_messages diff --git a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua index 01a404abb5..8d747bd7c4 100644 --- a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua +++ b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua @@ -180,16 +180,21 @@ agent_wrap_up_time = row.agent_wrap_up_time; agent_reject_delay_time = row.agent_reject_delay_time; agent_busy_delay_time = row.agent_busy_delay_time; + agent_record = row.agent_record; --get and then set the complete agent_contact with the call_timeout and when necessary confirm --confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1"; --if you change this variable also change app/call_center/call_center_agent_edit.php confirm = "group_confirm_file=ivr/ivr-accept_reject_voicemail.wav,group_confirm_key=1,group_confirm_read_timeout=2000,leg_timeout="..agent_call_timeout; + local record = ""; + if (agent_record == "true") then + record = string.format(",execute_on_pre_bridge='record_session %s/%s/archive/${strftime(%%Y)}/${strftime(%%b)}/${strftime(%%d)}/${uuid}.${record_ext}'", recordings_dir, domain_name) + end if (string.find(agent_contact, '}') == nil) then --not found if (string.find(agent_contact, 'sofia/gateway') == nil) then --add the call_timeout - agent_contact = "{call_timeout="..agent_call_timeout..",domain_name="..domain_name..",domain_uuid="..domain_uuid..",extension_uuid="..extension_uuid..",sip_h_caller_destination=${caller_destination}}"..agent_contact; + agent_contact = "{call_timeout="..agent_call_timeout..",domain_name="..domain_name..",domain_uuid="..domain_uuid..",extension_uuid="..extension_uuid..",sip_h_caller_destination=${caller_destination}"..record.."}"..agent_contact; else --add the call_timeout and confirm agent_contact = "{"..confirm..",call_timeout="..agent_call_timeout..",domain_name="..domain_name..",domain_uuid="..domain_uuid..",sip_h_caller_destination=${caller_destination}}"..agent_contact; diff --git a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/ivr.conf.lua b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/ivr.conf.lua index 851f951251..d6497da5c4 100644 --- a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/ivr.conf.lua +++ b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/ivr.conf.lua @@ -98,6 +98,7 @@ ivr_menu_greet_short = row["ivr_menu_greet_short"]; ivr_menu_invalid_sound = row["ivr_menu_invalid_sound"]; ivr_menu_exit_sound = row["ivr_menu_exit_sound"]; + ivr_menu_pin_number = row["ivr_menu_pin_number"]; ivr_menu_confirm_macro = row["ivr_menu_confirm_macro"]; ivr_menu_confirm_key = row["ivr_menu_confirm_key"]; ivr_menu_tts_engine = row["ivr_menu_tts_engine"]; @@ -248,6 +249,7 @@ table.insert(xml, [[ greet-short="]]..ivr_menu_greet_short..[[" ]]); table.insert(xml, [[ invalid-sound="]]..ivr_menu_invalid_sound..[[" ]]); table.insert(xml, [[ exit-sound="]]..ivr_menu_exit_sound..[[" ]]); + table.insert(xml, [[ pin="]]..ivr_menu_pin_number..[[" ]]); table.insert(xml, [[ confirm-macro="]]..ivr_menu_confirm_macro..[[" ]]); table.insert(xml, [[ confirm-key="]]..ivr_menu_confirm_key..[[" ]]); table.insert(xml, [[ tts-engine="]]..ivr_menu_tts_engine..[[" ]]); @@ -279,9 +281,12 @@ --direct dial if (ivr_menu_direct_dial == "true") then table.insert(xml, [[ \n]]); - table.insert(xml, [[ \n]]); + --table.insert(xml, [[ \n]]); table.insert(xml, [[ \n]]); - table.insert(xml, [[ \n]]); + --table.insert(xml, [[ \n]]); + if (#ivr_menu_cid_prefix > 0) then + table.insert(xml, [[ \n]]); + end table.insert(xml, [[ \n]]); end diff --git a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua index 71beae1443..6274ab2e4c 100644 --- a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua +++ b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua @@ -181,6 +181,12 @@ if (string.len(field.ping) > 0) then table.insert(xml, [[ ]]); end + if (string.len(field.ping_min) > 0) then + table.insert(xml, [[ ]]); + end + if (string.len(field.ping_max) > 0) then + table.insert(xml, [[ ]]); + end if (string.len(field.context) > 0) then table.insert(xml, [[ ]]); end diff --git a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua index 5b24939647..90a9909417 100644 --- a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua +++ b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/dialplan/dialplan.lua @@ -116,7 +116,7 @@ --get the dialplan xml if (context_name == 'public' and dialplan_mode == 'single') then - sql = "SELECT d.domain_name, dialplan_xml FROM v_dialplans AS p, v_domains AS d "; + sql = "SELECT (select domain_name from v_domains where domain_uuid = p.domain_uuid) as domain_name, dialplan_xml FROM v_dialplans AS p "; sql = sql .. "WHERE ( "; sql = sql .. " p.dialplan_uuid IN ( "; sql = sql .. " SELECT dialplan_uuid FROM v_destinations " @@ -132,7 +132,6 @@ sql = sql .. " ) "; sql = sql .. " or (p.dialplan_context like '%public%' and p.domain_uuid IS NULL) "; sql = sql .. ") "; - sql = sql .. "AND p.domain_uuid = d.domain_uuid "; sql = sql .. "AND (p.hostname = :hostname OR p.hostname IS NULL) "; sql = sql .. "AND p.dialplan_enabled = 'true' "; sql = sql .. "ORDER BY p.dialplan_order ASC "; diff --git a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua index b02e0fc606..89a5b3d044 100644 --- a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua +++ b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua @@ -312,6 +312,7 @@ password = row.password; mwi_account = row.mwi_account; auth_acl = row.auth_acl; + --variables sip_from_user = row.extension; sip_from_number = (#number_alias > 0) and number_alias or row.extension; @@ -412,6 +413,25 @@ end); end + --get the extension settings from the database + if (extension_uuid) then + local sql = "SELECT * FROM v_extension_settings " + .. "WHERE extension_uuid = :extension_uuid " + .. "and extension_setting_enabled = 'true' "; + local params = {extension_uuid=extension_uuid}; + if (debug["sql"]) then + freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n"); + end + extension_settings = {} + dbh:query(sql, params, function(row) + table.insert(extension_settings, { + extension_setting_type = row.extension_setting_type, + extension_setting_name = row.extension_setting_name, + extension_setting_value = row.extension_setting_value + }); + end); + end + --get the voicemail from the database if (continue) then vm_enabled = "true"; @@ -510,6 +530,11 @@ table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); + for key,row in pairs(extension_settings) do + if (row.extension_setting_type == 'param') then + table.insert(xml, [[ ]]); + end + end table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); @@ -645,6 +670,11 @@ table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); + for key,row in pairs(extension_settings) do + if (row.extension_setting_type == 'variable') then + table.insert(xml, [[ ]]); + end + end table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); diff --git a/app/scripts/resources/scripts/call_forward.lua b/app/scripts/resources/scripts/call_forward.lua index bc97e5f130..ceed101ea1 100644 --- a/app/scripts/resources/scripts/call_forward.lua +++ b/app/scripts/resources/scripts/call_forward.lua @@ -147,7 +147,6 @@ local last_forward_all_destination = row.forward_all_destination; local follow_me_uuid = row.follow_me_uuid; local toll_allow = row.toll_allow or ''; - local forward_caller_id_uuid = row.forward_caller_id_uuid; --toggle enabled if enabled == "toggle" then @@ -190,56 +189,17 @@ session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-call_forwarding_has_been_set.wav"); end ---get the caller_id for outbound call - local forward_caller_id = "" - if enabled == "true" and not empty(forward_caller_id_uuid) then - local sql = "select destination_number, destination_description,".. - "destination_caller_id_number, destination_caller_id_name " .. - "from v_destinations where domain_uuid = :domain_uuid and " .. - "destination_type = 'inbound' and destination_uuid = :destination_uuid"; - local params = {domain_uuid = domain_uuid; destination_uuid = forward_caller_id_uuid} - if (debug["sql"]) then - log.noticef("SQL: %s; params: %s", sql, json.encode(params)); - end - local row = dbh:first_row(sql, params) - if row then - local caller_id_number = row.destination_caller_id_number - if empty(caller_id_number) then - caller_id_number = row.destination_number - end - - local caller_id_name = row.destination_caller_id_name - if empty(caller_id_name) then - caller_id_name = row.destination_description - end - - if not empty(caller_id_number) then - forward_caller_id = forward_caller_id .. - ",outbound_caller_id_number=" .. caller_id_number .. - ",origination_caller_id_number=" .. caller_id_number - end - - if not empty(caller_id_name) then - forward_caller_id = forward_caller_id .. - ",outbound_caller_id_name=" .. caller_id_name .. - ",origination_caller_id_name=" .. caller_id_name - end - end - end - --get default caller_id for outbound call - if enabled == "true" and empty(forward_caller_id_uuid) then - if settings:get('cdr', 'call_forward_fix', 'boolean') == 'true' then - if not empty(row.outbound_caller_id_number) then - forward_caller_id = forward_caller_id .. - ",outbound_caller_id_number=" .. row.outbound_caller_id_number .. - ",origination_caller_id_number=" .. row.outbound_caller_id_number - end - if not empty(row.outbound_caller_id_name) then - forward_caller_id = forward_caller_id .. - ",outbound_caller_id_name=" .. row.outbound_caller_id_name .. - ",origination_caller_id_name=" .. row.outbound_caller_id_name - end + if enabled == "true" and settings:get('cdr', 'call_forward_fix', 'boolean') == 'true' then + if not empty(row.outbound_caller_id_number) then + forward_caller_id = forward_caller_id .. + ",outbound_caller_id_number=" .. row.outbound_caller_id_number .. + ",origination_caller_id_number=" .. row.outbound_caller_id_number + end + if not empty(row.outbound_caller_id_name) then + forward_caller_id = forward_caller_id .. + ",outbound_caller_id_name=" .. row.outbound_caller_id_name .. + ",origination_caller_id_name=" .. row.outbound_caller_id_name end end @@ -302,14 +262,14 @@ -- Get the sip_profile if (extension ~= nil and domain_name ~= nil) then - sip_profile = notify.get_profile(extension, domain_name); + sip_profiles = notify.get_profiles(extension, domain_name); end - if (sip_profile ~= nil) then + if (sip_profiles ~= nil) then freeswitch.consoleLog("NOTICE", "[feature_event] SIP NOTIFY: CFWD set to "..forward_all_enabled.."\n"); --Do Not Disturb - notify.dnd(extension, domain_name, sip_profile, do_not_disturb); + notify.dnd(extension, domain_name, sip_profiles, do_not_disturb); --Forward all forward_immediate_enabled = forward_all_enabled; @@ -321,7 +281,7 @@ end freeswitch.consoleLog("NOTICE", "[feature_event] forward_immediate_destination "..forward_immediate_destination.."\n"); - notify.forward_immediate(extension, domain_name, sip_profile, forward_immediate_enabled, forward_immediate_destination); + notify.forward_immediate(extension, domain_name, sip_profiles, forward_immediate_enabled, forward_immediate_destination); --Forward busy --workaround for freeswitch not sending NOTIFY when destination values are nil. Send 0. @@ -330,7 +290,7 @@ end freeswitch.consoleLog("NOTICE", "[feature_event] forward_busy_destination "..forward_busy_destination.."\n"); - notify.forward_busy(extension, domain_name, sip_profile, forward_busy_enabled, forward_busy_destination); + notify.forward_busy(extension, domain_name, sip_profiles, forward_busy_enabled, forward_busy_destination); --Forward No Answer ring_count = math.ceil (call_timeout / 6); @@ -340,7 +300,7 @@ end freeswitch.consoleLog("NOTICE", "[feature_event] forward_no_answer_destination "..forward_no_answer_destination.."\n"); - notify.forward_no_answer(extension, domain_name, sip_profile, forward_no_answer_enabled, forward_no_answer_destination, ring_count); + notify.forward_no_answer(extension, domain_name, sip_profiles, forward_no_answer_enabled, forward_no_answer_destination, ring_count); end end diff --git a/app/scripts/resources/scripts/do_not_disturb.lua b/app/scripts/resources/scripts/do_not_disturb.lua index 27229694f4..bb70185552 100644 --- a/app/scripts/resources/scripts/do_not_disturb.lua +++ b/app/scripts/resources/scripts/do_not_disturb.lua @@ -100,7 +100,7 @@ extension = row.extension; number_alias = row.number_alias or ''; accountcode = row.accountcode; - follow_me_uuid = row.follow_me_uuid; + follow_me_uuid = row.follow_me_uuid or nil; do_not_disturb = row.do_not_disturb; forward_all_destination = row.forward_all_destination; forward_all_enabled = row.forward_all_enabled; @@ -227,15 +227,15 @@ -- Get the sip_profile if (extension ~= nil and domain_name ~= nil) then - sip_profile = notify.get_profile(extension, domain_name); + sip_profiles = notify.get_profiles(extension, domain_name); end -- check if not nil - if (sip_profile ~= nil) then + if (sip_profiles ~= nil) then freeswitch.consoleLog("NOTICE", "[feature_event] SIP NOTIFY: CFWD set to "..forward_all_enabled.."\n"); --Do Not Disturb - notify.dnd(extension, domain_name, sip_profile, do_not_disturb); + notify.dnd(extension, domain_name, sip_profiles, do_not_disturb); --Forward all forward_immediate_enabled = forward_all_enabled; @@ -246,7 +246,7 @@ forward_immediate_destination = '0'; end - notify.forward_immediate(extension, domain_name, sip_profile, forward_immediate_enabled, forward_immediate_destination); + notify.forward_immediate(extension, domain_name, sip_profiles, forward_immediate_enabled, forward_immediate_destination); --Forward busy --workaround for freeswitch not sending NOTIFY when destination values are nil. Send 0. @@ -254,7 +254,7 @@ forward_busy_destination = '0'; end - notify.forward_busy(extension, domain_name, sip_profile, forward_busy_enabled, forward_busy_destination); + notify.forward_busy(extension, domain_name, sip_profiles, forward_busy_enabled, forward_busy_destination); --Forward No Answer ring_count = math.ceil (call_timeout / 6); @@ -263,7 +263,7 @@ forward_no_answer_destination = '0'; end - notify.forward_no_answer(extension, domain_name, sip_profile, forward_no_answer_enabled, forward_no_answer_destination, ring_count); + notify.forward_no_answer(extension, domain_name, sip_profiles, forward_no_answer_enabled, forward_no_answer_destination, ring_count); end end diff --git a/app/scripts/resources/scripts/dtmf_handler.lua b/app/scripts/resources/scripts/dtmf_handler.lua new file mode 100644 index 0000000000..89f4faa786 --- /dev/null +++ b/app/scripts/resources/scripts/dtmf_handler.lua @@ -0,0 +1,16 @@ +--local s = event:serialize("xml") +--local name = event:getHeader("Event-Name") +--freeswitch.consoleLog("NOTICE", "Got event! " .. name) +--freeswitch.consoleLog("NOTICE", "Serial!\n" .. s) + +local call_uuid = event:getHeader("Caller-Unique-ID"); +--local channel_timestamp = event:getHeader("Event-Date-Timestamp"); +local channel_timestamp = os.time(); +local dtmf_value = event:getHeader("DTMF-Digit"); + +local session = freeswitch.Session(call_uuid); +local history = channel_timestamp .. ':' .. dtmf_value .. "\n"; +session:execute("push", "dtmf_history="..history); + +-- lua.conf.xml +-- diff --git a/app/scripts/resources/scripts/resources/functions/send_mail.lua b/app/scripts/resources/scripts/resources/functions/send_mail.lua index 72af13bf59..c99ce9be3f 100644 --- a/app/scripts/resources/scripts/resources/functions/send_mail.lua +++ b/app/scripts/resources/scripts/resources/functions/send_mail.lua @@ -1,30 +1,13 @@ -local Settings = require "resources.functions.lazy_settings"; local Database = require "resources.functions.database"; +local Settings = require "resources.functions.lazy_settings"; local cache = require"resources.functions.cache"; local log = require "resources.functions.log".send_mail - local db = dbh or Database.new('system'); ---local settings = Settings.new(db, nil, nil); ---local email_method = settings:get('email', 'method', 'text'); +local settings = Settings.new(db, domain_name, domain_uuid) +local email_queue_enabled = settings:get('email_queue', 'enabled', 'boolean') or "false"; ---get the dialplan mode from the cache -email_method_key = "settings:email:email_mode"; -email_method, err = cache.get(email_method_key); - ---if not found in the cache then get it from the database -if (err == 'NOT FOUND') then - --get the mode from default settings - sql = "select default_setting_value from v_default_settings " - sql = sql .. "where default_setting_category = 'email' "; - sql = sql .. "and default_setting_subcategory = 'method' "; - email_method = db:first_value(sql, nil); - if (email_method) then - local ok, err = cache.set(email_method_key, email_method, expire["dialplan"]); - end -end - -if (email_method == 'queue') then +if (email_queue_enabled == 'true') then function send_mail(headers, email_address, email_message, email_file) --include json library @@ -36,8 +19,16 @@ if (email_method == 'queue') then local domain_uuid = headers["X-FusionPBX-Domain-UUID"]; local domain_name = headers["X-FusionPBX-Domain-Name"]; local email_type = headers["X-FusionPBX-Email-Type"] or 'info'; - local call_uuid = headers["X-FusionPBX-Email-Call-UUID"]; + local call_uuid = headers["X-FusionPBX-Call-UUID"]; + local local_after_email = headers["X-FusionPBX-local_after_email"] or ''; + if (local_after_email == 'false') then + email_action_after = 'delete'; + else + email_action_after = ''; + end + + local db = dbh or Database.new('system'); local settings = Settings.new(db, domain_name, domain_uuid); local email_from = settings:get('email', 'smtp_from', 'text'); @@ -65,7 +56,10 @@ if (email_method == 'queue') then sql = sql .. " email_to, "; sql = sql .. " email_subject, "; sql = sql .. " email_body, "; - sql = sql .. " email_status "; + sql = sql .. " email_status, "; + sql = sql .. " email_uuid, "; + sql = sql .. " email_action_after "; + sql = sql .. ") "; sql = sql .. "values ( "; sql = sql .. " :email_queue_uuid, "; @@ -76,7 +70,9 @@ if (email_method == 'queue') then sql = sql .. " :email_to, "; sql = sql .. " :email_subject, "; sql = sql .. " :email_body, "; - sql = sql .. " :email_status "; + sql = sql .. " :email_status, "; + sql = sql .. " :email_uuid, "; + sql = sql .. " :email_action_after "; sql = sql .. ") "; local params = { email_queue_uuid = email_queue_uuid; @@ -87,6 +83,8 @@ if (email_method == 'queue') then email_subject = email_subject; email_body = email_body; email_status = email_status; + email_uuid = call_uuid; + email_action_after = email_action_after; } db:query(sql, params); @@ -100,7 +98,8 @@ if (email_method == 'queue') then local email_table = split(email_file, '/', true) email_attachment_name = email_table[#email_table] - email_attachment_path = email_file.sub(email_file, 0, (string.len(email_file) - string.len(email_attachment_name)) - 1); + email_attachment_path = email_file.sub(email_file, 0, (string.len(email_file) - string.len(email_attachment_name)) - 1); + --freeswitch.consoleLog("notice", "[send_email] voicemail path: " .. email_attachment_path .. "/" .. email_attachment_name .. "\n"); --base64 encode the file --local file = require "resources.functions.file" @@ -136,7 +135,7 @@ if (email_method == 'queue') then email_attachment_base64 = email_attachment_base64; } if (debug["sql"]) then - freeswitch.consoleLog("notice", "[dialplan] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n"); + freeswitch.consoleLog("notice", "[send_email] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n"); end db:query(sql, params); end @@ -162,7 +161,7 @@ else local domain_uuid = headers["X-FusionPBX-Domain-UUID"] local domain_name = headers["X-FusionPBX-Domain-Name"] local email_type = headers["X-FusionPBX-Email-Type"] or 'info' - local call_uuid = headers["X-FusionPBX-Email-Call-UUID"] + local call_uuid = headers["X-FusionPBX-Call-UUID"] local db = dbh or Database.new('system') local settings = Settings.new(db, domain_name, domain_uuid) diff --git a/app/sip_status/app_languages.php b/app/sip_status/app_languages.php index ad694a46fb..9b939199e0 100644 --- a/app/sip_status/app_languages.php +++ b/app/sip_status/app_languages.php @@ -345,8 +345,8 @@ $text['button-flush_registrations']['de-ch'] = "Registrierungen verwerfen"; //co $text['button-flush_registrations']['de-de'] = "Registrierungen verwerfen"; $text['button-flush_registrations']['es-cl'] = "Inscripciones Flush"; $text['button-flush_registrations']['es-mx'] = "Inscripciones Flush"; //copied from es-cl -$text['button-flush_registrations']['fr-ca'] = "Nettoyer enregistrements"; //copied from fr-fr -$text['button-flush_registrations']['fr-fr'] = "Nettoyer enregistrements"; +$text['button-flush_registrations']['fr-ca'] = "Effacer enregistrements"; //copied from fr-fr +$text['button-flush_registrations']['fr-fr'] = "Effacer enregistrements"; $text['button-flush_registrations']['he-il'] = ""; $text['button-flush_registrations']['it-it'] = "Pulisci Registrazioni"; $text['button-flush_registrations']['nl-nl'] = "Verwijder Registraties"; diff --git a/app/time_conditions/app_config.php b/app/time_conditions/app_config.php index 9bd9a0e8b5..6c90db17d9 100644 --- a/app/time_conditions/app_config.php +++ b/app/time_conditions/app_config.php @@ -34,7 +34,7 @@ $apps[$x]['destinations'][$y]['type'] = "sql"; $apps[$x]['destinations'][$y]['label'] = "time_conditions"; $apps[$x]['destinations'][$y]['name'] = "time_conditions"; - $apps[$x]['destinations'][$y]['sql'] = "select dialplan_name as name, dialplan_number as destination, dialplan_context as context, dialplan_description as description from v_dialplans "; + $apps[$x]['destinations'][$y]['sql'] = "select dialplan_name as name, dialplan_number as destination, dialplan_number as extension, dialplan_context as context, dialplan_description as description from v_dialplans "; $apps[$x]['destinations'][$y]['where'] = "where (domain_uuid = '\${domain_uuid}' or domain_uuid is null) and app_uuid = '4b821450-926b-175a-af93-a03c441818b1' and dialplan_enabled = 'true' "; $apps[$x]['destinations'][$y]['order_by'] = "dialplan_number asc"; $apps[$x]['destinations'][$y]['field']['context'] = "context"; @@ -94,6 +94,7 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_england"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"new_years_day":{"mday":"1","mon":"1"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "1"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "England Holiday"; $y++; @@ -102,6 +103,7 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_england"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"may_day":{"mon":"5","mday":"1-7","wday":"2"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "129"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "England Holiday"; $y++; @@ -110,6 +112,7 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_england"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"spring_bank_holiday":{"mon":"5","mday":"25-31","wday":"2"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "146"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "England Holiday"; $y++; @@ -118,6 +121,16 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_england"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"august_bank_holiday":{"mon":"8","mday":"25-31","wday":"2"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "243"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "England Holiday"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "0c29051f-d2f4-4f9c-b84c-2abca0943897"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "time_conditions"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_england"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"christmas_eve":{"mday":"24","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "359"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "England Holiday"; $y++; @@ -126,6 +139,7 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_england"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"christmas_day":{"mday":"25","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "360"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "England Holiday"; $y++; @@ -134,16 +148,27 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_england"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"boxing_day":{"mday":"26","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "361"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "England Holiday"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "d157d293-6f8c-4350-89fd-2cee42070b3f"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "time_conditions"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_england"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"new_years_eve":{"mday":"31","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "366"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "England Holiday"; - //define USA holiday presets + //define USA holiday presets $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3df036bb-ae96-4735-96da-a32e90b51940"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "time_conditions"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"new_years_day":{"mday":"1","mon":"1"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "1"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; @@ -152,6 +177,7 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"martin_luther_king_jr_day":{"wday":"2","mon":"1","mday":"15-21"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "19"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; @@ -160,7 +186,8 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"presidents_day":{"wday":"2","mon":"2","mday":"15-21"}}'; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "38"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "0957bbc4-60e8-44d1-b51d-943de4ee5b2f"; @@ -168,7 +195,8 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"memorial_day":{"mday":"25-31","wday":"2","mon":"5"}}'; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "146"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "0aa94174-a339-47d6-b6ab-c264b3786074"; @@ -176,6 +204,7 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"independence_day":{"mday":"4","mon":"7"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "186"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; @@ -184,7 +213,8 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"labor_day":{"wday":"2","mon":"9","mday":"1-7"}}'; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "251"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "261a0ea4-26a3-4261-95e5-888afd221ca0"; @@ -192,7 +222,8 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"columbus_day":{"wday":"2","mon":"10","mday":"8-14"}}'; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "281"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "829d346b-b0ed-4690-8641-8ed01052e303"; @@ -200,7 +231,8 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"veterans_day":{"mday":"11","mon":"11"}}'; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "316"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c1fdfebe-3544-4b01-8a83-d0fee8e9a47a"; @@ -208,7 +240,8 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"thanksgiving_day":{"wday":"5","mon":"11","mday":"22-28"}}'; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "331"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "2fcab411-971d-466c-bf6d-42f6bcd32ad2"; @@ -216,6 +249,16 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"black_friday":{"wday":"6","mon":"11","mday":"23-29"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "332"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "d3279498-d796-4ce9-a3b7-6a4ee600e8b1"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "time_conditions"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"christmas_eve":{"mday":"24","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "359"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; @@ -224,14 +267,27 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"christmas_day":{"mday":"25","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "360"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "106ba766-1f26-4edc-81be-e4c0dd8937b1"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "time_conditions"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_usa"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"new_years_eve":{"mday":"31","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "366"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "USA Holiday"; + + //define Canada holiday presets + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = '340856f4-ed1d-42ec-b13b-7f37630d019a'; $apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions'; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"new_years_day":{"mday":"1","mon":"1"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "1"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; $y++; @@ -240,6 +296,7 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"family_day":{"wday":"2","mon":"2","mday":"15-21"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "48"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; $y++; @@ -248,6 +305,7 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"victoria_day":{"wday":"2","mon":"5","mday":"18-24"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "139"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; $y++; @@ -256,6 +314,7 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"canada_day":{"mday":"1","mon":"7"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "183"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; $y++; @@ -264,38 +323,7 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"bc_day":{"wday":"2","mon":"8","mday":"1-7"}}'; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; - $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = '2eed38e8-11c3-4477-9185-103c36ccf26d'; - $apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions'; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; - $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; - $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"thanksgiving_day":{"wday":"2","mon":"10","mday":"8-14"}}'; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; - $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c3244258-55fe-4d20-a23d-ac9e108bf38e'; - $apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions'; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; - $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; - $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"remembrance_day":{"mday":"11","mon":"11"}}'; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; - $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = '51717873-86d2-43a2-8748-ff191b4915e7'; - $apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions'; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; - $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; - $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"christmas_day":{"mday":"25","mon":"12"}}'; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; - $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; - $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'a96c087a-503c-4b7c-87af-dff24d5d39c1'; - $apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions'; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; - $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; - $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"boxing_day":{"mday":"26","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "216"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; $y++; @@ -304,8 +332,63 @@ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"labour_day":{"wday":"2","mon":"9","mday":"1-7"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "251"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = '2eed38e8-11c3-4477-9185-103c36ccf26d'; + $apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions'; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; + $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"thanksgiving_day":{"wday":"2","mon":"10","mday":"8-14"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "286"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; + $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'c3244258-55fe-4d20-a23d-ac9e108bf38e'; + $apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions'; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; + $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"remembrance_day":{"mday":"11","mon":"11"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "316"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; + $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "a8f39f63-436f-464c-83ce-5b845f90416e"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "time_conditions"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_canada"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"christmas_eve":{"mday":"24","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "359"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = '51717873-86d2-43a2-8748-ff191b4915e7'; + $apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions'; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; + $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"christmas_day":{"mday":"25","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "360"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; + $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = 'a96c087a-503c-4b7c-87af-dff24d5d39c1'; + $apps[$x]['default_settings'][$y]['default_setting_category'] = 'time_conditions'; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = 'preset_canada'; + $apps[$x]['default_settings'][$y]['default_setting_name'] = 'array'; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"boxing_day":{"mday":"26","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "361"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = 'true'; + $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "d51cd684-f712-4537-9d5d-d4335a089cf8"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "time_conditions"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "preset_canada"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "array"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = '{"new_years_eve":{"mday":"31","mon":"12"}}'; + $apps[$x]['default_settings'][$y]['default_setting_order'] = "366"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = 'Canada Holiday'; //cache details $apps[$x]['cache']['key'] = "dialplan.\${dialplan_context}"; diff --git a/app/time_conditions/resources/classes/time_conditions.php b/app/time_conditions/resources/classes/time_conditions.php index 4beba427df..3adf26ddc5 100644 --- a/app/time_conditions/resources/classes/time_conditions.php +++ b/app/time_conditions/resources/classes/time_conditions.php @@ -123,6 +123,11 @@ } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-delete'].': '.@sizeof($array[$this->table])); @@ -210,6 +215,11 @@ } } + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } + //set message message::add($text['message-toggle']); } diff --git a/app/time_conditions/time_condition_edit.php b/app/time_conditions/time_condition_edit.php index 7b2aa374f4..e99afdb52d 100644 --- a/app/time_conditions/time_condition_edit.php +++ b/app/time_conditions/time_condition_edit.php @@ -49,7 +49,11 @@ $preset_region = "preset_".$_SESSION['time_conditions']['region']['text']; if (is_array($_SESSION['time_conditions'][$preset_region])) { foreach ($_SESSION['time_conditions'][$preset_region] as $json) { - $available_presets[] = json_decode($json, true); + $json_array = json_decode($json, true); + if (is_array($json_array)) { + $available_presets[] = $json_array; + $valid_presets[] = array_key_first(end($available_presets)); + } } } unset($preset_region); @@ -501,7 +505,12 @@ //clear the cache $cache = new cache; - $cache->delete("dialplan:".$_SESSION["context"]); + $cache->delete("dialplan:".$_SESSION["domain_name"]); + + //clear the destinations session array + if (isset($_SESSION['destinations']['array'])) { + unset($_SESSION['destinations']['array']); + } //set the message if ($action == "add") { @@ -555,10 +564,7 @@ $sql .= " dialplan_detail_tag = 'condition' "; $sql .= " and dialplan_detail_type in ('year','mon','mday','wday','yday','week','mweek','hour','minute','minute-of-day','time-of-day','date-time') "; $sql .= " ) "; - $sql .= " or ( "; - $sql .= " dialplan_detail_tag = 'action' "; - $sql .= " and dialplan_detail_data not like 'preset=%' "; - $sql .= " ) "; + $sql .= " or dialplan_detail_tag = 'action' "; $sql .= ") "; $sql .= "order by dialplan_detail_group asc, dialplan_detail_order asc"; $parameters['dialplan_uuid'] = $dialplan_uuid; @@ -569,46 +575,52 @@ //load current conditions into array (combined by group), and retrieve action and anti-action $c = 0; - if (is_array($dialplan_details)) { - foreach ($dialplan_details as $row) { - if ($row['dialplan_detail_tag'] == 'action') { - if ($row['dialplan_detail_group'] == '999') { - $dialplan_anti_action = $row['dialplan_detail_type'].(($row['dialplan_detail_data'] != '') ? ':'.$row['dialplan_detail_data'] : null); + if (is_array($dialplan_details) && @sizeof($dialplan_details) != 0) { + //detect dialplan detail group has valid preset + $dialplan_detail_group_max = 0; + foreach ($dialplan_details as $i => $row) { + if ($row['dialplan_detail_tag'] == 'action' && $row['dialplan_detail_type'] == 'set' && strpos($row['dialplan_detail_data'], 'preset=') === 0) { + $preset_name = explode('=',$row['dialplan_detail_data'])[1]; + if (in_array($preset_name, $valid_presets)) { + $dialplan_detail_group_preset[$row['dialplan_detail_group']] = $preset_name; } else { - $dialplan_actions[$row['dialplan_detail_group']] = $row['dialplan_detail_type'].(($row['dialplan_detail_data'] != '') ? ':'.$row['dialplan_detail_data'] : null); + $invalid_presets_dialplan_detail_groups[] = $row['dialplan_detail_group']; + unset($dialplan_details[$i]); + } + } + if ($row['dialplan_detail_group'] > $dialplan_detail_group_max) { $dialplan_detail_group_max = $row['dialplan_detail_group']; } + } + //reorder any invalid preset dialplan detail groups + if (is_array($invalid_presets_dialplan_detail_groups) && @sizeof($invalid_presets_dialplan_detail_groups) != 0) { + foreach ($dialplan_details as $i => $row) { + if (in_array($row['dialplan_detail_group'], $invalid_presets_dialplan_detail_groups)) { + $dialplan_details[$i]['dialplan_detail_group'] = $dialplan_detail_group_max + 5; + } + } + } + //parse out dialplan actions, anti-actions and conditions + foreach ($dialplan_details as $i => $row) { + if ($row['dialplan_detail_tag'] == 'action') { + if ($row['dialplan_detail_group'] == '999') { + $dialplan_anti_action = $row['dialplan_detail_type'].($row['dialplan_detail_data'] != '' || $row['dialplan_detail_type'] == 'hangup' ? ':'.$row['dialplan_detail_data'] : null); + } + else { + $dialplan_detail_group = $dialplan_detail_group_preset[$row['dialplan_detail_group']] ?: $row['dialplan_detail_group']; + $dialplan_actions[$dialplan_detail_group] = $row['dialplan_detail_type'].($row['dialplan_detail_data'] != '' || $row['dialplan_detail_type'] == 'hangup' ? ':'.$row['dialplan_detail_data'] : null); } } else if ($row['dialplan_detail_tag'] == 'condition') { - $current_conditions[$row['dialplan_detail_group']][$row['dialplan_detail_type']] = $row['dialplan_detail_data']; + $dialplan_detail_group = $dialplan_detail_group_preset[$row['dialplan_detail_group']] ?: $row['dialplan_detail_group']; + $current_conditions[$dialplan_detail_group][$row['dialplan_detail_type']] = $row['dialplan_detail_data']; } } } -// //find the selected presets -// if (is_array($available_presets)) { -// foreach ($available_presets as $preset_number => &$preset) { -// if (is_array($preset)) { -// foreach ($preset as $preset_name => $preset_variables) { -// $preset_checked[$preset_name] = 'false'; -// if (is_array($dialplan_details)) { -// foreach ($dialplan_details as $row) { -// if ($row['dialplan_detail_tag'] == 'action') { -// if ($row['dialplan_detail_data'] == 'preset='.$preset_name) { -// $preset_checked[$preset_name] = 'true'; -// } -// } -// } -// } -// } -// } -// } -// } - //loop through available presets (if any) - if (is_array($available_presets)) { + if (is_array($available_presets) && @sizeof($available_presets) != 0) { foreach ($available_presets as $preset_number => $preset) { - if (is_array($preset)) { + if (is_array($preset) && @sizeof($preset) != 0) { foreach ($preset as $preset_name => $preset_variables) { //loop through each condition group if (is_array($current_conditions)) { @@ -622,8 +634,17 @@ } //if all preset variables found, then condition is a preset if ($matches == sizeof($preset_variables)) { - - $current_presets[$preset_number] = $group_id; + //preset found + if (!is_numeric($group_id)) { + $current_presets[] = $group_id; + } + //preset *conditions* found, but wasn't marked as a preset in the dialplan, so promote and update current conditions and dialplan actions + else { + $current_presets[] = $preset_name; + $current_conditions[$preset_name] = $current_conditions[$group_id]; + $dialplan_actions[$preset_name] = $dialplan_actions[$group_id]; + unset($current_conditions[$group_id], $dialplan_actions[$group_id]); + } } } } @@ -631,6 +652,11 @@ } } } + + //sort arrays by keys + if (is_array($dialplan_actions)) { ksort($dialplan_actions); } + if (is_array($current_conditions)) { ksort($current_conditions); } + } //set the defaults @@ -644,6 +670,16 @@ $document['title'] = $text['title-time_condition']; require_once "resources/header.php"; +//debug +// echo "
\n"; +// echo "".'$dialplan_details'."\n"; view_array($dialplan_details, false); +// echo "".'$dialplan_anti_action'."\n"; view_array($dialplan_anti_action, false); +// echo "".'$dialplan_actions'."\n"; view_array($dialplan_actions, false); // +// echo "".'$current_conditions'."\n"; view_array($current_conditions, false); // +// echo "".'$available_presets'."\n"; view_array($available_presets, false); +// echo "".'$current_presets'."\n"; view_array($current_presets, false); // +// echo "


\n"; + ?> "; } } @@ -1152,7 +1185,7 @@ if ($action == 'update') { echo "
"; echo button::create(['type'=>'button','label'=>$text['button-advanced'],'icon'=>'tools','onclick'=>"$(this).fadeOut(400, function() { $('#default_preset_destination').fadeIn(400); document.getElementById('default_preset_destination_description').innerHTML += '
".$text['description-presets_advanced']."'; });"]); - echo " "; + echo " "; echo "
".(($row['tta'] > 0) ? $row['tta']."s" : " ")."".(($row['tta'] >= 0) ? $row['tta']."s" : " ")."
".escape($app_name)." ".escape(wordwrap($app_data,75,"\n", true))." '.format_phone($fields['destination_number']).''.$fields['start_stamp'].''.(($fields['tta'] > 0) ? $fields['tta'].'s' : null).''.(($fields['tta'] >= 0) ? $fields['tta'].'s' : null).''.gmdate("G:i:s", $seconds).'".escape($row['volume'])." ".(round(escape($row['minutes']),2))." ".(round(escape($row['avg_min']),2))." / ".(round(escape($row['cpm_ans']),2))." ".escape($row['missed'])." ".escape($row['missed'])." ".(round(escape($row['asr']),2))." ".(round(escape($row['aloc']),2))." 
\n"; - echo " \n"; - echo "
\n"; + echo " \n"; + echo "
\n"; echo $text['description-description']."\n"; echo "
\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-description']."\n"; echo "
".$text['label-tools']."".$text['label-domain_description']."\n"; echo $text['label-'.$row['domain_enabled']]; + echo " ".escape($row['domain_description'])."\n"; diff --git a/core/groups/app_languages.php b/core/groups/app_languages.php index a703294a8c..f984c6967c 100644 --- a/core/groups/app_languages.php +++ b/core/groups/app_languages.php @@ -1681,6 +1681,48 @@ $text['label-12-hour']['ru-ru'] = "12-часовой"; $text['label-12-hour']['sv-se'] = "12-timmars"; $text['label-12-hour']['uk-ua'] = "12-годинний"; +$text['label-assigned']['en-us'] = "Assigned"; +$text['label-assigned']['en-gb'] = "Assigned"; +$text['label-assigned']['ar-eg'] = "Assigned"; +$text['label-assigned']['de-at'] = "Assigned"; +$text['label-assigned']['de-ch'] = "Assigned"; +$text['label-assigned']['de-de'] = "Assigned"; +$text['label-assigned']['es-cl'] = "Assigned"; +$text['label-assigned']['es-mx'] = "Assigned"; +$text['label-assigned']['fr-ca'] = "Assigned"; +$text['label-assigned']['fr-fr'] = "Assigned"; +$text['label-assigned']['he-il'] = "Assigned"; +$text['label-assigned']['it-it'] = "Assigned"; +$text['label-assigned']['nl-nl'] = "Assigned"; +$text['label-assigned']['pl-pl'] = "Assigned"; +$text['label-assigned']['pt-br'] = "Assigned"; +$text['label-assigned']['pt-pt'] = "Assigned"; +$text['label-assigned']['ro-ro'] = "Assigned"; +$text['label-assigned']['ru-ru'] = "Assigned"; +$text['label-assigned']['sv-se'] = "Assigned"; +$text['label-assigned']['uk-ua'] = "Assigned"; + +$text['label-unassigned']['en-us'] = "Unassigned"; +$text['label-unassigned']['en-gb'] = "Unassigned"; +$text['label-unassigned']['ar-eg'] = "Unassigned"; +$text['label-unassigned']['de-at'] = "Unassigned"; +$text['label-unassigned']['de-ch'] = "Unassigned"; +$text['label-unassigned']['de-de'] = "Unassigned"; +$text['label-unassigned']['es-cl'] = "Unassigned"; +$text['label-unassigned']['es-mx'] = "Unassigned"; +$text['label-unassigned']['fr-ca'] = "Unassigned"; +$text['label-unassigned']['fr-fr'] = "Unassigned"; +$text['label-unassigned']['he-il'] = "Unassigned"; +$text['label-unassigned']['it-it'] = "Unassigned"; +$text['label-unassigned']['nl-nl'] = "Unassigned"; +$text['label-unassigned']['pl-pl'] = "Unassigned"; +$text['label-unassigned']['pt-br'] = "Unassigned"; +$text['label-unassigned']['pt-pt'] = "Unassigned"; +$text['label-unassigned']['ro-ro'] = "Unassigned"; +$text['label-unassigned']['ru-ru'] = "Unassigned"; +$text['label-unassigned']['sv-se'] = "Unassigned"; +$text['label-unassigned']['uk-ua'] = "Unassigned"; + $text['header-user_setting-edit']['en-us'] = "User Setting"; $text['header-user_setting-edit']['en-gb'] = "User Setting"; $text['header-user_setting-edit']['ar-eg'] = ""; diff --git a/core/groups/group_edit.php b/core/groups/group_edit.php index 20c46742ed..a47fb1e3cd 100644 --- a/core/groups/group_edit.php +++ b/core/groups/group_edit.php @@ -56,6 +56,7 @@ if (is_array($_POST)) { $group_uuid = $_POST["group_uuid"]; $group_name = $_POST["group_name"]; + $group_name_previous = $_POST["group_name_previous"]; $domain_uuid = $_POST["domain_uuid"]; $group_level = $_POST["group_level"]; $group_protected = $_POST["group_protected"]; @@ -136,6 +137,22 @@ $database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84'; $database->save($array); + //update group name in group permissions if group name changed + if ($group_name != $group_name_previous) { + $sql = "update v_group_permissions "; + $sql .= "set group_name = :group_name "; + $sql .= "where group_name = :group_name_previous "; + $sql .= "and group_uuid = :group_uuid "; + $parameters['group_name'] = $group_name; + $parameters['group_name_previous'] = $group_name_previous; + $parameters['group_uuid'] = $group_uuid; + $database = new database; + $database->app_name = 'Group Manager'; + $database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84'; + $database->execute($sql, $parameters); + unset($sql, $parameters, $database); + } + //redirect the user if (isset($action)) { if ($action == "add") { @@ -147,7 +164,7 @@ header('Location: group_edit.php?id='.urlencode($group_uuid)); return; } - } //(is_array($_POST) && strlen($_POST["persistformvar"]) == 0) + } //pre-populate the form if (is_array($_GET) && $_POST["persistformvar"] != "true") { @@ -227,6 +244,7 @@ echo "\n"; echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-group_name']."\n"; echo "
\n"; if (is_array($group_permissions) && @sizeof($group_permissions) != 0) { @@ -309,59 +317,75 @@ foreach ($group_permissions as $row) { $checked = ($row['permission_assigned'] === 'true') ? " checked=\"checked\"" : $checked = ''; $protected = ($row['permission_protected'] === 'true') ? " checked=\"checked\"" : ''; - $application_name = strtolower($row['application_name']); - $label_application_name = ucwords(str_replace(['_','-'], " ", $row['application_name'])); - - $label_application_name = ucwords($label_application_name); + $application_name = strtolower(str_replace([' ','-'], '_', $row['application_name'])); + $application_name_label = ucwords(str_replace(['_','-'], " ", $row['application_name'])); + //application heading if ($previous_application_name !== $row['application_name']) { - echo " "; + echo " "; echo " \n"; echo " "; - echo " "; - echo " \n"; + echo " "; + echo " \n"; echo " "; - echo "\n"; + echo " \n"; if (permission_exists('group_permission_add') || permission_exists('group_permission_edit') || permission_exists('group_permission_delete')) { - echo " \n"; + echo " \n"; } echo th_order_by('group_name', $text['label-group_name'], $order_by, $order); - if (permission_exists('group_permission_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') { - echo " \n"; + if (permission_exists('group_permission_add') || permission_exists('group_permission_edit') || permission_exists('group_permission_delete')) { + echo th_order_by('group_permission_protected', $text['label-group_protected'], $order_by, $order, null, "style='text-align: right;'"); + echo " \n"; + } + echo " \n"; + $displayed_permissions[$application_name] = 0; + } + + //application permission + if (!$view || ($view == 'assigned' && $checked) || ($view == 'unassigned' && !$checked) || ($view == 'protected' && $protected)) { + echo "\n"; + if (permission_exists('group_permission_add') || permission_exists('group_permission_edit') || permission_exists('group_permission_delete')) { + echo " \n"; + } + echo " \n"; + if (permission_exists('group_permission_add') || permission_exists('group_permission_edit') || permission_exists('group_permission_delete')) { + echo " \n"; + echo " \n"; } - echo " \n"; - echo th_order_by('group_permission_protected', $text['label-group_protected'], $order_by, $order, null, "class=''"); echo "\n"; + $displayed_permissions[$application_name]++; + } - } - echo "\n"; - if (permission_exists('group_permission_add') || permission_exists('group_permission_edit') || permission_exists('group_permission_delete')) { - echo " \n"; - } - echo " \n"; - if (permission_exists('group_permission_add') || permission_exists('group_permission_edit') || permission_exists('group_permission_delete')) { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo "\n"; - - //set the previous category + //set the previous application name $previous_application_name = $row['application_name']; $x++; + } unset($group_permissions); + + //hide application heading if no permissions displayed + if (is_array($displayed_permissions) && @sizeof($displayed_permissions) != 0) { + echo "\n"; + } + } echo "
 
".escape($label_application_name)."
".escape($application_name_label)."
\n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo "  \n"; + echo " \n"; + echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " "; + echo " ".escape($row['permission_name']); + echo "  \n"; + echo " \n"; + echo " \n"; - echo " \n"; - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " ".escape($row['permission_name'])."\n"; - echo " \n"; - echo " "; - echo "
\n"; diff --git a/core/menu/app_languages.php b/core/menu/app_languages.php index 1402fe0c8f..d7a9e33c83 100644 --- a/core/menu/app_languages.php +++ b/core/menu/app_languages.php @@ -925,4 +925,25 @@ $text['button-move_down']['ru-ru'] = "Переместить вниз"; $text['button-move_down']['sv-se'] = "Flytta Ned"; $text['button-move_down']['uk-ua'] = "Перемістити вниз"; -?> +$text['confirm-restore']['en-us'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['en-gb'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['ar-eg'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['de-at'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['de-ch'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['de-de'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['es-cl'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['es-mx'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['fr-ca'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['fr-fr'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['he-il'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['it-it'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['nl-nl'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['pl-pl'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['pt-br'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['pt-pt'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['ro-ro'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['ru-ru'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['sv-se'] = "You are about to restore all unprotected items on this menu."; +$text['confirm-restore']['uk-ua'] = "You are about to restore all unprotected items on this menu."; + +?> \ No newline at end of file diff --git a/core/menu/menu_edit.php b/core/menu/menu_edit.php index 0ac637eead..c4911b3618 100644 --- a/core/menu/menu_edit.php +++ b/core/menu/menu_edit.php @@ -165,13 +165,17 @@ echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','collapse'=>'hide-xs','link'=>'menu.php']); echo button::create(['type'=>'button','label'=>$text['button-reload'],'icon'=>$_SESSION['theme']['button_icon_reload'],'collapse'=>'hide-xs','style'=>'margin-left: 15px;','link'=>'menu_reload.php?menu_uuid='.urlencode($menu_uuid).'&menu_language='.urlencode($menu_language)]); if (permission_exists('menu_restore') && $action == "update") { - echo button::create(['type'=>'button','label'=>$text['button-restore_default'],'icon'=>'key','collapse'=>'hide-xs','link'=>'menu_restore_default.php?menu_uuid='.urlencode($menu_uuid).'&menu_language='.urlencode($menu_language)]); + echo button::create(['type'=>'button','label'=>$text['button-restore_default'],'icon'=>'undo-alt','collapse'=>'hide-xs','onclick'=>"modal_open('modal-restore','btn_restore');"]); } echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','collapse'=>'hide-xs']); echo " \n"; echo "
\n"; echo "\n"; + if (permission_exists('menu_restore') && $action == "update") { + echo modal::create(['id'=>'modal-restore','type'=>'confirmation','message'=>$text['confirm-restore'],'actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_restore','style'=>'float: right; margin-left: 15px;','collapse'=>'never','link'=>'menu_restore_default.php?menu_uuid='.urlencode($menu_uuid).'&menu_language='.urlencode($menu_language),'onclick'=>'modal_close();'])]); + } + echo $text['description-menu']."\n"; echo "

\n"; diff --git a/core/software/resources/classes/software.php b/core/software/resources/classes/software.php index 6a627941bc..2760d50b2d 100644 --- a/core/software/resources/classes/software.php +++ b/core/software/resources/classes/software.php @@ -12,7 +12,7 @@ if (!class_exists('software')) { * version */ public static function version() { - return '4.5.18'; + return '4.5.22'; } /** diff --git a/core/upgrade/index.php b/core/upgrade/index.php index 45ef27cafe..1b1308e47c 100644 --- a/core/upgrade/index.php +++ b/core/upgrade/index.php @@ -86,9 +86,11 @@ // load an array of the database schema and compare it with the active database if ($do["schema"] && permission_exists("upgrade_schema")) { - $upgrade_data_types = check_str($do["data_types"]); require_once "resources/classes/schema.php"; $obj = new schema(); + if (isset($do["data_types"]) && $do["data_types"] == 'true') { + $obj->data_types = true; + } $_SESSION["response"]["schema"] = $obj->schema("html"); message::add($text['message-upgrade_schema'], null, $message_timeout); } @@ -283,4 +285,4 @@ //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/core/upgrade/upgrade_schema.php b/core/upgrade/upgrade_schema.php index 7acb2829ea..04a305a122 100644 --- a/core/upgrade/upgrade_schema.php +++ b/core/upgrade/upgrade_schema.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2014 + Portions created by the Initial Developer are Copyright (C) 2008-2020 the Initial Developer. All Rights Reserved. Contributor(s): @@ -64,12 +64,16 @@ //get the database schema put it into an array then compare and update the database as needed. require_once "resources/classes/schema.php"; $obj = new schema; + if (isset($argv[1]) && $argv[1] == 'data_types') { + $obj->data_types = true; + } echo $obj->schema($format); -if (!$included && $format == 'html') { - echo "
\n"; - echo "
\n"; - require_once "resources/footer.php"; -} +//formatting for html + if (!$included && $format == 'html') { + echo "
\n"; + echo "
\n"; + require_once "resources/footer.php"; + } ?> diff --git a/core/user_logs/app_config.php b/core/user_logs/app_config.php new file mode 100644 index 0000000000..a303770571 --- /dev/null +++ b/core/user_logs/app_config.php @@ -0,0 +1,84 @@ + diff --git a/core/user_logs/app_defaults.php b/core/user_logs/app_defaults.php new file mode 100644 index 0000000000..adadacce42 --- /dev/null +++ b/core/user_logs/app_defaults.php @@ -0,0 +1,7 @@ + diff --git a/core/user_logs/app_languages.php b/core/user_logs/app_languages.php new file mode 100644 index 0000000000..75c752b8a4 --- /dev/null +++ b/core/user_logs/app_languages.php @@ -0,0 +1,422 @@ + \ No newline at end of file diff --git a/core/user_logs/app_menu.php b/core/user_logs/app_menu.php new file mode 100644 index 0000000000..77d20630af --- /dev/null +++ b/core/user_logs/app_menu.php @@ -0,0 +1,19 @@ + diff --git a/core/user_logs/resources/classes/user_logs.php b/core/user_logs/resources/classes/user_logs.php new file mode 100644 index 0000000000..b654a06416 --- /dev/null +++ b/core/user_logs/resources/classes/user_logs.php @@ -0,0 +1,161 @@ + + Portions created by the Initial Developer are Copyright (C) 2019-2021 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ + +/** + * user_logs class + * + * @method null delete + * @method null toggle + * @method null copy + */ +if (!class_exists('user_logs')) { + class user_logs { + + /** + * declare the variables + */ + private $app_name; + private $app_uuid; + private $name; + private $table; + private $toggle_field; + private $toggle_values; + private $location; + + /** + * called when the object is created + */ + public function __construct() { + //assign the variables + $this->app_name = 'user_logs'; + $this->app_uuid = '582a13cf-7d75-4ea3-b2d9-60914352d76e'; + $this->name = 'user_log'; + $this->table = 'user_logs'; + $this->toggle_field = ''; + $this->toggle_values = ['true','false']; + $this->location = 'user_logs.php'; + } + + /** + * called when there are no references to a particular object + * unset the variables used in the class + */ + public function __destruct() { + foreach ($this as $key => $value) { + unset($this->$key); + } + } + + /** + * add user_logs + */ + public static function add($result) { + //prepare the array + $array['user_logs'][0]["timestamp"] = 'now()'; + $array['user_logs'][0]["domain_uuid"] = $result['domain_uuid']; + $array['user_logs'][0]["user_uuid"] = $result['user_uuid']; + $array['user_logs'][0]["username"] = $result['username']; + $array['user_logs'][0]["type"] = 'login'; + $array['user_logs'][0]["remote_address"] = $_SERVER['REMOTE_ADDR']; + $array['user_logs'][0]["user_agent"] = $_SERVER['HTTP_USER_AGENT']; + $array['user_logs'][0]["type"] = 'login'; + if ($result["authorized"] == "true") { + $array['user_logs'][0]["result"] = 'success'; + } + else { + $array['user_logs'][0]["result"] = 'failure'; + } + + //add the dialplan permission + $p = new permissions; + $p->add("user_log_add", 'temp'); + + //save to the data + $database = new database; + $database->app_name = 'authentication'; + $database->app_uuid = 'a8a12918-69a4-4ece-a1ae-3932be0e41f1'; + $database->uuid($user_log_uuid); + $database->save($array); + $message = $database->message; + + //remove the temporary permission + $p->delete("user_log_add", 'temp'); + } + + /** + * delete rows from the database + */ + public function delete($records) { + if (permission_exists($this->name.'_delete')) { + + //add multi-lingual support + $language = new text; + $text = $language->get(); + + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: '.$this->location); + exit; + } + + //delete multiple records + if (is_array($records) && @sizeof($records) != 0) { + //build the delete array + $x = 0; + foreach ($records as $record) { + //add to the array + if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + $array[$this->table][$x][$this->name.'_uuid'] = $record['uuid']; + $array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid']; + } + + //increment the id + $x++; + } + + //delete the checked rows + if (is_array($array) && @sizeof($array) != 0) { + //execute delete + $database = new database; + $database->app_name = $this->app_name; + $database->app_uuid = $this->app_uuid; + $database->delete($array); + unset($array); + + //set message + message::add($text['message-delete']); + } + unset($records); + } + } + } + + } +} + +?> diff --git a/core/user_logs/root.php b/core/user_logs/root.php new file mode 100644 index 0000000000..6fdf32f37b --- /dev/null +++ b/core/user_logs/root.php @@ -0,0 +1,90 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ + +// make sure the PATH_SEPARATOR is defined + umask(2); + if (!defined("PATH_SEPARATOR")) { + if (strpos($_ENV["OS"], "Win") !== false) { + define("PATH_SEPARATOR", ";"); + } else { + define("PATH_SEPARATOR", ":"); + } + } + + if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html'; + + // make sure the document_root is set + $_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]); + if(PHP_SAPI == 'cli'){ + chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME)); + $script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]); + $dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME)); + if (file_exists('/project_root.php')) { + $path = '/'; + } else { + $i = 1; + $path = ''; + while ($i < count($dirs)) { + $path .= '/' . $dirs[$i]; + if (file_exists($path. '/project_root.php')) { + break; + } + $i++; + } + } + $_SERVER["DOCUMENT_ROOT"] = $path; + }else{ + $_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]); + } + $_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]); +// try to detect if a project path is being used + if (!defined('PROJECT_PATH')) { + if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) { + define('PROJECT_PATH', '/fusionpbx'); + } elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) { + define('PROJECT_PATH', ''); + } else { + $dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME))); + $i = 1; + $path = $_SERVER["DOCUMENT_ROOT"]; + while ($i < count($dirs)) { + $path .= '/' . $dirs[$i]; + if (file_exists($path. '/project_root.php')) { + break; + } + $i++; + } + if(!file_exists($path. '/project_root.php')){ + die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance"); + } + $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); + define('PROJECT_PATH', $project_path); + } + $_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH); + set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]); + } + +?> \ No newline at end of file diff --git a/core/user_logs/user_log_edit.php b/core/user_logs/user_log_edit.php new file mode 100644 index 0000000000..10c368ab30 --- /dev/null +++ b/core/user_logs/user_log_edit.php @@ -0,0 +1,213 @@ +get(); + +//get the uuid + $user_log_uuid = $_GET['id']; + +//pre-populate the form + if (is_array($_GET) && $_POST["persistformvar"] != "true") { + $sql = "select * from v_user_logs "; + $sql .= "where user_log_uuid = :user_log_uuid "; + //$sql .= "and domain_uuid = :domain_uuid "; + //$parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $parameters['user_log_uuid'] = $user_log_uuid; + $database = new database; + $row = $database->select($sql, $parameters, 'row'); + if (is_array($row) && @sizeof($row) != 0) { + $domain_uuid = $row["domain_uuid"]; + $timestamp = $row["timestamp"]; + $user_uuid = $row["user_uuid"]; + $username = $row["username"]; + $type = $row["type"]; + $result = $row["result"]; + $remote_address = $row["remote_address"]; + $user_agent = $row["user_agent"]; + } + unset($sql, $parameters, $row); + } + +//create token + $object = new token; + $token = $object->create($_SERVER['PHP_SELF']); + +//show the header + $document['title'] = $text['title-user_log']; + require_once "resources/header.php"; + +//get the users + $sql = "SELECT user_uuid, username FROM v_users "; + $sql .= "WHERE domain_uuid = :domain_uuid "; + $sql .= "ORDER by username asc "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $database = new database; + $users = $database->execute($sql, $parameters, 'all'); + unset ($sql, $parameters); + +//show the content + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "
".$text['title-user_log']."
\n"; + echo "
\n"; + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'user_logs.php']); + echo "
\n"; + echo "
\n"; + echo "
\n"; + + echo $text['title_description-user_logs']."\n"; + echo "

\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo " ".$text['label-domain_uuid']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-domain_uuid']."\n"; + echo "
\n"; + echo " ".$text['label-timestamp']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-timestamp']."\n"; + echo "
\n"; + echo " ".$text['label-user_uuid']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-user_uuid']."\n"; + echo "
\n"; + echo " ".$text['label-username']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-username']."\n"; + echo "
\n"; + echo " ".$text['label-type']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-type']."\n"; + echo "
\n"; + echo " ".$text['label-result']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-result']."\n"; + echo "
\n"; + echo " ".$text['label-remote_address']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-remote_address']."\n"; + echo "
\n"; + echo " ".$text['label-user_agent']."\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-user_agent']."\n"; + echo "
"; + echo "

"; + + echo "\n"; + + echo ""; + +//include the footer + require_once "resources/footer.php"; + +?> \ No newline at end of file diff --git a/core/user_logs/user_logs.php b/core/user_logs/user_logs.php new file mode 100644 index 0000000000..b497244ad7 --- /dev/null +++ b/core/user_logs/user_logs.php @@ -0,0 +1,270 @@ + + Portions created by the Initial Developer are Copyright (C) 2018 - 2020 + the Initial Developer. All Rights Reserved. +*/ + +//includes + require_once "root.php"; + require_once "resources/require.php"; + require_once "resources/check_auth.php"; + require_once "resources/paging.php"; + +//check permissions + if (permission_exists('user_log_view')) { + //access granted + } + else { + echo "access denied"; + exit; + } + +//add multi-lingual support + $language = new text; + $text = $language->get(); + +//get the http post data + if (is_array($_POST['user_logs'])) { + $action = $_POST['action']; + $search = $_POST['search']; + $user_logs = $_POST['user_logs']; + } + +//process the http post data by action + if ($action != '' && is_array($user_logs) && @sizeof($user_logs) != 0) { + + //validate the token + $token = new token; + if (!$token->validate($_SERVER['PHP_SELF'])) { + message::add($text['message-invalid_token'],'negative'); + header('Location: user_logs.php'); + exit; + } + + //prepare the array + foreach($user_logs as $row) { + $array['user_logs'][$x]['checked'] = $row['checked']; + $array['user_logs'][$x]['user_log_uuid'] = $row['user_log_uuid']; + $x++; + } + + //prepare the database object + $database = new database; + $database->app_name = 'user_logs'; + $database->app_uuid = '582a13cf-7d75-4ea3-b2d9-60914352d76e'; + + //send the array to the database class + if ($action == 'delete') { + if (permission_exists('user_log_delete')) { + $database->delete($array); + } + } + + //redirect the user + header('Location: user_logs.php'.($search != '' ? '?search='.urlencode($search) : null)); + exit; + } + +//get order and order by + $order_by = $_GET["order_by"]; + $order = $_GET["order"]; + +//add the search + if (isset($_GET["search"])) { + $search = strtolower($_GET["search"]); + } + +//get the count + $sql = "select count(user_log_uuid) "; + $sql .= "from v_user_logs "; + if (permission_exists('user_log_all') && $_GET['show'] == 'all') { + $sql .= "where true "; + } + else { + $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + } + if (isset($search)) { + $sql .= "and ("; + $sql .= " lower(username) like :search "; + $sql .= " or lower(type) like :search "; + $sql .= " or lower(result) like :search "; + $sql .= " or lower(remote_address) like :search "; + $sql .= " or lower(user_agent) like :search "; + $sql .= ") "; + $parameters['search'] = '%'.$search.'%'; + } + $database = new database; + $num_rows = $database->select($sql, $parameters, 'column'); + unset($sql, $parameters); + +//prepare to page the results + $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; + $param = $search ? "&search=".$search : null; + $param = ($_GET['show'] == 'all' && permission_exists('user_log_all')) ? "&show=all" : null; + $page = is_numeric($_GET['page']) ? $_GET['page'] : 0; + list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page); + list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true); + $offset = $rows_per_page * $page; + +//get the list + $sql = "select "; + $sql .= "domain_uuid, "; + $sql .= "user_log_uuid, "; + $sql .= "timestamp, "; + $sql .= "username, "; + $sql .= "type, "; + $sql .= "result, "; + $sql .= "remote_address, "; + $sql .= "user_agent "; + $sql .= "from v_user_logs "; + if (permission_exists('user_log_all') && $_GET['show'] == 'all') { + $sql .= "where true "; + } + else { + $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + } + if (isset($search)) { + $sql .= "and ( "; + $sql .= " lower(username) like :search "; + $sql .= " or lower(type) like :search "; + $sql .= " or lower(result) like :search "; + $sql .= " or lower(remote_address) like :search "; + $sql .= " or lower(user_agent) like :search "; + $sql .= ") "; + $parameters['search'] = '%'.$search.'%'; + } + $sql .= order_by($order_by, $order, 'timestamp', 'desc'); + $sql .= limit_offset($rows_per_page, $offset); + $database = new database; + $user_logs = $database->select($sql, $parameters, 'all'); + unset($sql, $parameters); + +//create token + $object = new token; + $token = $object->create($_SERVER['PHP_SELF']); + +//additional includes + $document['title'] = $text['title-user_logs']; + require_once "resources/header.php"; + +//show the content + echo "
\n"; + echo "
".$text['title-user_logs']." (".$num_rows.")
\n"; + echo "
\n"; + if (permission_exists('user_log_delete') && $user_logs) { + echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display:none;','onclick'=>"modal_open('modal-delete','btn_delete');"]); + } + echo "\n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + + if (permission_exists('user_log_delete') && $user_logs) { + echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]); + } + + echo $text['title_description-user_logs']."\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + if (permission_exists('user_log_add') || permission_exists('user_log_edit') || permission_exists('user_log_delete')) { + echo " \n"; + } + if ($_GET['show'] == 'all' && permission_exists('user_log_all')) { + echo th_order_by('domain_name', $text['label-domain'], $order_by, $order); + } + echo th_order_by('timestamp', $text['label-timestamp'], $order_by, $order); + echo th_order_by('username', $text['label-username'], $order_by, $order); + echo th_order_by('type', $text['label-type'], $order_by, $order); + echo th_order_by('result', $text['label-result'], $order_by, $order); + echo th_order_by('remote_address', $text['label-remote_address'], $order_by, $order); + echo th_order_by('user_agent', $text['label-user_agent'], $order_by, $order); + if (permission_exists('user_log_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') { + echo " \n"; + } + echo "\n"; + + if (is_array($user_logs) && @sizeof($user_logs) != 0) { + $x = 0; + foreach ($user_logs as $row) { + if (permission_exists('user_log_edit')) { + $list_row_url = "user_log_edit.php?id=".urlencode($row['user_log_uuid']); + } + echo "\n"; + if (permission_exists('user_log_add') || permission_exists('user_log_edit') || permission_exists('user_log_delete')) { + echo " \n"; + } + if ($_GET['show'] == 'all' && permission_exists('user_log_all')) { + echo " \n"; + } + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + if (permission_exists('user_log_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') { + echo " \n"; + } + echo "\n"; + $x++; + } + unset($user_logs); + } + + echo "
\n"; + echo " \n"; + echo "  
\n"; + echo " \n"; + echo " \n"; + echo " ".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."".escape($row['timestamp'])."".escape($row['username'])."".escape($row['type'])."".escape($row['result'])."".escape($row['remote_address'])."".escape($row['user_agent'])."\n"; + echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]); + echo "
\n"; + echo "
\n"; + echo "
".$paging_controls."
\n"; + echo "\n"; + echo "
\n"; + +//include the footer + require_once "resources/footer.php"; + +?> diff --git a/core/user_settings/app_languages.php b/core/user_settings/app_languages.php index 3b25bb7a90..714a717fff 100644 --- a/core/user_settings/app_languages.php +++ b/core/user_settings/app_languages.php @@ -1332,7 +1332,7 @@ $text['label-ivr_menus']['de-de'] = "Automatische Vermittlungen"; $text['label-ivr_menus']['el-gr'] = "Μενού IVR"; $text['label-ivr_menus']['es-cl'] = "Menus IVR"; $text['label-ivr_menus']['es-mx'] = "Menus IVR"; //copied from es-cl -$text['label-ivr_menus']['fr-ca'] = "Menus SVI"; //copied from fr-fr +$text['label-ivr_menus']['fr-ca'] = "Menus RVI"; $text['label-ivr_menus']['fr-fr'] = "Menus SVI"; $text['label-ivr_menus']['he-il'] = ""; $text['label-ivr_menus']['it-it'] = "Menu IVR"; @@ -2049,6 +2049,60 @@ $text['label-active_domains']['ru-ru'] = "Активные домены"; $text['label-active_domains']['sv-se'] = "Aktiva Domäner"; $text['label-active_domains']['uk-ua'] = "активні домени"; +$text['label-dynamic']['en-us'] = "Dynamic"; +$text['label-dynamic']['en-gb'] = "Dynamic"; +$text['label-dynamic']['ar-eg'] = "Dynamic"; +$text['label-dynamic']['de-at'] = "Dynamic"; +$text['label-dynamic']['de-ch'] = "Dynamic"; +$text['label-dynamic']['de-de'] = "Dynamic"; +$text['label-dynamic']['es-cl'] = "Dynamic"; +$text['label-dynamic']['es-mx'] = "Dynamic"; +$text['label-dynamic']['fr-ca'] = "Dynamic"; +$text['label-dynamic']['fr-fr'] = "Dynamic"; +$text['label-dynamic']['he-il'] = "Dynamic"; +$text['label-dynamic']['it-it'] = "Dynamic"; +$text['label-dynamic']['nl-nl'] = "Dynamic"; +$text['label-dynamic']['pl-pl'] = "Dynamic"; +$text['label-dynamic']['pt-br'] = "Dynamic"; +$text['label-dynamic']['pt-pt'] = "Dynamic"; +$text['label-dynamic']['ro-ro'] = "Dynamic"; + +$text['label-single']['en-us'] = "Single"; +$text['label-single']['en-gb'] = "Single"; +$text['label-single']['ar-eg'] = "Single"; +$text['label-single']['de-at'] = "Single"; +$text['label-single']['de-ch'] = "Single"; +$text['label-single']['de-de'] = "Single"; +$text['label-single']['es-cl'] = "Single"; +$text['label-single']['es-mx'] = "Single"; +$text['label-single']['fr-ca'] = "Single"; +$text['label-single']['fr-fr'] = "Single"; +$text['label-single']['he-il'] = "Single"; +$text['label-single']['it-it'] = "Single"; +$text['label-single']['nl-nl'] = "Single"; +$text['label-single']['pl-pl'] = "Single"; +$text['label-single']['pt-br'] = "Single"; +$text['label-single']['pt-pt'] = "Single"; +$text['label-single']['ro-ro'] = "Single"; + +$text['label-multiple']['en-us'] = "Multiple"; +$text['label-multiple']['en-gb'] = "Multiple"; +$text['label-multiple']['ar-eg'] = "Multiple"; +$text['label-multiple']['de-at'] = "Multiple"; +$text['label-multiple']['de-ch'] = "Multiple"; +$text['label-multiple']['de-de'] = "Multiple"; +$text['label-multiple']['es-cl'] = "Multiple"; +$text['label-multiple']['es-mx'] = "Multiple"; +$text['label-multiple']['fr-ca'] = "Multiple"; +$text['label-multiple']['fr-fr'] = "Multiple"; +$text['label-multiple']['he-il'] = "Multiple"; +$text['label-multiple']['it-it'] = "Multiple"; +$text['label-multiple']['nl-nl'] = "Multiple"; +$text['label-multiple']['pl-pl'] = "Multiple"; +$text['label-multiple']['pt-br'] = "Multiple"; +$text['label-multiple']['pt-pt'] = "Multiple"; +$text['label-multiple']['ro-ro'] = "Multiple"; + $text['header-user_dashboard']['en-us'] = "Dashboard"; $text['header-user_dashboard']['en-gb'] = "Dashboard"; $text['header-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم"; @@ -2071,7 +2125,6 @@ $text['header-user_dashboard']['ru-ru'] = "Панель пользователя $text['header-user_dashboard']['sv-se'] = "Dashboard"; $text['header-user_dashboard']['uk-ua'] = "Панель користувача"; - $text['header-user_setting-edit']['en-us'] = "User Setting"; $text['header-user_setting-edit']['en-gb'] = "User Setting"; $text['header-user_setting-edit']['ar-eg'] = ""; diff --git a/core/user_settings/user_setting_edit.php b/core/user_settings/user_setting_edit.php index cb57ebda9f..f81ddb3fed 100644 --- a/core/user_settings/user_setting_edit.php +++ b/core/user_settings/user_setting_edit.php @@ -319,7 +319,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //pre-populate the form if (is_uuid($_GET["id"]) && count($_GET) > 0 && $_POST["persistformvar"] != "true") { $user_setting_uuid = $_GET["id"]; - $sql = "select user_setting_category, user_setting_subcategory, user_setting_name, user_setting_value, cast(user_setting_enabled as text), user_setting_description "; + $sql = "select user_setting_category, user_setting_subcategory, user_setting_name, user_setting_value, user_setting_order, cast(user_setting_enabled as text), user_setting_description "; $sql .= "from v_user_settings "; $sql .= "where user_setting_uuid = :user_setting_uuid "; $sql .= "and user_uuid = :user_uuid "; @@ -657,6 +657,37 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; } + elseif ($user_setting_category == "users" && $user_setting_subcategory == "username_format" && $user_setting_name == "text" ) { + echo " \n"; + } + elseif ($user_setting_category == "destinations" && $user_setting_subcategory == "dialplan_details" && $user_setting_name == "boolean" ) { + echo " \n"; + } + elseif ($user_setting_category == "destinations" && $user_setting_subcategory == "dialplan_mode" && $user_setting_name == "text" ) { + echo " \n"; + } + elseif ($user_setting_category == "destinations" && $user_setting_subcategory == "select_mode" && $user_setting_name == "text" ) { + echo " \n"; + } + elseif ($user_setting_category == "destinations" && $user_setting_subcategory == "unique" && $user_setting_name == "boolean" ) { + echo " \n"; + } else { echo " \n"; } diff --git a/core/user_settings/user_settings.php b/core/user_settings/user_settings.php index ad7421d20d..cbb12bb017 100644 --- a/core/user_settings/user_settings.php +++ b/core/user_settings/user_settings.php @@ -298,9 +298,18 @@ echo " ".(img_spacer('15px', '15px', 'background: '.escape($row['user_setting_value']).'; margin-right: 4px; vertical-align: middle; border: 1px solid '.(color_adjust($row['user_setting_value'], -0.18)).'; padding: -1px;')); echo "".escape($row['user_setting_value'])."\n"; } + else if ($category == 'users' && $subcategory == 'username_format' && $name == 'text') { + echo " ".$text['option-username_format_'.$row['user_setting_value']]."\n"; + } else if ($category == 'recordings' && $subcategory == 'storage_type' && $name == 'text') { echo " ".$text['label-'.$row['user_setting_value']]."\n"; } + else if ($category == 'destinations' && $subcategory == 'dialplan_mode' && $name == 'text') { + echo " ".$text['label-'.$row['user_setting_value']]."\n"; + } + else if ($category == 'destinations' && $subcategory == 'select_mode' && $name == 'text') { + echo " ".$text['label-'.$row['user_setting_value']]."\n"; + } else { echo " ".escape($row['user_setting_value'])."\n"; } diff --git a/core/users/app_config.php b/core/users/app_config.php index ffba651654..f22620cfbd 100644 --- a/core/users/app_config.php +++ b/core/users/app_config.php @@ -94,6 +94,14 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "53cc1060-78f9-44ca-b9b0-17fb2fffd5e1"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "users"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "username_format"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "any"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Require a specific username format."; + $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "e3f5f4cd-0f17-428a-b788-2f2db91b6dc7"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "users"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "password_length"; diff --git a/core/users/app_languages.php b/core/users/app_languages.php index cdfc4dc6c4..2698b2c3cf 100644 --- a/core/users/app_languages.php +++ b/core/users/app_languages.php @@ -1558,6 +1558,60 @@ $text['label-12-hour']['ru-ru'] = "12-часовой"; $text['label-12-hour']['sv-se'] = "12-Timmars"; $text['label-12-hour']['uk-ua'] = "12-годинний"; +$text['label-dynamic']['en-us'] = "Dynamic"; +$text['label-dynamic']['en-gb'] = "Dynamic"; +$text['label-dynamic']['ar-eg'] = "Dynamic"; +$text['label-dynamic']['de-at'] = "Dynamic"; +$text['label-dynamic']['de-ch'] = "Dynamic"; +$text['label-dynamic']['de-de'] = "Dynamic"; +$text['label-dynamic']['es-cl'] = "Dynamic"; +$text['label-dynamic']['es-mx'] = "Dynamic"; +$text['label-dynamic']['fr-ca'] = "Dynamic"; +$text['label-dynamic']['fr-fr'] = "Dynamic"; +$text['label-dynamic']['he-il'] = "Dynamic"; +$text['label-dynamic']['it-it'] = "Dynamic"; +$text['label-dynamic']['nl-nl'] = "Dynamic"; +$text['label-dynamic']['pl-pl'] = "Dynamic"; +$text['label-dynamic']['pt-br'] = "Dynamic"; +$text['label-dynamic']['pt-pt'] = "Dynamic"; +$text['label-dynamic']['ro-ro'] = "Dynamic"; + +$text['label-single']['en-us'] = "Single"; +$text['label-single']['en-gb'] = "Single"; +$text['label-single']['ar-eg'] = "Single"; +$text['label-single']['de-at'] = "Single"; +$text['label-single']['de-ch'] = "Single"; +$text['label-single']['de-de'] = "Single"; +$text['label-single']['es-cl'] = "Single"; +$text['label-single']['es-mx'] = "Single"; +$text['label-single']['fr-ca'] = "Single"; +$text['label-single']['fr-fr'] = "Single"; +$text['label-single']['he-il'] = "Single"; +$text['label-single']['it-it'] = "Single"; +$text['label-single']['nl-nl'] = "Single"; +$text['label-single']['pl-pl'] = "Single"; +$text['label-single']['pt-br'] = "Single"; +$text['label-single']['pt-pt'] = "Single"; +$text['label-single']['ro-ro'] = "Single"; + +$text['label-multiple']['en-us'] = "Multiple"; +$text['label-multiple']['en-gb'] = "Multiple"; +$text['label-multiple']['ar-eg'] = "Multiple"; +$text['label-multiple']['de-at'] = "Multiple"; +$text['label-multiple']['de-ch'] = "Multiple"; +$text['label-multiple']['de-de'] = "Multiple"; +$text['label-multiple']['es-cl'] = "Multiple"; +$text['label-multiple']['es-mx'] = "Multiple"; +$text['label-multiple']['fr-ca'] = "Multiple"; +$text['label-multiple']['fr-fr'] = "Multiple"; +$text['label-multiple']['he-il'] = "Multiple"; +$text['label-multiple']['it-it'] = "Multiple"; +$text['label-multiple']['nl-nl'] = "Multiple"; +$text['label-multiple']['pl-pl'] = "Multiple"; +$text['label-multiple']['pt-br'] = "Multiple"; +$text['label-multiple']['pt-pt'] = "Multiple"; +$text['label-multiple']['ro-ro'] = "Multiple"; + $text['header-user_manager']['en-us'] = "Users"; $text['header-user_manager']['en-gb'] = "Users"; $text['header-user_manager']['ar-eg'] = ""; diff --git a/core/users/user_edit.php b/core/users/user_edit.php index c0190fd82d..5bedf46777 100644 --- a/core/users/user_edit.php +++ b/core/users/user_edit.php @@ -135,7 +135,9 @@ } $group_uuid_name = $_POST["group_uuid_name"]; $user_enabled = $_POST["user_enabled"]; - $api_key = $_POST["api_key"]; + if (permission_exists('api_key')) { + $api_key = $_POST["api_key"]; + } if (permission_exists('message_key')) { $message_key = $_POST["message_key"]; } @@ -152,6 +154,14 @@ if ($username == '') { $invalid[] = $text['label-username']; } + if ($_SESSION['users']['username_format']['text'] != '' && $_SESSION['users']['username_format']['text'] != 'any') { + if ( + ($_SESSION['users']['username_format']['text'] == 'email' && !valid_email($username)) || + ($_SESSION['users']['username_format']['text'] == 'no_email' && valid_email($username)) + ) { + message::add($text['message-username_format_invalid'], 'negative', 7500); + } + } if ((permission_exists('user_edit') && $action == 'edit' && $username != $username_old && $username != '') || (permission_exists('user_add') && $action == 'add' && $username != '')) { $sql = "select count(*) from v_users where username = :username "; @@ -490,7 +500,9 @@ $array['users'][$x]['user_email'] = $user_email; $array['users'][$x]['user_status'] = $user_status; if (permission_exists('user_add') || permission_exists('user_edit')) { - $array['users'][$x]['api_key'] = ($api_key != '') ? $api_key : null; + if (permission_exists('api_key')) { + $array['users'][$x]['api_key'] = ($api_key != '') ? $api_key : null; + } $array['users'][$x]['user_enabled'] = $user_enabled; if (permission_exists('contact_add')) { $array['users'][$x]['contact_uuid'] = ($contact_uuid != '') ? $contact_uuid : null; @@ -941,7 +953,7 @@ echo " "; echo escape($field['group_name']).(($field['group_domain_uuid'] != '') ? "@".$_SESSION['domains'][$field['group_domain_uuid']]['domain_name'] : null); echo " \n"; - if (permission_exists('group_member_delete') || if_group("superadmin")) { + if (permission_exists('user_group_delete') || if_group("superadmin")) { echo " \n"; echo " ".$v_link_label_delete."\n"; echo " \n"; diff --git a/core/users/user_imports.php b/core/users/user_imports.php index 4cefe880e7..3cebb54c1d 100644 --- a/core/users/user_imports.php +++ b/core/users/user_imports.php @@ -62,26 +62,25 @@ //save the data to the csv file if (isset($_POST['data'])) { - $file = $_SESSION['server']['temp']['dir']."/users-".$_SESSION['domain_name'].".csv"; - file_put_contents($file, $_POST['data']); - $_SESSION['file'] = $file; - } - -//copy the csv file - //$_POST['submit'] == "Upload" && - if (is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('user_imports')) { - if ($_POST['type'] == 'csv') { - move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['server']['temp']['dir'].'/'.$_FILES['ulfile']['name']); - $save_msg = "Uploaded file to ".$_SESSION['server']['temp']['dir']."/". htmlentities($_FILES['ulfile']['name']); - //system('chmod -R 744 '.$_SESSION['server']['temp']['dir'].'*'); - unset($_POST['txtCommand']); - $file = $_SESSION['server']['temp']['dir'].'/'.$_FILES['ulfile']['name']; + $file = $_SESSION['server']['temp']['dir'].'/users-'.$_SESSION['domain_name'].'.csv'; + if (file_put_contents($file, $_POST['data'])) { $_SESSION['file'] = $file; } } +//copy the csv file + //$_POST['submit'] == "Upload" && + if (is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('user_import')) { + if ($_POST['type'] == 'csv') { + $file = $_SESSION['server']['temp']['dir'].'/users-'.$_SESSION['domain_name'].'.csv'; + if (move_uploaded_file($_FILES['ulfile']['tmp_name'], $file)) { + $_SESSION['file'] = $file; + } + } + } + //get the schema - if (strlen($delimiter) > 0) { + if (strlen($delimiter) > 0 && file_exists($_SESSION['file'])) { //get the first line $line = fgets(fopen($_SESSION['file'], 'r')); $line_fields = explode($delimiter, $line); diff --git a/resources/app_languages.php b/resources/app_languages.php index bb58f8cd50..77d9360dfc 100644 --- a/resources/app_languages.php +++ b/resources/app_languages.php @@ -409,6 +409,90 @@ $text['message-unsupported_file_type']['ru-ru'] = "Тип файла не под $text['message-unsupported_file_type']['sv-se'] = "Inte stöds filtyp"; $text['message-unsupported_file_type']['uk-ua'] = "Тип файлу не підтримується"; +$text['message-username_format_invalid']['en-us'] = "Invalid Username Format"; +$text['message-username_format_invalid']['en-gb'] = "Invalid Username Format"; +$text['message-username_format_invalid']['ar-eg'] = ""; +$text['message-username_format_invalid']['de-at'] = "Ungültiger Benutzername"; //copied from de-de +$text['message-username_format_invalid']['de-ch'] = "Ungültiger Benutzername"; //copied from de-de +$text['message-username_format_invalid']['de-de'] = "Ungültiger Benutzername"; +$text['message-username_format_invalid']['es-cl'] = ""; +$text['message-username_format_invalid']['es-mx'] = ""; +$text['message-username_format_invalid']['fr-ca'] = ""; +$text['message-username_format_invalid']['fr-fr'] = ""; +$text['message-username_format_invalid']['he-il'] = ""; +$text['message-username_format_invalid']['it-it'] = ""; +$text['message-username_format_invalid']['nl-nl'] = ""; +$text['message-username_format_invalid']['pl-pl'] = ""; +$text['message-username_format_invalid']['pt-br'] = "Nome de usuário inválida"; +$text['message-username_format_invalid']['pt-pt'] = ""; +$text['message-username_format_invalid']['ro-ro'] = ""; +$text['message-username_format_invalid']['ru-ru'] = "Неверное имя пользователя"; +$text['message-username_format_invalid']['sv-se'] = ""; +$text['message-username_format_invalid']['uk-ua'] = "Geçersiz Kullanıcı Adı"; + +$text['option-username_format_any']['en-us'] = "Any"; +$text['option-username_format_any']['en-gb'] = "Any"; +$text['option-username_format_any']['ar-eg'] = "Any"; +$text['option-username_format_any']['de-at'] = "Any"; +$text['option-username_format_any']['de-ch'] = "Any"; +$text['option-username_format_any']['de-de'] = "Any"; +$text['option-username_format_any']['es-cl'] = "Any"; +$text['option-username_format_any']['es-mx'] = "Any"; +$text['option-username_format_any']['fr-ca'] = "Any"; +$text['option-username_format_any']['fr-fr'] = "Any"; +$text['option-username_format_any']['he-il'] = "Any"; +$text['option-username_format_any']['it-it'] = "Any"; +$text['option-username_format_any']['nl-nl'] = "Any"; +$text['option-username_format_any']['pl-pl'] = "Any"; +$text['option-username_format_any']['pt-br'] = "Any"; +$text['option-username_format_any']['pt-pt'] = "Any"; +$text['option-username_format_any']['ro-ro'] = "Any"; +$text['option-username_format_any']['ru-ru'] = "Any"; +$text['option-username_format_any']['sv-se'] = "Any"; +$text['option-username_format_any']['uk-ua'] = "Any"; + +$text['option-username_format_email']['en-us'] = "Email Address"; +$text['option-username_format_email']['en-gb'] = "Email Address"; +$text['option-username_format_email']['ar-eg'] = "Email Address"; +$text['option-username_format_email']['de-at'] = "Email Address"; +$text['option-username_format_email']['de-ch'] = "Email Address"; +$text['option-username_format_email']['de-de'] = "Email Address"; +$text['option-username_format_email']['es-cl'] = "Email Address"; +$text['option-username_format_email']['es-mx'] = "Email Address"; +$text['option-username_format_email']['fr-ca'] = "Email Address"; +$text['option-username_format_email']['fr-fr'] = "Email Address"; +$text['option-username_format_email']['he-il'] = "Email Address"; +$text['option-username_format_email']['it-it'] = "Email Address"; +$text['option-username_format_email']['nl-nl'] = "Email Address"; +$text['option-username_format_email']['pl-pl'] = "Email Address"; +$text['option-username_format_email']['pt-br'] = "Email Address"; +$text['option-username_format_email']['pt-pt'] = "Email Address"; +$text['option-username_format_email']['ro-ro'] = "Email Address"; +$text['option-username_format_email']['ru-ru'] = "Email Address"; +$text['option-username_format_email']['sv-se'] = "Email Address"; +$text['option-username_format_email']['uk-ua'] = "Email Address"; + +$text['option-username_format_no_email']['en-us'] = "Not Email Address"; +$text['option-username_format_no_email']['en-gb'] = "Not Email Address"; +$text['option-username_format_no_email']['ar-eg'] = "Not Email Address"; +$text['option-username_format_no_email']['de-at'] = "Not Email Address"; +$text['option-username_format_no_email']['de-ch'] = "Not Email Address"; +$text['option-username_format_no_email']['de-de'] = "Not Email Address"; +$text['option-username_format_no_email']['es-cl'] = "Not Email Address"; +$text['option-username_format_no_email']['es-mx'] = "Not Email Address"; +$text['option-username_format_no_email']['fr-ca'] = "Not Email Address"; +$text['option-username_format_no_email']['fr-fr'] = "Not Email Address"; +$text['option-username_format_no_email']['he-il'] = "Not Email Address"; +$text['option-username_format_no_email']['it-it'] = "Not Email Address"; +$text['option-username_format_no_email']['nl-nl'] = "Not Email Address"; +$text['option-username_format_no_email']['pl-pl'] = "Not Email Address"; +$text['option-username_format_no_email']['pt-br'] = "Not Email Address"; +$text['option-username_format_no_email']['pt-pt'] = "Not Email Address"; +$text['option-username_format_no_email']['ro-ro'] = "Not Email Address"; +$text['option-username_format_no_email']['ru-ru'] = "Not Email Address"; +$text['option-username_format_no_email']['sv-se'] = "Not Email Address"; +$text['option-username_format_no_email']['uk-ua'] = "Not Email Address"; + $text['confirm-delete']['en-us'] = "Do you really want to DELETE this?"; $text['confirm-delete']['en-gb'] = "Do you really want to DELETE this?"; $text['confirm-delete']['ar-eg'] = "هل تريد حقا أن تحذف هذا؟"; @@ -578,8 +662,8 @@ $text['button-clear']['de-de'] = "Zurücksetzen"; $text['button-clear']['el-gr'] = "Εκκαθάριση"; $text['button-clear']['es-cl'] = "Limpiar"; $text['button-clear']['es-mx'] = "Limpiar"; //copied from es-cl -$text['button-clear']['fr-ca'] = "Nettoyer"; //copied from fr-fr -$text['button-clear']['fr-fr'] = "Nettoyer"; +$text['button-clear']['fr-ca'] = "Effacer"; //copied from fr-fr +$text['button-clear']['fr-fr'] = "Effacer"; $text['button-clear']['he-il'] = "נקה"; $text['button-clear']['it-it'] = "Pulisci"; $text['button-clear']['nl-nl'] = ""; @@ -670,8 +754,8 @@ $text['button-search']['de-de'] = "Suchen"; $text['button-search']['el-gr'] = "Αναζήτηση"; $text['button-search']['es-cl'] = "Buscar"; $text['button-search']['es-mx'] = "Buscar"; //copied from es-cl -$text['button-search']['fr-ca'] = "Chercher"; //copied from fr-fr -$text['button-search']['fr-fr'] = "Chercher"; +$text['button-search']['fr-ca'] = "Rechercher"; //copied from fr-fr +$text['button-search']['fr-fr'] = "Rechercher"; $text['button-search']['he-il'] = "חפש"; $text['button-search']['it-it'] = "Ricerca"; $text['button-search']['nl-nl'] = ""; @@ -3061,6 +3145,29 @@ $text['label-add']['sv-se'] = "Lägg Till"; $text['label-add']['uk-ua'] = "Додати"; $text['label-add']['tr-tr'] = "Ekle"; +$text['label-update']['en-us'] = "Update"; +$text['label-update']['en-gb'] = "Update"; +$text['label-update']['ar-eg'] = ""; +$text['label-update']['de-at'] = ""; //copied from de-de +$text['label-update']['de-ch'] = ""; //copied from de-de +$text['label-update']['de-de'] = ""; +$text['label-update']['el-gr'] = ""; +$text['label-update']['es-cl'] = ""; +$text['label-update']['es-mx'] = ""; //copied from es-cl +$text['label-update']['fr-ca'] = ""; //copied from fr-fr +$text['label-update']['fr-fr'] = ""; +$text['label-update']['he-il'] = ""; +$text['label-update']['it-it'] = ""; +$text['label-update']['nl-nl'] = ""; +$text['label-update']['pl-pl'] = ""; +$text['label-update']['pt-br'] = ""; //copied from pt-pt +$text['label-update']['pt-pt'] = ""; +$text['label-update']['ro-ro'] = ""; +$text['label-update']['ru-ru'] = ""; +$text['label-update']['sv-se'] = ""; +$text['label-update']['uk-ua'] = ""; +$text['label-update']['tr-tr'] = ""; + $text['label-delete']['en-us'] = "Delete"; $text['label-delete']['en-gb'] = "Delete"; $text['label-delete']['ar-eg'] = ""; @@ -4142,8 +4249,8 @@ $text['label-uploaded']['de-ch'] = "Hochgeladen"; //copied from de-de $text['label-uploaded']['de-de'] = "Hochgeladen"; $text['label-uploaded']['es-cl'] = "Subir"; $text['label-uploaded']['es-mx'] = "Subir"; //copied from es-cl -$text['label-uploaded']['fr-ca'] = "Envoyé"; //copied from fr-fr -$text['label-uploaded']['fr-fr'] = "Envoyé"; +$text['label-uploaded']['fr-ca'] = "Envoyés"; //copied from fr-fr +$text['label-uploaded']['fr-fr'] = "Envoyés"; $text['label-uploaded']['he-il'] = "הוטען"; $text['label-uploaded']['it-it'] = "Caricato"; $text['label-uploaded']['nl-nl'] = "Opgestuurd"; diff --git a/resources/check_auth.php b/resources/check_auth.php index 462b43abc9..745bba9322 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -74,6 +74,7 @@ if ($result["authorized"] === "true") { //set the session variables $_SESSION["domain_uuid"] = $result["domain_uuid"]; + //$_SESSION["domain_name"] = $result["domain_name"]; $_SESSION["user_uuid"] = $result["user_uuid"]; //user session array @@ -146,6 +147,7 @@ if (is_array($sql_where_or) && @sizeof($sql_where_or) != 0) { $sql .= "and (".implode(' or ', $sql_where_or).") "; } + $sql .= "and permission_assigned = 'true' "; $parameters['domain_uuid'] = $_SESSION["domain_uuid"]; $database = new database; $result = $database->select($sql, $parameters, 'all'); @@ -246,7 +248,7 @@ $_SESSION['user']['extension'][$x]['user_context'] = $row['user_context']; $_SESSION['user']['extension'][$x]['description'] = $row['description']; - //set the user context + //set the context $_SESSION['user']['user_context'] = $row["user_context"]; $_SESSION['user_context'] = $row["user_context"]; } diff --git a/resources/classes/button.php b/resources/classes/button.php index 8af56f1f05..c10ee3c017 100644 --- a/resources/classes/button.php +++ b/resources/classes/button.php @@ -59,7 +59,9 @@ if (!class_exists('button')) { $button .= $array['onclick'] ? "onclick=".self::quote($array['onclick'])." " : null; $button .= $array['onmouseover'] ? "onmouseenter=".self::quote($array['onmouseover'])." " : null; $button .= $array['onmouseout'] ? "onmouseleave=".self::quote($array['onmouseout'])." " : null; - $button .= "class='btn btn-".($array['class'] ? $array['class'] : 'default')." ".($array['disabled'] ? 'disabled' : null)."' "; + //detect class addition (using + prefix) + $button_class = $array['class'] && $array['class'][0] == '+' ? 'default '.substr($array['class'], 1) : $array['class']; + $button .= "class='btn btn-".($button_class ? $button_class : 'default')." ".($array['disabled'] ? 'disabled' : null)."' "; //ensure margin* styles are not applied to the button element when a link is defined if (is_array($array['style']) && @sizeof($array['style']) != 0) { foreach ($array['style'] as $property => $value) { diff --git a/resources/classes/cache.php b/resources/classes/cache.php index 84ecf6100b..dcd1655817 100644 --- a/resources/classes/cache.php +++ b/resources/classes/cache.php @@ -145,11 +145,13 @@ class cache { event_socket_request($fp, $event); //remove the local files - if (file_exists($_SESSION['cache']['location']['text'] . "/" . $key)) { - unlink($_SESSION['cache']['location']['text'] . "/" . $key); - } - if (file_exists($_SESSION['cache']['location']['text'] . "/" . $key . ".tmp")) { - unlink($_SESSION['cache']['location']['text'] . "/" . $key . ".tmp"); + foreach (glob($_SESSION['cache']['location']['text'] . "/" . $key) as $file) { + if (file_exists($file)) { + unlink($file); + } + if (file_exists($file)) { + unlink($file . ".tmp"); + } } } diff --git a/resources/classes/database.php b/resources/classes/database.php index 31fad75c1b..c711d9c4f2 100644 --- a/resources/classes/database.php +++ b/resources/classes/database.php @@ -62,7 +62,7 @@ include "root.php"; * Called when the object is created */ public function __construct() { - if (!isset($this->domain_uuid)) { + if (!isset($this->domain_uuid) && isset($_SESSION['domain_uuid'])) { $this->domain_uuid = $_SESSION['domain_uuid']; } } @@ -1619,7 +1619,7 @@ include "root.php"; } //end function toggle - public function save($array) { + public function save($array, $transaction_save = true) { //return the array if (!is_array($array)) { echo "not an array"; return false; } @@ -2248,7 +2248,7 @@ include "root.php"; $user_uuid = $_SESSION['user_uuid']; //log the transaction results - if (file_exists($_SERVER["PROJECT_ROOT"]."/app/database_transactions/app_config.php")) { + if ($transaction_save && file_exists($_SERVER["PROJECT_ROOT"]."/app/database_transactions/app_config.php")) { try { $sql = "insert into v_database_transactions "; $sql .= "("; diff --git a/resources/classes/domains.php b/resources/classes/domains.php index bbec08c196..40c34c1b0e 100644 --- a/resources/classes/domains.php +++ b/resources/classes/domains.php @@ -262,8 +262,6 @@ if (!class_exists('domains')) { //clear the domains session array to update it unset($_SESSION["domains"]); - unset($_SESSION["domain_uuid"]); - unset($_SESSION["domain_name"]); unset($_SESSION['domain']); unset($_SESSION['switch']); @@ -873,6 +871,9 @@ if (!class_exists('domains')) { $sql .= "default_setting_subcategory, "; $sql .= "default_setting_name, "; $sql .= "default_setting_value, "; + if ($row['default_setting_order']) { + $sql .= "default_setting_order, "; + } $sql .= "default_setting_enabled, "; $sql .= "default_setting_description "; $sql .= ") values \n"; @@ -882,6 +883,9 @@ if (!class_exists('domains')) { $sql .= "'".check_str($row['default_setting_subcategory'])."', "; $sql .= "'".check_str($row['default_setting_name'])."', "; $sql .= "'".check_str($row['default_setting_value'])."', "; + if ($row['default_setting_order']) { + $sql .= "'".check_str($row['default_setting_order'])."', "; + } $sql .= "'".check_str($row['default_setting_enabled'])."', "; $sql .= "'".check_str($row['default_setting_description'])."' "; $sql .= ");"; diff --git a/resources/classes/file.php b/resources/classes/file.php index 6072c16cf5..52c244bff0 100644 --- a/resources/classes/file.php +++ b/resources/classes/file.php @@ -65,15 +65,25 @@ class file { /** * Get the sounds list of search as a relative path without the rate */ - public function sounds() { - $dir = $_SESSION['switch']['sounds']['dir'].'/en/us/callie'; + public function sounds($language = 'en', $dialect = 'us', $voice = 'callie') { + //set default values + if (!isset($language)) { $language = 'en'; } + if (!isset($dialect)) { $dialect = 'us'; } + if (!isset($voice)) { $voice = 'callie'; } + + //set the variables + $dir = $_SESSION['switch']['sounds']['dir'].'/'.$language.'/'.$dialect.'/'.$voice; $rate = '8000'; $files = $this->glob($dir.'/*/'.$rate, true); + + //loop through the languages foreach($files as $file) { $file = substr($file, strlen($dir)+1); $file = str_replace("/".$rate, "", $file); $array[] = $file; } + + //return the list of sounds return $array; } diff --git a/resources/classes/schema.php b/resources/classes/schema.php index 4c29d6fc2a..a10a6be5f1 100644 --- a/resources/classes/schema.php +++ b/resources/classes/schema.php @@ -34,6 +34,7 @@ if (!class_exists('schema')) { public $apps; public $db_type; public $result; + public $data_types; //class constructor public function __construct() { @@ -49,7 +50,12 @@ if (!class_exists('schema')) { $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php"); $x=0; foreach ($config_list as &$config_path) { - include($config_path); + try { + include($config_path); + } + catch (Exception $e) { + //echo 'Caught exception: ', $e->getMessage(), "\n"; + } $x++; } $this->apps = $apps; @@ -381,7 +387,7 @@ if (!class_exists('schema')) { $field_count++; } } - $sql .= ");\n\n"; + $sql .= ");\n"; return $sql; } } @@ -452,7 +458,7 @@ if (!class_exists('schema')) { $field_count++; } } - $sql .= " FROM tmp_".$table.";\n\n"; + $sql .= " FROM tmp_".$table.";\n"; return $sql; } } @@ -463,8 +469,9 @@ if (!class_exists('schema')) { public function schema ($format = '') { //set the global variable - global $db, $upgrade_data_types, $text,$output_format; - if ($format=='') $format = $output_format; + global $db, $text, $output_format; + + if ($format == '') $format = $output_format; //get the db variables require_once "resources/classes/config.php"; @@ -519,7 +526,12 @@ if (!class_exists('schema')) { $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php"); $x=0; foreach ($config_list as &$config_path) { - include($config_path); + try { + include($config_path); + } + catch (Exception $e) { + //echo 'Caught exception: ', $e->getMessage(), "\n"; + } $x++; } @@ -665,7 +677,7 @@ if (!class_exists('schema')) { //change the data type if it has been changed //if the data type in the app db array is different than the type in the database then change the data type - if ($upgrade_data_types) { + if ($this->data_types) { $db_field_type = $this->db_column_data_type ($db_type, $db_name, $table_name, $field_name); $field_type_array = explode("(", $field_type); $field_type = $field_type_array[0]; @@ -677,40 +689,24 @@ if (!class_exists('schema')) { $sql_update .= "AS uuid);\n"; } else { - if ($db_field_type == "integer" && strtolower($field_type) == "serial") { - //field type has not changed - } - else if ($db_field_type == "timestamp without time zone" && strtolower($field_type) == "timestamp") { - //field type has not changed - } - else if ($db_field_type == "timestamp without time zone" && strtolower($field_type) == "datetime") { - //field type has not changed - } - else if ($db_field_type == "timestamp with time zone" && strtolower($field_type) == "timestamptz") { - //field type has not changed - } - else if ($db_field_type == "integer" && strtolower($field_type) == "numeric") { - //field type has not changed - } - else if ($db_field_type == "character" && strtolower($field_type) == "char") { - //field type has not changed - } + //field type has not changed + if ($db_field_type == "integer" && strtolower($field_type) == "serial") { } + else if ($db_field_type == "timestamp without time zone" && strtolower($field_type) == "timestamp") { } + else if ($db_field_type == "timestamp without time zone" && strtolower($field_type) == "datetime") { } + else if ($db_field_type == "timestamp with time zone" && strtolower($field_type) == "timestamptz") { } + else if ($db_field_type == "integer" && strtolower($field_type) == "numeric") { } + else if ($db_field_type == "character" && strtolower($field_type) == "char") { } + //field type has changed else { switch ($field_type) { + case 'numeric': $using = $field_name."::numeric"; break; case 'timestamp': - case 'datetime': - $sql_update .= "ALTER TABLE ".$table_name." ALTER COLUMN ".$field_name." TYPE ".$field_type." USING ".$field_name."::timestamp without time zone;\n"; - break; - case 'timestamptz': - $sql_update .= "ALTER TABLE ".$table_name." ALTER COLUMN ".$field_name." TYPE ".$field_type." USING ".$field_name."::timestamp with time zone;\n"; - break; - case 'boolean': - $sql_update .= "ALTER TABLE ".$table_name." ALTER COLUMN ".$field_name." TYPE ".$field_type." USING ".$field_name."::boolean;\n"; - break; - default: - //$sql_update .= "-- $db_type, $db_name, $table_name, $field_name ".db_column_data_type ($db_type, $db_name, $table_name, $field_name)."
"; - $sql_update .= "ALTER TABLE ".$table_name." ALTER COLUMN ".$field_name." TYPE ".$field_type.";\n"; + case 'datetime': $using = $field_name."::timestamp without time zone"; break; + case 'timestamptz': $using = $field_name."::timestamp with time zone"; break; + case 'boolean': $using = $field_name."::boolean"; break; + default: unset($using); } + $sql_update .= "ALTER TABLE ".$table_name." ALTER COLUMN ".$field_name." TYPE ".$field_type." ".($using ? "USING ".$using : null).";\n"; } } } @@ -896,11 +892,11 @@ if (!class_exists('schema')) { try { $this->db->query(trim($sql)); if ($format == "text") { - $response .= " $sql\n"; + $response .= " $sql;\n"; } } catch (PDOException $error) { - $response .= " error: " . $error->getMessage() . " sql: $sql
"; + $response .= " error: " . $error->getMessage() . " sql: $sql\n"; } } } diff --git a/resources/footer.php b/resources/footer.php index dfe6bb571d..c75cb1e0b1 100644 --- a/resources/footer.php +++ b/resources/footer.php @@ -72,7 +72,7 @@ $view = new template(); $view->engine = 'smarty'; $view->template_dir = $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH.'/themes/'.$_SESSION['domain']['template']['name'].'/'; - $view->cache_dir = $_SESSION['server']['temp']['dir']; + $view->cache_dir = $_SESSION['server']['temp']['dir'] ?: sys_get_temp_dir(); $view->init(); //add multi-lingual support diff --git a/resources/functions.php b/resources/functions.php index 9203a49788..0ed1240d45 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -51,7 +51,7 @@ } } if ($db_type == "pgsql") { - $string = pg_escape_string($string); + $string = str_replace("'","''",$string); } if ($db_type == "mysql") { if(function_exists('mysql_real_escape_string')){ @@ -393,7 +393,7 @@ //html table header order by function th_order_by($field_name, $column_title, $order_by, $order, $app_uuid = '', $css = '', $http_get_params = '', $description = '') { global $text; - if (is_uuid($app_uuid) > 0) { $app_uuid = "&app_uuid=".$app_uuid; } // accomodate need to pass app_uuid where necessary (inbound/outbound routes lists) + if (is_uuid($app_uuid) > 0) { $app_uuid = "&app_uuid=".urlencode($app_uuid); } // accomodate need to pass app_uuid where necessary (inbound/outbound routes lists) $field_name = preg_replace("#[^a-zA-Z0-9_]#", "", $field_name); $field_value = preg_replace("#[^a-zA-Z0-9_]#", "", $field_value); @@ -438,13 +438,19 @@ if (strlen($order_by) == 0) { $order = 'asc'; } - if ($order == "asc") { - $description .= $text['label-order'].': '.$text['label-ascending']; - $html .= "".escape($column_title).""; + if ($order_by == $field_name) { + if ($order == "asc") { + $description .= $text['label-order'].' '.$text['label-descending']; + $html .= "".escape($column_title).""; + } + else { + $description .= $text['label-order'].' '.$text['label-ascending']; + $html .= "".escape($column_title).""; + } } else { - $description .= $text['label-order'].': '.$text['label-descending']; - $html .= "".escape($column_title).""; + $description .= $text['label-order'].' '.$text['label-ascending']; + $html .= "".escape($column_title).""; } $html .= ""; return $html; @@ -1405,45 +1411,33 @@ function number_pad($number,$n) { if (!is_array($eml_recipients)) { // must be a single or delimited recipient address(s) $eml_recipients = str_replace(' ', '', $eml_recipients); - if (substr_count(',', $eml_recipients)) { $delim = ','; } - if (substr_count(';', $eml_recipients)) { $delim = ';'; } - if ($delim) { $eml_recipients = explode($delim, $eml_recipients); } // delimiter found, convert to array of addresses + $eml_recipients = str_replace(array(';',','), ' ', $eml_recipients); + $eml_recipients = explode(' ', $eml_recipients); // convert to array of addresses } - - if (is_array($eml_recipients)) { // check if multiple recipients - foreach ($eml_recipients as $eml_recipient) { - if (is_array($eml_recipient)) { // check if each recipient has multiple fields - if ($eml_recipient["address"] != '' && preg_match($regexp, $eml_recipient["address"]) == 1) { // check if valid address - switch ($eml_recipient["delivery"]) { - case "cc" : $mail -> AddCC($eml_recipient["address"], ($eml_recipient["name"]) ? $eml_recipient["name"] : $eml_recipient["address"]); break; - case "bcc" : $mail -> AddBCC($eml_recipient["address"], ($eml_recipient["name"]) ? $eml_recipient["name"] : $eml_recipient["address"]); break; - default : $mail -> AddAddress($eml_recipient["address"], ($eml_recipient["name"]) ? $eml_recipient["name"] : $eml_recipient["address"]); - } - $address_found = true; + foreach ($eml_recipients as $eml_recipient) { + if (is_array($eml_recipient)) { // check if each recipient has multiple fields + if ($eml_recipient["address"] != '' && preg_match($regexp, $eml_recipient["address"]) == 1) { // check if valid address + switch ($eml_recipient["delivery"]) { + case "cc" : $mail -> AddCC($eml_recipient["address"], ($eml_recipient["name"]) ? $eml_recipient["name"] : $eml_recipient["address"]); break; + case "bcc" : $mail -> AddBCC($eml_recipient["address"], ($eml_recipient["name"]) ? $eml_recipient["name"] : $eml_recipient["address"]); break; + default : $mail -> AddAddress($eml_recipient["address"], ($eml_recipient["name"]) ? $eml_recipient["name"] : $eml_recipient["address"]); } - } - else if ($eml_recipient != '' && preg_match($regexp, $eml_recipient) == 1) { // check if recipient value is simply (only) an address - $mail -> AddAddress($eml_recipient); $address_found = true; } } - - if (!$address_found) { - $eml_error = "No valid e-mail address provided."; - return false; - } - - } - else { // just a single e-mail address found, not an array of addresses - if ($eml_recipients != '' && preg_match($regexp, $eml_recipients) == 1) { // check if email syntax is valid - $mail -> AddAddress($eml_recipients); - } - else { - $eml_error = "No valid e-mail address provided."; - return false; + else if ($eml_recipient != '' && preg_match($regexp, $eml_recipient) == 1) { // check if recipient value is simply (only) an address + $mail -> AddAddress($eml_recipient); + $address_found = true; } } + if (!$address_found) { + $eml_error = "No valid e-mail address provided."; + return false; + } + + + if (is_array($eml_attachments) && sizeof($eml_attachments) > 0) { foreach ($eml_attachments as $attachment) { $attachment['name'] = $attachment['name'] != '' ? $attachment['name'] : basename($attachment['value']); @@ -2058,13 +2052,25 @@ function number_pad($number,$n) { //validate and format order by clause of select statement if (!function_exists('order_by')) { function order_by($col, $dir, $col_default = '', $dir_default = 'asc') { + $order_by = ' order by '; $col = preg_replace('#[^a-zA-Z0-9-_.]#', '', $col); $dir = strtolower($dir) == 'desc' ? 'desc' : 'asc'; if ($col != '') { - return ' order by '.$col.' '.$dir.' '; + return $order_by.$col.' '.$dir.' '; } - else if ($col_default != '') { - return ' order by '.$col_default.' '.$dir_default.' '; + else if (is_array($col_default) || $col_default != '') { + if (is_array($col_default) && @sizeof($col_default) != 0) { + foreach ($col_default as $k => $column) { + $direction = (is_array($dir_default) && @sizeof($dir_default) != 0 && (strtolower($dir_default[$k]) == 'asc' || strtolower($dir_default[$k]) == 'desc')) ? $dir_default[$k] : 'asc'; + $order_bys[] = $column.' '.$direction.' '; + } + if (is_array($order_bys) && @sizeof($order_bys) != 0) { + return $order_by.implode(', ', $order_bys); + } + } + else { + return $order_by.$col_default.' '.$dir_default.' '; + } } } } @@ -2135,19 +2141,29 @@ function number_pad($number,$n) { function persistent_form_values($action, $array = null) { switch ($action) { case 'store': + // $array is expected to be an array of key / value pairs to store in the session if (is_array($array) && @sizeof($array) != 0) { - $_SESSION[$_SERVER['PHP_SELF']] = $array; + $_SESSION['persistent'][$_SERVER['PHP_SELF']] = $array; } break; case 'exists': - return is_array($_SESSION[$_SERVER['PHP_SELF']]) && @sizeof($_SESSION[$_SERVER['PHP_SELF']]) != 0 ? true : false; + return is_array($_SESSION['persistent'][$_SERVER['PHP_SELF']]) && @sizeof($_SESSION['persistent'][$_SERVER['PHP_SELF']]) != 0 ? true : false; break; case 'load': - if (is_array($_SESSION[$_SERVER['PHP_SELF']]) && @sizeof($_SESSION[$_SERVER['PHP_SELF']]) != 0) { - foreach ($_SESSION[$_SERVER['PHP_SELF']] as $key => $value) { + // $array is expected to be the name of the array to create containing the key / value pairs + if ($array && !is_array($array)) { + global $$array; + } + if (is_array($_SESSION['persistent'][$_SERVER['PHP_SELF']]) && @sizeof($_SESSION['persistent'][$_SERVER['PHP_SELF']]) != 0) { + foreach ($_SESSION['persistent'][$_SERVER['PHP_SELF']] as $key => $value) { if ($key != 'XID' && $key != 'ACT' && $key != 'RET') { - global $$key; - $$key = $value; + if ($array && !is_array($array)) { + $$array[$key] = $value; + } + else { + global $$key; + $$key = $value; + } } } global $unsaved; @@ -2155,15 +2171,25 @@ function number_pad($number,$n) { } break; case 'view': - if (is_array($_SESSION[$_SERVER['PHP_SELF']]) && @sizeof($_SESSION[$_SERVER['PHP_SELF']]) != 0) { - view_array($_SESSION[$_SERVER['PHP_SELF']], false); + if (is_array($_SESSION['persistent'][$_SERVER['PHP_SELF']]) && @sizeof($_SESSION['persistent'][$_SERVER['PHP_SELF']]) != 0) { + view_array($_SESSION['persistent'][$_SERVER['PHP_SELF']], false); } break; case 'clear': - unset($_SESSION[$_SERVER['PHP_SELF']]); + unset($_SESSION['persistent'][$_SERVER['PHP_SELF']]); break; } } } +//add alternative array_key_first for older verisons of PHP + if (!function_exists('array_key_first')) { + function array_key_first(array $arr) { + foreach($arr as $key => $unused) { + return $key; + } + return NULL; + } + } + ?> diff --git a/resources/login.php b/resources/login.php index d8c0b0019d..75aff2ade5 100644 --- a/resources/login.php +++ b/resources/login.php @@ -70,6 +70,7 @@ //see if email exists $sql = "select "; + $sql .= "user_uuid, "; $sql .= "username, "; $sql .= "password, "; $sql .= "domain_uuid "; @@ -91,12 +92,40 @@ //generate reset link email and body variables $domain_uuid = $result['domain_uuid']; - $domain_name = $_SESSION['domains'][$domain_uuid]['domain_name']; + if ($_SESSION['login']['password_reset_domain']['text'] != '') { + $domain_name = $_SESSION['login']['password_reset_domain']['text']; + } + else { + foreach ($_SESSION['domains'] as $uuid => $domain) { + if (strtolower($domain['domain_name']) == strtolower($_SERVER['HTTP_HOST'])) { + $domain_name = $_SERVER['HTTP_HOST']; + break; + } + } + $domain_name = $domain_name ? $domain_name : $_SESSION['domains'][$domain_uuid]['domain_name']; + } $key = encrypt($_SESSION['login']['password_reset_key']['text'], $result['username'].'|'.$result['domain_uuid'].'|'.$result['password']); $reset_link = "https://".$domain_name.PROJECT_PATH."/login.php?action=define&key=".urlencode($key); - $reset_button = email_button(strtoupper($text['label-reset_password']), $reset_link, '#2e82d0', '#fff'); + $reset_button = email_button(strtoupper($text['label-reset_password']), $reset_link, ($_SESSION['theme']['button_background_color_email']['text'] ? $_SESSION['theme']['button_background_color_email']['text'] : '#2e82d0'), ($_SESSION['theme']['button_text_color_email']['text'] ? $_SESSION['theme']['button_text_color_email']['text'] : '#ffffff')); $logo_full = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAABGCAYAAADl5IkzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NjAzQjkyMEYxMzA5MTFFNEJCMEVBNTk1RkYzM0FEMjciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NjAzQjkyMTAxMzA5MTFFNEJCMEVBNTk1RkYzM0FEMjciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MDNCOTIwRDEzMDkxMUU0QkIwRUE1OTVGRjMzQUQyNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo2MDNCOTIwRTEzMDkxMUU0QkIwRUE1OTVGRjMzQUQyNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PufA528AAFJVSURBVHja7H0HnBRV8n/15Lg5B9hdwpKDkiQJBlA5Eczp7sR05sN0Zw5n+OmZw5m9UzFgVowICh4gIhmJy7I5787O7OTY8//Wm55lWBZEz/Pu703zaWZ2Zvr169fvW/WtelXVUjQapd62t99+mw5lO+200w72tZTwPkr/3k36hc6T3JLbz7YdKs5+Avb22TQ/N9i2b98upaSkdAO8qKhI/ingwwBIh3Ch0YMIkgMdnxQEye1/bvs5gC41NDSo+I1er5eys7PFh+3t7fK2bduiB5I8PYAsxfe8vDy1RqNRDR06VKt8p+pxqKxSqSRZlqPr168Pd3R0hJ1OZ1yYRBOB3EMQ9BQCScAntyTQD0GbCu0NkEsMcP4sEAhEV69eLR8E1ALM0Pjq4cOHGw0GgxF/G9RqtRG7GQC24tUiSRLvJuxqBehxsMswNbj9CPYwwO4vLi524TN3OBzm3YPPPOiHz263e3HekAJouQf4o0nQJ7ck0A8R5EzRGeSJ2rsXzamCltfk5OSYzGZzqlarzQSYs7FnAdi5eM3Bawb2NACbwZ6GPQXvDfH+4b0AuuJPiMaBjr/9kUikC69dALgLeyf2duxtmZmZraWlpfzeHgqFHB6Px4k+egB+uQfwk2BPbkmg9wS4YocTgxyUOQrwyL2BG9TbZLFY0gFsBnUewFsASt5X2UvxWTE+s2A3RtxuQ3tVFfna2sjNu8NBQZeLIoEARYJBikYiFOfmKq2WNHo9aUwm0mK3pKeTMTeXzAUFlFtaGlVJkg/gdjPYoeFbsNdAGNRDyNRnZWU14+9WAL/NZrN17dmzxw8GEgUrkdFf1ZAhQxJt+CTwk9v/rkaHRjwQENT9+vUzpKenp0HL5wHg/QDogdj5tT/+7o/XnIjPJ9WuXk0Na9dS265dZKupIV97O/kB7JDPR2HsQYBbDodJBsDjqwKJ/DuqUpGkVpNFo6FMAF8NwJPZTJA+kgTmkF5WZiodOTKncMSIYVkjR5LZag2jvSYAfDeAXgXg7zEajbtzc3NrmAGkpqba29ra/BBakR+w7ZNbcvv/cpN+4vJaos2tHjRoUArAkqfT6foB5MMB6CEA9iD8PTDo81laNm+m6q++op3LllHLzp0kA8zRUEiAGLSc1AAs7wTwavGqYiDjc7xh3i4ALiV42gBO8ZkRgiAd73UQCjgXaVnb43gWErDTyYv2261WShs4kAaMH08FkyZR+ogRlJmW1smgx74dv1vn9/vXgZ1UAegOxSxIgj25/SLbf+vyWhzgqoKCAn1+fn4WNGMf1tgA+BiAbTxrcr/Nlr7j00+pdsUKqli+nJorKoQGNhoMpAcg1UYjaSwWAs3uBrUAdswg3/c10ROnAJ3b4m9lAJu9bTpuB5+puX1odj00vDE1lYwpKaTDubx1dWT76CP6JwaVz23p1y8je9as8cOmTRufnpMzA/b7xwD9wpEjR1ZDiDjRlzAofQCUPpQEfXL7n6LubMOC3qoyMjKAn5RMALs/gD0K+2F4Px6vJdsXL1ZtXbSIqr75hppgxxO0tgmAs2Rmkh6alsEswB2jEmInaGWo6ARRIsWkSQ+tToowiFN4SVG9QewmtCO0PLfD79FmCPRf4/eTFsBOB30vzMigSRACrq4uam9ooJoFC+jDW2+lnNNPLzzujjtOhw3vBqWvhNDy4TxOXGN9Tk5OHa7ZoXjvk4BPbr96oEtdXV2avn37prMjzWQyTQSwgRvzUZFAIG3tK6/QmpdeogaAm21trV5PKWlppGI6DnBqAbwwQCcD+BJ2BrdaFdPCWrVG2NwsAKIMaABVmBORMIUje8HLbanRrhZg1YAVRBLoPL+P8HEMdrQdYecdzhMBhQ+BwqthKnjtdmEaWPr3p9yJE2kYKH3zhg305V13U+SWW1JwTTO1Ot1p6E9xKBxaD0q/Vq1Wr8L1bkhPT2+y2+1u9tgnwZ7cftVAh9Y247UUmu63APgcZ2trwZLnnqOVTz1FHaDGTJF1AKIlK4v0AGwYGjUA0EcBMq1OS6k5uZTety9Zc3PIkp9PhuwcMkMYpIDCq40GUuF4/BCIDZHsD1DI6aIut5v8Djt5mprJ29ZKflsndeJcDH6m6bJC6+NAjyhaXXjpWbgw2Nmxx3/jcwZ90OEgNSi/IT2dDKD2Um4ue/HDUjhcIDlaMmoeO59Sj/r9mJSJp7IpMg6mxaug9Z87HI5qhUAkt+T2qwS6WC6DlrVCuw21WCxnrnr++Yz37rqLOpqaKAtgMYMWMw1ngIWdTuEIS8vOpmHHHEO5hx9OOUMGU/aAAZRZXBzVZGT2bD+2OJ7gFJT22uf7hLGGQburli+Xvrj5ZiFEVBAs4QSgh6HBGdwaAJm1OTvl+DUCYSNYAFgFe/Y1Hg8ZsLOW7+JIvhiL0ETCPnKu+5LsK74ky6gnqOCCvx5uGjDO53Q6K3HdbW63O3665JbcfpUaXQ0QcaRaXwbEtx98QA0AeT7sbwao3+UUFNwKwI+aO4fKTziBSiZPJlN2TjTaw63fC6ClHuDeTxDEj1FDqJTPmUMrH3hA8nZ0CKDzNwHsWvbOQ2sHAWDZ6yUT+qKF1mdmIcCOVzWEQJjX5tmMAFtwVVezYy7eB7Xsw3WYBX0h16a15Nm+itIHHdEHfeM1f2Y0To7yS9L35Parpe6grxqAXQfQSUUFBbQOH/qhYTNBw/uPP4oOP+VkGnX66RAD2m5wM/Ck2NYNaIfTT502p2Tr9FJbm5u6uvzkcgcoLEdJUkkJwkCitFQDlQ/IkcaMLhZtckPehgbJb7PF7Hlli4e6RQHmDmhuc3k5dVZUUCEYhrawUGh5LXah4Rnk/AqB0Pn991R44myK+f5UqmBnI3EMntqkF+fXpOUITY/rSOHrT7AUklty+1UCnem4HAwGfZFIJABqbC2Cdj3qkkvosDPPiOaOGMkx6NEQECFFIpIqtokoum1bG6Wd25qporKD6psd1AGA2xx+cnugYdUSGSwG4WSTI7Ct8S8oS2Rz+sjX5SW7w0eeLg+t//qP0sihBULr1yxdSoGWFmFfy4n8HqB2gc6XX345HQWzYsOiRbTlj38ko9Uq2o9Auwt7nbU6NH4YQG/fXUmDB/QXQgT9VYdbd5FKxwE5Eqm0OlKZUtgcCGAP+/3+pBZPbr96oEdhn4P1BtoBpj2TL700a9r8P1J6/wFBAJ8FAGeUqbTYOC59xVfb6ZMPvpeqatsBGBXpDTqypFooLdNCpQNzSWfQCi97KCyTNyiT2x+igDdIQfzdGYpSpstHsicEwdBFoWAa5eenUZwW1K5cSUHY2bxkF1HUKwOetbYLDGLkBRcIrl88Zoy0Q6MRVF144hWNzjt/BsObWvB+2vCRIg5HrVZrQx3b0V+18N6T0UzarBKCJnfj+lxerzeeIJPcktuvD+hDhw6V2traJJ/P58HebLfbt2YWF2cYDIYcKDoNa0KSNMbNG6vp/bc3SCuX7aCCwlQaOaYfnTxuDECtIZ1OC01N5PGHyYfdD2B7/EFyh2Tyh6MU8AQA+gh1BqHRAyGK+gIUxHd7Gl10w+WTKDfTLPriqaulJmh0PbQ5r6+r45QdwOwCcIvGjaPMkhLx2+ply8gFO74A1F144KHNdQx4xWZ3NjaSr29fSklPZTAL+yLcuAF2v5ZkKG+1VkOajDwKRCIC6BBoAuhJ+zy5/Wo1ul6vlx0OhxeK0sGx4Xj1QXlr6mo7jIs/3aJa/tVWcjtDdPSxw+ieh04nk1lLIYDFCzB7fGFy+SLkC4QpADAHg3gPoLuBfL/MJkEYmjxCdoA8xHZ6KEzusES7bCHK65tJV5w3rrsf37/8CjmbGslUWCS87VHlAgBGnN9JZTNndvsUbBs2iGU+9hOI5BjY7gx2NV55haBlxQoqHjM2HoarCns7Kdq5hyRodO6YyqAnTRbOY2t3cQqsQh6SIE9uv16gs30OrcfY8kGTa81mS/97/vKOaeOGaupTnEW/v3AqDR/eF/QZgIUN7nFDcweC0NxhaG6ZfAB3EN8FgmEBeA9rcoAaX1MUn3cFZAJjF6Bz4bMmn0TtriA99+eplGbRiz546+to23PPki49Q4TAxr1igs/D3k7Jz6fS446L9Rd7x6pVlAr7nNfW40ttQqvzWjte6+obaMRVV/E5RSEL/54VUjTiA1Hg0NwwaVOySK1R4bAwp8D6kkBPbr96oHO+ucKSZWhyq98XNL3+8jJ64bUraMSIPuTpCpPd7gbeQqDeADY0uT8Q6QY5a/KQAHkINjmoOlrCxxAMoNBAe0iBT0dEBc2upj1tTjptRjnNmzu8uw+rbryR/HYH6bKzhcddpaCOaTmntJbPnk15w4aJ37Zu2kTtW7ZQGqg5a3S23xnkGuz8nr32bbDfc4+cLoQL+xdCNSuV0NtYvJ0mrz+bBDgsyAkwcY2+XxGNHzne3UUvkiZAcvuvArqSbx5f6+alJkpLs8ijDx+okmQNOTuDZGt3UyDEkWcyeaHJAwC51x/pBnmwW5PDBsf0Znudvexu2ObBCEe0RakxDJD7YVs3OmlIeQ49e8tReyn7U09R5QcfkDEtnSIazT4oY1rOGW/lJ53U/fu6jz8mNce7Y9dw7Htco3PGHD7jpbecIUPImmqNSux4Y/u87mvRoEiwgWFg6DtUOOKw21wul5NlSnp6unrAgAEpGo0mlavh4DMD0/4DZQB22xExP2KE8+TxWyfsfefq1as9nAefBPzPu/VSoqw3Ydu99Rz/XmoVHnIbBzj2UEqb9TxPb4VQov9WoCeeyOv1+kDjXaFw2DVoUGHq+jU1VJCfBlBzBJosNHZAaHIAnal6iCl7GNode4QXzyTQdZns4OdVrU6q7/BDm4OuQ5N7wxzfHqURg3Jo0V1HUYoulrPWtOJr+u6OO0ijN4hAFnbAhZUOqRjMXi9lDx1Kw845p7ujW998k6wpKRThUFyAWw2qL7zuDHRo9araWup/7bUi3E+AvH07ReyVMftcuNyiZCgdw0B3QKN34Lq93G5paWmeXq8fajQap3J+PT4yEXWTC/qBm8gVcWycFuvxeFbj+N1sdCTNgZ8P4EOHDlWPGTOGS5Sx99YEgarqDTS45bi1oYDf7/ctXbrUa7fbu82y/v3769LS0sxow4L7peMV48TjlaVYfglgbgRaW1s98ZJlUASqgQMHchUlEx+bcC6PGxt+F+zFoct1FtXFxcUGzC0L5ir3W83nYCsUpqMPu1en0wWUMm3RfzfQZafT6cZE7cBuHz6iJPW9d9bSzBNGABAx+ztG16G9xd+y+NznC1OrM0QNHR7a2eQiJ7R8HwiHocMKaVauiXIyzGQ1aknPy3B6DR05IofMBjFGZNu4nr783e9FoowpJyeW0Ra/cxy2yuD1+2n0xRd3d3I7QO6oqqLCzEwuKhfT5qxO8crHeFpbyYW/844+Ni4lpdDOj6SoywHb38yePSKdgXR9RsOs8LfhJnVSDP68ejjQZDKdVVdf97sG2PgHiebbX0pGuQENjRo1ciZu2n3oSzvfyHhm3MG0zAG0xU/6/SFosB9s+1/p10/p4yH2FRhR82pQP4zvELwvwGcW2re4qFiN5RJkXGfQarW2AZz1AHzdnj17uBoRZ2cWQpAP43Rr3N90vu89tKqsCG03fmdHG40FBQX1AL0X507FzgVWShXGx6ajG23VoT87Ro4cWbt582Z7PDmKrwfn15SUlORxv7mGA1djwmFcSzGAY21cNwFt7QH2GhXF8G/X6DIA7sUFtft8vqYB5fklthY3NTQ6KAJNzM421uw+AJxpfBiUvd3mpeVbmsmH4T1sZDHdNnsYTRmVRwU51kMyb+s++ZRaa2oplePRlcw28cqJKwC5F7Z2n7Fjxdp5fFv/7LPQzFoKcVpsjC8Lbc7x71GAnSvaZIw+jIrLSmIBfLye3/ClIluh0cM+0uUPI21GFgUaGtpwzTZuBlLXihs/xGKxnHrHbXfS7h0NlJufTSKpVvphkLOjcvv2LbRg4Yv548aOOxZao6qsrGxLSkpKCDeZC4AwtQ+APPg5D56lN0+G7du3q/A9ayouoqlHH3QxpaKK4vcilmf9+vXeqqqqONGRioqKNNBuBkxEo0pRPxzoBKXiV7RKd6zRuHHjuDAnMxOhvbDxf9ywnzVWe3t7aPny5ZFe6KmKNdjw4cNNmNg67Go+uMe5QtRLIQ9ug7XY6NGjTQAl91GjgIJ9Ij5cj4+vJ/GcRxxxhKgMDK3Hvxfn42tDP4M2m41JFyw4TRku+XSNJM0LORyp+1VVQffE/NFoZLXZHNKbTI2RYHATALYW92IN7rUf7Y8EG7wyYLMNY/anCPPEuG0WKbKk08m6lJQumIYVOGYbhEUNzp+r02pnh93uEp6fYp6iC5aioiaNx7MQ7z8BK9xUXV3dpdQuVPfp06eA07x5XuGYE8OdnQbOshTZmmp1VG+1/tPhcDyG37J+8v9Up/AhB8wokwNjEeDJ31pSmhXNzrVKtbUdlJ+XQT5vEJo8Sn4GOSa1Hxr+0zX1dPWF4+h3J42I/oDN0+s25OKLaPsrr1DnnioyMXC5tBQGEIKG/E4n8RL+xDvv3OtPeO01qlu7llSg7UFOgWVVzE44Jckl5HZTa3sHDTrh+O4A+kjbVlWk+isisAkewijMD9Pgo5jys1BrxQQSQMdk4AKWfRlofK9Hjx5FRX0KIeTkQ7oWvmibrSMWjqvVDobmOBNAGYfJEVU0RCfGdRf+rgG1b8VnTPUEaMEiMjAZ+uK4cnxfiD4YebUAux3H7MBv90CrtDGmCwsLcwCeYv6dUniTaaQM8HVA+7QAYI3QDg2VlZXuAQMGpOJ3fSBIhuCVNaCBccrt4to5N39PfX09axKvUgmFNZAafUpDW7noTz7az+NCn1y5V6G2rIk6IcBacnJymqGRWgHajjht5d+A3hpw/TzBy5gl4dhM5dhOnLeCz4s/m3GMLz58EByW1NTUYvyejynjIqIkQijkTvx+N8bMzcVPNAbDKYsuuCDVX1lJGSUlUjzNWTQCQRZlM85gUMkWiyYnI6N/3pQp/Qcee+x0tPcZzrEbgmLSnq++GvYZWOLAqVOFksDxUqK/JcK2oNGo1qSmZuUWFWWVnXrqxJTc3Ap8p1395psl/4RZePiRRwpl4/d4SJeXVzD3uecu4/RpCHh27H7P9zwvL8+K8402m81nOyorT1o8fz6lZWSQxmgkf10dbayrk/787bdHYlw+xpzfSv9CCPaP0ujYg5BcTN1bcnP1rpKy/JStmxopc5pF2OWsuXkVjkHu4iUzScUg7y4ZxeNUD9t8R10XVbT6qMnppy4c5PJDQOA3Me+7imaPzqZ5k4tIn5NHx774PH0852RyNjeTCu2ZQeELRx9OBrz2mzOb+kyf3i2JNr38MgUDAbIq+eoRRaNHldRVL4SDPy+PDjvj7LjgkYLbF5Lswfc6kyDoUehFQ9l4boft6WaAwq5cO2u9VMERcQPxOTnsZvohR1x8iwm/AMZBxUIjH5NyLrerVLjlwQkCFFs7OjoewoRgye1TLotBzTUAzoDUP4cr5YoCHLHzcmRiE94/lJ+fvxsAt+J3hwG4R+D9MKVsNttBDF4/tF8jgMR59iugHWvxmQngOReTbYbyW0kBXAi/rezs7HwYbXE/BAsYMWJEBgDMNQCHoP0RXHhEASozDZarrETDim3ZgnNtxDVtLC8v3wwBtGvTpk0dCsfOwHHjISzOwziMVSr+suzFIcEt+P4NvF8OAbFHccloWFvimMkQENcAlPnsGI4fg/7vxPsv8Fl+IBRKyQRQDr/nHsqaODFWtix+j+IZlvjMA2bXsmoVbfvb36jivfcyj3/mmdNw3l3Y0zgD88jjjqNxL7xAMudVxGlZ7AKFAxiMgRw7dlDlsmX0xfnn09ibbx5YOnly16iTTw52LlqkG3/ZZZQ9ebIIzf783HNp1YIFhvFnnXUK8FMLe7wNArQzNzeXTcGZOotl9rK//IWm//a3VPb73wsmsBZ/56amkspi2eVpakKXfT9lleenOeN40DHBO3HSOmi61uEjilPeeGMVjRpfSh7cDo5qY9ruDUOrY85YrTq66r6vqLAgVdpS30W7mtxk90ZFZFxTN6njLBLs7AiLxm7rB9+2UE66nmYNzaacKdNo1qJFVLngNcqaNJEKZ/yGTLnp+z3VwQ6t316xW0hDtuXjobGcvsppsyquH1dbS32uu470OjXTxKikVqtCW/8Gbc5Xh89CPlKnZZCu7xhyer3NuClN7AhRAKnhBJe40HI4ushkNnYLsVAwRC4whljue3QfAcDvQ6EgNTXUx5052nnzztOuXPEtxsjKTj9eszd+9dXSSZjM3wC8VbzayN1nYDOwMJlPvPbaa7Jef+0tgvYW5+lyOoyrvlmRajZb5mCCVmPSDIQwOHbZsmWq119/nbZs3grpAUaj1lBeQU7KrBNOyDnnnLNHQysfid8vY4cUgDbjzjvvyHn15TfIkmIlLpsP7Whc8OrLhw0ZMuQY/IZB5ABFz8Bx4wH8Y9CXY7Radclnn31Bn372CW37fht12rtEWLNer6WBgwbQscfMyPnNibNGQIOdjPY+wTUsHTVq1EqAvRXXVAQhMQ0U9tizzz4XbNAvav2ppKhxwWuvTBkwYGCUa/P379+/C8yDx4EzpYpw7hlfffXVgHnnzaOsrFxRYMTv9Rjvf+C+8ccce6yMOelUqdUaHhv7nj0UxVzgnAamwZJS4Yi/ixkeKio88UTKhzDY+Nxz9Onll+tnPf54P85t4KCqrtZWsq9fT367PVYZiY/HMXFzjwWGrk8fOuzSS6nPxo205JJLyPrRR5b0Pn28I6++WrP0mmtU026/XdRZGA6gfwbmOXjGjL643ydCWNVj/Gtxvybhfh239sUXpXQwz+yRI8m2Zg21rlhBu8FMT1m8OAqJsBuYa23jDLB/wXH7Y2vGcby7GwBoZBCMm1gy4KUFK6ihzUNmkz5mp4djgTAc7TaiJI2+g40e2NxCOo2KXAAT7gNpjVrKsGqBaYnCALmsUQNnGEQoN/5M9sl06kuVtOkaI5XnWyh30mSxH2xL7VNK6SWl5GhpEVI3rATOiDBZ0PYgQNhhMtPJF19K8Uy44LonJBkTNMomahDnhfmhGzIRNnppNNjQIICu2EUCn3uRKzEYxM4ytqvLSXtqttOYMaNIpzOwagaLiIoknTjQw0ENHT1zEsEWZDopb9r8PQ0eOILycvME0D/8+H1ofD8Z9cYSzpaL3xscyx7kYnQ3bU9lDRXklND4w8cBFGp66bUXye3xUkZG5kiAYKQ/4Cs+ac5J9N03m2ncmAk0bNDhilkqEUx/evrxV+ieu/9KDz/y1/K5c+fmsq8FbZsrdldQnz4DqaykRPR56dKl1MFpwCoVO5WKYVfy0uIETMozMDmPfOGFF+mxRx4Dq/HTqOGHUZ/CgdSvRBtjTrhkj9tDD/zfk3TdNTfQeeefa4WAOtNqTRmCfhSASaxkRxnaLWNTxucO0rjDJ5PFaqJNW76nP//pRlr8xedTodmbwTa4f98y0AHqTBzTpw0ADAc0NGHMFFEteBf6XgsByiaEgC8AybkQPmhsLgcunLGcB1FVFVuK5RLhRUWkgYD1QBiwACg7+mhas2AB7V650lA6YYLMsVsAuOTG9yHcY74ud309uZuaxAoO7GZK7d+fVAYDOdE+VyEee9pp9OVNN6nPevNNXfHYscGKWbMM255+mgaedRZ7/2gYBMrya66hua++OgFAb4ewrMT1HWtvayvZ+eCDNB0KqGPbNsFAvoWQnvbii+Rsb9+G+7ABzIorF/tob9nEf7tG5xP5ITkbMUnqi0uKfNmZKca6mg4qG5gPkOPLoAzNHhbLaq5ghApzTNCqErWHJTLjaC90cRDwk6KxenBqjVoMNgOdYHNz0lvQIJHfJdOoR7fRpxeW0/QBaQlrfOtg7H5OUmALpCpM2YyLSMo+l9RaifoePZ1qVq4QTjfYUQKhDHQdbnRTWzuNuuHPlJqdwXZdVMXafPNDrMjFr1hCC9rebyIFfD727tRAkrbEaauU4GKPqmRB3a1WswBRQ10DjRwxkt5++90IbwxktnX3dch1q3h+q7NyeWqMAU8CNEhmi570Wh1/ycsrxriMwmRm5xvbv2qLxQzNp6ZwJEy8+mIymshg0HO7ZlxO2gnH/YbsHV76zawTRREOGV0QzkKcQwdNO27cGGpr76B5v7uYdAt1aTNmzOB+SinWFGojdyyOAP+4FBhPaGxcunsQQD4UlP30ltamERdeeAlt2biTpk85hlLTLeI8QgOEw93XikkMoXc4RcKj6d03P6F333mPHnz4gRGzTpjFBQqKICBdGLds7pNOrxNj4AcIhw0dQp9++ik98cSTdOmll8zAte+GkKln5xWPCY7VazBGXLFI2N4yTxmMnUmYUGw66NFrie1qD0w9TVqa0MINoNfNXV2UA0EWRD/d0NRFoMVZhx0mfDf8nIBM/N3yySfqsiOO0LBpxgD3ANzMAFwQGlvRRub48YL8haHld61cSQNAzblSEd9aLjqqBpUHMNWwuV1H33yzeuHUqVrrl19SCsdsFBZScPVq+v799y2DTzxxGgTzCIxT2YfnnUeD0C4HcXHEZ8U771DJ2WdT/rBhjtra2g12u30D5lpTgiPuF9HofKIAblQ79j0Ae9u0o4f1Xfj+esotyRFe9yBoOWeh2Rnwip+qHXPAJ5bJJXIx0DEwQaZBvOPiZA6C0fDfahH1pmaKlYab3xakc96qoT3XjyIjW5qe70jaMT52ycJe4t6AWQLovA075Uza8Oxz5IVU1Gm1FED7BkwIzptn23zclX+MU2cpuPYhKdxSS7LKAKmPPgQhgqyppB9wDLSftxnXV40BtilAV+/jWIPM93o95PX4hOXhhVYNhUM82cM4tsvtdrMfwyV0v2L24ivOnNECMDmZmZnF/CEkNWm0GiEYmYZyRVyWQZjEcbtdwufMAMSSPwOis9NO9k6HiElgjYbJwtejv//++1U7tu6haUceQ20QanxeO9iKzdZOWoAjKzMLQsHAsoUG9BtKl/zhMqpvqDULoQcm5XA6yNZhFecI+L1C4PITc6DFx4N+D6qqqhz0m9/MpZBfTVMnTcM99lNri0+wkQCXDeN8Arw3QLtx6W29EBYSjRo1mmqqa+ics35PT/7t0bxzzjnnZAgRdvRlaHV68vkC1GHrRN+04oKHDB5Gd95+F8068fj0vJz8WRAyO1paWjZg/IRjTSXYiQeAsmO8Q+Tscsalpyoe18jU2tvWRhqAkJVI6/btNPqFF6IDp0wJsC3UXFWlWzV/vkQbNpAhPz9W1xBj3wXhIHKscQ3s7PWAHTLQO6FpC2bMoGMefDCE+xFmv8qORYu02++4Q1U2fboQJixMrTCpmlatUg86/ngVqK9v8oMPar865xwazhWKIXSKBw+mtffeSwPnzMnRwSTb9PLLRnnzZtKdcILor2vXLuqEwJhzww3U0NCwxeFwfGez2SpwRU5liZd+KaDzBmHncWBCV2OvP2nusL6PP7OM3DYnaLhWpJ7aQ6CqykoYh7VyJjdjvkuW2HtEYQCagc22OQNd2NRcwhl/RzSg9Hy7IjjIKGPCqPeuhDq+joFcn0Bg/G3gWTtIMgymrCEDaMAJs+i7V14WEpbb5DpxLQ4HHXXrrZSakSYUqywHpeDmJ0lwtCi0KDor+2HLlhxBhv5j5M7GxlpcWx17mxXhti/Q0f9gyE++gEcUy/AFPdC02liNeqhWTHKx9MOrTQrYGbAMVomXTMRnOK6jo1OYMoFgAJNWFlpUlsM9V4W6mQQX1HR0OQQwuPPhcBCswoK5rNEu/vxLSk/PArg7xbg3NNZRRo6Fzjh7NrV3dtDrrywkszFDXLO9s41U2iDV19epi4qKuYAAOewOmA0m4V/wAeiwwTl11wKQjwOdL5h78mmCZZWXDwQraBPRjtDw6E87pWdaqXxQOY6xErQvNTY0g51YqbCgEOc0k8lsoaK8fnTZJVdSYVFB1tQpR6qZ+XAdfr6GTpgJRrMhZjpD6KjVZvz2cvr8889Hgd4el5+f78SYGOKj4fUB6GAmLFy5qq+U4AtRxVzxYulVjZ0LkHL5MDUrl2CQH+EVzisu1h12xRXW7847T+o/e3asRgHb+2grCBDz8iyHVXvQL27Lh891aIMzGGHO8ZyIDps7N23jffepXI2NpGF2xvMaLCDQ2Smxnc9KovCww9T9fvtbc8U//kF9p0wR9noaGMSKO+9UH/6nP1k3/u1v1Le8XKRMRyD0t69bR3PAHKDFq6AE1uCVvfM2xTEb+SVt9HjRVS/A3sDLESUlWWPGjCszbK91Ur+yLLIxyGGf81KYDZrSK8ovy9QJjsz54mHFDg9EEowBOWb3kklLosSLHFVWEjR03KAUMiq9jNpWk+RLCIFQKT7Z+kehpp4VHx1586205YP3xbIGF5yox80qxSBP/OPV7GiK2ebf3CuFm2ooatBTNAAWEY7RduPIudBmfofL5dqFa2s40ACzHev1ucnj8wqtxRTZ0WUDuOq1RoMpLRQKpsuxNVRBhmPCJSJCNbKzsz0sbSAPyO3rIqMHNr0/AFYROoQAHEmc1+XqEsFAPNFNRrPkdDp0VXuqQGEzyOmJ1exTa6O0Zs3qqA+oZZf1Gaedqp88eSplZ+XSNddfRjffehOFQ7KPKS+flqN8LSkWsVwYCuN4tagUpAYLSLvwgguourKBhg0ZQV1OOwRTiPZUVdCowwfTU889QLNO+A2DIBzzcanUFRU7pbvuvpfeePVtKu3bjyyWFGh6PQSBheZfOZ+2bN1s4YxAnUYj2IDT00URKdQt1bIzM+mLxV/T0888I80777wp7LzyserHhOBxC4R81MXHsO3tde3jjOYpwYyQQatlRxqEGNcfoJgpIitL/bIJ58C9Jj8AJnw47e0wAzPEkiwzqxB/h+MZ6AG0Zdx7b7pzqZgt8G84hwJSRAgGEzQ3WE4XgLoT5/JPuP32Ua9//rnUAc1t5rRo7NUvvUQ1y5dLmfy4MbThA5PgpxeN+ctfKLtfP3d9ff16aPMNmIP1vMyqzPLoL63RBX1HR5pxAyrRmcZ5Z4/td86V71JaYToFfbjoQJC4jKKb1EJDdEVYm2vIIzMolAATq4pSss2UmgKKB17O694OfO/twoEBJSAe3509IkfhEbhpre/HPGzMbFkgwFamkExS6CWKlj6EgbdgIAvpyOuvo/f+9KdY5RrQyKNuuY00UsxKlp21UmDdX0nWspMOtB1tyQEfSdB2lvHnk93lqoQQq4RE7lBoe68D7Pf7YMt7hI3Itvr2rbtAm49mra0S9rFSq16cU44Iiooz0VfLl5lGjRoJja4ht9sF6m1AW34ANyKYwsEYmgS7PBAG0AFmGbiKyLGitGyzuzxucTslFTQTBIfRpBHzkQNK2IMNaRxdsmSJgTVyRkamw9Zhb2PBEjMjMO7+mAARdfcwAVnbsqmxc/sO1Ssvv0aF+SXkdDvEeWvqq+m00+bQW2+9TZgHraCZ7WBAHEEYBZtJycnJy3v5pZdyxo4Zo54//1oqKigBnddTVlYGbd+5nR595DHt5VdcoeeH6UYiQXK5nWykdGtlZjapKal020230slz55Rgns3EeXaxicL94nnvQV9EeDVofKJ8lJQoSDdrcy5aCtAGoI3NmZkSzBz2dUQ9brd6wwMPSCkw51ygzHyTuioqKPP443mtPQK6rvFCo7sBfr75XgA9jeMyYAOhb6lM3Td88IEmUFtLftjeEtqXebkVvy+eMiUK07ER2ngLxr0R9nr69CefLPnwyCOpmFkrzIL03FxyVVaSql8/sWzsrKoi07hxdNj8+dTe2LgFdv5qUHaOj7AfbA7+u4EuYMfpm5CyNQD6nslT+/XrW5BC1RXtVJipIw/umSOigZKO4r1ETsYubkpZYQadOCGfjh6eRcP6pFEm6JpOqxbPaGAlHsJxnb4Q7Wj309f1bso0qWlKH2PsjNXPxwIAxYqrSlk7U8XogDtI0q6biIY+Ln46+frrqeLLZfTN4s/ojBtvpkHHHi0ccDxz/V9eTBGXHwLAStEgtDkERcTjJ+OkeWjb4HO2trI2r1HCDXutKsMTKxjxkRcCgjUM/80TsNPmEGymuza9gnReyw/LMccCa9vYWrJEHq+TjG49+ZkWyhFSqQ6u0WOyQwYgHSK3IF5ANzUlXU5LTVE3NzYDOFkCKFV7GujMM8+S3njj9VReRuMQzYkTJwZxz7pAr7/v6upq5KAV2MC5HIDj9WNiu42CfYVDDHRdFNekf+yJx9X4hPwwUwJBmBu2Dho5apgAOSZjTWNj41porx0cQciaEvY52H7aANBtsOMrypsaG7V/feABysosgOmhIq3aRM+/8CJdc+21RiMoLxMBv89BbNFExJKhnSzmVAhAPTW31tEf/nAJvffeeyPYSckFOlWqmBXlBANh2u9Bv/YLZeCoSWhXDYDOk4ufCrT0d78jXWqqLghAsjMtit0M+5wf6qmCYLPBvBs0cqTw4bBdzlSO25DZjwRlUbNkCb37299qJLdb4wVdd3JhUauVfG63OB9T+PzTTqOUrCxvR1XVbozv92CGeoxFdt+RI7NG33CDZd0dd1BuWRlB6pEBfXOj/Qj6YUMb5zz1FLk7O6va29u/YU87Pwz056Ds/wrQldVugtBz1QIUu7xe/+gLfzcu+/q7FlNuejG5/UxTMVig6w5ip1CILjixnF64ZlL0QFVg+X/OYzEDMMUpWprRz9ojo6aOJBft9cKppb1kjSf97ieIii4iSo2ltp7y0ss0ac03nNUWLyxJgfVPScEdS3DjoOnDGnRRRRGAlR3G1smXc805jg/YDWlcrwxy78sZytObnc5OimkYheqElbry0cSlNQ7a2euR1ut1sYvmgC3IEZu9je1yEeWn+gHqHh+7js5WcQzFIpj44sJTpk5Uv/HGQmrrgM2oiXmy33rrTdi5n6ruvff/jJdccomRs/G4BibaaQaoOGCG+Xkkdh8iot14dKzZbBLlu77++mvxd2dXB8XYeZTuv/8+XnVoaW5uXgVt/iU7ZpUQTe6gCd/t4r9ZUNxy260DXn7lFWpt5aUprRAku3bt5LgCyajXCWbENneQY4TkmB+Cr0Gtio3rhx9+SAsXLtSecsophezs1Om0Ij/Bhr5GFSd0z2GLKnxXxRpZ+H7U5Nm1i9xxIcvhpdCsrtZW8UARpxcmGEA76Pzzw5GY91M4Z1gI8GO/xOi0tFDzwoXihoqSwRBSLKCjACknVhmGDqVTX32Vx4UFng2CtV7Ed9jtawH28umg8A0YSxtscD3MBnZEC4EEATPpiScoq6TEi7Hcit+v5xUtZTx/tvJlqp94nByn77jJO7nu+UmzBlOf/FTaWuUQGWzsSfZ5AyTBngO3pKIsowhSUZaeumOtZY+N5K4mcPtG6FBMtPAB4vb7XhnrLcOPVb9fWXDwq2JiB3c2+t3emPeU3KzowNmzY5qcJVPHLpX/n9fHouUi7GnnsFh87vCQadQppC8ZCo3mrgTQKzGfHAejTHHABUMBaGV39+4PeoU3OhQJ4JKDYo/RazlBK8feR5QhiAOW6b30A7cj2uMYwRCCwtsfuu2227v7yppOjsZMAKfTRdCslJOTQ48++qiFI9tKSkom9enTp8xqtabFSoEl3tbYZjKZJYyFVFdXF+tvrJIWBICZZs6YyWHIDbjvnIm3CV9wJl61slfywysxN9awr8OgN/iOP/6E7jbi4Pz6639CSOoxPrF+BtgUCvroN7Nn0bRp07s/5+3iiy9mbW/mQCOYAIqYjfRUGN2bG5K7Eq810JYN0Jp1AHwTQM5rVBzPW4vv90CzV4KSbwFImb5Nf+wxMlmtIRECLMsSO2iqAMJ6HMt7IwDdhPvOx/N3dR6PaLceNn4FTC83tDQ/XATCjbPn9EpEoR1jUY+9neNPhlxwATEfr4VZwW1Wc3QdhNBE3B+Yb1z3oEFxAncpYSA/W2aj6l84lu+EGzeUacpWnVZlP2PucGpv7iKvN0x2P+eDR4W3k7Qq+nhtC6n2clMpULlKan1gLLU/chh1PDuROl6YQJ0vjSPny6PJ/dYE8i8+jUJbX9x7M9PLKTrgaoo6FQgGpb17SCN8eVSzluRVF++3ds3OWN9n5xCMDUxlC0AOjQeTIuLxYiS1ZJ14MZeiqgfQeYLuUWh7+EBZVL05zfgzjljLzc2j9PQMSktLp9TUNLFbrCliyclisQpbdd9l9YO3GxdUB8oSUJbfQgCvb/ny5SJDrreNl/JuvPFGGjBgAG3evHkQqPWs1NTUIZxQIvXSMOYqtHCbxP6DxG348OGiKg8HtPCz5/FRq2JLupSdhWQLBMEe/KaGWURZWel+7VfBLo09YHPfKQhzgj766CMyGA3dn3FgEhgJFLFGjz73dkP210LKNAko+sCloIf3TmVnJ0xuWhpd8uabNOzssz2Yx82C4SjCON6GX5kQzoQ23MoeUKzJnWvW0N+GDWOzIBt9HFZUVMS5AzLem5RcBcuKe+8VgAsm7J0wE5bdeScvk6ZBiJqysrI0CrbknxPoP9VG7/a+Axh10AxbIN1HXXDOYWP/sXAD7WmwUVpWCqn1GuHsSsXr+i0t9OXGRmnaiDzFt9ZE7g3rSAOGruFaj2BqYHbEYQ/MzCPSGlKp36FoVwXpJt0fO+vIu0mufIOkrhaoHIwFh3HzEpnMnm2t0Bjy2udBgXNIP/HueLEMyf3JxRSs3EAyLx+FDfgdQB4MQ5uDco04kYyjjo02NzZW4EZvgxZqU+6f/GMGZOrUqfTVV191P/C1u5i91F2rXmy8PMOBH7Is9+JTl3oG1wgw7I3Hk3pjFxIA5Ya9XD969OiCxsamrAugORgsvW28/DVlyhQOTMk96qijDPGVgd48/GKloMfGAku5rgD65laWIEMQivEKPCEFGw4eeiUhqDcB1atg6+pysZAJP/boY5o//OEP3Z8vWLCAmYkWwlTqLWEoceNagWz4mZXveKQPnzEj9gguDC0HyKSUllLRtGnU/5hjyOV0ttbW1m7nzLnCwsLhasgbY0KOK0+GsiFDaOBJJ4GhBsUTfhpWrqSaCsxN5Rz82uBy0ZfXX0/H//3vwzMzM8dDMFnxOoaB//n8+bRn+3bK6KFdeaC+gO0+ZO5cS2pp6SgIxnIOFGppafFSQkWi/xTQ42DnTCU7wFEBwG8uKUkrn3fOmJTr71lC4ZQwqXVqEVyi0cri6p75tJKOGlXAGihqPfyUaGdxPykCBapS4wZAE/G6N6nZKQVqquEa7H6SV/6VpL4nk7ZoPEkM1DEvUujjWRhwdvFCI0RVIngkNiKYUCovhb+5h+RAkLRH3C4Fvn2U/AB/RMt03SSCYyJhCRZCgCIqI6VMv4q8bncz9x9Ar0ywjX4cNeJYABixYAWdaKdFKT8VVQAvKwEzGtz0fEjt0khkfxBJMb+DKnEu4HfxB2JIvQGDQ22DoaADtt0uaL4mTNSR77//fvbSpUs1d999N63EhOxtO+mkuaDfHo7Ci/TubQ2BlaRyTOk+psIeDhuFGoaG4swrXaLXIrFbMBH0+J6z40xNTU37tS/i9XsRdhR7Mq584YUXyq+88opq1apV3V+dd9550j333HNIk1qnvMrK+3MXL+ZlL56vnMnHjyDgRBFHTXV1I3v0MX41UFiZGOr+IpJQOV6lSLK+EybQ9Dvv5CSiMMdIcOzCkquvVi9//HER1sG/5bjlikWL6Kiurjy0NY0zAzmvoH7VKv3XMA2sSl+iijY3KO3zhPt43jy6YP36UZgnx+IcNQD7GrAwN/2HbfR9tDo6xOGi32Owdl5z8QQaVJZJPncg5hnGoGlxQ816Nb2zspYqm1yxmAZJilqPvppgzlI4oKZwiG1mftVg54qtZgDfAs2LEyy9pFu9agaeQKox11LIS2LtOcwOtbAK7/HKx8opFIam9337AHW9MJI8K+7E32grbIl9H1KhbZkirphtbhl1DC8RbUP/N0NgNcU9nQcvmrD/sHEACZsmaGdPQ0PDElDTd2pqat6CjfsWtMU7+Pvt5ubmpRx7wFT7QFpOrVZzeSq1EqQTD7IROdu9CgcVJ5LodaB9Kmhbzv5yAPB2MAwPGEYIO02aNGl/IIcC9Nhjj/MSu643H6Df549mZmbJ+fl5+3ze2NhIu3fv5ii7wrS0tP4QXKz4NJxSq+Sqi6jj3Nzc/haLZRD6lMJ96LmNHz9eedR1D1MlKpyZMpcXf/bZZ/f5dseOHXTdddcdIAl4Xx9KXFrGU744go/HBfdmI9r5GPtbfE/q6+vfxT1aBEb0Lca9kcMspARpq0pY8mDhwMwJ97ESc6VzxqOPRlPUMReHWonjcsKW79y1i+9JOcey64zG/p+cd54AilYRPGajkUadfLJgCpLCPHZs2EDf3HcfzDvLdBYSMK1KlUOk/zTQKUE4dWGC7wTQNwWCYccdV08nr9MPMIZJCmOPyKTjdVJfkO5+czMpxRDkjJmXR7UFh1HY7QP4QKcBwkhQJQAfCWEPGCisNlOgchN5P7+m+5bqpz5IUr/jKdTJKYdcs50j4NQxgREEmAHqsJxKoY5GCAIOAsEe1gqQs08p4mZnlZkyT76TuhyOagiqdej7bsUMC/6w9j5QeIEIdeU11G8xHt9AgPwTE2MZ2l+GScbhjGvwPXtUwykp+9uaEAjszMmCFijDJGEFYYTm6w/NyM9+0/emGTnkFJMqFZp8DOz0aRAKAzG2KTARnLzGPW7cONfXX38dPieh1FZ8++ab1ZISwbffdx6PqJ5F48aN3e+7G264gSfkYNDSE8rLy6cOHTq0D86dyvvgwYPzcc4p+G4WfjP673//B9cd3Od4joXHRBYZfT0tpLhLAsD0Dxw4MHz77bf3btsnLEX27D5nwmnikjJ+d2Jhuh3t7e0r0cYHEMLvMcBbW1u/gnDkDjZAKHk4iDH+zIDEXVJuOqdpe73eJi4PxeOWUlAQ8+QrWl04e2PefSPay1px8820h9fJld/wN9MeeohOf/ddKhs+XFB3raLdl9x4I7kbG7MwbicA7IfDzk+Pn/6/AejM6zyYzNXQVt/jdcsZc0fQSTPLqbO1CxctC6BrcUN5+ezdZTW0vcEpxeoAyNH0k26jkMsP8IViIBc7g57rvQHsQSPJMODdKx4h77qXu8FuOvFtWFIDKGz3iWqyMSHBwoGXzFhQ6CgCsLPjjdsTgoTb9skU7HRQ2qxrSJNT7AP4NoJqb+abFw95/aESSL1SaKU2ASaZz2QycZmoOsULXavsdbjxnCTTwTnbffv23a+NhQvfIBzbF9R+1vDhw8+GJj4rLy9vLrT1MGhSDYC5z++zs3NIr9NG0G5qS0t73/nz56fgWPVzzz2rRzvMFDlkswvX5r7vvvvk3oJ+evgB9qYpwtLgYmcXXnThfse999579NDDD6shjI4GoC9CHy8uLS09F0A/CwC+KCMj43J8d+KOHTvT/vCHi/Zrm9fGA2IL7r8GHmOqXLasBXOp8Q7Yr4MHD0kQshrhwFNJ6gNPaqUceKJmjsZiG+xgRbz0t0PZK5R7w/fLBSEZiT8rMFGjC4ERK0oaBYvJys7OLsT4pmDSU1d9fYziK+dkwPIDRjjYyFZRYfznvfcKyq5RqOKQsWNpzCWXsK/Gd8yTT4qaURHlOBZ7n5x7Lq9sjMJ+DO7lUAhxw38D0Lttddbq/BQXDt0DcOrumD9ZRL25HB6SmdaGI2RRR8nT5qRH3tosxcsOpYyfHbVMOJtCdhs0sizAzRo6tsfoeCSaIuzqrkVXkr/6m5gENZrJfOYSilqgGexu8Vuxh9T7viptxYRAFFreRoayCZQx5yYO+NiB/q7D6y7FmXpItvmBvO5igoCsgNaGFKHhVZyz7LR1Y5K5gB1RnmrixIn7tfHww4/T2rXrzbBvpwJAl+NGX4eJNRft9bnssstp76pkbJs+fbqwZ0HBjf37l9JTTz0lPn/66WdJrdEaAbZcaAf2+BqWLv1qv05nc4kuUiKO9zMjZOFzmDljZnTChCP2+/56UOg///kGDUA3Dee5GPuf0Neb8Ho5tNHM119/LWPCuHGxAKJEbavWgBH8mZ8TEGSg93QwMoh5anCGZFtb2/e4P40LFryyz3RTCaCrDng/oj2AGrf9uao32IRHAXa7skLgVnxi4cR2ugUFr7nzePhFzjxHA5UAhAMd27ZlfDB7tsRaTity6SUB2Iy8PM4rZ+FrWDJvngjs1SkTiwE/45lneBmXc0W6CidODE286qruSceg37FqFa1je95qPQb7kf369ev7c1B4zb+KcqXIHV8jL0/UYVKuw14ydFCf7D9dMsF484Nfg17qSA+qxZlaBr2KXvpoF10wc5A0bnCmWFfPPesetW/bSgo77KROTY9ltKmjIuRTVoMRqHTYs0lytJHtpVMo46IlZCwaRrqsvtGU3y+RbM8eQxGvj6Iqo9CsjAf2xMsRtXgvwlz5bzeEDkhU1il3Uigc7OAUQHbCgU63HZptTt2JFzFmoVKmnhxP6+wGfDyKX2lPjBEmtw+SvBU3uvrUU08d8Ntzf98dxsqtud1dNG36NDr9tFMNA8vL8w0Q5ryOvXjxYtjFFQn2aKyLs2efJIDe0tLSw7NeRSOGD1effeaZpj4lfWnnzl30JLRHzw3CRo5lhO0v8JWUfQ6H9S1YsMDCy3I9/UIPPPBXevPNN2nGsTNSB5YPTOVHb9XV1RMH2axfv67XsXv88ccJwoAr0MgidqAHSGNLbuIJO+28osNe/pEjR2befPMthnvuuVusBLCwSDyu5xKdVqHuIoyXi3rsvS8y7lNYwV04YaVAlSgwmKaLnFf2o+D86RASDUuW0JtHHqnlYqQhl4s6KyvJj7Gz6PWxoqU4DzdSeswxfF5p3aOPqqvXrqV42BefdMott1D60KEcy74dQHeA/Qw+9rHHymo++ojaqqtJr/x2BSh82Zw52dasrOMwZ6qUAhwt/0qUnIZ+ni2u1XFvHDsA9NWgNkU3XTltzOdfVtLKTU2Uq00TwWxWgL3d4adbn18rLX1sFseFR3S5feXMk29WNT1/FUU1QVKZ9OD1LLWjFMEgqgToOW89l8JtrdT25EzKvuJzMhUNJ33BkKh5xv9JnQsvA/+xdoM8GonF1Yv3DHLYTeFOJ+zya8g65pgIpwEC6N8p6+aug62bx5fpogo/j9trkjIpWfvtE+XX+8MdxBgB5E0ul2sn6O3YO+68Lf3WW29R2lfHQmsDfnr11Vd7dThxbEvcAz5o0FA688zTYQ4GQhdffJH+oYce3EcQ7NixnW69/bYeINIQp8kzjTWbrXT++fPYpxBmJ3ov3nzOwvJzzH9BQX7hhx9+kHpSQu38mM6TAexaeuHF5w9CGPeuEN1440108R8uDmHM7cwyZE5+6qbgcQEWwxwA6cJY7eAlOgiGwrvvvuvwDz9cRFu3bhEhxXHB2oNRiTHnpBaN8tp9U2Jev4OWY4om1IYTyS0xhkaSxUL+jg4Rl96dbsVLeFzNiKvNcOJLOEyQdDQd9nfQ7VZ9C1AbFKHjx3clI0bQlLvuoubm5oqmpqbl7BhEd+3ASeqMF1/MfOOo2HMMTDify+ejldD0sz/8cCzu7wyAvTk3N9fV2trq+qlA/zmoe7zCp9DqXE8ON3JTR0fHt9Dw9U/fewKlmzXktnvF41nU4RClm7T05fJKeuLNTcIZxLZ65vEXRdOOPp8itk7Y0RFhc4cVb7qg38Izb6CIOocCbe3U8uhJ5K7eJEqW+nZ9R6GQUXHGqWO2fUQdc+qxN94PGgq73DRoEuWddz9T9grs3wDo27i4oELd5B9aPusGs7x33Xsv9VQlTiTVAaIJg7A7mzGBd2J8Nt9yy810/IzjlEkWjhV9UOtF+KfExTmw83v+TMPho8q6tlZjoL///QWOTnNy7jsHy/zlzrsTqK1mvzY0aiXmQDGKn3nmaZE/HwsPVu3nvRZJM5EI+152NTY2bpwxY4ZryZKllJuT1305sfPoxGucKKsAMbXEn2n3ifn46/0PEMAaAfvY1d7eXgGm4AmLtfR9PeeSqEei4tRbzqdoxm/Xg8Kv4hWRp576W3eEnZxQlDMasz2kRImqJPN33ww5ZqOL8rk/oLDYeUSKE4lUvHPZKGhus8kkPObsTNQZDGI+iGKlTOuZli9YIGoaLj7zTAFWXs7gIihM3Y9+7jkCHho4lh3zbg3uG2eorcE82NgXJtiEq6+OlVngFSq8bFkEofb3vxPMuBlQnKNhZhUoiln6jwE9Aeysbpy4oCpOmsdFrRs4INt3/43Hks/pxe4jKRAmvRwiKG26/ek1VNXkUilUTS667HEyDhxDEU4m8HEJIJXwpsvCW67Y4Bzwosshf5uNGh85lapvPoLsKxYSD0+425mnOPS4PBTsctntIo0xlfIvfYIzzjpYCGECrwd9avihKLiECDVefw0KOhuO0W0O0+QwV0HNgsG4VogcJKqJ12/ZG76T840xPtsXfbKILrv0yu72OHyWX9kc4D3+Wew8UTps1Bha9c0KGjFieCcAuB7M5DsAYdett91MN910q2Jzh5U2ImKP95M/1wCYzz33PJ111pkhFhQMKl566rkcHhK172Q3xmgnzrMcdPOfEyaMt23esomuuOwqYp0ZO0+s3Xi+MSfARKJ7Q3BnzjieVq9eTVf98UoP2lgDU2QZa2qMpSMEYRIMBvcJv+Xae4owCkFrOwH2JgBjHSd6TJx4RPC6a6+PjXckuI82ZwcnMxBezQk5nYJe+pTkFGGAA4xcjomXNg+kFfn+cqlqLvMsjgdIfR6PSFzh3e/1ikw43rkSMT/Xg6v69psyhU5eupTKTzklsvaBB2jDZ58JNHLBU55cR9x0E+WNGcNLc+y/WscBMbEIXftGzINv2Rcx6Z57qKhfP0Et42sRn19wAXXt3JnJdepxXZn/CgP/uah7otbice3ERW1FB3P58coXnjt20vfbWunxZ1eQuiiDdEYdmaFF2pvsdOmdS+iL505RxQCikovmv6iqvvNEijjtJBlyYzRZ6uXOmFIp7Ia95KgjSZ/BT0uL5bRHlfLvgnpxnrmPIgEv5Vz0IBn6Dg7U1tZ+y8tfnC+sOOCCh3JdHGwRz9CChlV4Y3zlIyxCW0FM2FHd1dtk6uHLqMYkXsPFFNhuf+TRB4dccunFxoVvLKRPP/2MamvrRf24aCRWAiotNVWshZ922uk09+TZImsMgFkP7fgdL6OhjTous3zHHbeOPOXkOYZnn32ePvtssaj7xokonA5aUlJMs0G9L7zwfA4z7QDo6nhdGNppqFql1u/PYNgkifADBCohkBr4gRN478zKyjr80ccfLr32umu077z7Ln3y0Se0dds28ri9IgPPaNBTn9K+dMJxx9GcuXMIwoH7W1tdXb0JE3o1xr0yMzMznyPAmLoboB35mX1xU4Cr4XB9e4DWiTFinHbiOraazeZizKW8++6/dwyXm9q+Y++SnU6rZ4HBT0NphgbMG3HZZZbCsWNF2W/OWGJBwJ5wGwYM53UdgL1F+JycUJI5ZMjYWTfcQGoOt+3hQ5DiNddZs+fmUsagQWIP+P1ero/PlXV+c/PNXL1VVKfRgQUMvfxywrVvZOXHMRuKI5DTh/kpxetxTC4ofO7MV1/NaVi8mCR+4i9XRursJH97O+nz8qy4Pk3ChIv+R4GeOJkxoLw8sl6r1WZiT334rhnDtu1soi9XVlFOQbrIIEq3aGjp0p30lydXSLdePlmsrRuKy6nw8mdUDQ+dG0sBtWTEJHz84Q0JXlRIC4ChR05+NIEJsja0t1D2addS5ozzZGg/1gwrMPE2KaHOh+qA4wAOXqaqxw1b8/gTj0y+9767RTioyIqD/c9lmpzOrl2gmBzV5DnAZBJxBwCQHX3YhjGSefmLaWl2dlb/W269uejue+7ics4qt9sjnklnMhpE/DoLGvyuHYBhtsTe6A24FhZWnI1Wj2P4+fVtRcVF5Y8/8WgRJo/J5/OLvnGlWR5LnMvFy6DYtrHjFPfFwDmlf7nrzoHX/+m67kw81vAQBh7Y399z27wExTQIAHTxMiSOHWqxWPpcdtklBVdf/Ud+jJDGBdYkQzClWC18n/hhHz70l2u61+P325X+cm1yfp4dvnJtLS0rHVpZWZGrrFaIaDymxxgbZluNbDrw73HeNvyezcFcXFf6xk3r+9lsdmGng99TWkqKp6m5iYOeKtFfV+7UqWMLjjuO21UrD5TwtrS1sTbdhjGy0f6FHKK4lxzV2Iw2N1BmZvawW27hPABdT2ApkcyiJiBXrOH7V1Nd7ea8fwjNlNJ58/KUB20wKPncvqaWlgooFzY/NuH3zXEWyW1zVB6n9jIWs8rKxg+9/voC5YEW7KgOerzeWgjajaxlWIjE05z/0xo9DvZQLEjIXY3JswYXwo/KSX/16dMLjz7peaqqd1Bappn0uJ4Uo4ru/9tKGto/U3XyzMEiiSNl9FHRvHn3SW0LbiV1Rg4knKX3NSAx8BGi3mqrY5zDDdsoZexxlPu7u6mluXkLQPo1JhFrwQZlWSV0iA85ZKcXPz5rd1NT01IApxODngcyb1BoPWxvD3vTN3GaKwuF3oCeIAi9PHlxk8Eo/RzJVoeJ0A8TpQ/2HIxZCiaLlp1LDrsMdhjy4vxcZpuzmzhegcNda5XcjDDeM9Nw4rUebZbzchzayeY67xx263DYQ5iULpyrhVNKMeEreMIDrOkAohdY5xrtubgeLkTJms1VVbWHH4qwkSv+KkLRDiHh4Xp6mLD8oIO+HB2Hnc/DD54UEZ2dnZyhGXQFlLr4XGQT7exO6C9/H0Zb33HWKTTZIH5oJQs31uS4R+ysXMd1DriIpMK4nPiskh9zxPwc/R6C8c+KRFQa7mttXW0Vr6Bw37BX4LdVGMM85Qk0HH7MzKQa/dnKQTO9AJ2TdII4Xwuun9vhZ6ptxvlSlTLfiYJaAJ3vOXYvsxy+XrbsMA4Wnus8HsoTdUTdBmZcGO8daHcX7a3/Jtgvr/hwVCabDVxRBmORr/SbGZVga/jNNn5wCvrzH/e6H8gLj/G37+ALx8Cn9enTZ+aCZ09PnXPGS2TrcFFampnMXJQvEKLL//QxDeqXrRrSP4sHUc44+ncqORSUbO/cR7p+hwHsZpHjvr93uOe1S2K5JdRcQbqcEiq48gVy2e3VmEAroRG+4aKPP2bNXAEn3xQProULYoYBlFoMejqXEVQmqJ+derghdZyxxWWS6AAVO5X2lMRaNh39YsmNJTsmbw72TK7VxtpEPB8J9Jo1Ej/w0R97FhzTPrsyYeIPeeBHEvmwd7CjETQ3D2PO7XCxBm1MqUUY6OJxWooDkuuacf87GVT8UAV+EIPyW37iKz+LrJofwUV7n/nFDyZ0KWWwvwfIs7BncvIGzmNQgqAYAOyUtfP50E4n7c1uExE6ACILxy38dBUcu0Wp2qLm59Arzxur4Xx5tM0aUzgAeKLjuM147cJYbVf6yxpbsEem3Nj5PGpc+05+EEOsTJbEF8Qa14b3NvYNHODesG3WiTHcjmtp4+KVOJ6XtjV7syBjW8x/LASwT5nncVONHwvFj6gyK9jivvswhja+LvSrK+74TVCIrEC4DgJH2rGASuMHWij3nhWCg80mtOnA9f3kApHSgZ40ojyC51CAcKDjpXisPzpZnJubO5lTIwsLC49cvmyX8ezfvSYe35QCzc4LuR1dPhrYL4e+eP8iyssyReLPLe/45FnJ9v7DZBg2BXZRCoAd3mc5RgA9upevc4mmYCMYrd9DRde/TmFrZivs0S9gnn0KoK+nWFql9xApe+K1qJWYBouyG5VYiPgyqU8Bb3xCH9TBp7SpSsjBMCbsugR7TFYmkl/pd+LkiiQ4VTVKuDUfb1Jetd3Gb0wzxoN44qWDtUqotVX5vTrhtx7lWjy0Nze/t/4aEnJI4rHA8f7GfWF+ZYzi9da0Sh9TlPPrlbZDCePopr0VVuIrXvHxtyYcE78ujzIupPQnPobRhP7Es0MjB3jYpFo5zqC0r01YSYn28EXJCdcaZ29q5Rh1wliGlXMHep5bOaeUcO/ie3wsQ8px8WPDieuVB8LeLwr0hAvhgUuDdC7NzMycXFBQcDzAPvHDDzYbLrjodQFyc4pRXG+73UPjxpTQp+9fFLWYdRGlfpjK9sU/VJ3vPkTGMTNIa82CYg91r6FwPfaYpgfIuaJqw04KtVRR0fy/UzS3zMYeY9CwxewIgnRsVCZv5Mc+lzxhIsTDmhNDqaMJNz3+NCg6lHMk3GxVj3bVvUyq+C73bD9BcKgS+pj42OD4pAsnrAokXk/i0k0k4beCMvUyOVU9wsF7jkViX+UENpN4vDbhminhOuPn7QmKnuMvHQBwUsK1U8L1yrT/Y4sPdC+kg6xKRfdZKtjXMyT1WK8/6Lnjz7TrEbErJbSbePw+SyP/NUBPiDpiKZXOj4bNzs6ekpeXN6OoqOiID97bqLv0D6+Jp7GaUgwiqq2t00NTJw+kd969KGo1acQk4yoojn++rer44CEyjz6WdJlFFA2H9gKdH1Sg0VOgZTf5d62ngsv+RqrCckdDQ8M/ock/b29vXwPKVqeAPPhjQd5jIlAvQTHRxNef0n4vbfc2sX7so4ilg7WR8Ftpv7C7Q7iWXo4/5P4e5NwHPPaHrq0XwUeHOm4/MI4HWk4+pGN/4Lf7R0YdWLD8KOz90kCPSyoGu3h+dVZW1iRo9pnQ7OM/+3CT/qJ5L5PHHaC0DIu4IpvNTWPGltFbH10azcmyiKefsGfXs/Vrdfs/biL90CPI2G+sUpCNV+U05KtaR74dq6nwsqeJCgc6oMlXAuSLAfJvcXi9Etf8k0Ge3JLbv2M7VJz9q0BX/bsvRAFWvLoPO2iq2CnW3Ny8BGD89rjZI/2vvnUR5cJWt3HR/UCIMq16Wru2guZOf1iqqbJpWKPzArVp6NRQ4Z9fpXBDBXk3LRGFKDSZBeTf8x35K9dT4RXPMMjtaHcFqPpS9rAD5A1x51sS5Mntf3VT/RInSQC7CKYB2PcA7Cubmpq+AL3+Zsr0cs+ir+bT8P4F1Obu5PImlG3Q09YdNXTSkQ/Q11/u0GixMdhVmX2CRTe8JautaeT48hVyLH6ewu31VDz/JYrklLWjva+hyZdw5BkX5lNAzppcTt7u5JYE+i8Mdi4eCK27AmD/rL6+fkXfsizbZ2tupONnjKZGfzt5Al6yGLS0p7mRTj/hIXrmscW8bKLnMkAhUvlyz38wkj55LmlT0qnwjy+S15hWx443MAXheOPnUCt0PZAEeXJLAv0X3HqCPRgM8vr2KoD907q6ui+j0VD1e4uvoxv+OIfcUTfZ/HYy6yXyyG664tqn6IJzn1L7AzKX/VVxbTb12Dkd1t8/0N7S5V4LYfE52+RgCt/Jshy3yX/WkrnJLbn9/7ppfukTJgSgCLBzmirAyRFEHE3lAPgn3vvIOUOHHV4k3Xj1K1RvqycTWYhzsV5euJDeeftL+mb9I8b8AksDB4dwyCmOq8e+W6nHxnm78YiqaNIuT27J7T8A9F7AzllhEYCWI4hc2Dlk0H3q6UcMnzhpgPmqy56ljxdzcUFeadPRGeceSRaLgQv97cExX3PkHcwAjh/uVLR4vPxwkq4nt+T2nwR6Ao1nwIvikgxOaOcgNLuHs4hgY9tycnJGf/T5XwoeeXgkPfXkB/TIY5fRCbPGh2GHf9fY2MbJKd+yNqe90Wi9Rj0lt+SWBPp/eGPNq4BdREJBOwdB5TlWuoN3gH/YlVedNPzqa07RdXV1NdXU1Gzr7OxcDY2+Ad/XsCYvKioKpaamigisIUOGJEGe3JLbfxvQE6h8RKHdYS4PyskLnIjg9Xpruegk1zbn5ADODgP4t3A2k0LVAw0NDREAXQLIk3Q9uSW3/1ag9wB7vKxT0OFwcFpko16v53KlWiUDq1WW5Q6F7ifmkyc1eXJLbv/tQO9ht/OyWMRisXB5Xn7GV2c8XxnvOc9d5JIn7fHkltwObfuXY93/nX2jfTOkJNo3IyqpxZPb//T2Y2LdNf/F1xEPromnVxL1yKxKbsktuR3apvov718isJMgT27J7Sdu/0+AAQDJxwXsCF3uggAAAABJRU5ErkJggg=='; $logo_shield = 'data:image/png;base64,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'; + + //get user language code, if exists + $sql = "select user_setting_value from v_user_settings "; + $sql .= "where user_uuid = :user_uuid "; + $sql .= "and domain_uuid = :domain_uuid "; + $sql .= "and user_setting_category = 'domain' "; + $sql .= "and user_setting_subcategory = 'language' "; + $sql .= "and user_setting_name = 'code' "; + $parameters['user_uuid'] = $result['user_uuid']; + $parameters['domain_uuid'] = $domain_uuid; + $database = new database; + $row = $database->select($sql, $parameters, 'row'); + if (is_array($row) && @sizeof($row) != 0) { + $user_language_code = $row['user_setting_value']; + } + unset($sql, $parameters, $row); + //get email template from db $sql = "select template_subject, template_body from v_email_templates "; $sql .= "where template_language = :template_language "; @@ -105,12 +134,14 @@ $sql .= "and template_subcategory = 'default' "; $sql .= "and template_type = 'html' "; $sql .= "and template_enabled = 'true' "; - $parameters['template_language'] = $_SESSION['domain']['language']['code']; + $parameters['template_language'] = $user_language_code ? $user_language_code : $_SESSION['domain']['language']['code']; $parameters['domain_uuid'] = $domain_uuid; $database = new database; $row = $database->select($sql, $parameters, 'row'); - $email_subject = $row['template_subject']; - $email_body = $row['template_body']; + if (is_array($row)) { + $email_subject = $row['template_subject']; + $email_body = $row['template_body']; + } unset($sql, $parameters, $row); //replace variables in email body @@ -160,6 +191,11 @@ $password_new = trim($_REQUEST['password_new']); $password_repeat = trim($_REQUEST['password_repeat']); + //if not requiring usernames to be of email format, strip off @domain as the valid domain for the reset is already being provided in the where clause below + if ($_SESSION['users']['username_format']['text'] != 'email') { + $username = substr_count($username, '@') != 0 ? explode('@', $username)[0] : $username; + } + if ($username !== '' && $username === $_SESSION['valid_username'] && $password_new !== '' && @@ -384,4 +420,4 @@ $login_page = true; include "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/resources/pdo.php b/resources/pdo.php index e856d9ef80..0d9e038927 100644 --- a/resources/pdo.php +++ b/resources/pdo.php @@ -246,15 +246,12 @@ if ($db_type == "mysql") { if ($db_type == "pgsql") { //database connection try { - if (isset($db_secure)) { - $dbissecure = $db_secure; - } - else { - $dbissecure = false; + if (!isset($db_secure)) { + $db_secure = false; } if (strlen($db_host) > 0) { if (strlen($db_port) == 0) { $db_port = "5432"; } - if ($dbissecure == true) { + if ($db_secure == true) { $db = new PDO("pgsql:host=$db_host port=$db_port dbname=$db_name user=$db_username password=$db_password sslmode=verify-ca sslrootcert=$db_cert_authority"); } else { @@ -304,18 +301,20 @@ if ($db_type == "pgsql") { unset($result); } - if (is_array($domains)) { + if (is_array($domains)) { foreach($domains as $row) { - if (count($domains) == 1) { - $_SESSION["domain_uuid"] = $row["domain_uuid"]; - $_SESSION["domain_name"] = $row['domain_name']; - } - else { - if ($row['domain_name'] == $domain_array[0] || $row['domain_name'] == 'www.'.$domain_array[0]) { + if (!isset($_SESSION['username'])) { + if (count($domains) == 1) { $_SESSION["domain_uuid"] = $row["domain_uuid"]; - $_SESSION["domain_name"] = $row["domain_name"]; + $_SESSION["domain_name"] = $row['domain_name']; } - } + else { + if ($row['domain_name'] == $domain_array[0] || $row['domain_name'] == 'www.'.$domain_array[0]) { + $_SESSION["domain_uuid"] = $row["domain_uuid"]; + $_SESSION["domain_name"] = $row["domain_name"]; + } + } + } $_SESSION['domains'][$row['domain_uuid']] = $row; } unset($domains, $prep_statement); diff --git a/resources/require.php b/resources/require.php index 6561af7ee9..4f6d9e7b41 100644 --- a/resources/require.php +++ b/resources/require.php @@ -72,11 +72,14 @@ require_once "resources/functions.php"; if ($config_exists) { require "resources/pdo.php"; - require_once "resources/switch.php"; + if (file_exists($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/resources/switch.php")) { + require_once "resources/switch.php"; + } } //change language on the fly - for translate tool (if available) if (isset($_REQUEST['view_lang_code']) && ($_REQUEST['view_lang_code']) != '') { $_SESSION['domain']['language']['code'] = $_REQUEST['view_lang_code']; } + ?> diff --git a/resources/switch.php b/resources/switch.php index f83401c8f8..76652fcdb3 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -432,97 +432,96 @@ function outbound_route_to_bridge($domain_uuid, $destination_number, array $chan $hostname = 'unknown'; } - $sql = "select * from v_dialplans "; - if (is_uuid($domain_uuid)) { - $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; - } - else { - $sql .= "where (domain_uuid is null) "; - } - $sql .= "and (hostname = :hostname or hostname is null) "; - $sql .= "and app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3' "; - $sql .= "and dialplan_enabled = 'true' "; - $sql .= "order by dialplan_order asc "; + $sql = "select d.dialplan_uuid, "; + $sql .= "d.dialplan_name, "; + $sql .= "dd.dialplan_detail_uuid, "; + $sql .= "dd.dialplan_detail_tag, "; + $sql .= "dd.dialplan_detail_type, "; + $sql .= "dd.dialplan_detail_data , "; + $sql .= "d.dialplan_continue "; + $sql .= "from v_dialplans d, v_dialplan_details dd "; + $sql .= "where d.dialplan_uuid = dd.dialplan_uuid "; if (is_uuid($domain_uuid)) { + $sql .= "and (d.domain_uuid = :domain_uuid or d.domain_uuid is null) "; $parameters['domain_uuid'] = $domain_uuid; } + else { + $sql .= "and (d.domain_uuid is null) "; + } + $sql .= "and (hostname = :hostname or hostname is null) "; + $sql .= "and d.app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3' "; + $sql .= "and d.dialplan_enabled = 'true' "; + $sql .= "order by d.domain_uuid, d.dialplan_order, dd.dialplan_detail_order "; $parameters['hostname'] = $hostname; $database = new database; $result = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); + if (is_array($result) && @sizeof($result) != 0) { - $x = 0; foreach ($result as &$row) { - //set as variables - $dialplan_uuid = $row['dialplan_uuid']; - $dialplan_detail_tag = $row["dialplan_detail_tag"]; - $dialplan_detail_type = $row['dialplan_detail_type']; - $dialplan_continue = $row['dialplan_continue']; - - //get the extension number using the dialplan_uuid - $sql = "select * "; - $sql .= "from v_dialplan_details "; - $sql .= "where dialplan_uuid = :dialplan_uuid "; - $sql .= "order by dialplan_detail_order asc "; - $parameters['dialplan_uuid'] = $dialplan_uuid; - $database = new database; - $sub_result = $database->select($sql, $parameters, 'all'); - unset($sql, $parameters); - - $condition_match = false; - if (is_array($sub_result) && @sizeof($sub_result) != 0) { - foreach ($sub_result as &$sub_row) { - if ($sub_row['dialplan_detail_tag'] == "condition") { - if ($sub_row['dialplan_detail_type'] == "destination_number") { - $pattern = '/'.$sub_row['dialplan_detail_data'].'/'; - preg_match($pattern, $destination_number, $matches, PREG_OFFSET_CAPTURE); - if (count($matches) == 0) { - $condition_match[] = 'false'; - } - else { - $condition_match[] = 'true'; - $regex_match_1 = $matches[1][0]; - $regex_match_2 = $matches[2][0]; - $regex_match_3 = $matches[3][0]; - $regex_match_4 = $matches[4][0]; - $regex_match_5 = $matches[5][0]; - } - } - elseif ($sub_row['dialplan_detail_type'] == "\${toll_allow}") { - $pattern = '/'.$sub_row['dialplan_detail_data'].'/'; - preg_match($pattern, $channel_variables['toll_allow'], $matches, PREG_OFFSET_CAPTURE); - if (count($matches) == 0) { - $condition_match[] = 'false'; - } - else { - $condition_match[] = 'true'; - } - } - } - } - } - - if (!in_array('false', $condition_match)) { - $x = 0; - foreach ($sub_result as &$sub_row) { - $dialplan_detail_data = $sub_row['dialplan_detail_data']; - if ($sub_row['dialplan_detail_tag'] == "action" && $sub_row['dialplan_detail_type'] == "bridge" && $dialplan_detail_data != "\${enum_auto_route}") { - $dialplan_detail_data = str_replace("\$1", $regex_match_1, $dialplan_detail_data); - $dialplan_detail_data = str_replace("\$2", $regex_match_2, $dialplan_detail_data); - $dialplan_detail_data = str_replace("\$3", $regex_match_3, $dialplan_detail_data); - $dialplan_detail_data = str_replace("\$4", $regex_match_4, $dialplan_detail_data); - $dialplan_detail_data = str_replace("\$5", $regex_match_5, $dialplan_detail_data); - $bridge_array[$x] = $dialplan_detail_data; - $x++; - if ($dialplan_continue == "false") { - break 2; - } - } - } - } + $dialplan_uuid = $row["dialplan_uuid"]; + $dialplan_detail_uuid = $row["dialplan_detail_uuid"]; + $outbound_routes[$dialplan_uuid][$dialplan_detail_uuid]["dialplan_detail_tag"] = $row["dialplan_detail_tag"]; + $outbound_routes[$dialplan_uuid][$dialplan_detail_uuid]["dialplan_detail_type"] = $row["dialplan_detail_type"]; + $outbound_routes[$dialplan_uuid][$dialplan_detail_uuid]["dialplan_detail_data"] = $row["dialplan_detail_data"]; + $outbound_routes[$dialplan_uuid]["dialplan_continue"] = $row["dialplan_continue"]; + } + } + + if (is_array($outbound_routes) && @sizeof($outbound_routes) != 0) { + $x = 0; + foreach ($outbound_routes as &$dialplan) { + $condition_match = false; + foreach ($dialplan as &$dialplan_details) { + if ($dialplan_details['dialplan_detail_tag'] == "condition") { + if ($dialplan_details['dialplan_detail_type'] == "destination_number") { + $pattern = '/'.$dialplan_details['dialplan_detail_data'].'/'; + preg_match($pattern, $destination_number, $matches, PREG_OFFSET_CAPTURE); + if (count($matches) == 0) { + $condition_match[] = 'false'; + } + else { + $condition_match[] = 'true'; + $regex_match_1 = $matches[1][0]; + $regex_match_2 = $matches[2][0]; + $regex_match_3 = $matches[3][0]; + $regex_match_4 = $matches[4][0]; + $regex_match_5 = $matches[5][0]; + } + } + elseif ($dialplan_details['dialplan_detail_type'] == "\${toll_allow}") { + $pattern = '/'.$dialplan_details['dialplan_detail_data'].'/'; + preg_match($pattern, $channel_variables['toll_allow'], $matches, PREG_OFFSET_CAPTURE); + if (count($matches) == 0) { + $condition_match[] = 'false'; + } + else { + $condition_match[] = 'true'; + } + } + } + } + + if (!in_array('false', $condition_match)) { + foreach ($dialplan as &$dialplan_details) { + $dialplan_detail_data = $dialplan_details['dialplan_detail_data']; + if ($dialplan_details['dialplan_detail_tag'] == "action" && $dialplan_details['dialplan_detail_type'] == "bridge" && $dialplan_detail_data != "\${enum_auto_route}") { + $dialplan_detail_data = str_replace("\$1", $regex_match_1, $dialplan_detail_data); + $dialplan_detail_data = str_replace("\$2", $regex_match_2, $dialplan_detail_data); + $dialplan_detail_data = str_replace("\$3", $regex_match_3, $dialplan_detail_data); + $dialplan_detail_data = str_replace("\$4", $regex_match_4, $dialplan_detail_data); + $dialplan_detail_data = str_replace("\$5", $regex_match_5, $dialplan_detail_data); + $bridge_array[$x] = $dialplan_detail_data; + $x++; + } + } + + if ($dialplan["dialplan_continue"] == "false") { + break; + } + } } } - unset($result, $row); return $bridge_array; } //$destination_number = '1231234'; diff --git a/resources/templates/conf/dialplan/default.xml.noload b/resources/templates/conf/dialplan/default.xml.noload deleted file mode 100644 index 350a85e97c..0000000000 --- a/resources/templates/conf/dialplan/default.xml.noload +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/resources/templates/conf/dialplan/default/00_ladspa.xml.noload b/resources/templates/conf/dialplan/default/00_ladspa.xml.noload deleted file mode 100644 index c950e1b3c0..0000000000 --- a/resources/templates/conf/dialplan/default/00_ladspa.xml.noload +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/templates/conf/dialplan/default/00_pizza_demo.xml.noload b/resources/templates/conf/dialplan/default/00_pizza_demo.xml.noload deleted file mode 100644 index e7fcca204a..0000000000 --- a/resources/templates/conf/dialplan/default/00_pizza_demo.xml.noload +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/resources/templates/conf/dialplan/default/01_Talking_Clock.xml.noload b/resources/templates/conf/dialplan/default/01_Talking_Clock.xml.noload deleted file mode 100644 index 1424f2e16e..0000000000 --- a/resources/templates/conf/dialplan/default/01_Talking_Clock.xml.noload +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/templates/conf/dialplan/default/01_example.com.xml.noload b/resources/templates/conf/dialplan/default/01_example.com.xml.noload deleted file mode 100644 index bd61cd2788..0000000000 --- a/resources/templates/conf/dialplan/default/01_example.com.xml.noload +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/templates/conf/dialplan/features.xml.noload b/resources/templates/conf/dialplan/features.xml.noload deleted file mode 100644 index 204a4b6fc8..0000000000 --- a/resources/templates/conf/dialplan/features.xml.noload +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/templates/conf/dialplan/public.xml.noload b/resources/templates/conf/dialplan/public.xml.noload deleted file mode 100644 index 8f6dd4a2ab..0000000000 --- a/resources/templates/conf/dialplan/public.xml.noload +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/templates/conf/dialplan/public/00_inbound_did.xml.noload b/resources/templates/conf/dialplan/public/00_inbound_did.xml.noload deleted file mode 100644 index 22b7223014..0000000000 --- a/resources/templates/conf/dialplan/public/00_inbound_did.xml.noload +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - diff --git a/resources/templates/conf/dialplan/skinny-patterns.xml.noload b/resources/templates/conf/dialplan/skinny-patterns.xml.noload deleted file mode 100644 index 7817323aa9..0000000000 --- a/resources/templates/conf/dialplan/skinny-patterns.xml.noload +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/resources/templates/conf/dialplan/skinny-patterns/20-Demo.xml b/resources/templates/conf/dialplan/skinny-patterns/20-Demo.xml deleted file mode 100644 index f69658128f..0000000000 --- a/resources/templates/conf/dialplan/skinny-patterns/20-Demo.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/resources/templates/conf/dialplan/skinny-patterns/20-Local_extension.xml b/resources/templates/conf/dialplan/skinny-patterns/20-Local_extension.xml deleted file mode 100644 index 9ad5651328..0000000000 --- a/resources/templates/conf/dialplan/skinny-patterns/20-Local_extension.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/templates/conf/dialplan/skinny-patterns/90-External.xml b/resources/templates/conf/dialplan/skinny-patterns/90-External.xml deleted file mode 100644 index 50d6c37f24..0000000000 --- a/resources/templates/conf/dialplan/skinny-patterns/90-External.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/resources/templates/conf/dialplan/skinny-patterns/99-Default_Drop.xml b/resources/templates/conf/dialplan/skinny-patterns/99-Default_Drop.xml deleted file mode 100644 index 897fd8fb94..0000000000 --- a/resources/templates/conf/dialplan/skinny-patterns/99-Default_Drop.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/resources/templates/conf/directory/default.xml.noload b/resources/templates/conf/directory/default.xml.noload deleted file mode 100644 index 818586b509..0000000000 --- a/resources/templates/conf/directory/default.xml.noload +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/templates/conf/directory/default/brian.xml.noload b/resources/templates/conf/directory/default/brian.xml.noload deleted file mode 100644 index 2cbb68fc76..0000000000 --- a/resources/templates/conf/directory/default/brian.xml.noload +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/templates/conf/directory/default/default.xml.noload b/resources/templates/conf/directory/default/default.xml.noload deleted file mode 100644 index bdddab9cac..0000000000 --- a/resources/templates/conf/directory/default/default.xml.noload +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/templates/conf/directory/default/example.com.xml.noload b/resources/templates/conf/directory/default/example.com.xml.noload deleted file mode 100644 index 42a33ddbf3..0000000000 --- a/resources/templates/conf/directory/default/example.com.xml.noload +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/templates/conf/directory/default/skinny-example.xml.noload b/resources/templates/conf/directory/default/skinny-example.xml.noload deleted file mode 100644 index 357eb72f12..0000000000 --- a/resources/templates/conf/directory/default/skinny-example.xml.noload +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - -