From 2a9ac0119e15691f8e4e0c2363ea94a587afc871 Mon Sep 17 00:00:00 2001 From: Levdbas-L Date: Sun, 1 Oct 2017 18:13:40 +0200 Subject: [PATCH] comments in functions. --- admin/js/support-hours-admin.js | 9 +++------ .../support-hours-admin-settings-workTable.php | 6 ++++-- admin/partials/support-hours-functions.php | 9 +++++---- admin/support-hours-admin-overview.php | 9 +++++---- admin/support-hours-admin-settings.php | 8 ++++---- admin/support-hours-admin-widget.php | 10 ++++++++-- 6 files changed, 29 insertions(+), 22 deletions(-) diff --git a/admin/js/support-hours-admin.js b/admin/js/support-hours-admin.js index 1991327..56a58a7 100644 --- a/admin/js/support-hours-admin.js +++ b/admin/js/support-hours-admin.js @@ -68,18 +68,18 @@ }) }) } - + // remove workFields row. $('.remove-row').click(function(e){ $(this).parents('.repeating').remove(); }); - + // set date field to todays date. $('.today').click(function(e){ var today = $('.currentDate').text(); e.preventDefault(); $(this).prev().val(today); }); - // Clone the previous section, and remove all of the values + // Clone the previous workField, and remove all of the values $('.repeat').click(function(e){ e.preventDefault(); var lastRepeatingGroup = jQuery('.repeating').last(); @@ -91,7 +91,4 @@ resetAttributeNames(cloned) }); }); - $(window).resize(function() { - $(".progress-bar").loading(); - }); })(jQuery); diff --git a/admin/partials/support-hours-admin-settings-workTable.php b/admin/partials/support-hours-admin-settings-workTable.php index 42f21ec..a4f904b 100644 --- a/admin/partials/support-hours-admin-settings-workTable.php +++ b/admin/partials/support-hours-admin-settings-workTable.php @@ -15,14 +15,16 @@ - + - - ||| ?> diff --git a/admin/partials/support-hours-functions.php b/admin/partials/support-hours-functions.php index abd3a78..9a2e34a 100644 --- a/admin/partials/support-hours-functions.php +++ b/admin/partials/support-hours-functions.php @@ -1,6 +1,6 @@ plugin_name); $users = $options['users']; $email = $options['email']; @@ -61,8 +61,9 @@ function AddTime($workFields) { $bought_hours = $options['bought_hours']; $bought_hours = minuszeros($bought_hours); $current_color = get_user_option( 'admin_color' ); + $size = 'big'; - + // TODO:set code to functions. if (strpos($used_hours, ':') !== false){ $size = 'small'; } else{ diff --git a/admin/support-hours-admin-overview.php b/admin/support-hours-admin-overview.php index 71d78db..54792cd 100644 --- a/admin/support-hours-admin-overview.php +++ b/admin/support-hours-admin-overview.php @@ -1,9 +1,7 @@ plugin_name); $bought_hours = $options['bought_hours']; $workFields = $options['workFields']; @@ -34,7 +33,9 @@ + // loop the $workFields. Show all. + foreach ( array_reverse($workFields) as $field ) { + ?> diff --git a/admin/support-hours-admin-settings.php b/admin/support-hours-admin-settings.php index a46bd1e..37cf366 100644 --- a/admin/support-hours-admin-settings.php +++ b/admin/support-hours-admin-settings.php @@ -1,18 +1,17 @@ -plugin_name); $bought_hours = $options['bought_hours']; $users = $options['users']; @@ -25,6 +24,7 @@

plugin_name); do_settings_sections($this->plugin_name); include_once( 'partials/support-hours-admin-settings-textFields.php' ); diff --git a/admin/support-hours-admin-widget.php b/admin/support-hours-admin-widget.php index 4872a96..f5e7a6a 100644 --- a/admin/support-hours-admin-widget.php +++ b/admin/support-hours-admin-widget.php @@ -11,13 +11,16 @@ * @package Support_Hours * @subpackage Support_Hours/admin/partials */ - +// check if user is set or is empty. if(!empty($users) && !empty($bought_hours)): $user_ID = get_current_user_id(); + + // several includes to modulize the code. include_once( 'partials/support-hours-admin-widget-clock.php' ); include_once( 'partials/support-hours-admin-widget-hourTable.php' ); include_once( 'partials/support-hours-admin-widget-bottomMessage.php' ); elseif(empty($users)): + // if $users is empty or users do not match. ?>

@@ -26,7 +29,10 @@

- +

plugin_name); ?>.