Changeset 486648
- Timestamp:
- 01/08/2012 09:27:06 PM (13 years ago)
- Location:
- propel/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
propel/trunk/changelog.txt
r485269 r486648 52 52 * Added "Project Overview" dashboard widget 53 53 * Readded shortcode for frontend display 54 55 56 -
propel/trunk/deprecated.php
r485269 r486648 24 24 <?php 25 25 foreach( $projects as $project ) { 26 echo '<li><a href="#project-' . $project->ID . '" ><span>' . $project->post_title . '</span></a></li>';26 echo '<li><a href="#project-' . $project->ID . '"><span>' . $project->post_title . '</span></a></li>'; 27 27 } 28 28 ?> -
propel/trunk/plugins/users.php
r485269 r486648 5 5 * (http://wordpress.org/extend/plugins/co-authors-plus/) 6 6 * 7 * @todo: add option to enable / disable pre_get_posts 7 * @todo: add option to enable / disable pre_get_posts. after the initial import every author should 8 * be added as a coauthor. this will allow for this plugin to be enabled and disabled seamlessly. 8 9 * @todo: move list-authors.php into this file 9 * @todo: when a coauthor is added to a project, make that coauthor of all tasks in that project 10 * @todo: when a coauthor is removed from a project, remove that coauthor from all the tasks in the project 10 * @todo: when a user is deleted projects are not reassigned appropratly 11 * @todo: make distinction between task owner and contributors more clear 12 * @todo: add tool to bulk add / remove contributors 13 * @todo: create an import tool. all authors should be added as contributors. 14 * should this happen each time the plugin is enabled? 11 15 */ 12 16 Propel_Authors::initialize(); … … 21 25 public static function initialize() { 22 26 add_filter( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ) ); 23 add_action( 'delete_user', array( __CLASS__, 'delete_user _action' ) );27 add_action( 'delete_user', array( __CLASS__, 'delete_user' ) ); 24 28 add_filter( 'wp_insert_post_data', array( __CLASS__, 'wp_insert_post_data' ) ); 25 29 add_action( 'save_post', array( __CLASS__, 'save_post' ), 10, 2 ); … … 45 49 $post = get_post( $post_id ); 46 50 $user = get_userdata( $post->post_author ); 47 self::add_coauthors( $post_id, array( $user->user_login) ); 51 $coauthors = array( $user->user_login ); 52 53 $project_managers = self::get_coauthors( $post->post_parent ); 54 foreach( $project_managers as $project_manager ) { 55 $coauthors[] = $project_manager->user_login; 56 } 57 $coauthors = array_unique( $coauthors ); 58 59 self::add_coauthors( $post_id, $coauthors ); 48 60 } 49 61 … … 63 75 } 64 76 } 65 66 77 } 67 78 … … 195 206 196 207 $post_type = $post->post_type; 197 198 208 if( isset( $_POST['coauthors-nonce'] ) && isset( $_POST['coauthors'] ) ) { 199 209 check_admin_referer( 'coauthors-edit', 'coauthors-nonce' ); … … 204 214 //ALL THE TASKS associated with that project 205 215 if( 'propel_project' == $typenow ) { 206 216 $posts = get_posts( array( 'post_type' => 'propel_task', 'post_parent' => $post_id ) ); 217 foreach( $posts as $post ) { 218 self::add_coauthors( $post->ID, $coauthors ); 219 } 207 220 } 208 221 … … 221 234 222 235 /** 223 * 236 * 224 237 * $coauthors array 238 239 225 240 */ 226 public static function add_coauthors( $post_id, $coauthors, $append = false ) {241 public static function add_coauthors( $post_id, $coauthors, $append = false ) { 227 242 global $current_user, $post; 228 243 … … 244 259 } 245 260 246 if( !has_term( $name, self::COAUTHOR_TAXONOMY, $post ->ID) ){261 if( !has_term( $name, self::COAUTHOR_TAXONOMY, $post ) ){ 247 262 $notify[] = $name; 248 263 } … … 252 267 $set = wp_set_post_terms( $post_id, $coauthors, self::COAUTHOR_TAXONOMY, $append ); 253 268 } 254 self::notify_coauthors($notify); 255 } 256 257 269 270 if( $notify ) { 271 self::notify_coauthors($notify); 272 } 273 } 274 275 /** 276 * When a user is deleted, remove the term information and reassign 277 * if requested. 278 */ 258 279 public static function delete_user( $delete_id ) { 259 280 global $wpdb; … … 262 283 263 284 if($reassign_id) { 264 $reassign_user = get_ profile_by_id( 'user_login', $reassign_id );285 $reassign_user = get_', $reassign_id ); 265 286 if( $reassign_user ) { 266 287 $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $delete_id ) ); … … 268 289 if ( $post_ids ) { 269 290 foreach ( $post_ids as $post_id ) { 270 self::add_coauthors( $post_id, array( $reassign_user ), true );291 self::add_coauthors( $post_id, array( $reassign_usere ); 271 292 } 272 293 } … … 274 295 } 275 296 276 $delete_user = get_ profile_by_id( 'user_login', $delete_id );297 $delete_user = get_', $delete_id ); 277 298 if( $delete_user ) { 278 wp_delete_term( $delete_user , self::COAUTHOR_TAXONOMY );299 wp_delete_term( $delete_user, self::COAUTHOR_TAXONOMY ); 279 300 } 280 301 } -
propel/trunk/propel.php
r485269 r486648 4 4 Plugin URI: http://www.johnciacia.com/propel/ 5 5 Description: Easily manage your projects, clients, tasks, and files. 6 Version: 2.0. 36 Version: 2.0. 7 7 Author: John Ciacia 8 8 Author URI: http://www.johnciacia.com -
propel/trunk/readme.txt
r485269 r486648 4 4 Requires at least: 3.0 5 5 Tested up to: 3.3.1 6 Stable tag: 2. 16 Stable tag: 2. 7 7 8 8 This plugin allows users to manage projects and tasks.
Note: See TracChangeset
for help on using the changeset viewer.