Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Feature/451 notification visibility branch for #461 #482

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
319a8fe
Adds field to the comment form to display notification info
goodguyry Jul 30, 2014
da675a5
Feedback updates as users are selected/deselected
goodguyry Jul 30, 2014
d42f421
Save the notification message info for display in the comment
goodguyry Jul 30, 2014
343adce
Display the saved notification feedback in the comment
goodguyry Jul 30, 2014
09857fa
Styles notification message in the form and comments
goodguyry Jul 30, 2014
c8c0c39
Slight formatting adjustment
goodguyry Jul 30, 2014
07d9133
Updated message creation to be more robust
goodguyry Jul 31, 2014
13dcc0e
Set up strings for localization
goodguyry Aug 29, 2014
de8b4c7
Build home_url() previews with trailing slash
jeremyfelt Jul 27, 2016
6d6cf81
Using PHPDoc to generate accesible Edit Flow documentation.
Jun 7, 2016
e429115
fix get_beginning_of_week comments
Oct 18, 2016
1c2d85a
fix get_ending_of_week returning wrong date after DST changes
Oct 21, 2016
f87ba61
Added usergroup obj filter for better flexibility
tcrsavage Oct 24, 2017
8f2fef2
Changed the way that the status on the calendar is made
Jan 22, 2018
806a99a
Support adding non-post data into days of calendar #417
cklosowski Jan 23, 2018
2f86e89
Add pre-html filter, to avoid doing WP_Post checks #417
cklosowski Mar 6, 2018
d29799d
Update filter name to follow naming convention #417
cklosowski Mar 6, 2018
6e6523d
Merge PR and fix conflicts
WPprodigy Apr 8, 2018
9f69bc8
Sanitize and escape
WPprodigy Apr 8, 2018
ade5a36
Conditionally output comment meta
WPprodigy Apr 8, 2018
71f833b
Formatting & Code Standards
WPprodigy Apr 8, 2018
02ebd65
Refactor notify method
WPprodigy Apr 8, 2018
f883b76
Trigger custom event when subscribers are updated
WPprodigy Apr 8, 2018
a42a44d
Localize text strings
WPprodigy Apr 8, 2018
231776d
Only save comment meta if necessary
WPprodigy Apr 8, 2018
ca9ca23
Update CSS
WPprodigy Apr 8, 2018
aad6fa1
Introduce filter to disable showing notified users
WPprodigy Apr 8, 2018
c220c60
Use WP core colors
WPprodigy Apr 8, 2018
9c1ea92
Update doc block
WPprodigy Apr 8, 2018
ee17d13
Capabilities: add capabilities via filters on VIP Go sites.
jeherve Apr 18, 2018
494499a
Made the changes discussed in PR #409
Apr 23, 2018
3be71d6
Merge pull request #357 from jeremyfelt/bug/home-url-344
rinatkhaziev May 5, 2018
fb006c0
Update story-budget.js
rinatkhaziev May 6, 2018
29cdfae
Fix missing escaping in story-budget.php
rinatkhaziev May 6, 2018
fd4a5ff
Merge pull request #456 from jeherve/add/cap-filters-vipgo
rinatkhaziev May 6, 2018
0f29b93
Supply an empty string as a filter arg for ef_pre_calendar_single_dat…
rinatkhaziev May 6, 2018
4a04769
Merge pull request #418 from cklosowski/issue/417
rinatkhaziev May 6, 2018
9243655
Move out add_screen_options_panel from init to admin_init. It has no …
rinatkhaziev May 6, 2018
484012a
Merge pull request #463 from Automattic/issues/354
rinatkhaziev May 7, 2018
830f559
Merge pull request #401 from humanmade/add-user-group-object-filter
rinatkhaziev May 7, 2018
342a784
Merge pull request #460 from raduconst/story-budget-columns
rinatkhaziev May 7, 2018
b76c844
Remove generated phpdoc.json - there's been many changes to the codeb…
rinatkhaziev May 7, 2018
c87f3b7
Merge pull request #353 from Automattic/documentation
rinatkhaziev May 7, 2018
0121284
Merge pull request #410 from raduconst/calendar-status
rinatkhaziev May 7, 2018
b8ad6a4
Displaying updated time instead of creation time in Notepad Dashboard…
TheCrowned May 28, 2018
dd59460
Notepad dashboard widget method changed to POST, update function twea…
TheCrowned May 28, 2018
5864f7d
Removed whitespace changes with respect to previous commit.
TheCrowned May 29, 2018
363d272
Removed whitespaces introduced in last commit
TheCrowned May 29, 2018
0d69708
Changed $_REQUEST references to $_POST references in handle_notepad_u…
TheCrowned May 29, 2018
69af79b
Merge pull request #470 from TheCrowned/update/dashboard-notepad-supe…
sboisvert Jun 5, 2018
aab8337
Merge pull request #469 from TheCrowned/fix/466-notepad-widget-post-form
rinatkhaziev Jun 14, 2018
31c2903
Merge pull request #380 from FewKinG/master
rinatkhaziev Jun 14, 2018
a4537ad
Merge pull request #452 from Automattic/feature/270-comments-notifica…
rinatkhaziev Jun 15, 2018
ed3c71d
Revert "Display who was notified for an editorial comment"
rinatkhaziev Jun 15, 2018
179abf7
Merge pull request #472 from Automattic/revert-452-feature/270-commen…
rinatkhaziev Jun 15, 2018
11d7db8
Revert "Revert "Display who was notified for an editorial comment""
rinatkhaziev Jun 15, 2018
72c7b9f
Merge pull request #473 from Automattic/revert-472-revert-452-feature…
rinatkhaziev Jun 15, 2018
4e5bd20
Merge pull request #468 from TheCrowned/fix/465-notepad-updated-time
rinatkhaziev Jun 15, 2018
faa9ac3
Update Changelog and Upgrade Notice sections for 0.8.3
rinatkhaziev Jun 14, 2018
155d5a9
Bump 'Tested up to' to 4.9.6
rinatkhaziev Jun 15, 2018
0edd15c
Mirror readme updates to README.md
rinatkhaziev Jun 15, 2018
d5368a3
Bump version to 0.8.3
rinatkhaziev Jun 15, 2018
4724a3c
Merge pull request #474 from Automattic/readme-updates-0.8.3
rinatkhaziev Jun 15, 2018
1011002
Merge branch 'automattic/master' into feature/451-notification-visibi…
jerclarke Nov 8, 2018
b31e84f
editorial-comments.js - update jQuery that pulls text from subscribed…
jerclarke Nov 8, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand All @@ -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**
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
43 changes: 39 additions & 4 deletions edit_flow.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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__ ) );
Expand Down Expand Up @@ -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' );

}
Expand All @@ -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 ) );
}

