diff --git a/admin/class-support-hours-admin.php b/admin/class-support-hours-admin.php index 62c42c0..ab4ebcf 100644 --- a/admin/class-support-hours-admin.php +++ b/admin/class-support-hours-admin.php @@ -1,52 +1,52 @@ - */ +* The admin-specific functionality of the plugin. +* +* Defines the plugin name, version, and two examples hooks for how to +* enqueue the admin-specific stylesheet and JavaScript. +* +* @package Support_Hours +* @subpackage Support_Hours/admin +* @author Erik van der Bas +*/ class Support_Hours_Admin { /** - * The ID of this plugin. - * - * @since 1.0.0 - * @access private - * @var string $plugin_name The ID of this plugin. - */ + * The ID of this plugin. + * + * @since 1.0.0 + * @access private + * @var string $plugin_name The ID of this plugin. + */ private $plugin_name; /** - * The version of this plugin. - * - * @since 1.0.0 - * @access private - * @var string $version The current version of this plugin. - */ + * The version of this plugin. + * + * @since 1.0.0 + * @access private + * @var string $version The current version of this plugin. + */ private $version; /** - * Initialize the class and set its properties. - * - * @since 1.0.0 - * @param string $plugin_name The name of this plugin. - * @param string $version The version of this plugin. - */ + * Initialize the class and set its properties. + * + * @since 1.0.0 + * @param string $plugin_name The name of this plugin. + * @param string $version The version of this plugin. + */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; @@ -54,49 +54,49 @@ public function __construct( $plugin_name, $version ) { } public function options_update() { - register_setting($this->plugin_name, $this->plugin_name, array($this, 'validate')); - } + register_setting($this->plugin_name, $this->plugin_name, array($this, 'validate')); + } /** - * Register the stylesheets for the admin area. - * - * @since 1.0.0 - */ + * Register the stylesheets for the admin area. + * + * @since 1.0.0 + */ public function enqueue_styles() { /** - * This function is provided for demonstration purposes only. - * - * An instance of this class should be passed to the run() function - * defined in Support_Hours_Loader as all of the hooks are defined - * in that particular class. - * - * The Support_Hours_Loader will then create the relationship - * between the defined hooks and the functions defined in this - * class. - */ + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Support_Hours_Loader as all of the hooks are defined + * in that particular class. + * + * The Support_Hours_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/support-hours-admin.min.css', array(), $this->version, 'all' ); } /** - * Register the JavaScript for the admin area. - * - * @since 1.0.0 - */ + * Register the JavaScript for the admin area. + * + * @since 1.0.0 + */ public function enqueue_scripts() { /** - * This function is provided for demonstration purposes only. - * - * An instance of this class should be passed to the run() function - * defined in Support_Hours_Loader as all of the hooks are defined - * in that particular class. - * - * The Support_Hours_Loader will then create the relationship - * between the defined hooks and the functions defined in this - * class. - */ + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Support_Hours_Loader as all of the hooks are defined + * in that particular class. + * + * The Support_Hours_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/support-hours-admin.js', array( 'jquery' ), $this->version, false ); @@ -104,46 +104,72 @@ public function enqueue_scripts() { public function add_plugin_admin_menu() { /* - * Add a settings page for this plugin to the Settings menu. - * - * NOTE: Alternative menu locations are available via WordPress administration menu functions. - * - * Administration Menus: http://codex.wordpress.org/Administration_Menus - * - */ - add_options_page( __( 'Support hours', $this->plugin_name), __( 'Support hours', $this->plugin_name), 'manage_options', $this->plugin_name, array($this, 'display_plugin_setup_page') + * Add a settings page for this plugin to the Settings menu. + * + * NOTE: Alternative menu locations are available via WordPress administration menu functions. + * + * Administration Menus: http://codex.wordpress.org/Administration_Menus + * + */ + add_menu_page( + __( 'Support Hours overview', $this->plugin_name), + __( 'Support Hours', $this->plugin_name), + 'publish_pages', + 'support-hours', + array($this, 'display_plugin_page'), + 'dashicons-clock' ); -} + add_submenu_page( + 'support-hours', + __( 'Support Hours overview', $this->plugin_name), + __( 'Overview', $this->plugin_name), + 'publish_pages', + 'support-hours', + array($this, 'display_plugin_page') + ); + add_submenu_page( + 'support-hours', + __( 'Support Hours settings', $this->plugin_name), + __( 'Settings', $this->plugin_name), + 'manage_options', + 'support-hours-settings', + array($this, 'display_plugin_setup_page') + ); + } - /** - * Add settings action link to the plugins page. - * - * @since 1.0.0 - */ + /** + * Add settings action link to the plugins page. + * + * @since 1.0.0 + */ public function add_action_links( $links ) { - /* - * Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name) - */ - $settings_link = array( - '' . __('Settings', $this->plugin_name) . '', - ); - return array_merge( $settings_link, $links ); + /* + * Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name) + */ + $settings_link = array( + '' . __('Settings', $this->plugin_name) . '', + ); + return array_merge( $settings_link, $links ); } /** - * Render the settings page for this plugin. - * - * @since 1.0.0 - */ + * Render the settings page for this plugin. + * + * @since 1.0.0 + */ + public function display_plugin_page() { + include_once( 'support-hours-admin-overview.php' ); + } public function display_plugin_setup_page() { - include_once( 'partials/support-hours-admin-page.php' ); + include_once( 'support-hours-admin-settings.php' ); } + public function validate($input) { $valid = array(); if ($input['bought_hours'] == null) { - $input['bought_hours'] = '00:00'; - } + $input['bought_hours'] = '00:00'; + } if($input['workFields'] == null){ $input['workFields'] = null; } @@ -153,21 +179,25 @@ public function validate($input) { $valid['workFields'] = $input['workFields']; return $valid; } + + function support_hours_add_dashboard_widgets() { + if ( current_user_can( 'publish_pages' ) ) { wp_add_dashboard_widget( - 'support_hours_dashboard_widget', // Widget slug. - __( 'Support Hours', $this->plugin_name), // Title. - array($this, 'support_hours_dashboard_widget_function') // Display function. + 'support_hours_dashboard_widget', // Widget slug. + __( 'Support Hours', $this->plugin_name), // Title. + array($this, 'support_hours_dashboard_widget_function') // Display function. ); global $wp_meta_boxes; - $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core']; - $support_hours_dashboard_widget_backup = array( 'support_hours_dashboard_widget' => $normal_dashboard['support_hours_dashboard_widget'] ); - unset( $normal_dashboard['support_hours_dashboard_widget'] ); - $sorted_dashboard = array_merge( $support_hours_dashboard_widget_backup, $normal_dashboard ); - $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard; + $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core']; + $support_hours_dashboard_widget_backup = array( 'support_hours_dashboard_widget' => $normal_dashboard['support_hours_dashboard_widget'] ); + unset( $normal_dashboard['support_hours_dashboard_widget'] ); + $sorted_dashboard = array_merge( $support_hours_dashboard_widget_backup, $normal_dashboard ); + $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard; + } } function support_hours_dashboard_widget_function() { include_once( 'partials/support-hours-functions.php' ); - include_once( 'partials/support-hours-admin-widget.php' ); + include_once( 'support-hours-admin-widget.php' ); } } diff --git a/admin/css/support-hours-admin.min.css b/admin/css/support-hours-admin.min.css index a1f0fb0..0f344e6 100644 --- a/admin/css/support-hours-admin.min.css +++ b/admin/css/support-hours-admin.min.css @@ -1 +1 @@ -.progress-bar{position:relative;width:100%;padding-bottom:100%}.progress-bar .background{background-color:#ccc}.progress-bar .left{background-color:#ccc;opacity:1}.progress-bar.midnight .rotate,.progress-bar.midnight .right{background-color:#e14d43}.progress-bar.midnight .innerCicle:hover .text{color:#e14d43}.progress-bar.ectoplasm .rotate,.progress-bar.ectoplasm .right{background-color:#a3b745}.progress-bar.ectoplasm .innerCicle:hover .text{color:#a3b745}.progress-bar.blue .rotate,.progress-bar.blue .right{background-color:#e1a948}.progress-bar.blue .innerCicle:hover .text{color:#e1a948}.progress-bar.ocean .rotate,.progress-bar.ocean .right{background-color:#9ebaa0}.progress-bar.ocean .innerCicle:hover .text{color:#9ebaa0}.progress-bar.coffee .rotate,.progress-bar.coffee .right{background-color:#c7a589}.progress-bar.coffee .innerCicle:hover .text{color:#c7a589}.progress-bar.sunrise .rotate,.progress-bar.sunrise .right{background-color:#dd823b}.progress-bar.sunrise .innerCicle:hover .text{color:#dd823b}.progress-bar .rotate{background-color:#008ec2}.progress-bar .right{background-color:#008ec2;transform:rotate(180deg);opacity:0}.progress-bar .innerCicle{width:90%;height:90%;margin:5%;position:absolute;z-index:12;border-radius:50%;background:white;transition:all 0.2s ease-in}.progress-bar .innerCicle .textHolder{display:block;top:50%;position:relative}.progress-bar .innerCicle .textHolder .text{text-align:center;display:block;color:#ccc;font-weight:bold;margin-top:-50px;font-size:35px;transition:all 0.2s ease-in;line-height:50px;position:absolute;width:100%}.progress-bar .innerCicle .textHolder .text.small{margin-top:-50px;line-height:50px;font-size:30px}.progress-bar .innerCicle:hover{width:94%;height:94%;margin:3%}.progress-bar .innerCicle:hover .text{font-size:45px;color:#008ec2}.progress-bar .innerCicle:hover .text.small{font-size:35px}.progress-bar div{border-radius:50%;height:100%;position:absolute;width:100%}.progress-bar .smallbr{display:none}@keyframes toggle{0%{opacity:0}100%{opacity:1}}@media screen and (max-width: 870px){.smallbr{display:block}.bigbr{display:none}.text{font-size:30px;line-height:40px;margin-top:-40px}.progress-bar:hover .text{font-size:40px}}@media screen and (max-width: 800px){.progress-bar{max-width:none;max-height:none}}#support_hours_dashboard_widget h3{margin:1.33em 0 0;font-size:16px;font-weight:bold}.bold{font-weight:bold;color:#444}.worktable{margin-top:20px;padding-bottom:10px;margin-bottom:10px}.worktable th{text-align:left}.worktable,.total{border-bottom:1px solid #eee}.total{padding-bottom:10px !important}.currentDate{display:none}.rwd-table{margin:1em 0;min-width:300px}.rwd-table tr{border-top:1px solid #ddd;border-bottom:1px solid #ddd}.rwd-table th{display:none}.rwd-table td{display:block}.rwd-table td:first-child{padding-top:.5em}.rwd-table td:last-child{padding-bottom:.5em}.rwd-table td.remove:before{content:'';width:0}.rwd-table td:before{content:attr(data-th) ": ";font-weight:bold;width:6.5em;display:inline-block}@media (min-width: 480px){.rwd-table td:before{display:none}}.rwd-table th,.rwd-table td{text-align:left}@media (min-width: 480px){.rwd-table th,.rwd-table td{display:table-cell;padding:.25em .5em}.rwd-table th:first-child,.rwd-table td:first-child{padding-left:0}.rwd-table th:last-child,.rwd-table td:last-child{padding-right:0}}.clearfix{clear:both} +.progress-bar{position:relative;width:100%;padding-bottom:100%}.progress-bar .background{background-color:#ccc}.progress-bar .left{background-color:#ccc;opacity:1}.progress-bar.midnight .rotate,.progress-bar.midnight .right{background-color:#e14d43}.progress-bar.midnight .innerCicle:hover .text{color:#e14d43}.progress-bar.ectoplasm .rotate,.progress-bar.ectoplasm .right{background-color:#a3b745}.progress-bar.ectoplasm .innerCicle:hover .text{color:#a3b745}.progress-bar.blue .rotate,.progress-bar.blue .right{background-color:#e1a948}.progress-bar.blue .innerCicle:hover .text{color:#e1a948}.progress-bar.ocean .rotate,.progress-bar.ocean .right{background-color:#9ebaa0}.progress-bar.ocean .innerCicle:hover .text{color:#9ebaa0}.progress-bar.coffee .rotate,.progress-bar.coffee .right{background-color:#c7a589}.progress-bar.coffee .innerCicle:hover .text{color:#c7a589}.progress-bar.sunrise .rotate,.progress-bar.sunrise .right{background-color:#dd823b}.progress-bar.sunrise .innerCicle:hover .text{color:#dd823b}.progress-bar .rotate{background-color:#008ec2}.progress-bar .right{background-color:#008ec2;transform:rotate(180deg);opacity:0}.progress-bar .innerCicle{width:90%;height:90%;margin:5%;position:absolute;z-index:12;border-radius:50%;background:white;transition:all 0.2s ease-in}.progress-bar .innerCicle .textHolder{display:block;top:50%;position:relative}.progress-bar .innerCicle .textHolder .text{text-align:center;display:block;color:#ccc;font-weight:bold;margin-top:-50px;font-size:35px;transition:all 0.2s ease-in;line-height:50px;position:absolute;width:100%}.progress-bar .innerCicle .textHolder .text.small{margin-top:-50px;line-height:50px;font-size:30px}.progress-bar .innerCicle:hover{width:94%;height:94%;margin:3%}.progress-bar .innerCicle:hover .text{font-size:45px;color:#008ec2}.progress-bar .innerCicle:hover .text.small{font-size:35px}.progress-bar div{border-radius:50%;height:100%;position:absolute;width:100%}.progress-bar .smallbr{display:none}@keyframes toggle{0%{opacity:0}100%{opacity:1}}@media screen and (max-width: 870px){.smallbr{display:block}.bigbr{display:none}.text{font-size:30px;line-height:40px;margin-top:-40px}.progress-bar:hover .text{font-size:40px}}@media screen and (max-width: 800px){.progress-bar{max-width:none;max-height:none}}#support_hours_dashboard_widget h3{margin:1.33em 0 0;font-size:16px;font-weight:bold}.bold{font-weight:bold;color:#444}.worktable{margin-top:20px;padding-bottom:10px;margin-bottom:10px}.worktable th{text-align:left}.total{border-top:1px solid #eee;border-bottom:1px solid #eee;margin:0 -12px;margin-top:10px;padding:8px 12px 4px;font-size:1rem;background:#fafafa}.currentDate{display:none}.rwd-table{margin:1em 0;min-width:300px}.rwd-table tr{border-top:1px solid #ddd;border-bottom:1px solid #ddd}.rwd-table th{display:none}.rwd-table td{display:block}.rwd-table td:first-child{padding-top:.5em}.rwd-table td:last-child{padding-bottom:.5em}.rwd-table td.remove:before{content:'';width:0}.rwd-table td:before{content:attr(data-th) ": ";font-weight:bold;width:6.5em;display:inline-block}@media (min-width: 480px){.rwd-table td:before{display:none}}.rwd-table th,.rwd-table td{text-align:left}@media (min-width: 480px){.rwd-table th,.rwd-table td{display:table-cell;padding:.25em .5em}.rwd-table th:first-child,.rwd-table td:first-child{padding-left:0}.rwd-table th:last-child,.rwd-table td:last-child{padding-right:0}}.clearfix{clear:both} diff --git a/admin/css/support-hours-admin.scss b/admin/css/support-hours-admin.scss index af759dd..d69d67e 100644 --- a/admin/css/support-hours-admin.scss +++ b/admin/css/support-hours-admin.scss @@ -177,11 +177,14 @@ $breakpoint-alpha: 480px; text-align: left; } } -.worktable, .total{ - border-bottom: 1px solid #eee; -} .total{ - padding-bottom: 10px !important; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; + margin: 0 -12px; + margin-top: 10px; + padding: 8px 12px 4px; + font-size: 1rem; + background:#fafafa; } .currentDate{ display: none; diff --git a/admin/js/support-hours-admin.js b/admin/js/support-hours-admin.js index 59c74b8..1991327 100644 --- a/admin/js/support-hours-admin.js +++ b/admin/js/support-hours-admin.js @@ -90,7 +90,6 @@ cloned.find("input:radio").attr("checked", false); resetAttributeNames(cloned) }); - }); $(window).resize(function() { $(".progress-bar").loading(); diff --git a/admin/partials/support-hours-admin-display-textFields.php b/admin/partials/support-hours-admin-settings-textFields.php similarity index 100% rename from admin/partials/support-hours-admin-display-textFields.php rename to admin/partials/support-hours-admin-settings-textFields.php diff --git a/admin/partials/support-hours-admin-display-workTable.php b/admin/partials/support-hours-admin-settings-workTable.php similarity index 89% rename from admin/partials/support-hours-admin-display-workTable.php rename to admin/partials/support-hours-admin-settings-workTable.php index 7e9418f..42f21ec 100644 --- a/admin/partials/support-hours-admin-display-workTable.php +++ b/admin/partials/support-hours-admin-settings-workTable.php @@ -1,3 +1,4 @@ + @@ -13,19 +14,20 @@ plugin_name); ?> - + - + - + ||| ?> - + @@ -37,11 +39,9 @@ - - @@ -62,10 +62,9 @@ - - + - plugin_name); ?>plugin_name), 'primary','submit', TRUE); ?> + plugin_name); ?>plugin_name), 'primary','submit', true); ?> diff --git a/admin/partials/support-hours-admin-widget-bottomMessage.php b/admin/partials/support-hours-admin-widget-bottomMessage.php index dea96b5..a54798e 100644 --- a/admin/partials/support-hours-admin-widget-bottomMessage.php +++ b/admin/partials/support-hours-admin-widget-bottomMessage.php @@ -2,10 +2,14 @@ plugin_name); ?>
= 80) {?> - plugin_name); ?>
+ plugin_name); ?>.
- plugin_name); ?>
+ plugin_name); ?>?
plugin_name); ?> - + (opens in a new window) + + + +

