Add hostname to sip profiles.

This commit is contained in:
Mark Crane
2013-11-12 15:56:26 +00:00
parent 55691db77d
commit 31f2d565bf
4 changed files with 203 additions and 138 deletions

View File

@@ -36,31 +36,31 @@
$apps[$x]['menu'][0]['groups'][] = "superadmin";
//permission details
$y = 0;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_view";
$y = 0;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_view";
$apps[$x]['permissions'][$y]['menu']['uuid'] = "47014b1d-13ad-921c-313d-ca42c0424b37";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_setting_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_setting_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_setting_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_setting_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_setting_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_setting_add";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_setting_edit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_setting_delete";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "sip_profile_setting_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
@@ -124,4 +124,9 @@
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "sip_profile_hostname";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "varchar(255)";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "vachar(255)";
$z++;
?>

View File

@@ -1,122 +1,159 @@
<?php
//SIP Profiles
$text['title-sip_profiles']['en-us'] = "SIP Profiles";
$text['title-sip_profiles']['pt-pt'] = "Perfis SIP";
$text['title-sip_profiles']['fr-fr'] = "Profiles SIP";
$text['title-sip_profiles']['en-us'] = "SIP Profiles";
$text['title-sip_profiles']['pt-pt'] = "Perfis SIP";
$text['title-sip_profiles']['fr-fr'] = "Profiles SIP";
$text['title-sip_profile']['en-us'] = "SIP Profile";
$text['title-sip_profile']['pt-pt'] = "Perfil SIP";
$text['title-sip_profile']['fr-fr'] = "Profile SIP";
$text['title-setting']['en-us'] = "Profile Setting";
$text['title-setting']['pt-pt'] = "Definições de Perfil";
$text['title-setting']['fr-fr'] = "Paramètres du Profile";
$text['title-sip_profile']['en-us'] = "SIP Profile";
$text['title-sip_profile']['pt-pt'] = "Perfil SIP";
$text['title-sip_profile']['fr-fr'] = "Profile SIP";
$text['header-sip_profiles']['en-us'] = "SIP Profiles";
$text['header-sip_profiles']['pt-pt'] = "Perfis SIP";
$text['header-sip_profiles']['fr-fr'] = "Profiles SIP";
$text['header-sip_profile']['en-us'] = "SIP Profile";
$text['header-sip_profile']['pt-pt'] = "Perfil SIP";
$text['header-sip_profile']['fr-fr'] = "Profile SIP";
$text['header_settings']['en-us'] = "Settings";
$text['header_settings']['pt-pt'] = "Definições";
$text['header_settings']['fr-fr'] = "Paramètres";
$text['header-setting']['en-us'] = "Profile Setting";
$text['header-setting']['pt-pt'] = "Definições de Perfil";
$text['header-setting']['fr-fr'] = "Paramètres du Profile";
$text['title-setting']['en-us'] = "Profile Setting";
$text['title-setting']['pt-pt'] = "Definições de Perfil";
$text['title-setting']['fr-fr'] = "Paramètres du Profile";
$text['description-sip_profiles']['en-us'] = "Manage settings for SIP profiles.";
$text['description-sip_profiles']['pt-pt'] = "Gerir definições para os perfis SIP.";
$text['description-sip_profiles']['fr-fr'] = "Gérer les paramètres du profile SIP";
$text['description-sip_profile']['en-us'] = "Manage settings for the SIP profile.";
$text['description-sip_profile']['pt-pt'] = "Gerir definições para o perfil SIP.";
$text['description-sip_profile']['fr-fr'] = "Gérer les paramètres du profile SIP";
$text['header-sip_profiles']['en-us'] = "SIP Profiles";
$text['header-sip_profiles']['pt-pt'] = "Perfis SIP";
$text['header-sip_profiles']['fr-fr'] = "Profiles SIP";
$text['label-name']['en-us'] = "Name";
$text['label-name']['pt-pt'] = "Nome";
$text['label-name']['fr-fr'] = "Nom";
$text['label-description']['en-us'] = "Description";
$text['label-description']['pt-pt'] = "Descrição";
$text['label-description']['fr-fr'] = "Description";
$text['label-setting_name']['en-us'] = "Name";
$text['label-setting_name']['pt-pt'] = "Nome";
$text['label-setting_name']['fr-fr'] = "Nom";
$text['label-setting_value']['en-us'] = "Value";
$text['label-setting_value']['pt-pt'] = "Valor";
$text['label-setting_value']['fr-fr'] = "Valeur";
$text['label-setting_enabled']['en-us'] = "Enabled";
$text['label-setting_enabled']['pt-pt'] = "Activado";
$text['label-setting_enabled']['fr-fr'] = "Actif";
$text['label-setting_description']['en-us'] = "Description";
$text['label-setting_description']['pt-pt'] = "Descrição";
$text['label-setting_description']['fr-fr'] = "Description";
$text['header-sip_profile']['en-us'] = "SIP Profile";
$text['header-sip_profile']['pt-pt'] = "Perfil SIP";
$text['header-sip_profile']['fr-fr'] = "Profile SIP";
$text['description-name']['en-us'] = "Enter the SIP Profile name.";
$text['description-name']['pt-pt'] = "Introduza o nome do perfil SIP.";
$text['description-name']['fr-fr'] = "Entrer le nom du Profile SIP.";
$text['description-description']['en-us'] = "Enter the description.";
$text['description-description']['pt-pt'] = "Introduza a descrição.";
$text['description-description']['fr-fr'] = "Entrer la description.";
$text['description-setting_name']['en-us'] = "Enter the name.";
$text['description-setting_name']['pt-pt'] = "Introduza o nome.";
$text['description-setting_name']['fr-fr'] = "Entrer le nom.";
$text['description-setting_value']['en-us'] = "Enter the value.";
$text['description-setting_value']['pt-pt'] = "Introduza o valor.";
$text['description-setting_value']['fr-fr'] = "Entrer la valeur.";
$text['description-setting_enabled']['en-us'] = "Choose to enable or disable this.";
$text['description-setting_enabled']['pt-pt'] = "Escolha se o parâmetro será activo ou desactivo.";
$text['description-setting_enabled']['fr-fr'] = "Choisir si le paramètre sera actif ou non.";
$text['description-setting_description']['en-us'] = "Enter the description.";
$text['description-setting_description']['pt-pt'] = "Introduza uma descrição.";
$text['description-setting_description']['fr-fr'] = "Entrer la description.";
$text['header_settings']['en-us'] = "Settings";
$text['header_settings']['pt-pt'] = "Definições";
$text['header_settings']['fr-fr'] = "Paramètres";
$text['option-true']['en-us'] = "True";
$text['option-true']['pt-pt'] = "Sim";
$text['option-true']['fr-fr'] = "Oui";
$text['option-false']['en-us'] = "False";
$text['option-false']['pt-pt'] = "Não";
$text['option-false']['fr-fr'] = "Non";
$text['header-setting']['en-us'] = "Profile Setting";
$text['header-setting']['pt-pt'] = "Definições de Perfil";
$text['header-setting']['fr-fr'] = "Paramètres du Profile";
$text['button-add']['en-us'] = "Add";
$text['button-add']['pt-pt'] = "Adicionar";
$text['button-add']['fr-fr'] = "Ajouter";
$text['button-edit']['en-us'] = "Edit";
$text['button-edit']['pt-pt'] = "Editar";
$text['button-edit']['fr-fr'] = "Editer";
$text['button-delete']['en-us'] = "Delete";
$text['button-delete']['pt-pt'] = "Remover";
$text['button-delete']['fr-fr'] = "Supprimer";
$text['button-back']['en-us'] = "Back";
$text['button-back']['pt-pt'] = "voltar";
$text['button-back']['fr-fr'] = "Retour";
$text['button-copy']['en-us'] = "Copy";
$text['button-copy']['pt-pt'] = "Copiar";
$text['button-copy']['fr-fr'] = "Copier";
$text['button-save']['en-us'] = "Save";
$text['button-save']['pt-pt'] = "Guardar";
$text['button-save']['fr-fr'] = "Sauvegarder";
$text['description-sip_profiles']['en-us'] = "Manage settings for SIP profiles.";
$text['description-sip_profiles']['pt-pt'] = "Gerir definições para os perfis SIP.";
$text['description-sip_profiles']['fr-fr'] = "Gérer les paramètres du profile SIP";
$text['confirm-delete']['en-us'] = "Do you really want to delete this?";
$text['confirm-delete']['pt-pt'] = "Tem a certeza que pretende remover isto?";
$text['confirm-delete']['fr-fr'] = "Voulez-vous vraiment supprimer cela?";
$text['confirm-copy']['en-us'] = "Do you really want to copy this?";
$text['confirm-copy']['pt-pt'] = "Tem a certeza que pretende copiar isto?";
$text['confirm-copy']['fr-fr'] = "Voulez-vous vraiment copier cela?";
$text['description-sip_profile']['en-us'] = "Manage settings for the SIP profile.";
$text['description-sip_profile']['pt-pt'] = "Gerir definições para o perfil SIP.";
$text['description-sip_profile']['fr-fr'] = "Gérer les paramètres du profile SIP";
$text['message-add']['en-us'] = "Add Completed";
$text['message-add']['pt-pt'] = "Adição Efectuada";
$text['message-add']['fr-fr'] = "Ajouté";
$text['message-update']['en-us'] = "Update Completed";
$text['message-update']['pt-pt'] = "Actualização Efectuada";
$text['message-update']['fr-fr'] = "Mis à jour";
$text['message-delete']['en-us'] = "Delete Completed";
$text['message-delete']['pt-pt'] = "Remoção Efectuada";
$text['message-delete']['fr-fr'] = "Supprimé";
$text['message-copy']['en-us'] = "Copy Completed";
$text['message-copy']['pt-pt'] = "Cópia Efectuada";
$text['message-copy']['fr-fr'] = "Copié";
$text['message-required']['en-us'] = "Please provide: ";
$text['message-required']['pt-pt'] = "Por favor indique: ";
$text['message-required']['fr-fr'] = "Merci d'indiquer: ";
$text['label-name']['en-us'] = "Name";
$text['label-name']['pt-pt'] = "Nome";
$text['label-name']['fr-fr'] = "Nom";
$text['label-description']['en-us'] = "Description";
$text['label-description']['pt-pt'] = "Descrição";
$text['label-description']['fr-fr'] = "Description";
$text['label-setting_name']['en-us'] = "Name";
$text['label-setting_name']['pt-pt'] = "Nome";
$text['label-setting_name']['fr-fr'] = "Nom";
$text['label-setting_value']['en-us'] = "Value";
$text['label-setting_value']['pt-pt'] = "Valor";
$text['label-setting_value']['fr-fr'] = "Valeur";
$text['label-setting_enabled']['en-us'] = "Enabled";
$text['label-setting_enabled']['pt-pt'] = "Activado";
$text['label-setting_enabled']['fr-fr'] = "Actif";
$text['label-setting_description']['en-us'] = "Description";
$text['label-setting_description']['pt-pt'] = "Descrição";
$text['label-setting_description']['fr-fr'] = "Description";
$text['description-name']['en-us'] = "Enter the SIP Profile name.";
$text['description-name']['pt-pt'] = "Introduza o nome do perfil SIP.";
$text['description-name']['fr-fr'] = "Entrer le nom du Profile SIP.";
$text['description-description']['en-us'] = "Enter the description.";
$text['description-description']['pt-pt'] = "Introduza a descrição.";
$text['description-description']['fr-fr'] = "Entrer la description.";
$text['description-setting_name']['en-us'] = "Enter the name.";
$text['description-setting_name']['pt-pt'] = "Introduza o nome.";
$text['description-setting_name']['fr-fr'] = "Entrer le nom.";
$text['description-setting_value']['en-us'] = "Enter the value.";
$text['description-setting_value']['pt-pt'] = "Introduza o valor.";
$text['description-setting_value']['fr-fr'] = "Entrer la valeur.";
$text['description-setting_enabled']['en-us'] = "Choose to enable or disable this.";
$text['description-setting_enabled']['pt-pt'] = "Escolha se o parâmetro será activo ou desactivo.";
$text['description-setting_enabled']['fr-fr'] = "Choisir si le paramètre sera actif ou non.";
$text['description-setting_description']['en-us'] = "Enter the description.";
$text['description-setting_description']['pt-pt'] = "Introduza uma descrição.";
$text['description-setting_description']['fr-fr'] = "Entrer la description.";
$text['header-hostname']['en-us'] = "Hostname";
$text['header-hostname']['pt-pt'] = "";
$text['header-hostname']['fr-fr'] = "";
$text['label-hostname']['en-us'] = 'Hostname';
$text['label-hostname']['pt-pt'] = '';
$text['label-hostname']['fr-fr'] = '';
$text['description-hostname']['en-us'] = 'Enter the hostname / switchname.';
$text['description-hostname']['pt-pt'] = '';
$text['description-hostname']['fr-fr'] = '';
$text['option-true']['en-us'] = "True";
$text['option-true']['pt-pt'] = "Sim";
$text['option-true']['fr-fr'] = "Oui";
$text['option-false']['en-us'] = "False";
$text['option-false']['pt-pt'] = "Não";
$text['option-false']['fr-fr'] = "Non";
$text['button-add']['en-us'] = "Add";
$text['button-add']['pt-pt'] = "Adicionar";
$text['button-add']['fr-fr'] = "Ajouter";
$text['button-edit']['en-us'] = "Edit";
$text['button-edit']['pt-pt'] = "Editar";
$text['button-edit']['fr-fr'] = "Editer";
$text['button-delete']['en-us'] = "Delete";
$text['button-delete']['pt-pt'] = "Remover";
$text['button-delete']['fr-fr'] = "Supprimer";
$text['button-back']['en-us'] = "Back";
$text['button-back']['pt-pt'] = "voltar";
$text['button-back']['fr-fr'] = "Retour";
$text['button-copy']['en-us'] = "Copy";
$text['button-copy']['pt-pt'] = "Copiar";
$text['button-copy']['fr-fr'] = "Copier";
$text['button-save']['en-us'] = "Save";
$text['button-save']['pt-pt'] = "Guardar";
$text['button-save']['fr-fr'] = "Sauvegarder";
$text['confirm-delete']['en-us'] = "Do you really want to delete this?";
$text['confirm-delete']['pt-pt'] = "Tem a certeza que pretende remover isto?";
$text['confirm-delete']['fr-fr'] = "Voulez-vous vraiment supprimer cela?";
$text['confirm-copy']['en-us'] = "Do you really want to copy this?";
$text['confirm-copy']['pt-pt'] = "Tem a certeza que pretende copiar isto?";
$text['confirm-copy']['fr-fr'] = "Voulez-vous vraiment copier cela?";
$text['message-add']['en-us'] = "Add Completed";
$text['message-add']['pt-pt'] = "Adição Efectuada";
$text['message-add']['fr-fr'] = "Ajouté";
$text['message-update']['en-us'] = "Update Completed";
$text['message-update']['pt-pt'] = "Actualização Efectuada";
$text['message-update']['fr-fr'] = "Mis à jour";
$text['message-delete']['en-us'] = "Delete Completed";
$text['message-delete']['pt-pt'] = "Remoção Efectuada";
$text['message-delete']['fr-fr'] = "Supprimé";
$text['message-copy']['en-us'] = "Copy Completed";
$text['message-copy']['pt-pt'] = "Cópia Efectuada";
$text['message-copy']['fr-fr'] = "Copié";
$text['message-required']['en-us'] = "Please provide: ";
$text['message-required']['pt-pt'] = "Por favor indique: ";
$text['message-required']['fr-fr'] = "Merci d'indiquer: ";
?>

