From 291bf93ed2fac743dc02228c448f3eb1bd6c8f69 Mon Sep 17 00:00:00 2001 From: George Dawoud Date: Mon, 3 Jul 2017 09:09:15 -0700 Subject: [PATCH] Fix Datatable settings created a common JS datatable settings for all standard datatables to use.. fixed dataTable to DataTable --- src/CartView.php | 6 +- src/Checkin.php | 10 +- src/EventNames.php | 11 +- src/FamilyList.php | 11 +- src/Include/Header-function.php | 154 +++++++++++---------- src/ListEvents.php | 11 +- src/PersonView.php | 10 +- src/UserList.php | 6 +- src/skin/js/FamilyView.js | 7 +- src/sundayschool/SundaySchoolClassView.php | 11 +- src/sundayschool/SundaySchoolDashboard.php | 7 +- 11 files changed, 94 insertions(+), 150 deletions(-) diff --git a/src/CartView.php b/src/CartView.php index ea2ad6e77b..c2979fa60d 100644 --- a/src/CartView.php +++ b/src/CartView.php @@ -360,11 +360,7 @@ function codename() diff --git a/src/Checkin.php b/src/Checkin.php index 564a70b2e7..7d999c13f7 100644 --- a/src/Checkin.php +++ b/src/Checkin.php @@ -397,15 +397,7 @@ class="direct-chat-img initials-image">  diff --git a/src/FamilyList.php b/src/FamilyList.php index cff2a5426d..253a5ebee9 100644 --- a/src/FamilyList.php +++ b/src/FamilyList.php @@ -84,16 +84,7 @@ diff --git a/src/Include/Header-function.php b/src/Include/Header-function.php index 07a56d4bac..6fb79e09fe 100644 --- a/src/Include/Header-function.php +++ b/src/Include/Header-function.php @@ -37,13 +37,13 @@ function Header_system_notifications() { if (NotificationService::hasActiveNotifications()) { ?> -
- link."\">".$notification->title.""; - } ?> -
- + link . "\">" . $notification->title . ""; + } ?> + +
@@ -87,7 +87,7 @@ function Header_modals()
+ for="issueDescription">
@@ -120,15 +120,27 @@ function Header_body_scripts() global $localeInfo; $systemService = new SystemService(); ?> - + '') && ($aMenu['session_var_in_uri']) && isset($_SESSION[$aMenu['session_var']])) { - if (strstr($link, '?') && true) { - $cConnector = '&'; - } else { - $cConnector = '?'; - } - $link .= $cConnector . $aMenu['url_parm_name'] . '=' . $_SESSION[$aMenu['session_var']]; - } - if (($text > '') && ($aMenu['session_var_in_text']) && isset($_SESSION[$aMenu['session_var']])) { - $text .= ' ' . $_SESSION[$aMenu['session_var']]; +$link = ($aMenu['uri'] == '') ? '' : SystemURLs::getRootPath() . '/' . $aMenu['uri']; +$text = $aMenu['statustext']; +if (!is_null($aMenu['session_var'])) { + if (($link > '') && ($aMenu['session_var_in_uri']) && isset($_SESSION[$aMenu['session_var']])) { + if (strstr($link, '?') && true) { + $cConnector = '&'; + } else { + $cConnector = '?'; } + $link .= $cConnector . $aMenu['url_parm_name'] . '=' . $_SESSION[$aMenu['session_var']]; } - if ($aMenu['ismenu']) { - $sSQL = "SELECT name + if (($text > '') && ($aMenu['session_var_in_text']) && isset($_SESSION[$aMenu['session_var']])) { + $text .= ' ' . $_SESSION[$aMenu['session_var']]; + } +} +if ($aMenu['ismenu']) { + $sSQL = "SELECT name FROM menuconfig_mcf WHERE parent = '" . $aMenu['name'] . "' AND active=1 " . $security_matrix . ' ORDER BY sortorder'; - $rsItemCnt = RunQuery($sSQL); - $numItems = mysqli_num_rows($rsItemCnt); - } - if (!($aMenu['ismenu']) || ($numItems > 0)) { - if ($link) { - if ($aMenu['name'] != 'sundayschool-dash') { // HACK to remove the sunday school 2nd dashboard + $rsItemCnt = RunQuery($sSQL); + $numItems = mysqli_num_rows($rsItemCnt); +} +if (!($aMenu['ismenu']) || ($numItems > 0)) { +if ($link) { + if ($aMenu['name'] != 'sundayschool-dash') { // HACK to remove the sunday school 2nd dashboard echo "
  • "; - if ($aMenu['icon'] != '') { - echo ''; - } - if ($aMenu['parent'] != 'root') { - echo ' '; - } - if ($aMenu['parent'] == 'root') { - echo '' . gettext($aMenu['content']) . ''; - } else { - echo gettext($aMenu['content']) . ''; - } - } + if ($aMenu['icon'] != '') { + echo ''; + } + if ($aMenu['parent'] != 'root') { + echo ' '; + } + if ($aMenu['parent'] == 'root') { + echo '' . gettext($aMenu['content']) . ''; } else { - echo "
  • \n"; - echo " \n"; - if ($aMenu['icon'] != '') { - echo '\n"; - } - echo '' . gettext($aMenu['content']) . "\n"; - echo "\n"; - if ($aMenu['name'] == 'deposit') { - echo '' . $_SESSION['iCurrentDeposit'] . "\n"; - } ?> + echo gettext($aMenu['content']) . ''; + } + } +} else { +echo "
  • \n"; +echo " \n"; +if ($aMenu['icon'] != '') { + echo '\n"; +} +echo '' . gettext($aMenu['content']) . "\n"; +echo "\n"; +if ($aMenu['name'] == 'deposit') { + echo '' . $_SESSION['iCurrentDeposit'] . "\n"; +} ?> \n
  • \n"; - } else { - echo "\n"; - } + } + if (($aMenu['ismenu']) && ($numItems > 0)) { + echo "\n"; + addMenu($aMenu['name']); + echo "\n\n"; + } else { + echo "\n"; + } - return true; + return true; } else { return false; } -} + } function create_side_nav($menu) { diff --git a/src/ListEvents.php b/src/ListEvents.php index 11d6a1b079..5ed08a0d07 100644 --- a/src/ListEvents.php +++ b/src/ListEvents.php @@ -357,16 +357,7 @@ diff --git a/src/PersonView.php b/src/PersonView.php index f20fe8c02f..39a62bda9a 100644 --- a/src/PersonView.php +++ b/src/PersonView.php @@ -971,14 +971,8 @@ function GroupAdd() { $("#input-volunteer-opportunities").select2(); $("#input-person-properties").select2(); - var options = { - "language": { - "url": window.CRM.root + "/skin/locale/datatables/" + window.CRM.locale + ".json" - }, - "responsive": true - }; - $("#assigned-volunteer-opps-table").DataTable(options); - $("#assigned-properties-table").DataTable(options); + $("#assigned-volunteer-opps-table").DataTable(window.CRM.plugin.dataTable); + $("#assigned-properties-table").DataTable(window.CRM.plugin.dataTable); contentExists(window.CRM.root + "/api/persons/" + person_ID + "/photo", function(success) { diff --git a/src/UserList.php b/src/UserList.php index 3ab55bac36..d6ffe32f76 100644 --- a/src/UserList.php +++ b/src/UserList.php @@ -106,11 +106,7 @@