diff --git a/README.md b/README.md index 02975fb1c..e74d84f37 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ Contributors: batmoo, danielbachhuber, sbressler, automattic Donate link: http://editflow.org/contribute/ Tags: edit flow, workflow, editorial, newsroom, management, journalism, post status, custom status, notifications, email, comments, editorial comments, usergroups, calendars, editorial calendar, story budget Requires at least: 4.5 -Tested up to: 4.6.1 -Stable tag: 0.8.2 +Tested up to: 4.9.6 +Stable tag: 0.8.3 Redefining your editorial workflow. @@ -56,6 +56,9 @@ For support questions, feedback and ideas, please use the [WordPress.org forums] ## Upgrade Notice +**0.8.3** +Improvements and bugfixes. + **0.8.2** Minor enhancements and bug fixes, translation updates. @@ -80,10 +83,10 @@ Contributors and other users without the 'publish_posts' capability can access c **0.7.1** Enhancements and bug fixes, including defaulting to the proper date in the calendar and an Italian localization. -**0.7** +**0.7** Complete rewrite into a modular architecture. Lots of polish added. Important note: If upgrading from pre-v0.6, please upgrade to v0.6.5 first -**0.6.5** +**0.6.5** Fixes an issue where the post timestamp would be set as soon as a custom status was used. **0.6.4** @@ -103,6 +106,18 @@ New features, including story budget and editorial metadata, a completely rewrit ## Changelog +**0.8.3 (June 14, 2018)** +* UI Improvement: Made primary buttons on Settings screen consistent with WordPress UI. Props [cojennin](https://github.com/cojennin). +* UI Improvement: Display who particularly was notified about an editorial comment. Props [goodguyry](https://github.com/goodguyry), [WPprodigy](https://github.com/WPprodigy) +* Improvement: Updated Russian translation and documentation. Props [achumakov](https://github.com/achumakov). +* Improvement: Eliminate a few cases of raw SQL queries in favor of `date_query`. Props [justnorris](https://github.com/justnorris). +* Improvement: Cache calendar items for each user individually to prevent potential cache pollution. Props [justnorris](https://github.com/justnorris). +* Improvement: various i18n updates. +* Improvement: Move ef_story_budget_posts_query_args filter down to allow overriding the date query in Story Budget module. +* Improvement: Limit results in Calendar to 200 per page, potentially saving from trouble on websites with large amount of content. +* Improvement: Don’t generate rewrite rules for notepad as they're unused. +* Improvement: Support modifying HTML output of a Calendar day via ef_pre_calendar_single_date_item_html filter. Props [cklosowski](https://github.com/cklosowski). + **0.8.2 (Sept. 16, 2016)** * Improvement: Updated Spanish localization thanks to [moucho](https://github.com/moucho) * Improvement: New Swedish localization thanks to [Warpsmith](https://github.com/Warpsmith) @@ -306,13 +321,13 @@ The following folks did some tremendous work helping with the release of Edit Fl * Added option to globally disable QuickPitch widget * Bug fix: Custom Status names cannot be longer than 20 chars * Bug fix: Deleted users are removed as subscribers from posts -* Bug fix: Blank menu items should now be sorta hidden +* Bug fix: Blank menu items should now be sorta hidden **0.2** * Custom Statuses are now supported for pages * Editorial Comments (with threading) * Email Notifications (on post status change and editorial comment) -* Additional Post metadata +* Additional Post metadata * Quick Pitch Dashboard widget * Bug fix: sorting issue on Manage Posts page (Mad props to David Smith from Columbia U.) * Other bug fixes diff --git a/edit_flow.php b/edit_flow.php index 57eb5639f..6e6024e32 100644 --- a/edit_flow.php +++ b/edit_flow.php @@ -4,7 +4,7 @@ Plugin URI: http://editflow.org/ Description: Remixing the WordPress admin for better editorial workflow options. Author: Daniel Bachhuber, Scott Bressler, Mohammad Jangda, Automattic, and others -Version: 0.8.2 +Version: 0.8.3 Author URI: http://editflow.org/ Copyright 2009-2016 Mohammad Jangda, Daniel Bachhuber, et al. @@ -28,7 +28,7 @@ */ // Define contants -define( 'EDIT_FLOW_VERSION' , '0.8.3-alpha' ); +define( 'EDIT_FLOW_VERSION' , '0.8.3' ); define( 'EDIT_FLOW_ROOT' , dirname(__FILE__) ); define( 'EDIT_FLOW_FILE_PATH' , EDIT_FLOW_ROOT . '/' . basename(__FILE__) ); define( 'EDIT_FLOW_URL' , plugins_url( '/', __FILE__ ) ); @@ -128,8 +128,12 @@ private function load_modules() { } } - // Supplementary plugins can hook into this, include their own modules - // and add them to the $edit_flow object + /** + * Fires after edit_flow has loaded all Edit Flow internal modules. + * + * Plugin authors can hook into this action, include their own modules add them to the $edit_flow object + * + */ do_action( 'ef_modules_loaded' ); } @@ -147,6 +151,13 @@ private function setup_actions() { add_action( 'admin_init', array( $this, 'action_admin_init' ) ); + /** + * Fires after setup of all edit_flow actions. + * + * Plugin authors can hook into this action to manipulate the edit_flow class after initial actions have been registered. + * + * @param edit_flow $this The core edit flow class + */ do_action_ref_array( 'editflow_after_setup_actions', array( &$this ) ); } @@ -169,6 +180,12 @@ function action_init() { if ( isset( $mod_data->options->enabled ) && $mod_data->options->enabled == 'on' ) $this->$mod_name->init(); + /** + * Fires after edit_flow has loaded all modules and module options. + * + * Plugin authors can hook into this action to trigger functionaltiy after all Edit Flow module's have been loaded. + * + */ do_action( 'ef_init' ); } @@ -248,6 +265,14 @@ public function register_module( $name, $args = array() ) { add_action( 'load-edit-flow_page_' . $args['settings_slug'], array( &$this->$name, 'action_settings_help_menu' ) ); $this->modules->$name = (object) $args; + + /** + * Fires after edit_flow has registered a module. + * + * Plugin authors can hook into this action to trigger functionaltiy after a module has been loaded. + * + * @param string $name The name of the registered module + */ do_action( 'ef_module_registered', $name ); return $this->modules->$name; } @@ -268,6 +293,13 @@ function load_module_options() { $this->$mod_name->module = $this->modules->$mod_name; } + + /** + * Fires after edit_flow has loaded all of the module options from the database. + * + * Plugin authors can hook into this action to read and manipulate module settings. + * + */ do_action( 'ef_module_options_loaded' ); } @@ -288,6 +320,9 @@ function action_init_after() { /** * Get a module by one of its descriptive values + * + * @param string $key The property to use for searching a module (ex: 'name') + * @param string|int|array $value The value to compare (using ==) */ function get_module_by( $key, $value ) { $module = false; diff --git a/modules/calendar/calendar.php b/modules/calendar/calendar.php index 666a2a0a4..e9b2f582b 100644 --- a/modules/calendar/calendar.php +++ b/modules/calendar/calendar.php @@ -85,13 +85,12 @@ function init() { // Define the create-post capability $this->create_post_cap = apply_filters( 'ef_calendar_create_post_cap', 'edit_posts' ); - - require_once( EDIT_FLOW_ROOT . '/common/php/' . 'screen-options.php' ); - add_screen_options_panel( self::usermeta_key_prefix . 'screen_options', __( 'Calendar Options', 'edit-flow' ), array( $this, 'generate_screen_options' ), self::screen_id, false, true ); + + add_action( 'admin_init', array( $this, 'add_screen_options_panel' ) ); add_action( 'admin_init', array( $this, 'handle_save_screen_options' ) ); add_action( 'admin_init', array( $this, 'register_settings' ) ); - add_action( 'admin_menu', array( $this, 'action_admin_menu' ) ); + add_action( 'admin_menu', array( $this, 'action_admin_menu' ) ); add_action( 'admin_print_styles', array( $this, 'add_admin_styles' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) ); @@ -244,6 +243,16 @@ function generate_screen_options() { return $output; } + /** + * Add module options to the screen panel + * + * @since 0.8.3 + */ + function add_screen_options_panel() { + require_once( EDIT_FLOW_ROOT . '/common/php/' . 'screen-options.php' ); + add_screen_options_panel( self::usermeta_key_prefix . 'screen_options', __( 'Calendar Options', 'edit-flow' ), array( $this, 'generate_screen_options' ), self::screen_id, false, true ); + } + /** * Handle the request to save the screen options * @@ -782,10 +791,14 @@ function view_calendar() { $this->hidden = 0; if ( !empty( $week_posts[$week_single_date] ) ) { - $week_posts[$week_single_date] = apply_filters( 'ef_calendar_posts_for_week', $week_posts[$week_single_date] ); + $week_posts[$week_single_date] = apply_filters( 'ef_calendar_posts_for_week', $week_posts[$week_single_date], $week_single_date ); - foreach ( $week_posts[$week_single_date] as $num => $post ){ - echo $this->generate_post_li_html( $post, $week_single_date, $num ); + foreach ( $week_posts[$week_single_date] as $num => $post ) { + $output = apply_filters( 'ef_pre_calendar_single_date_item_html', '', $this, $num, $post, $week_single_date ); + if ( ! $output ) { + $output = $this->generate_post_li_html( $post, $week_single_date, $num ); + } + echo $output; } } @@ -1297,23 +1310,23 @@ function get_pagination_link( $direction = 'next', $filters = array(), $weeks_of /** * Given a day in string format, returns the day at the beginning of that week, which can be the given date. - * The end of the week is determined by the blog option, 'start_of_week'. + * The beginning of the week is determined by the blog option, 'start_of_week'. * * @see http://www.php.net/manual/en/datetime.formats.date.php for valid date formats * * @param string $date String representing a date - * @param string $format Date format in which the end of the week should be returned + * @param string $format Date format in which the beginning of the week should be returned * @param int $week Number of weeks we're offsetting the range - * @return string $formatted_start_of_week End of the week + * @return string $formatted_start_of_week Beginning of the week */ function get_beginning_of_week( $date, $format = 'Y-m-d', $week = 1 ) { $date = strtotime( $date ); $start_of_week = get_option( 'start_of_week' ); $day_of_week = date( 'w', $date ); - $date += (( $start_of_week - $day_of_week - 7 ) % 7) * 60 * 60 * 24 * $week; - $additional = 3600 * 24 * 7 * ( $week - 1 ); - $formatted_start_of_week = date( $format, $date + $additional ); + $date += (( $start_of_week - $day_of_week - 7 ) % 7) * 60 * 60 * 24 ; + $date = strtotime ( '+' . ( $week - 1 ) . ' week', $date ) ; + $formatted_start_of_week = date( $format, $date ); return $formatted_start_of_week; } @@ -1335,8 +1348,8 @@ function get_ending_of_week( $date, $format = 'Y-m-d', $week = 1 ) { $end_of_week = get_option( 'start_of_week' ) - 1; $day_of_week = date( 'w', $date ); $date += (( $end_of_week - $day_of_week + 7 ) % 7) * 60 * 60 * 24; - $additional = 3600 * 24 * 7 * ( $week - 1 ); - $formatted_end_of_week = date( $format, $date + $additional ); + $date = strtotime ( '+' . ( $week - 1 ) . ' week', $date ) ; + $formatted_end_of_week = date( $format, $date ); return $formatted_end_of_week; } diff --git a/modules/custom-status/custom-status.php b/modules/custom-status/custom-status.php index 8569dd3a7..ed20665d2 100644 --- a/modules/custom-status/custom-status.php +++ b/modules/custom-status/custom-status.php @@ -1695,7 +1695,7 @@ private function get_preview_link( $post ) { } $args['preview_id'] = $post->ID; - return add_query_arg( $args, home_url() ); + return add_query_arg( $args, home_url( '/' ) ); } /** @@ -1735,7 +1735,7 @@ public function fix_post_row_actions( $actions, $post ) { ); } $args['preview'] = 'true'; - $preview_link = add_query_arg( $args, home_url() ); + $preview_link = add_query_arg( $args, home_url( '/' ) ); $actions['view'] = '' . __( 'Preview' ) . ''; return $actions; diff --git a/modules/dashboard/widgets/dashboard-notepad.php b/modules/dashboard/widgets/dashboard-notepad.php index 3ee25bae2..b61ced0f0 100644 --- a/modules/dashboard/widgets/dashboard-notepad.php +++ b/modules/dashboard/widgets/dashboard-notepad.php @@ -35,7 +35,7 @@ public function handle_notepad_update() { global $pagenow; if ( 'index.php' != $pagenow - || ( empty( $_REQUEST['action'] ) || 'dashboard-notepad' != $_REQUEST['action'] ) ) + || ( empty( $_POST['action'] ) || 'dashboard-notepad' != $_POST['action'] ) ) return; check_admin_referer( 'dashboard-notepad' ); @@ -43,25 +43,22 @@ public function handle_notepad_update() { if ( ! current_user_can( $this->edit_cap ) ) wp_die( EditFlow()->dashboard->messages['invalid-permissions'] ); - $current_id = (int)$_REQUEST['notepad-id']; + $current_id = (int) $_POST['notepad-id']; $current_notepad = get_post( $current_id ); $new_note = array( - 'post_content' => wp_filter_nohtml_kses( $_REQUEST['note'] ), + 'post_content' => wp_filter_nohtml_kses( $_POST['note'] ), 'post_type' => self::notepad_post_type, 'post_status' => 'draft', 'post_author' => get_current_user_id(), ); if ( $current_notepad && self::notepad_post_type == $current_notepad->post_type - && ! isset ( $_REQUEST['create-note'] ) ) { + && ! isset ( $_POST['create-note'] ) ) { $new_note['ID'] = $current_id; wp_update_post( $new_note ); } else { wp_insert_post( $new_note ); } - - wp_safe_redirect( wp_get_referer() ); - exit; } /** @@ -83,12 +80,12 @@ public function notepad_widget() { $current_post = ( ! empty( $posts[0] ) ) ? $posts[0] : false; if ( $current_post ) - $last_updated = '' . sprintf( __( '%1$s last updated on %2$s', 'edit-flow' ), get_user_by( 'id', $current_post->post_author )->display_name, get_the_time( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $current_post ) ) . ''; + $last_updated = '' . sprintf( __( '%1$s last updated on %2$s', 'edit-flow' ), get_user_by( 'id', $current_post->post_author )->display_name, get_the_modified_time( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $current_post ) ) . ''; else $last_updated = ''; if ( current_user_can( $this->edit_cap ) ) { - echo '
'; + echo ''; echo ''; echo ''; echo ' + module_enabled( 'notifications' ) ) : ?> + + +