View File

@@ -53,6 +53,7 @@ else {
if (count($_POST)>0) {
$sip_profile_name = check_str($_POST["sip_profile_name"]);
$sip_profile_description = check_str($_POST["sip_profile_description"]);
$sip_profile_hostname = check_str($_POST["sip_profile_hostname"]);
}
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
@@ -86,12 +87,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "(";
$sql .= "sip_profile_uuid, ";
$sql .= "sip_profile_name, ";
$sql .= "sip_profile_hostname, ";
$sql .= "sip_profile_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
$sql .= "'$sip_profile_name', ";
$sql .= "'$sip_profile_hostname', ";
$sql .= "'$sip_profile_description' ";
$sql .= ")";
$db->exec(check_sql($sql));
@@ -102,6 +105,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
$sql = "update v_sip_profiles set ";
$sql .= "sip_profile_name = '$sip_profile_name', ";
$sql .= "sip_profile_hostname = '$sip_profile_hostname', ";
$sql .= "sip_profile_description = '$sip_profile_description' ";
$sql .= "where sip_profile_uuid = '$sip_profile_uuid'";
$db->exec(check_sql($sql));
@@ -136,6 +140,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$result = $prep_statement->fetchAll();
foreach ($result as &$row) {
$sip_profile_name = $row["sip_profile_name"];
$sip_profile_hostname = $row["sip_profile_hostname"];
$sip_profile_description = $row["sip_profile_description"];
break; //limit to 1 row
}
@@ -180,6 +185,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-hostname'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='sip_profile_hostname' maxlength='255' value=\"$sip_profile_hostname\">\n";
echo "<br />\n";
echo $text['description-hostname']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-description'].":\n";

View File

@@ -58,8 +58,12 @@ require_once "resources/paging.php";
echo "<table width='100%' border='0'>\n";
echo " <tr>\n";
echo " <td align='left' width='50%' nowrap='nowrap'><b>".$text['header-sip_profiles']."</b></td>\n";
echo " <td width='50%' align='right'>&nbsp;</td>\n";
echo " <td align='left' width='33%' nowrap='nowrap'><b>".$text['header-sip_profiles']."</b></td>\n";
echo " <td width='33%' align='right'>&nbsp;</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' width='33%' nowrap='nowrap'><b>".$text['header-hostname']."</b></td>\n";
echo " <td width='33%' align='right'>&nbsp;</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' colspan='2'>\n";
@@ -109,6 +113,7 @@ require_once "resources/paging.php";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('sip_profile_name', $text['label-name'], $order_by, $order);
echo "<th align='left' >".$text['label-hostname']."</th>\n";
echo "<th align='left' width='60%'>".$text['label-description']."</th>\n";
echo "<td align='right' width='42'>\n";
if (permission_exists('sip_profile_add')) {
@@ -121,6 +126,7 @@ require_once "resources/paging.php";
foreach($result as $row) {
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['sip_profile_name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['sip_profile_hostname']."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg'>".$row['sip_profile_description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('sip_profile_edit')) {
@@ -140,9 +146,10 @@ require_once "resources/paging.php";
echo "<td colspan='3' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
echo " <td width='25%' nowrap>&nbsp;</td>\n";
echo " <td width='25%' nowrap>&nbsp;</td>\n";
echo " <td width='25%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='25%' align='right'>\n";
if (permission_exists('sip_profile_add')) {
echo " <a href='sip_profile_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}