From 8403c75bc473deb9163a676e9563629a59808ac3 Mon Sep 17 00:00:00 2001 From: George Dawoud Date: Mon, 3 Jul 2017 08:41:57 -0700 Subject: [PATCH 1/6] month view only show current month events from #2625 --- src/calendar.php | 78 ++++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/src/calendar.php b/src/calendar.php index f3a6f9857c..c5e756c6bb 100644 --- a/src/calendar.php +++ b/src/calendar.php @@ -11,57 +11,65 @@ require 'Include/Header.php'; ?>
-
-
- getEventTypes() as $type) { - ?> -
-
-
- +
+
+ getEventTypes() as $type) { + ?> +
+
+
+ +
-
-
-
- -
+
+
+ +
+
+
- -
- +
  - + From 6cc3483441bf9a917b006cf0ca93ebdae25c21a7 Mon Sep 17 00:00:00 2001 From: George Dawoud Date: Mon, 3 Jul 2017 08:43:52 -0700 Subject: [PATCH 2/6] Apply fixes from StyleCI (#2689) --- src/calendar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calendar.php b/src/calendar.php index c5e756c6bb..2c0094423e 100644 --- a/src/calendar.php +++ b/src/calendar.php @@ -21,13 +21,13 @@
getEventTypes() as $type) { - ?> + ?>
+} ?>
From 291bf93ed2fac743dc02228c448f3eb1bd6c8f69 Mon Sep 17 00:00:00 2001 From: George Dawoud Date: Mon, 3 Jul 2017 09:09:15 -0700 Subject: [PATCH 3/6] 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 @@ diff --git a/src/Checkin.php b/src/Checkin.php index 7d999c13f7..564a70b2e7 100644 --- a/src/Checkin.php +++ b/src/Checkin.php @@ -397,7 +397,15 @@ class="direct-chat-img initials-image">  diff --git a/src/FamilyList.php b/src/FamilyList.php index 253a5ebee9..cff2a5426d 100644 --- a/src/FamilyList.php +++ b/src/FamilyList.php @@ -84,7 +84,16 @@ diff --git a/src/Include/Header-function.php b/src/Include/Header-function.php index 6fb79e09fe..07a56d4bac 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,27 +120,15 @@ 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 = ($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 (($text > '') && ($aMenu['session_var_in_text']) && isset($_SESSION[$aMenu['session_var']])) { + $text .= ' ' . $_SESSION[$aMenu['session_var']]; } - $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']]; } -} -if ($aMenu['ismenu']) { - $sSQL = "SELECT name + 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']) . ''; + if ($aMenu['icon'] != '') { + echo ''; + } + if ($aMenu['parent'] != 'root') { + echo ' '; + } + if ($aMenu['parent'] == 'root') { + echo '' . gettext($aMenu['content']) . ''; + } else { + echo gettext($aMenu['content']) . ''; + } + } } else { - 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 "
  • \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 5ed08a0d07..11d6a1b079 100644 --- a/src/ListEvents.php +++ b/src/ListEvents.php @@ -357,7 +357,16 @@ diff --git a/src/PersonView.php b/src/PersonView.php index 39a62bda9a..f20fe8c02f 100644 --- a/src/PersonView.php +++ b/src/PersonView.php @@ -971,8 +971,14 @@ function GroupAdd() { $("#input-volunteer-opportunities").select2(); $("#input-person-properties").select2(); - $("#assigned-volunteer-opps-table").DataTable(window.CRM.plugin.dataTable); - $("#assigned-properties-table").DataTable(window.CRM.plugin.dataTable); + 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); contentExists(window.CRM.root + "/api/persons/" + person_ID + "/photo", function(success) { diff --git a/src/UserList.php b/src/UserList.php index d6ffe32f76..3ab55bac36 100644 --- a/src/UserList.php +++ b/src/UserList.php @@ -106,7 +106,11 @@