@@ -218,6 +229,28 @@ function the_comment_form( ) { module_enabled( 'notifications' ) || ! apply_filters( 'ef_editorial_comments_show_notified_users', true ) ) { + return; + } + + $notification = get_comment_meta( $comment_id, 'notification_list', true ); + + if ( empty( $notification ) ) { + $message = esc_html__( 'No users or groups were notified.', 'edit-flow' ); + } else { + $message = ''. esc_html__( 'Notified', 'edit-flow' ) . ': ' . esc_html( $notification ); + } + + echo '

' . $message . '

'; + } + /** * Displays a single comment */ @@ -268,6 +301,7 @@ function the_comment($comment, $args, $depth) {
+ maybe_output_comment_meta( $comment->comment_ID ); ?>

@@ -290,7 +324,7 @@ function ajax_insert_comment( ) { // Set up comment data $post_id = absint( $_POST['post_id'] ); - $parent = absint( $_POST['parent'] ); + $parent = absint( $_POST['parent'] ); // Only allow the comment if user can edit post // @TODO: allow contributers to add comments as well (?) @@ -332,6 +366,15 @@ function ajax_insert_comment( ) { $comment_id = wp_insert_comment($data); $comment = get_comment($comment_id); + // Save the list of notified users/usergroups. + if ( $this->module_enabled( 'notifications' ) && apply_filters( 'ef_editorial_comments_show_notified_users', true ) ) { + $notification = isset( $_POST['notification'] ) ? sanitize_text_field( $_POST['notification'] ) : ''; + + if ( ! empty( $notification ) && __( 'No one will be notified.', 'edit-flow' ) !== $notification ) { + add_comment_meta( $comment_id, 'notification_list', $notification ); + } + } + // Register actions -- will be used to set up notifications and other modules can hook into this if ( $comment_id ) do_action( 'ef_post_insert_editorial_comment', $comment ); diff --git a/modules/editorial-comments/lib/editorial-comments.css b/modules/editorial-comments/lib/editorial-comments.css index e62237695..0a6b9c454 100644 --- a/modules/editorial-comments/lib/editorial-comments.css +++ b/modules/editorial-comments/lib/editorial-comments.css @@ -24,9 +24,16 @@ border-bottom: 1px solid #e5e5e5; background: #fff; } - #ef-comments li:hover p.row-actions { + + .row-actions { + margin-top: 0; + } + + #ef-comments li:hover p.row-actions, + #ef-comments li:hover .ef-notification-meta { visibility: visible; } + #ef-comments li p.row-actions { text-align: right; } @@ -111,4 +118,28 @@ #ef-comment-rbutton { margin-top: 10px; margin-bottom: 10px; -} \ No newline at end of file +} + +input[readonly].ef-reply-notifier-message { + height: 2em; + width: 100%; + padding: 0.5em; + border: none; + font-size: 1em; + border-left: 4px solid #46b450; +} + +label[for="ef-reply-notifier"] { + margin: 0.75em 0; + display: block; + cursor: default; +} + +input[readonly].ef-none-selected { + border-left: 4px solid #dc3232; +} + +.ef-notification-meta { + margin-bottom: 0; + visibility: hidden; +} diff --git a/modules/editorial-comments/lib/editorial-comments.js b/modules/editorial-comments/lib/editorial-comments.js index ae8513f54..21e1721d7 100644 --- a/modules/editorial-comments/lib/editorial-comments.js +++ b/modules/editorial-comments/lib/editorial-comments.js @@ -21,6 +21,11 @@ editorialCommentReply = { // Bind click events to cancel and submit buttons jQuery('a.ef-replycancel', row).click(function() { return editorialCommentReply.revert(); }); jQuery('a.ef-replysave', row).click(function() { return editorialCommentReply.send(); }); + + // Watch for changes to the subscribed users. + $( '#ef-post_following_box' ).on( 'following_list_updated', function() { + editorialCommentReply.notifiedMessage(); + } ); }, revert : function() { @@ -65,6 +70,9 @@ editorialCommentReply = { } jQuery('#ef-comment_respond').hide(); + + // Display who will be notified for this comment + this.notifiedMessage(); // Show reply textbox jQuery('#ef-replyrow') @@ -101,7 +109,8 @@ editorialCommentReply = { post.parent = (jQuery("#ef-comment_parent").val()=='') ? 0 : jQuery("#ef-comment_parent").val(); post._nonce = jQuery("#ef_comment_nonce").val(); post.post_id = jQuery("#ef-post_id").val(); - + post.notification = jQuery('#ef-reply-notifier').val(); + // Send the request jQuery.ajax({ type : 'POST', @@ -114,6 +123,40 @@ editorialCommentReply = { return false; }, + /** + * Display who will be notified of the new comment. + */ + notifiedMessage : function() { + var message_wrapper = jQuery( '#ef-reply-notifier' ); + + if ( ! message_wrapper[0] ) { + return; + } + + var subscribed_users = jQuery( '.ef-post_following_list li input:checkbox:checked' ); + + // No users will be notified, so return early with a default message. + if ( 0 === subscribed_users.length ) { + message_wrapper.addClass( 'ef-none-selected' ); + message_wrapper.val( __ef_localize_post_comment.none_notified ); + return; + } + + var usernames = []; + subscribed_users.each( function() { + usernames.push( $( this ).parent().siblings('.ef-user_displayname').text() ); + } ); + + // Convert array of usernames into a sentence. + var message = usernames.pop(); + if ( usernames.length > 0 ) { + message = usernames.join( ', ' ) + ' ' + __ef_localize_post_comment.and + ' ' + message + '.'; + } + + message_wrapper.removeClass( 'ef-none-selected' ); + message_wrapper.val( message ); + }, + show : function(xml) { var response, comment, supplemental, id, bg; diff --git a/modules/notifications/lib/notifications.js b/modules/notifications/lib/notifications.js index b556b7a6d..8e9023c50 100644 --- a/modules/notifications/lib/notifications.js +++ b/modules/notifications/lib/notifications.js @@ -36,6 +36,10 @@ jQuery(document).ready(function($) { url : (ajaxurl) ? ajaxurl : wpListL10n.url, data : params, success : function( response ) { + + // This event is used to show an updated list of who will be notified of editorial comments and status updates. + $( '#ef-post_following_box' ).trigger( 'following_list_updated' ); + var backgroundColor = parent_this.css( 'background-color' ); $(parent_this.parents('li')) .animate( { 'backgroundColor':'#CCEEBB' }, 200 ) diff --git a/modules/story-budget/lib/story-budget.css b/modules/story-budget/lib/story-budget.css index 446db29cb..2ae5c8a87 100644 --- a/modules/story-budget/lib/story-budget.css +++ b/modules/story-budget/lib/story-budget.css @@ -30,17 +30,16 @@ font-size: 14px; } +.postbox { + display: block; + margin: 0 auto 10px; + justify-content: space-between; +} .postbox-container { - float: left; padding-right: 0; -} - -.postbox { - display: block; - margin-bottom: 10px; - margin-left: 10px; - margin-right: 10px; + display: flex; + flex-flow: row wrap; } .postbox .inside { diff --git a/modules/story-budget/lib/story-budget.js b/modules/story-budget/lib/story-budget.js index 1d69264ae..0add6280e 100644 --- a/modules/story-budget/lib/story-budget.js +++ b/modules/story-budget/lib/story-budget.js @@ -16,27 +16,35 @@ jQuery(document).ready(function($) { $("h3.hndle,div.handlediv").click(function() { $(this).parent().children("div.inside").toggle(); }); - + // Change number of columns when choosing a new number from Screen Options - $("input[name=ef_story_budget_screen_columns]").click(function() { - var numColumns = $(this).val(); - - jQuery(".postbox-container").css('width', (100 / numColumns) + '%' ); + + var columnsSwitch = $("input[name=ef_story_budget_screen_columns]"); + columnsSwitch.click(function() { + var numColumns = parseInt($(this).val()); + var classPrefix = 'columns-number-'; + $(".postbox-container").removeClass(function() { + for (var index = 1, c = []; index <= columnsSwitch.length; index++) { + c.push( classPrefix + index ) + } + return c.join(' '); + }).addClass(classPrefix + numColumns); }); + - jQuery('h2 a.change-date').click(function(){ - jQuery(this).hide(); - jQuery('h2 form .form-value').hide(); - jQuery('h2 form input').show(); - jQuery('h2 form a.change-date-cancel').show(); + $('h2 a.change-date').click(function(){ + $(this).hide(); + $('h2 form .form-value').hide(); + $('h2 form input').show(); + $('h2 form a.change-date-cancel').show(); return false; }); - jQuery('h2 form a.change-date-cancel').click(function(){ - jQuery(this).hide(); - jQuery('h2 form .form-value').show(); - jQuery('h2 form input').hide(); - jQuery('h2 form a.change-date').show(); + $('h2 form a.change-date-cancel').click(function(){ + $(this).hide(); + $('h2 form .form-value').show(); + $('h2 form input').hide(); + $('h2 form a.change-date').show(); return false; }); }); diff --git a/modules/story-budget/story-budget.php b/modules/story-budget/story-budget.php index 7b2f61ae9..29b523b2d 100644 --- a/modules/story-budget/story-budget.php +++ b/modules/story-budget/story-budget.php @@ -65,13 +65,9 @@ function init() { // Filter to allow users to pick a taxonomy other than 'category' for sorting their posts $this->taxonomy_used = apply_filters( 'ef_story_budget_taxonomy_used', $this->taxonomy_used ); - + add_action( 'admin_init', array( $this, 'handle_form_date_range_change' ) ); - - include_once( EDIT_FLOW_ROOT . '/common/php/' . 'screen-options.php' ); - if ( function_exists( 'add_screen_options_panel' ) ) - add_screen_options_panel( self::usermeta_key_prefix . 'screen_columns', __( 'Screen Layout', 'edit-flow' ), array( $this, 'print_column_prefs' ), self::screen_id, array( $this, 'save_column_prefs' ), true ); - + add_action( 'admin_init', array( $this, 'add_screen_options_panel' ) ); // Register the columns of data appearing on every term. This is hooked into admin_init // so other Edit Flow modules can register their filters if needed add_action( 'admin_init', array( $this, 'register_term_columns' ) ); @@ -227,6 +223,16 @@ function get_num_columns() { return $this->num_columns; } + /** + * Add module options to the screen panel + * + * @since 0.8.3 + */ + function add_screen_options_panel() { + require_once( EDIT_FLOW_ROOT . '/common/php/' . 'screen-options.php' ); + add_screen_options_panel( self::usermeta_key_prefix . 'screen_columns', __( 'Screen Layout', 'edit-flow' ), array( $this, 'print_column_prefs' ), self::screen_id, array( $this, 'save_column_prefs' ), true ); + } + /** * Print column number preferences for screen options */ @@ -284,23 +290,25 @@ function story_budget() { print_messages(); ?> table_navigation(); ?>
- num_columns ); - $term_index = 0; - // Show just one column if we've filtered to one term - if ( count( $this->terms ) == 1 ) - $this->num_columns = 1; - for( $i = 1; $i <= $this->num_columns; $i++ ) { - echo '
'; - for( $j = 0; $j < $terms_per_container; $j++ ) { - if ( isset( $this->terms[$term_index] ) ) - $this->print_term( $this->terms[$term_index] ); - $term_index++; + num_columns ) . '">'; + foreach( (array) $this->terms as $term ) { + $this->print_term( $term ); } + echo '
'; - } - ?> + ?> +
post_modified_gmt . " GMT" ); - return $this->timesince( $modified_time_gmt ); + return sprintf( esc_html__( '%s ago', 'edit-flow' ), human_time_diff( get_the_time( 'U', $post->ID ), current_time( 'timestamp' ) ) ); break; default: break; diff --git a/modules/user-groups/user-groups.php b/modules/user-groups/user-groups.php index 98551fd3a..e85fa9ff6 100644 --- a/modules/user-groups/user-groups.php +++ b/modules/user-groups/user-groups.php @@ -844,6 +844,9 @@ function get_usergroup_by( $field, $value ) { $usergroup->$key = $value; } } + + $usergroup = apply_filters( 'ef_usergroup_object', $usergroup ); + return $usergroup; } diff --git a/readme.txt b/readme.txt index 26ab4367e..ee998ea72 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: batmoo, danielbachhuber, sbressler, automattic Donate link: http://editflow.org/contribute/ Tags: edit flow, workflow, editorial, newsroom, management, journalism, post status, custom status, notifications, email, comments, editorial comments, usergroups, calendars, editorial calendar, story budget Requires at least: 4.5 -Tested up to: 4.8 -Stable tag: 0.8.2 +Tested up to: 4.9.6 +Stable tag: 0.8.3 Redefining your editorial workflow. @@ -56,6 +56,9 @@ For support questions, feedback and ideas, please use the [WordPress.org forums] == Upgrade Notice == += 0.8.3 = +Improvements and bugfixes. + = 0.8.2 = Minor enhancements and bug fixes, translation updates. @@ -103,6 +106,29 @@ New features, including story budget and editorial metadata, a completely rewrit == Changelog == += 0.8.3 (June 14, 2018) = +* UI Improvement: Made primary buttons on Settings screen consistent with WordPress UI. Props [cojennin](https://github.com/cojennin). +* UI Improvement: Display who particularly was notified about an editorial comment. Props [goodguyry](https://github.com/goodguyry), [WPprodigy](https://github.com/WPprodigy) +* Improvement: Updated Russian translation and documentation. Props [achumakov](https://github.com/achumakov). +* Improvement: Eliminate a few cases of raw SQL queries in favor of `date_query`. Props [justnorris](https://github.com/justnorris). +* Improvement: Cache calendar items for each user individually to prevent potential cache pollution. Props [justnorris](https://github.com/justnorris). +* Improvement: various i18n updates. +* Improvement: Move ef_story_budget_posts_query_args filter down to allow overriding the date query in Story Budget module. +* Improvement: Limit results in Calendar to 200 per page, potentially saving from trouble on websites with large amount of content. +* Improvement: Don’t generate rewrite rules for notepad as they're unused. +* Improvement: Support modifying HTML output of a Calendar day via ef_pre_calendar_single_date_item_html filter. Props [cklosowski](https://github.com/cklosowski). + +* Improvement: show custom post statuses in Calendar and Story Budget. Props [mikeyarce](https://github.com/mikeyarce) +* WordPress Coding Standards improvements and code cleanup by many unsung heroes (primarily [justnorris](https://github.com/justnorris)). +* Bug fix: Prevent user from removing "Draft" post status, breaking the auto-draft functionality. +* Bug fix: Fix ef_pre_insert_editorial_comment filter so that it actually has meaning. Props [sudar](https://github.com/sudar). +* Bug fix: Fix PHP Warning: array_map(): Argument #2 should be an array. Props Michael Auteri. +* Bug fix: Always offset post times to UTC+0 for Calendars to prevent incorrect times when adding to iCalendar/Google Calendar. Props [justnorris](https://github.com/justnorris). +* Bug fix: Use taxonomy when checking for term existence when trying to prevent term collision. Props [shadyvb](https://github.com/shadyvb). +* Bug fix: Correctly handle screen options update for Story Budget columns. Props [raduconst](https://github.com/raduconst) +* Bug fix: EF_Calendar::get_beginning_of_week and EF_Calendar::get_ending_of_week should respect DST now. Props [FewKinG](https://github.com/FewKinG) +* Bug fix: Build home_url() previews with trailing slash. Props [jeremyfelt](https://github.com/jeremyfelt) + = 0.8.2 (Sept 16, 2016) = * Improvement: Updated Spanish localization thanks to [moucho](https://github.com/moucho) * Improvement: New Swedish localization thanks to [Warpsmith](https://github.com/Warpsmith) diff --git a/vipgo-helper.php b/vipgo-helper.php index 77ad84fad..be0166473 100644 --- a/vipgo-helper.php +++ b/vipgo-helper.php @@ -4,6 +4,16 @@ */ add_action( 'after_setup_theme', 'EditFlow' ); +/** + * Caps don't get loaded on install on VIP Go. Instead, let's add + * them via filters. + */ +add_filter( 'ef_kill_add_caps_to_role', '__return_true' ); +add_filter( 'ef_view_calendar_cap', function() {return 'edit_posts'; } ); +add_filter( 'ef_view_story_budget_cap', function() { return 'edit_posts'; } ); +add_filter( 'ef_edit_post_subscriptions_cap', function() { return 'edit_others_posts'; } ); +add_filter( 'ef_manage_usergroups_cap', function() { return 'manage_options'; } ); + /** * Edit Flow loads modules after plugins_loaded, which has already been fired when loading via wpcom_vip_load_plugins * Let's run the method at after_setup_themes