Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split destinations column in domain counts #186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions domain_counts/domain_counts.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,19 @@
$sql .= "where domain_uuid = d.domain_uuid\n";
$sql .= ") as device_count, \n";

//destinations
//inbound-destinations
$sql .= "(\n";
$sql .= "select count(*) from v_destinations \n";
$sql .= "where domain_uuid = d.domain_uuid\n";
$sql .= ") as destination_count, \n";
$sql .= "where domain_uuid = d.domain_uuid \n";
$sql .= "and destination_type = 'inbound'\n";
$sql .= ") as inbound_destination_count, \n";

//outbound-destinations
$sql .= "(\n";
$sql .= "select count(*) from v_destinations \n";
$sql .= "where domain_uuid = d.domain_uuid \n";
$sql .= "and destination_type = 'outbound'\n";
$sql .= ") as outbound_destination_count, \n";

//faxes
$sql .= "(\n";
Expand Down Expand Up @@ -246,7 +254,8 @@
echo th_order_by('extension_count', $text['label-extensions'], $order_by,$order);
echo th_order_by('user_count', $text['label-users'], $order_by, $order);
echo th_order_by('device_count', $text['label-devices'], $order_by, $order);
echo th_order_by('destination_count', $text['label-destinations'], $order_by, $order);
echo th_order_by('inbound_destination_count', $text['label-inbound-destinations'], $order_by, $order);
echo th_order_by('outbound_destination_count', $text['label-outbound-destinations'], $order_by, $order);
echo th_order_by('fax_count', $text['label-faxes'], $order_by, $order);
echo th_order_by('ivr_count', $text['label-ivrs'], $order_by, $order);
echo th_order_by('voicemail_count', $text['label-voicemails'], $order_by, $order);
Expand All @@ -263,7 +272,8 @@
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['extension_count'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['user_count'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['device_count'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['destination_count'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['inbound_destination_count'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['outbound_destination_count'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['fax_count'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['ivr_count'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['voicemail_count'])."&nbsp;</td>\n";
Expand Down