diff --git a/admin/partials/support-hours-admin-widget-hourTable.php b/admin/partials/support-hours-admin-widget-hourTable.php index 362db9a..e34efb6 100644 --- a/admin/partials/support-hours-admin-widget-hourTable.php +++ b/admin/partials/support-hours-admin-widget-hourTable.php @@ -9,14 +9,30 @@ - + - + = 5){ + break; + } + } + ?> -

plugin_name); ?>:

+ + plugin_name); ?> + + = 5 && current_user_can('publish_pages')): ?> + plugin_name); ?> + +
plugin_name); ?>:
+ + plugin_name); ?> diff --git a/admin/support-hours-admin-overview.php b/admin/support-hours-admin-overview.php new file mode 100644 index 0000000..71d78db --- /dev/null +++ b/admin/support-hours-admin-overview.php @@ -0,0 +1,53 @@ + +plugin_name); + $bought_hours = $options['bought_hours']; + $workFields = $options['workFields']; + include_once( 'partials/support-hours-functions.php' ); +?> +
+

+
+ + + + + + + + + + + + + + + + + + + + +
plugin_name); ?>plugin_name); ?>plugin_name); ?>
+
+ plugin_name); ?>: + plugin_name); ?> + plugin_name); ?> +
+ diff --git a/admin/partials/support-hours-admin-page.php b/admin/support-hours-admin-settings.php similarity index 84% rename from admin/partials/support-hours-admin-page.php rename to admin/support-hours-admin-settings.php index 2411b21..a46bd1e 100644 --- a/admin/partials/support-hours-admin-page.php +++ b/admin/support-hours-admin-settings.php @@ -9,7 +9,7 @@ * @since 1.0.0 * * @package Support_Hours -* @subpackage Support_Hours/admin/partials +* @subpackage Support_Hours/admin */ ?> plugin_name); do_settings_sections($this->plugin_name); - include_once( 'support-hours-admin-display-textFields.php' ); - include_once( 'support-hours-admin-display-workTable.php' ); + include_once( 'partials/support-hours-admin-settings-textFields.php' ); + include_once( 'partials/support-hours-admin-settings-workTable.php' ); ?> diff --git a/admin/partials/support-hours-admin-widget.php b/admin/support-hours-admin-widget.php similarity index 67% rename from admin/partials/support-hours-admin-widget.php rename to admin/support-hours-admin-widget.php index fc5dbd9..4872a96 100644 --- a/admin/partials/support-hours-admin-widget.php +++ b/admin/support-hours-admin-widget.php @@ -13,16 +13,15 @@ */ if(!empty($users) && !empty($bought_hours)): - - include_once( 'support-hours-admin-widget-clock.php' ); - include_once( 'support-hours-admin-widget-hourTable.php' ); - include_once( 'support-hours-admin-widget-bottomMessage.php' ); - + $user_ID = get_current_user_id(); + 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)): ?>

