Changeset 1968512
- Timestamp:
- 11/04/2018 12:17:40 PM (7 years ago)
- Location:
- support-hours
- Files:
-
- 42 added
- 3 deleted
- 10 edited
-
tags/1.5.2 (added)
-
tags/1.5.2/LICENSE.txt (added)
-
tags/1.5.2/README.txt (added)
-
tags/1.5.2/admin (added)
-
tags/1.5.2/admin/class-support-hours-admin.php (added)
-
tags/1.5.2/admin/index.php (added)
-
tags/1.5.2/admin/partials (added)
-
tags/1.5.2/admin/partials/common (added)
-
tags/1.5.2/admin/partials/common/bottom-message.php (added)
-
tags/1.5.2/admin/partials/common/notice-configure.php (added)
-
tags/1.5.2/admin/partials/common/notice-no-hours.php (added)
-
tags/1.5.2/admin/partials/common/worktable.php (added)
-
tags/1.5.2/admin/partials/settings (added)
-
tags/1.5.2/admin/partials/settings/general-settings-form.php (added)
-
tags/1.5.2/admin/partials/settings/work-table-fields.php (added)
-
tags/1.5.2/admin/partials/settings/work-table-form.php (added)
-
tags/1.5.2/admin/partials/widgets (added)
-
tags/1.5.2/admin/partials/widgets/widget-clock.php (added)
-
tags/1.5.2/admin/support-hours-admin-functions.php (added)
-
tags/1.5.2/admin/support-hours-admin-overview.php (added)
-
tags/1.5.2/admin/support-hours-admin-settings.php (added)
-
tags/1.5.2/admin/support-hours-admin-widget.php (added)
-
tags/1.5.2/dist (added)
-
tags/1.5.2/dist/scripts (added)
-
tags/1.5.2/dist/scripts/support-hours-admin.js (added)
-
tags/1.5.2/dist/styles (added)
-
tags/1.5.2/dist/styles/support-hours-admin.css (added)
-
tags/1.5.2/includes (added)
-
tags/1.5.2/includes/class-support-hours-activator.php (added)
-
tags/1.5.2/includes/class-support-hours-deactivator.php (added)
-
tags/1.5.2/includes/class-support-hours-i18n.php (added)
-
tags/1.5.2/includes/class-support-hours-loader.php (added)
-
tags/1.5.2/includes/class-support-hours.php (added)
-
tags/1.5.2/includes/index.php (added)
-
tags/1.5.2/languages (added)
-
tags/1.5.2/languages/support-hours-nl_NL.mo (added)
-
tags/1.5.2/languages/support-hours-nl_NL.po (added)
-
tags/1.5.2/languages/support-hours.pot (added)
-
tags/1.5.2/support-hours.php (added)
-
tags/1.5.2/uninstall.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/class-support-hours-admin.php (modified) (2 diffs)
-
trunk/admin/partials/common/configure-plugin-notice.php (deleted)
-
trunk/admin/partials/common/notice-configure.php (added)
-
trunk/admin/partials/common/notice-no-hours.php (added)
-
trunk/admin/partials/settings/work-table-form.php (modified) (1 diff)
-
trunk/admin/support-hours-admin-functions.php (modified) (4 diffs)
-
trunk/admin/support-hours-admin-overview.php (modified) (2 diffs)
-
trunk/admin/support-hours-admin-widget.php (modified) (1 diff)
-
trunk/includes/class-support-hours.php (modified) (3 diffs)
-
trunk/index.php (deleted)
-
trunk/languages/support-hours-nl_NL.mo (modified) (previous)
-
trunk/languages/support-hours-nl_NL.po (modified) (6 diffs)
-
trunk/public (deleted)
-
trunk/support-hours.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
support-hours/trunk/README.txt
r1964531 r1968512 4 4 Requires at least: 3.0.1 5 5 Tested up to: 5.0 6 Stable tag: 1.5. 16 Stable tag: 1.5.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 47 47 48 48 == Changelog == 49 50 = 1.5.2 = 51 52 * order activities on data at saving. 53 * removed time transform function 54 * removed public side of plugin for a smaller package 55 * update to notices and errors if thrown. 49 56 50 57 = 1.5.1 = -
support-hours/trunk/admin/class-support-hours-admin.php
r1960674 r1968512 159 159 public function display_plugin_page() { 160 160 include_once( 'support-hours-admin-functions.php' ); 161 echo transform_fixed_time($static_time, $workFields, $name, $options);162 161 include_once( 'support-hours-admin-overview.php' ); 163 162 } … … 168 167 public function validate($input) { 169 168 $valid = array(); 170 if ($input['bought_hours'] == null) { 171 $input['bought_hours'] = '00:00'; 169 170 171 $valid['email'] = sanitize_email($input['email']); 172 173 if(isset($input['users'])): 174 $valid['users'] = $input['users']; 175 else: 176 $valid['users'] = array(); 177 endif; 178 179 if(!isset($input['workFields']) || $input['workFields'] == null){ 180 $input['workFields'] = null; 181 } else{ 182 function date_compare($a, $b) 183 { 184 $t1 = strtotime($a['date']); 185 $t2 = strtotime($b['date']); 186 return $t1 - $t2; 187 } 188 usort($input['workFields'], 'date_compare'); 172 189 } 173 if($input['workFields'] == null){ 174 $input['workFields'] = null; 175 } 176 $valid['bought_hours'] = sanitize_text_field($input['bought_hours']); 177 $valid['email'] = sanitize_email($input['email']); 178 $valid['users'] = $input['users']; 190 179 191 $valid['workFields'] = $input['workFields']; 180 192 return $valid; -
support-hours/trunk/admin/partials/settings/work-table-form.php
r1960674 r1968512 29 29 </tbody> 30 30 </table> 31 <p><em><?php _e('Activities will be sorted by date on save', $name); ?>.</em></p> 31 32 <a href="#" class="repeat button button-secondary"> 32 33 <?php _e('Add activity', $name); ?> -
support-hours/trunk/admin/support-hours-admin-functions.php
r1960674 r1968512 5 5 $users = $options['users']; 6 6 $email = $options['email']; 7 $static_time = $options['bought_hours'];7 //$static_time = $options['bought_hours']; 8 8 $current_color = get_user_option( 'admin_color' ); 9 9 $workFields = $options['workFields']; … … 12 12 $bought_minutes = AddTime($workFields, 'time-added', 'minutes'); 13 13 14 /* 14 15 // NOTE: temp function to transform first set of hours to new hour system. 15 16 function transform_fixed_time($static_time, $workFields, $name, $options){ … … 23 24 ); 24 25 array_unshift($options['workFields'], $newdata); 25 $options = array_diff_key($options, ['bought_hours' => "xy"]);26 //$options = array_diff_key($options, ['bought_hours' => "xy"]); 26 27 27 28 $options['workFields'] = array_map(function($arr){ … … 33 34 } 34 35 echo transform_fixed_time($static_time, $workFields, $name, $options); 36 */ 35 37 36 38 function minutestoTime($minutes){ -
support-hours/trunk/admin/support-hours-admin-overview.php
r1960674 r1968512 18 18 </p> 19 19 <?php 20 if(!empty($users) && (!empty($bought_minutes) || $bought_minutes == '0' )&& !empty($email)):20 if(!empty($users) && $bought_minutes !== '0' && !empty($email)): 21 21 $user_ID = get_current_user_id(); 22 22 $i = 0; … … 29 29 30 30 elseif(empty($users) || empty($email)): 31 include_once( 'partials/common/notice-configure.php' ); 31 32 32 include_once( 'partials/common/configure-plugin-notice.php' ); 33 else: 34 include_once( 'partials/common/notice-no-hours.php' ); 33 35 34 endif; ?>35 36 endif; 37 ?> 36 38 </div> -
support-hours/trunk/admin/support-hours-admin-widget.php
r1960674 r1968512 15 15 $i = 0; 16 16 global $pagenow; 17 if(!empty($users) && !empty($email) ):17 if(!empty($users) && !empty($email) && !empty($workFields[0]['date'])): 18 18 19 19 include_once( 'partials/widgets/widget-clock.php' ); 20 21 if ( !empty($workFields[0]['date']) ) : 22 23 include_once( 'partials/common/worktable.php' ); 24 25 endif; 26 20 include_once( 'partials/common/worktable.php' ); 27 21 include_once( 'partials/common/bottom-message.php' ); 28 22 29 elseif(empty($users) || empty($email) || $bought_minutes == '0'):23 elseif(empty($users) || empty($email)): 30 24 31 include_once( 'partials/common/configure-plugin-notice.php' );25 include_once( 'partials/common/notice-configure.php' ); 32 26 33 else: ?> 27 else: 34 28 35 <div class="warning-message notice support-hours-notice inline notice-warning notice-alt"> 36 <p><?php _e( 'No Support Hours bought yet.', $this->plugin_name); ?></p> 37 </div> 38 <a class="button button-primary" href="mailto:<?php echo $email; ?>'?SUBJECT=<?php _e('Order Support Hours', $this->plugin_name); ?> - <?php echo bloginfo('name'); ?>"> 39 <?php _e('Order Support Hours', $this->plugin_name); ?> 40 </a> 29 include_once( 'partials/common/notice-no-hours.php' ); 41 30 42 <?php endif; ?> 31 endif; 32 ?> -
support-hours/trunk/includes/class-support-hours.php
r1737711 r1968512 75 75 $this->set_locale(); 76 76 $this->define_admin_hooks(); 77 $this->define_public_hooks();78 77 79 78 } … … 118 117 * side of the site. 119 118 */ 120 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-support-hours-public.php';121 119 122 120 $this->loader = new Support_Hours_Loader(); … … 165 163 166 164 /** 167 * Register all of the hooks related to the public-facing functionality168 * of the plugin.169 *170 * @since 1.0.0171 * @access private172 */173 private function define_public_hooks() {174 $plugin_public = new Support_Hours_Public( $this->get_plugin_name(), $this->get_version() );175 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );176 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );177 }178 /**179 165 * Run the loader to execute all of the hooks with WordPress. 180 166 * -
support-hours/trunk/languages/support-hours-nl_NL.po
r1964531 r1968512 2 2 msgstr "" 3 3 "Project-Id-Version: Support hours\n" 4 "POT-Creation-Date: 2018- 09-15 17:35+0200\n"5 "PO-Revision-Date: 2018- 09-15 17:35+0200\n"4 "POT-Creation-Date: 2018-10-29 09:31+0100\n" 5 "PO-Revision-Date: 2018-10-29 09:34+0100\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: Erik van der Bas <erik@basedonline.nl>\n" … … 24 24 25 25 #: admin/class-support-hours-admin.php:114 26 #: admin/class-support-hours-admin.php:1 8826 #: admin/class-support-hours-admin.php:198 27 27 msgid "Support Hours" 28 28 msgstr "Support Hours" … … 98 98 99 99 #: admin/partials/common/worktable.php:17 100 #: admin/partials/settings/work-table-fields.php:23 100 101 #: admin/partials/settings/work-table-form.php:10 101 102 msgid "Time" … … 126 127 127 128 #: admin/partials/settings/work-table-fields.php:8 128 #: admin/partials/settings/work-table-fields.php:23129 129 msgid "Time used" 130 130 msgstr "Tijd verbruikt" … … 142 142 msgstr "Type" 143 143 144 #: admin/partials/settings/work-table-form.php:27 144 #: admin/partials/settings/work-table-form.php:31 145 msgid "Activities will be sorted by date on save" 146 msgstr "Activiteiten worden gesorteerd op datum tijdens het bijwerken" 147 148 #: admin/partials/settings/work-table-form.php:33 145 149 msgid "Add activity" 146 150 msgstr "Voeg activiteit toe" 147 151 148 #: admin/partials/settings/work-table-form.php: 29152 #: admin/partials/settings/work-table-form.php:35 149 153 msgid "Save" 150 154 msgstr "Bijwerken" … … 170 174 msgstr "Een compleet overzicht van alle activiteiten." 171 175 172 #: admin/support-hours-admin-settings.php:3 7176 #: admin/support-hours-admin-settings.php:36 173 177 msgid "" 174 178 "You do not have access to this page because you are not a Support Hours " -
support-hours/trunk/support-hours.php
r1964531 r1968512 17 17 * Plugin URI: http://basedonline.nl 18 18 * Description: Use Support hours to give yourself and your clients insights on the status of pre-paid work. 19 * Version: 1.5. 119 * Version: 1.5.2 20 20 * Author: Erik van der Bas 21 21 * Author URI: https://basedonline.nl
Note: See TracChangeset
for help on using the changeset viewer.