diff --git a/app/voicemails/resources/dashboard/voicemails.php b/app/voicemails/resources/dashboard/voicemails.php
index 6cb9253a9c..ad036a3a64 100644
--- a/app/voicemails/resources/dashboard/voicemails.php
+++ b/app/voicemails/resources/dashboard/voicemails.php
@@ -22,116 +22,120 @@
$theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/";
//voicemail
- //if (is_array($selected_blocks) && in_array('voicemail', $selected_blocks) && permission_exists('voicemail_message_view') && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/voicemails/")) {
- //required class
- require_once "app/voicemails/resources/classes/voicemail.php";
- //get the voicemail
- $vm = new voicemail;
- $vm->db = $db;
- $vm->domain_uuid = $_SESSION['domain_uuid'];
- $vm->order_by = $order_by;
- $vm->order = $order;
- $voicemails = $vm->messages();
- //sum total and new
- $messages['total'] = 0;
- $messages['new'] = 0;
- if (sizeof($voicemails) > 0) {
- foreach($voicemails as $field) {
- $messages[$field['voicemail_uuid']]['ext'] = $field['voicemail_id'];
- $messages[$field['voicemail_uuid']]['total'] = 0;
- $messages[$field['voicemail_uuid']]['new'] = 0;
- foreach($field['messages'] as &$row) {
- if ($row['message_status'] == '') {
- $messages[$field['voicemail_uuid']]['new']++;
- $messages['new']++;
- }
- $messages[$field['voicemail_uuid']]['total']++;
- $messages['total']++;
- }
+ echo "
\n";
+
+//required class
+ require_once "app/voicemails/resources/classes/voicemail.php";
+
+//get the voicemail
+ $vm = new voicemail;
+ $vm->db = $db;
+ $vm->domain_uuid = $_SESSION['domain_uuid'];
+ $vm->order_by = $order_by;
+ $vm->order = $order;
+ $voicemails = $vm->messages();
+
+//sum total and new
+ $messages['total'] = 0;
+ $messages['new'] = 0;
+ if (sizeof($voicemails) > 0) {
+ foreach($voicemails as $field) {
+ $messages[$field['voicemail_uuid']]['ext'] = $field['voicemail_id'];
+ $messages[$field['voicemail_uuid']]['total'] = 0;
+ $messages[$field['voicemail_uuid']]['new'] = 0;
+ foreach($field['messages'] as &$row) {
+ if ($row['message_status'] == '') {
+ $messages[$field['voicemail_uuid']]['new']++;
+ $messages['new']++;
}
+ $messages[$field['voicemail_uuid']]['total']++;
+ $messages['total']++;
}
+ }
+ }
- //add doughnut chart
- echo "
-
+//add doughnut chart
+ echo "
+
-
- ";
-
- echo "
";
- if (sizeof($voicemails) > 0) {
- echo "
";
- echo "";
- echo " | ".$text['label-voicemail']." | ";
- echo " ".$text['label-new']." | ";
- echo " ".$text['label-total']." | ";
- echo "
";
-
- $c = 0;
- $row_style["0"] = "row_style0";
- $row_style["1"] = "row_style1";
-
- foreach ($messages as $voicemail_uuid => $row) {
- if (is_uuid($voicemail_uuid)) {
- $tr_link = "href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php?id=".(permission_exists('voicemail_view') ? $voicemail_uuid : $row['ext'])."'";
- echo "";
- echo " | ".$row['ext']." | ";
- echo " ".$row['new']." | ";
- echo " ".$row['total']." | ";
- echo "
";
- $c = ($c) ? 0 : 1;
+ legend: {
+ display: false
+ },
+ title: {
+ display: true,
+ text: '".$text['label-new_messages']."',
+ fontFamily: chart_font_family
+ }
}
- }
+ },
+ plugins: [chart_counter],
+ };
- echo "
";
+ const new_messages_chart = new Chart(
+ document.getElementById('new_messages_chart'),
+ new_messages_config
+ );
+
+ ";
+
+ echo "
";
+ if (sizeof($voicemails) > 0) {
+ echo "
";
+ echo "";
+ echo " | ".$text['label-voicemail']." | ";
+ echo " ".$text['label-new']." | ";
+ echo " ".$text['label-total']." | ";
+ echo "
";
+
+ $c = 0;
+ $row_style["0"] = "row_style0";
+ $row_style["1"] = "row_style1";
+
+ foreach ($messages as $voicemail_uuid => $row) {
+ if (is_uuid($voicemail_uuid)) {
+ $tr_link = "href='".PROJECT_PATH."/app/voicemails/voicemail_messages.php?id=".(permission_exists('voicemail_view') ? $voicemail_uuid : $row['ext'])."'";
+ echo "";
+ echo " | ".$row['ext']." | ";
+ echo " ".$row['new']." | ";
+ echo " ".$row['total']." | ";
+ echo "
";
+ $c = ($c) ? 0 : 1;
}
- else {
- echo "
".$text['label-no_voicemail_assigned'];
- }
- echo "";
- $n++;
- //}
- echo " ";
+ }
+
+ echo "
";
+ }
+ else {
+ echo "
".$text['label-no_voicemail_assigned'];
+ }
+ echo "
";
+ $n++;
+
+ echo "
";
+ echo "
\n";
?>