- + plugin_name); ?>

diff --git a/includes/class-support-hours-uninstaller.php b/includes/class-support-hours-uninstaller.php deleted file mode 100644 index 6b3a984..0000000 --- a/includes/class-support-hours-uninstaller.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ -class Support_Hours_Uninstaller { - - /** - * Short Description. (use period) - * - * Long Description. - * - * @since 1.0.0 - */ - public static function uninstall() { - delete_option('support-hours'); - } - -} diff --git a/includes/class-support-hours.php b/includes/class-support-hours.php index c1a7841..3e83538 100644 --- a/includes/class-support-hours.php +++ b/includes/class-support-hours.php @@ -158,7 +158,7 @@ private function define_admin_hooks() { $this->loader->add_filter( 'plugin_action_links_' . $plugin_basename, $plugin_admin, 'add_action_links' ); $this->loader->add_action('admin_init', $plugin_admin, 'options_update'); - //test + // load widget hook from class-support-hours-admin.php $this->loader->add_action( 'wp_dashboard_setup', $plugin_admin, 'support_hours_add_dashboard_widgets' ); } diff --git a/languages/support-hours-nl_NL.mo b/languages/support-hours-nl_NL.mo index 76fba21..bfd35f7 100644 Binary files a/languages/support-hours-nl_NL.mo and b/languages/support-hours-nl_NL.mo differ diff --git a/languages/support-hours-nl_NL.po b/languages/support-hours-nl_NL.po index 9be80a9..5f18a5b 100644 --- a/languages/support-hours-nl_NL.po +++ b/languages/support-hours-nl_NL.po @@ -1,38 +1,49 @@ msgid "" msgstr "" "Project-Id-Version: Support hours\n" -"POT-Creation-Date: 2017-03-07 16:28+0100\n" -"PO-Revision-Date: 2017-03-07 16:39+0100\n" +"POT-Creation-Date: 2017-09-28 13:59+0200\n" +"PO-Revision-Date: 2017-09-28 13:59+0200\n" "Last-Translator: \n" "Language-Team: Erik van der Bas \n" "Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.12\n" +"X-Generator: Poedit 2.0.4\n" "X-Poedit-Basepath: ..\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: __;_e;_\n" "X-Poedit-SearchPath-0: .\n" -#: admin/class-support-hours-admin.php:114 -msgid "Support hours" -msgstr "Support uren" +#: admin/class-support-hours-admin.php:115 +#: admin/class-support-hours-admin.php:124 +msgid "Support Hours overview" +msgstr "Support Uren overzicht" -#: admin/class-support-hours-admin.php:128 -msgid "Settings" -msgstr "Instellingen" - -#: admin/class-support-hours-admin.php:160 +#: admin/class-support-hours-admin.php:116 +#: admin/class-support-hours-admin.php:188 msgid "Support Hours" msgstr "Support Uren" -#: admin/partials/support-hours-admin-display.php:35 +#: admin/class-support-hours-admin.php:125 +msgid "Overview" +msgstr "Overzicht" + +#: admin/class-support-hours-admin.php:132 +msgid "Support Hours settings" +msgstr "Support Uren instellingen" + +#: admin/class-support-hours-admin.php:133 +#: admin/class-support-hours-admin.php:150 +msgid "Settings" +msgstr "Instellingen" + +#: admin/partials/support-hours-admin-settings-textFields.php:2 msgid "Select Support Hours managers" msgstr "Selecteer Support Uren managers" -#: admin/partials/support-hours-admin-display.php:36 +#: admin/partials/support-hours-admin-settings-textFields.php:3 msgid "" "Select Support-Hour manager. Warning! If you do not set yourself as a " "Support Hours manager, you will loose access to this page until the plugin " @@ -42,7 +53,7 @@ msgstr "" "als Support Uren manager, dan verliest u de toegang tot deze pagina totdat " "de plugin gedeactiveerd en opnieuw geactiveerd is." -#: admin/partials/support-hours-admin-display.php:41 +#: admin/partials/support-hours-admin-settings-textFields.php:8 msgid "" "Warning! If you do not set yourself as a Support Hours manager, you will " "loose access to this page until the plugin is disabled and enabled." @@ -51,110 +62,131 @@ msgstr "" "verliest u de toegang tot deze pagina totdat de plugin gedeactiveerd en " "opnieuw geactiveerd is." -#: admin/partials/support-hours-admin-display.php:44 -#: admin/partials/support-hours-admin-display.php:45 +#: admin/partials/support-hours-admin-settings-textFields.php:11 +#: admin/partials/support-hours-admin-settings-textFields.php:12 msgid "E-Mail adress main Support Hours manager" msgstr "E-Mail adres Support Uren manager" -#: admin/partials/support-hours-admin-display.php:49 -#: admin/partials/support-hours-admin-display.php:50 +#: admin/partials/support-hours-admin-settings-textFields.php:16 +#: admin/partials/support-hours-admin-settings-textFields.php:17 msgid "Amount of bought Support Hours" msgstr "Aantal ingekochte Support Uren" -#: admin/partials/support-hours-admin-display.php:52 +#: admin/partials/support-hours-admin-settings-textFields.php:19 msgid "Please enter a valid time" -msgstr "Voer een valide tijd in." +msgstr "Voer een valide tijd in" -#: admin/partials/support-hours-admin-display.php:60 -#: admin/partials/support-hours-admin-display.php:73 -#: admin/partials/support-hours-admin-display.php:87 -#: admin/partials/support-hours-admin-widget.php:45 +#: admin/partials/support-hours-admin-settings-workTable.php:12 +#: admin/partials/support-hours-admin-settings-workTable.php:28 +#: admin/partials/support-hours-admin-settings-workTable.php:51 +#: admin/partials/support-hours-admin-widget-hourTable.php:6 +#: admin/support-hours-admin-overview.php:30 msgid "Date" msgstr "Datum" -#: admin/partials/support-hours-admin-display.php:61 -#: admin/partials/support-hours-admin-display.php:77 -#: admin/partials/support-hours-admin-display.php:91 -#: admin/partials/support-hours-admin-widget.php:46 +#: admin/partials/support-hours-admin-settings-workTable.php:13 +#: admin/partials/support-hours-admin-settings-workTable.php:33 +#: admin/partials/support-hours-admin-settings-workTable.php:56 +#: admin/partials/support-hours-admin-widget-hourTable.php:7 +#: admin/support-hours-admin-overview.php:31 msgid "Description" msgstr "Beschrijving" -#: admin/partials/support-hours-admin-display.php:62 -#: admin/partials/support-hours-admin-display.php:80 -#: admin/partials/support-hours-admin-display.php:94 -#: admin/partials/support-hours-admin-widget.php:47 +#: admin/partials/support-hours-admin-settings-workTable.php:14 +#: admin/partials/support-hours-admin-settings-workTable.php:37 +#: admin/partials/support-hours-admin-settings-workTable.php:60 +#: admin/partials/support-hours-admin-widget-hourTable.php:8 +#: admin/support-hours-admin-overview.php:32 msgid "Time used" msgstr "Tijd verbruikt" -#: admin/partials/support-hours-admin-display.php:75 -#: admin/partials/support-hours-admin-display.php:89 +#: admin/partials/support-hours-admin-settings-workTable.php:30 +#: admin/partials/support-hours-admin-settings-workTable.php:53 msgid "Today" msgstr "Vandaag" -#: admin/partials/support-hours-admin-display.php:78 -#: admin/partials/support-hours-admin-display.php:92 +#: admin/partials/support-hours-admin-settings-workTable.php:34 +#: admin/partials/support-hours-admin-settings-workTable.php:57 msgid "Description of the activity" msgstr "Beschrijving van de activiteit" -#: admin/partials/support-hours-admin-display.php:102 -msgid "Add row" -msgstr "voeg rij toe" +#: admin/partials/support-hours-admin-settings-workTable.php:69 +msgid "Add activity" +msgstr "Voeg activiteit toe" -#: admin/partials/support-hours-admin-display.php:102 +#: admin/partials/support-hours-admin-settings-workTable.php:69 msgid "Save all changes" msgstr "Bijwerken" -#: admin/partials/support-hours-admin-display.php:106 -msgid "" -"You do not have access to this page because you are not a Support Hours " -"manager. Please disable and enable this plugin if you need access again." -msgstr "" -"U heeft geen toegang tot deze pagina omdat u geen Support Uren manager " -"bent. Deactiveer en activeer de plugin opnieuw om weer toegang te krijgen " -"tot deze pagina." +#: admin/partials/support-hours-admin-widget-bottomMessage.php:3 +msgid "Support hours used." +msgstr "Support uren verbruikt." + +#: admin/partials/support-hours-admin-widget-bottomMessage.php:5 +msgid "Support hours almost used" +msgstr "Support Uren bijna gebruik" -#: admin/partials/support-hours-admin-widget.php:30 +#: admin/partials/support-hours-admin-widget-bottomMessage.php:7 +msgid "Need more support hours" +msgstr "Heeft u meer support uren nodig" + +#: admin/partials/support-hours-admin-widget-bottomMessage.php:9 +#: admin/support-hours-admin-widget.php:35 +msgid "Contact me via" +msgstr "Neem contact op via" + +#: admin/partials/support-hours-admin-widget-clock.php:15 +#: admin/support-hours-admin-overview.php:51 msgid "hours" msgstr "uur" -#: admin/partials/support-hours-admin-widget.php:34 +#: admin/partials/support-hours-admin-widget-clock.php:19 msgid "used" msgstr "verbruikt" -#: admin/partials/support-hours-admin-widget.php:41 +#: admin/partials/support-hours-admin-widget-hourTable.php:2 msgid "Activities" msgstr "Activiteiten" -#: admin/partials/support-hours-admin-widget.php:60 +#: admin/partials/support-hours-admin-widget-hourTable.php:30 +msgid "Add new activity" +msgstr "Voeg nieuwe activiteit toe" + +#: admin/partials/support-hours-admin-widget-hourTable.php:33 +msgid "View all acitivities" +msgstr "Bekijk alle activiteiten" + +#: admin/partials/support-hours-admin-widget-hourTable.php:35 +#: admin/support-hours-admin-overview.php:49 msgid "Total" msgstr "Totaal" -#: admin/partials/support-hours-admin-widget.php:64 -msgid "Support hours used." -msgstr "Support uren verbruikt." - -#: admin/partials/support-hours-admin-widget.php:66 -msgid "Support hours almost used." -msgstr "Support-uren bijna gebruikt" +#: admin/partials/support-hours-admin-widget-hourTable.php:37 +msgid "Add first acitivity" +msgstr "Voeg eerste activiteit toe" -#: admin/partials/support-hours-admin-widget.php:68 -msgid "Need more support hours?" -msgstr "Heeft u meer support uren nodig?" +#: admin/support-hours-admin-overview.php:50 +msgid "hours used of" +msgstr "uren gebruikt van" -#: admin/partials/support-hours-admin-widget.php:70 -#: admin/partials/support-hours-admin-widget.php:81 -msgid "Contact me via" -msgstr "Neem contact op via" +#: admin/support-hours-admin-settings.php:36 +msgid "" +"You do not have access to this page because you are not a Support Hours " +"manager. Please disable and enable this plugin if you need access again." +msgstr "" +"U heeft geen toegang tot deze pagina omdat u geen Support Uren manager " +"bent. Deactiveer en activeer de plugin opnieuw om weer toegang te krijgen " +"tot deze pagina." -#: admin/partials/support-hours-admin-widget.php:76 +#: admin/support-hours-admin-widget.php:25 msgid "Configure plugin!" msgstr "Configureer plugin!" -#: admin/partials/support-hours-admin-widget.php:79 +#: admin/support-hours-admin-widget.php:32 msgid "No support Hours bought" msgstr "Geen support uren gekocht" -#: includes/class-support-hours-activator.php:36 support-hours.php:58 +#: includes/class-support-hours-activator.php:36 msgid "" "Support Hours uses a new system to store hours. Do not forget to input the " "old hours into the new system. Amount of old hours need to be set:" @@ -163,9 +195,19 @@ msgstr "" "de oude uren in te vullen in het nieuwe systeem. Het aantal uren wat opnieuw " "opgeslagen dient te worden:" -#: support-hours.php:66 -msgid "I understand. Dismiss this notice." -msgstr "Begrepen. Verwijder deze opmerking." +#~ msgid "hours " +#~ msgstr "uren" + +#, fuzzy +#~| msgid "Support hours" +#~ msgid "Support hours overview" +#~ msgstr "Support uren" + +#~ msgid "Add row" +#~ msgstr "voeg rij toe" + +#~ msgid "I understand. Dismiss this notice." +#~ msgstr "Begrepen. Verwijder deze opmerking." #~ msgid "" #~ "Warning! If you do not set yourself as a Support Hours manager, you will " diff --git a/languages/support-hours.pot b/languages/support-hours.pot index 1e1e3ec..7f56049 100644 --- a/languages/support-hours.pot +++ b/languages/support-hours.pot @@ -5,14 +5,14 @@ msgid "" msgstr "" "Project-Id-Version: Support Hours 1.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/support-hours\n" -"POT-Creation-Date: 2016-11-01 09:37+0100\n" +"POT-Creation-Date: 2017-09-28 14:00+0200\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"X-Generator: Poedit 1.8.11\n" +"X-Generator: Poedit 2.0.4\n" #: admin/class-support-hours-admin.php:114 #: admin/class-support-hours-admin.php:154 diff --git a/support-hours.php b/support-hours.php index bdffe67..151bf40 100644 --- a/support-hours.php +++ b/support-hours.php @@ -47,43 +47,10 @@ function deactivate_support_hours() { Support_Hours_Deactivator::deactivate(); } -function uninstall_support_hours() { - require_once plugin_dir_path( __FILE__ ) . 'includes/class-support-hours-uninstaller.php'; - Support_Hours_Uninstaller::uninstall(); -} - register_activation_hook( __FILE__, 'activate_support_hours' ); register_deactivation_hook( __FILE__, 'deactivate_support_hours' ); -register_uninstall_hook(__FILE__, 'uninstall_support_hours'); - -function supportHours_plugin_notice() { - global $current_user; - $options = get_option('support-hours'); - $class = 'notice notice-warning is-dismissible'; - $first = __( 'Support Hours uses a new system to store hours. Do not forget to input the old hours into the new system. Amount of old hours need to be set:', 'support-hours' ); - $user_id = $current_user->ID; - if (!get_user_meta($user_id, 'supportHours_plugin_notice_ignore')) { ?> -
-

- - - -

-
- ID; - if (isset($_GET['my-plugin-ignore-notice'])) { - add_user_meta($user_id, 'supportHours_plugin_notice_ignore', 'true', true); - } -} -add_action('admin_init', 'supportHours_plugin_notice_ignore'); /** * The core plugin class that is used to define internationalization, diff --git a/uninstall.php b/uninstall.php index 6d1d96e..27576a0 100644 --- a/uninstall.php +++ b/uninstall.php @@ -29,3 +29,4 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { exit; } +delete_option('support-hours');