Plugin Directory

Changeset 486648

Timestamp:
01/08/2012 09:27:06 PM (13 years ago)
Author:
johnciacia
Message:

adding change log and added title attribute to project list item

Location:
propel/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • propel/trunk/changelog.txt

    r485269 r486648  
    5252* Added "Project Overview" dashboard widget
    5353* Readded shortcode for frontend display
     54
     55
     56
  • propel/trunk/deprecated.php

    r485269 r486648  
    2424        <?php
    2525        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>';
    2727        }
    2828        ?>
  • propel/trunk/plugins/users.php

    r485269 r486648  
    55 * (http://wordpress.org/extend/plugins/co-authors-plus/)
    66 *
    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.
    89 * @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?
    1115 */
    1216Propel_Authors::initialize();
     
    2125    public static function initialize() {
    2226        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' ) );
    2428        add_filter( 'wp_insert_post_data', array( __CLASS__, 'wp_insert_post_data' ) );
    2529        add_action( 'save_post', array( __CLASS__, 'save_post' ), 10, 2 );
     
    4549        $post = get_post( $post_id );
    4650        $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 );
    4860    }
    4961
     
    6375            }
    6476        }
    65        
    6677    }
    6778
     
    195206
    196207        $post_type = $post->post_type;
    197 
    198208        if( isset( $_POST['coauthors-nonce'] ) && isset( $_POST['coauthors'] ) ) {
    199209            check_admin_referer( 'coauthors-edit', 'coauthors-nonce' );
     
    204214            //ALL THE TASKS associated with that project
    205215            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                }
    207220            }
    208221
     
    221234
    222235    /**
    223      *
     236     *
    224237     * $coauthors array
     238
     239
    225240     */
    226     public static function add_coauthors( $post_id, $coauthors, $append = false ) {
     241    public static function add_coauthors( $post_id, $coauthors, $append = false ) {
    227242        global $current_user, $post;
    228243
     
    244259            }
    245260
    246             if( !has_term( $name, self::COAUTHOR_TAXONOMY, $post->ID ) ){
     261            if( !has_term( $name, self::COAUTHOR_TAXONOMY, $post ) ){
    247262                $notify[] = $name;
    248263            }
     
    252267            $set = wp_set_post_terms( $post_id, $coauthors, self::COAUTHOR_TAXONOMY, $append );
    253268        }
    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     */
    258279    public static function delete_user( $delete_id ) {
    259280        global $wpdb;
     
    262283
    263284        if($reassign_id) {
    264             $reassign_user = get_profile_by_id( 'user_login', $reassign_id );
     285            $reassign_user = get_', $reassign_id );
    265286            if( $reassign_user ) {
    266287                $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $delete_id ) );
     
    268289                if ( $post_ids ) {
    269290                    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 );
    271292                    }
    272293                }
     
    274295        }
    275296
    276         $delete_user = get_profile_by_id( 'user_login', $delete_id );
     297        $delete_user = get_', $delete_id );
    277298        if( $delete_user ) {
    278             wp_delete_term( $delete_user, self::COAUTHOR_TAXONOMY );
     299            wp_delete_term( $delete_user, self::COAUTHOR_TAXONOMY );
    279300        }
    280301    }
  • propel/trunk/propel.php

    r485269 r486648  
    44Plugin URI: http://www.johnciacia.com/propel/
    55Description: Easily manage your projects, clients, tasks, and files.
    6 Version: 2.0.3
     6Version: 2.0.
    77Author: John Ciacia
    88Author URI: http://www.johnciacia.com
  • propel/trunk/readme.txt

    r485269 r486648  
    44Requires at least: 3.0
    55Tested up to: 3.3.1
    6 Stable tag: 2.1
     6Stable tag: 2.
    77
    88This plugin allows users to manage projects and tasks.
Note: See TracChangeset for help on using the changeset viewer.