Expand All @@ -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' );
}

Expand Down Expand Up @@ -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;
}
Expand All @@ -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' );
}

Expand All @@ -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;
Expand Down
43 changes: 28 additions & 15 deletions modules/calendar/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );

Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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;
}

}
Expand Down Expand Up @@ -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;

}
Expand All @@ -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;

}
Expand Down
4 changes: 2 additions & 2 deletions modules/custom-status/custom-status.php
Original file line number Diff line number Diff line change
Expand Up @@ -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( '/' ) );
}

/**
Expand Down Expand Up @@ -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'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $post->post_title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
return $actions;
Expand Down
17 changes: 7 additions & 10 deletions modules/dashboard/widgets/dashboard-notepad.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,30 @@ 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' );

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;
}

/**
Expand All @@ -83,12 +80,12 @@ public function notepad_widget() {
$current_post = ( ! empty( $posts[0] ) ) ? $posts[0] : false;

if ( $current_post )
$last_updated = '<span id="dashboard-notepad-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 ) ) . '</span>';
$last_updated = '<span id="dashboard-notepad-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 ) ) . '</span>';
else
$last_updated = '';

if ( current_user_can( $this->edit_cap ) ) {
echo '<form id="dashboard-notepad">';
echo '<form method="post" id="dashboard-notepad">';
echo '<input type="hidden" name="action" value="dashboard-notepad" />';
echo '<input type="hidden" name="notepad-id" value="' . esc_attr( $current_id ) . '" />';
echo '<textarea style="width:100%" rows="10" name="note">';
Expand All @@ -112,4 +109,4 @@ public function notepad_widget() {
}
}

}
}
Loading