Add links to certain column text in a list view.

Add ability to edit Call Block number.
This commit is contained in:
Nate Jones
2014-06-21 00:58:16 +00:00
parent 93786dd1b9
commit e979147858
14 changed files with 165 additions and 146 deletions

View File

@@ -127,10 +127,15 @@
$text['label-edit-note']['pt-pt'] = "Bloquear chamadas a partir de um número. Edite o nome e active/desactive.";
$text['label-edit-note']['fr-fr'] = "Bloquer les appels à partir d'un numéro. Editer le nom et activer/désactiver ci-dessous.";
$text['label-exact-number']['en-us'] = "Enter the exact number.";
$text['label-exact-number']['es-cl'] = "Ingrese el nú exacto.";
$text['label-exact-number']['pt-pt'] = "Introduza o número exacto.";
$text['label-exact-number']['fr-fr'] = "Entrer le numéro exact.";
$text['description-number']['en-us'] = "Enter the exact number.";
$text['description-number']['es-cl'] = "Ingrese el nú exacto.";
$text['description-number']['pt-pt'] = "Introduza o número exacto.";
$text['description-number']['fr-fr'] = "Entrer le numéro exact.";
$text['description-name']['en-us'] = "Enter the name.";
$text['description-name']['es-cl'] = "Introduzca el nombre.";
$text['description-name']['pt-pt'] = "Digite o nome.";
$text['description-name']['fr-fr'] = "Entrez le nom.";
$text['label-reject']['en-us'] = "Reject";
$text['label-reject']['es-cl'] = "Rechazar";
@@ -142,10 +147,10 @@
$text['label-busy']['pt-pt'] = "Ocupado";
$text['label-busy']['fr-fr'] = "Occupé";
$text['label-action-message']['en-us'] = "Set an action for calls from this number.";
$text['label-action-message']['es-cl'] = "Configurar una acción para llamadas desde este número.";
$text['label-action-message']['pt-pt'] = "Escolha uma acção para chamadas com origem neste número.";
$text['label-action-message']['fr-fr'] = "Choisir une action pour les appels venant de ce numéro.";
$text['description-action']['en-us'] = "Set an action for calls from this number.";
$text['description-action']['es-cl'] = "Configurar una acción para llamadas desde este número.";
$text['description-action']['pt-pt'] = "Escolha uma acção para chamadas com origem neste número.";
$text['description-action']['fr-fr'] = "Choisir une action pour les appels venant de ce numéro.";
$text['label-true']['en-us'] = "True";
$text['label-true']['es-cl'] = "Verdadero";
@@ -157,10 +162,10 @@
$text['label-false']['pt-pt'] = "Não";
$text['label-false']['fr-fr'] = "Non";
$text['label-enable-message']['en-us'] = "Set to true to enable call blocking for this number.";
$text['label-enable-message']['es-cl'] = "Seleccione verdadero para activar el bloqueo de llamadas desde este número.";
$text['label-enable-message']['pt-pt'] = "Escolha 'sim' para activar o bloqueio de chamadas para este número.";
$text['label-enable-message']['fr-fr'] = "Choisir Oui pour activer le bloquage d'appel. ";
$text['description-enable']['en-us'] = "Set to true to enable call blocking for this number.";
$text['description-enable']['es-cl'] = "Seleccione verdadero para activar el bloqueo de llamadas desde este número.";
$text['description-enable']['pt-pt'] = "Escolha 'sim' para activar o bloqueio de chamadas para este número.";
$text['description-enable']['fr-fr'] = "Choisir Oui pour activer le bloquage d'appel. ";
$text['button-save']['en-us'] = "Save";
$text['button-save']['es-cl'] = "Guardar";

View File

@@ -112,7 +112,7 @@ else {
echo "<tr>\n";
echo th_order_by('call_block_number', $text['label-number'], $order_by, $order);
echo th_order_by('call_block_name', $text['label-name'], $order_by, $order);
echo th_order_by('call_block_count', $text['label-count'], $order_by, $order);
echo th_order_by('call_block_count', $text['label-count'], $order_by, $order, '', "style='text-align: center;'");
echo th_order_by('date_added', $text['label-date-added'], $order_by, $order);
echo th_order_by('call_block_action', $text['label-action'], $order_by, $order);
echo th_order_by('call_block_enabled', $text['label-enabled'], $order_by, $order);
@@ -125,18 +125,25 @@ else {
if ($result_count > 0) {
foreach($result as $row) {
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['call_block_number']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['call_block_name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['call_block_count']."&nbsp;</td>\n";
echo "<tr>\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if (permission_exists('call_block_edit')) {
echo "<a href='call_block_edit.php?id=".$row['call_block_uuid']."'>".$row['call_block_number']."</a>";
}
else {
echo $row['call_block_number'];
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['call_block_name']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;'>".$row['call_block_count']."</td>\n";
if (defined('TIME_24HR') && TIME_24HR == 1) {
$tmp_date_added = date("j M Y H:i:s", $row['date_added']);
} else {
$tmp_date_added = date("j M Y h:i:sa", $row['date_added']);
}
echo " <td valign='top' class='".$row_style[$c]."'>".$tmp_date_added."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['call_block_action']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['call_block_enabled']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$tmp_date_added."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['call_block_action']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['call_block_enabled'])."</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('call_block_edit')) {
echo "<a href='call_block_edit.php?id=".$row['call_block_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";

View File

@@ -147,7 +147,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
$sql = "update v_call_block set ";
$sql .= "call_block_name = '$call_block_name', ";
//$sql .= "call_block_number = '$call_block_number', ";
$sql .= "call_block_number = '$call_block_number', ";
$sql .= "call_block_action = '$call_block_action', ";
$sql .= "call_block_enabled = '$call_block_enabled' ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
@@ -221,40 +221,34 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Number:\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-number'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if ($action == "add") {
echo " <input class='formfld' type='text' name='call_block_number' maxlength='255' value=\"$call_block_number\">\n";
echo "<br />\n";
echo $text['label-exact-number']."\n";
}
else {
echo $call_block_number;
}
echo " <input class='formfld' type='text' name='call_block_number' maxlength='255' value=\"$call_block_number\">\n";
echo "<br />\n";
echo $text['description-number']."\n";
echo "<br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Name:\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-name'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_block_name' maxlength='255' value=\"$call_block_name\">\n";
echo "<br />\n";
echo "Enter the name.\n";
echo $text['description-name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Action:\n";
echo " ".$text['label-action'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='call_block_action'>\n";
echo " <option value=''></option>\n";
$pieces = explode(" ", $call_block_action);
$action = $pieces[0];
$extension = $pieces[2];
@@ -273,14 +267,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
call_block_get_extensions($extension);
echo " </select>\n";
echo "<br />\n";
echo $text['label-action-message']."\n";
echo $text['description-action']."\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Enabled:\n";
echo " ".$text['label-enabled'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='call_block_enabled'>\n";
@@ -288,7 +282,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <option value='false' ".(($call_block_enabled == "false") ? "selected" : null).">".$text['label-false']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['label-enable-message']."\n";
echo $text['description-enable']."\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";