├── .gitignore ├── includes ├── css │ ├── admin.css │ ├── jquery-ui │ │ ├── images │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_454545_256x240.png │ │ │ ├── ui-icons_888888_256x240.png │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ ├── ui-icons_f6cf3b_256x240.png │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ ├── ui-bg_glass_75_ffffff_1x400.png │ │ │ ├── ui-bg_inset-soft_95_fef1ec_1x100.png │ │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ └── jquery.ui.1.8.16.ie.css │ ├── colorbox.css │ ├── bp.css │ └── collabpress.css ├── images │ ├── cp-task-icons.png │ ├── project-bc-bg.png │ ├── dashboard-bc-bg.png │ ├── collabpress-menu-icon.png │ └── collabpress-page-icon.png ├── tools │ ├── fancybox │ │ ├── blank.gif │ │ ├── fancybox.png │ │ ├── fancybox-x.png │ │ ├── fancybox-y.png │ │ ├── fancy_close.png │ │ ├── fancy_loading.png │ │ ├── fancy_nav_left.png │ │ ├── fancy_nav_right.png │ │ ├── fancy_shadow_e.png │ │ ├── fancy_shadow_n.png │ │ ├── fancy_shadow_ne.png │ │ ├── fancy_shadow_nw.png │ │ ├── fancy_shadow_s.png │ │ ├── fancy_shadow_se.png │ │ ├── fancy_shadow_sw.png │ │ ├── fancy_shadow_w.png │ │ ├── fancy_title_left.png │ │ ├── fancy_title_main.png │ │ ├── fancy_title_over.png │ │ ├── fancy_title_right.png │ │ ├── jquery.mousewheel-3.0.4.pack.js │ │ ├── jquery.easing-1.3.pack.js │ │ └── jquery.fancybox-1.3.4.css │ └── boones-pagination │ │ └── boones-pagination.php ├── js │ ├── cp_post.js │ ├── bp.js │ ├── admin.js │ ├── cp_uploader.js │ └── jquery.colorbox-min.js ├── menus.php ├── templates │ └── collabpress │ │ ├── content-calendar.php │ │ ├── content-single-project-calendar.php │ │ ├── content-activity.php │ │ ├── content-single-project-users.php │ │ ├── content-single-project-files.php │ │ ├── buddypress │ │ ├── dashboard.php │ │ ├── content-single-task.php │ │ └── content-single-project.php │ │ ├── dashboard.php │ │ ├── content-single-project.php │ │ ├── content-single-task.php │ │ └── content-single-project-tasks.php ├── shortcode.php ├── menus │ ├── footer.php │ ├── dashboard.php │ └── settings.php ├── footer.php ├── update.php ├── presstrends.php ├── admin_init.php ├── cp-core.php ├── ajax-handlers.php ├── content-actions.php └── cp-bp-notifications.php ├── languages ├── collabpress-de_DE.mo ├── collabpress-es_ES.mo └── collabpress-sk_SK.mo ├── tests ├── bootstrap.php ├── factory.php └── test-functions.php ├── phpunit.xml ├── constants.php ├── .travis.yml ├── cp-loader.php └── readme.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /includes/css/admin.css: -------------------------------------------------------------------------------- 1 | .collabpress { 2 | margin: 4px 15px 0 0; 3 | } -------------------------------------------------------------------------------- /languages/collabpress-de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/languages/collabpress-de_DE.mo -------------------------------------------------------------------------------- /languages/collabpress-es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/languages/collabpress-es_ES.mo -------------------------------------------------------------------------------- /languages/collabpress-sk_SK.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/languages/collabpress-sk_SK.mo -------------------------------------------------------------------------------- /includes/images/cp-task-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/images/cp-task-icons.png -------------------------------------------------------------------------------- /includes/images/project-bc-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/images/project-bc-bg.png -------------------------------------------------------------------------------- /includes/tools/fancybox/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/blank.gif -------------------------------------------------------------------------------- /includes/images/dashboard-bc-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/images/dashboard-bc-bg.png -------------------------------------------------------------------------------- /includes/js/cp_post.js: -------------------------------------------------------------------------------- 1 | var uploadComplete 2 | 3 | (function($){ 4 | 5 | uploadComplete = function(){ 6 | }; 7 | 8 | })(jQuery); -------------------------------------------------------------------------------- /includes/tools/fancybox/fancybox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancybox.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancybox-x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancybox-x.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancybox-y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancybox-y.png -------------------------------------------------------------------------------- /includes/images/collabpress-menu-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/images/collabpress-menu-icon.png -------------------------------------------------------------------------------- /includes/images/collabpress-page-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/images/collabpress-page-icon.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_close.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_loading.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_nav_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_nav_left.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_nav_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_nav_right.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_shadow_e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_shadow_e.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_shadow_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_shadow_n.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_shadow_ne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_shadow_ne.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_shadow_nw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_shadow_nw.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_shadow_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_shadow_s.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_shadow_se.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_shadow_se.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_shadow_sw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_shadow_sw.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_shadow_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_shadow_w.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_title_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_title_left.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_title_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_title_main.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_title_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_title_over.png -------------------------------------------------------------------------------- /includes/tools/fancybox/fancy_title_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/tools/fancybox/fancy_title_right.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-icons_f6cf3b_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-icons_f6cf3b_256x240.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-bg_glass_75_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-bg_glass_75_ffffff_1x400.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-bg_inset-soft_95_fef1ec_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-bg_inset-soft_95_fef1ec_1x100.png -------------------------------------------------------------------------------- /includes/css/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebDevStudios/CollabPress/HEAD/includes/css/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | array( basename( dirname( dirname( __FILE__ ) ) ) . '/cp-loader.php' ), 5 | ); 6 | 7 | require getenv( 'WP_TESTS_DIR' ) . '/includes/bootstrap.php'; 8 | 9 | -------------------------------------------------------------------------------- /includes/js/bp.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($){ 2 | $('.hide-on-load .inside').slideToggle(200); 3 | 4 | $('.cp-meta-box h4').click(function(){ 5 | var parent = $(this).parent(); 6 | $(parent).children('.inside').slideToggle(200); 7 | }); 8 | },jQuery); -------------------------------------------------------------------------------- /includes/menus.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | ./tests/ 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /includes/js/admin.js: -------------------------------------------------------------------------------- 1 | jQuery(function() { 2 | 3 | // Hover Class 4 | jQuery('.cp-activity-row ').live('mouseover mouseout', function(event) { 5 | if (event.type == 'mouseover') { 6 | jQuery(this).addClass('hover'); 7 | } else { 8 | jQuery(this).removeClass('hover'); 9 | } 10 | }); 11 | 12 | // Date Picker 13 | jQuery("#datepicker").datepicker({dateFormat: 'm/d/yy'}); 14 | 15 | jQuery("a.cp_grouped_elements").fancybox(); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /includes/js/cp_uploader.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function() { 2 | var thePostID; 3 | jQuery('#upload_image_button').live('click', function() { 4 | thePostID = jQuery(this).parent().children('.cp-featured-id').filter(':first').val(); 5 | formfield = jQuery('#upload_image').attr('name'); 6 | inputfield = jQuery('#upload_image_button').attr('name'); 7 | tb_show('', 'media-upload.php?type=file&post_id='+thePostID+'&TB_iframe=true'); 8 | return false; 9 | }); 10 | }); -------------------------------------------------------------------------------- /includes/templates/collabpress/content-calendar.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 |
8 |
9 |
10 |

11 | $month, 17 | 'year' => $year, 18 | ) 19 | ); ?> 20 |
21 |
-------------------------------------------------------------------------------- /includes/shortcode.php: -------------------------------------------------------------------------------- 1 | 2 | v - · · · 3 |

-------------------------------------------------------------------------------- /includes/templates/collabpress/content-single-project-calendar.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 |

11 |

 » 

12 |
13 |
14 | $cp->project->ID, 20 | 'month' => $month, 21 | 'year' => $year ) 22 | ); ?> 23 |
24 |
25 | -------------------------------------------------------------------------------- /constants.php: -------------------------------------------------------------------------------- 1 | 2 | v - 3 | · 4 | : 5 | Github · 6 | Make Blog 7 |
8 | 9 | · 10 | · 11 | · 12 | · 13 | · 14 | · 15 | 16 |

-------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.3 5 | - 5.4 6 | 7 | env: 8 | - WP_VERSION=master WP_MULTISITE=0 9 | - WP_VERSION=3.4.2 WP_MULTISITE=0 10 | - WP_VERSION=master WP_MULTISITE=1 11 | - WP_VERSION=3.4.2 WP_MULTISITE=1 12 | 13 | before_install: 14 | - git submodule update --init --recursive 15 | 16 | before_script: 17 | # set up WP install 18 | - WP_CORE_DIR=/tmp/wordpress/ 19 | - wget -nv -O /tmp/wordpress.tar.gz https://github.com/WordPress/WordPress/tarball/$WP_VERSION 20 | - mkdir -p $WP_CORE_DIR 21 | - tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR 22 | - plugin_slug=$(basename $(pwd)) 23 | - plugin_dir=$WP_CORE_DIR/wp-content/plugins/$plugin_slug 24 | - cd .. 25 | - mv $plugin_slug $plugin_dir 26 | # set up testing suite 27 | - export WP_TESTS_DIR=/tmp/wordpress-tests/ 28 | - svn co --ignore-externals --quiet http://unit-tests.svn.wordpress.org/trunk/ $WP_TESTS_DIR 29 | - cd $WP_TESTS_DIR 30 | - cp wp-tests-config-sample.php wp-tests-config.php 31 | - sed -i "s:dirname( __FILE__ ) . '/wordpress/':'$WP_CORE_DIR':" wp-tests-config.php 32 | - sed -i "s/yourdbnamehere/wordpress_test/" wp-tests-config.php 33 | - sed -i "s/yourusernamehere/root/" wp-tests-config.php 34 | - sed -i "s/yourpasswordhere//" wp-tests-config.php 35 | # set up database 36 | - mysql -e 'CREATE DATABASE wordpress_test;' -uroot 37 | # prepare for running the tests 38 | - cd $plugin_dir 39 | 40 | script: phpunit 41 | -------------------------------------------------------------------------------- /tests/factory.php: -------------------------------------------------------------------------------- 1 | default_generation_definitions = array( 8 | 'post_status' => 'publish', 9 | 'post_title' => new WP_UnitTest_Generator_Sequence( 'Task title %s' ), 10 | 'post_content' => new WP_UnitTest_Generator_Sequence( 'Task description %s' ), 11 | 'post_type' => 'cp-tasks' 12 | ); 13 | } 14 | 15 | function create_object( $args ) { 16 | $post_id = wp_insert_post( $args ); 17 | 18 | if ( isset( $args['assigned_user_id'] ) ) { 19 | update_post_meta( $post_id, '_cp-task-assign', $args['assigned_user_id'] ); 20 | } 21 | 22 | if ( isset( $args['status'] ) ) { 23 | update_post_meta( $post_id, '_cp-task-status', $args['status'] ); 24 | } 25 | 26 | if ( isset( $args['task_list_id'] ) ) { 27 | update_post_meta( $post_id, '_cp-task-list-id', $args['task_list_id'] ); 28 | } 29 | 30 | return $post_id; 31 | } 32 | 33 | /** 34 | * @todo 35 | */ 36 | function update_object( $object, $fields ) {} 37 | 38 | function get_object_by_id( $post_id ) { 39 | return get_post( $post_id ); 40 | } 41 | } 42 | 43 | class CP_UnitTest_Factory_For_TaskList extends WP_UnitTest_Factory_For_Thing { 44 | 45 | function __construct( $factory = null ) { 46 | parent::__construct( $factory ); 47 | $this->default_generation_definitions = array( 48 | 'post_status' => 'publish', 49 | 'post_title' => new WP_UnitTest_Generator_Sequence( 'TaskList title %s' ), 50 | 'post_content' => new WP_UnitTest_Generator_Sequence( 'TaskList description %s' ), 51 | 'post_type' => 'cp-task-list' 52 | ); 53 | } 54 | 55 | function create_object( $args ) { 56 | $post_id = wp_insert_post( $args ); 57 | 58 | if ( isset( $args['project_id'] ) ) { 59 | update_post_meta( $post_id, '_cp-project-id', $args['project_id'] ); 60 | } 61 | 62 | return $post_id; 63 | } 64 | 65 | /** 66 | * @todo 67 | */ 68 | function update_object( $object, $fields ) {} 69 | 70 | function get_object_by_id( $post_id ) { 71 | return get_post( $post_id ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /includes/css/colorbox.css: -------------------------------------------------------------------------------- 1 | /* 2 | ColorBox Core Style: 3 | The following CSS is consistent between example themes and should not be altered. 4 | */ 5 | #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} 6 | #cboxOverlay{position:fixed; width:100%; height:100%;} 7 | #cboxMiddleLeft, #cboxBottomLeft{clear:left;} 8 | #cboxContent{position:relative;} 9 | #cboxLoadedContent{overflow:auto;} 10 | #cboxTitle{margin:0;} 11 | #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} 12 | #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} 13 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} 14 | .cboxIframe{width:100%; height:100%; display:block; border:0;} 15 | #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} 16 | 17 | /* 18 | User Style: 19 | Change the following styles to modify the appearance of ColorBox. They are 20 | ordered & tabbed in a way that represents the nesting of the generated HTML. 21 | */ 22 | #cboxOverlay{background:#fff;} 23 | #colorbox{} 24 | #cboxContent{margin-top:32px; overflow:visible;} 25 | .cboxIframe{background:#fff;} 26 | #cboxError{padding:50px; border:1px solid #ccc;} 27 | #cboxLoadedContent{background:#000; padding:1px;} 28 | #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} 29 | #cboxLoadingOverlay{background:#000;} 30 | #cboxTitle{position:absolute; top:-22px; left:0; color:#000;} 31 | #cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;} 32 | #cboxSlideshow, #cboxPrevious, #cboxNext, #cboxClose{text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(images/controls.png) no-repeat 0 0;} 33 | #cboxPrevious{background-position:0px 0px; right:44px;} 34 | #cboxPrevious:hover{background-position:0px -25px;} 35 | #cboxNext{background-position:-25px 0px; right:22px;} 36 | #cboxNext:hover{background-position:-25px -25px;} 37 | #cboxClose{background-position:-50px 0px; right:0;} 38 | #cboxClose:hover{background-position:-50px -25px;} 39 | .cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;} 40 | .cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;} 41 | .cboxSlideshow_on #cboxSlideshow:hover{background-position:-100px -25px;} 42 | .cboxSlideshow_off #cboxSlideshow{background-position:-100px 0px; right:44px;} 43 | .cboxSlideshow_off #cboxSlideshow:hover{background-position:-75px -25px;} 44 | -------------------------------------------------------------------------------- /cp-loader.php: -------------------------------------------------------------------------------- 1 | 'enabled', 14 | 'email_notifications' => 'disabled', 15 | 'num_recent_activity' => '4', 16 | 'user_role' => 'manage_options', 17 | 'settings_user_role' => 'manage_options', 18 | 'shortcode_user_role' => 'all', 19 | 'num_users_display' => '10', 20 | 'debug_mode' => 'disabled', 21 | 'date_format' => 'F j, Y', 22 | ); 23 | 24 | update_option( 'cp_options', $cp_defaults ); 25 | } 26 | 27 | add_action( 'init', 'cp_update' ); 28 | 29 | /** 30 | * Update scripts for specific versions 31 | * 32 | * @since 1.3 33 | */ 34 | function cp_update() { 35 | global $wpdb; 36 | $installed_version = get_option( 'CP_VERSION' ); 37 | 38 | if ( $installed_version != COLLABPRESS_VERSION ) { 39 | // 1.3 specific upgrades 40 | if ( version_compare( $installed_version, '1.3-dev', '<' ) ) { 41 | $tablename = $wpdb->prefix . 'cp_project_users'; 42 | 43 | // Add project_users table 44 | $sql = "CREATE TABLE $tablename ( 45 | project_member_id bigint(20) NOT NULL AUTO_INCREMENT, 46 | project_id bigint(20) NOT NULL, 47 | user_id bigint(20) NOT NULL, 48 | UNIQUE KEY project_member_id (project_member_id) 49 | );"; 50 | 51 | require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 52 | dbDelta( $sql ); 53 | 54 | // Move old user relationships into new user table 55 | $projects = get_posts( 56 | array( 57 | 'post_type' => 'cp-projects', 58 | 'posts_per_page' => -1 59 | ) 60 | ); 61 | foreach ( $projects as $project ) { 62 | $users = get_post_meta( $project->ID, '_cp-project-users', true ); 63 | foreach ( $users as $user_id ) { 64 | cp_add_user_to_project( $project->ID, $user_id ); 65 | } 66 | } 67 | 68 | } 69 | 70 | // 1.4 specific upgrades 71 | if ( version_compare( $installed_version, '1.4-dev', '<' ) ) { 72 | 73 | // Change task due date storage format from m/d/yy to mysql formatted date 74 | $tasks = get_posts( array( 'post_type' => 'cp-tasks', 'posts_per_page' => -1 ) ); 75 | foreach ( $tasks as $task ) { 76 | $due_date = cp_get_task_due_date_mysql( $task->ID ); 77 | $unix_timestamp = strtotime( $due_date ); 78 | $formatted_date = gmdate( 'Y-m-d H:i:s', ( $unix_timestamp ) ); 79 | cp_update_task( array( 'ID' => $task->ID, 'task_due_date' => $formatted_date ) ); 80 | } 81 | 82 | // 1.4 introduces the date format option, which we need to add 83 | // a default to in the cp_options. 84 | $cp_options = cp_get_options(); 85 | if ( empty( $cp_options['date_format'] ) ) { 86 | $cp_options['date_format'] = 'F j, Y'; 87 | update_option( 'cp_options', $cp_options ); 88 | } 89 | } 90 | 91 | update_option( 'CP_VERSION', COLLABPRESS_VERSION ); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /includes/presstrends.php: -------------------------------------------------------------------------------- 1 | Name ); 27 | } else { 28 | $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' ); 29 | $theme_name = $theme_data['Name']; 30 | } 31 | 32 | $plugin_name = '&'; 33 | foreach ( get_plugins() as $plugin_info ) { 34 | $plugin_name .= $plugin_info['Name'] . '&'; 35 | } 36 | // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE 37 | $plugin_data = get_plugin_data( COLLABPRESS_PLUGIN_DIR . 'cp-loader.php' ); 38 | $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" ); 39 | $data = array( 40 | 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ), 41 | 'posts' => $count_posts->publish, 42 | 'pages' => $count_pages->publish, 43 | 'comments' => $comments_count->total_comments, 44 | 'approved' => $comments_count->approved, 45 | 'spam' => $comments_count->spam, 46 | 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ), 47 | 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0, 48 | 'theme_version' => $plugin_data['Version'], 49 | 'theme_name' => $theme_name, 50 | 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ), 51 | 'plugins' => count( get_option( 'active_plugins' ) ), 52 | 'plugin' => urlencode( $plugin_name ), 53 | 'wpversion' => get_bloginfo( 'version' ), 54 | ); 55 | 56 | foreach ( $data as $k => $v ) { 57 | $url .= $k . '/' . $v . '/'; 58 | } 59 | wp_remote_get( $url ); 60 | set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 ); 61 | } 62 | } 63 | 64 | // PressTrends WordPress Action 65 | $cp_options = cp_get_options(); 66 | $cp_presstrends = ( ! empty ( $cp_options['presstrends'] ) && $cp_options['presstrends'] == 'no' ) ? true : false; 67 | if ( $cp_presstrends ) 68 | add_action('admin_init', 'presstrends_CollabPress_plugin'); -------------------------------------------------------------------------------- /includes/admin_init.php: -------------------------------------------------------------------------------- 1 | add_cap( 'administrator', 'cp_add_projects' ); 20 | $wp_roles->add_cap( 'administrator', 'cp_edit_projects' ); 21 | $wp_roles->add_cap( 'administrator', 'cp_add_task_lists' ); 22 | $wp_roles->add_cap( 'administrator', 'cp_edit_task_lists' ); 23 | $wp_roles->add_cap( 'administrator', 'cp_add_task' ); 24 | $wp_roles->add_cap( 'administrator', 'cp_edit_task' ); 25 | 26 | $wp_roles->add_cap( 'editor', 'cp_add_projects' ); 27 | $wp_roles->add_cap( 'editor', 'cp_edit_projects' ); 28 | $wp_roles->add_cap( 'editor', 'cp_add_task_lists' ); 29 | $wp_roles->add_cap( 'editor', 'cp_edit_task_lists' ); 30 | $wp_roles->add_cap( 'editor', 'cp_add_task' ); 31 | $wp_roles->add_cap( 'editor', 'cp_edit_task' ); 32 | 33 | $wp_roles->add_cap( 'author', 'cp_add_projects' ); 34 | $wp_roles->add_cap( 'author', 'cp_edit_projects' ); 35 | $wp_roles->add_cap( 'author', 'cp_add_task_lists' ); 36 | $wp_roles->add_cap( 'author', 'cp_edit_task_lists' ); 37 | $wp_roles->add_cap( 'author', 'cp_add_task' ); 38 | $wp_roles->add_cap( 'author', 'cp_edit_task' ); 39 | 40 | $wp_roles->add_cap( 'contributor', 'cp_add_projects' ); 41 | $wp_roles->add_cap( 'contributor', 'cp_edit_projects' ); 42 | $wp_roles->add_cap( 'contributor', 'cp_add_task_lists' ); 43 | $wp_roles->add_cap( 'contributor', 'cp_edit_task_lists' ); 44 | $wp_roles->add_cap( 'contributor', 'cp_add_task' ); 45 | $wp_roles->add_cap( 'contributor', 'cp_edit_task' ); 46 | 47 | $wp_roles->add_cap( 'subscriber', 'cp_add_projects' ); 48 | $wp_roles->add_cap( 'subscriber', 'cp_edit_projects' ); 49 | $wp_roles->add_cap( 'subscriber', 'cp_add_task_lists' ); 50 | $wp_roles->add_cap( 'subscriber', 'cp_edit_task_lists' ); 51 | $wp_roles->add_cap( 'subscriber', 'cp_add_task' ); 52 | $wp_roles->add_cap( 'subscriber', 'cp_edit_task' ); 53 | 54 | } 55 | 56 | add_action( 'admin_init', 'cp_dismiss_admin_notice' ); 57 | 58 | /** 59 | * Dismiss a CP warning admin notice 60 | * 61 | * @since 1.3 62 | */ 63 | function cp_dismiss_admin_notice() { 64 | if ( ! current_user_can( 'manage_options' ) ) { 65 | return; 66 | } 67 | 68 | // Sanitize 69 | $notices = array( 'no_bp_groups', 'no_bp_15' ); 70 | if ( ! isset( $_GET['cp_dismiss'] ) || ! in_array( $_GET['cp_dismiss'], $notices ) ) { 71 | return; 72 | } 73 | 74 | check_admin_referer( 'cp_dismiss_notice' ); 75 | 76 | $dismissed = get_option( 'cp_dismissed_messages' ); 77 | if ( ! $dismissed ) { 78 | $dismissed = array(); 79 | } 80 | 81 | $dismissed[ $_GET['cp_dismiss'] ] = '1'; 82 | 83 | update_option( 'cp_dismissed_messages', $dismissed ); 84 | 85 | $redirect = remove_query_arg( array( '_wpnonce', 'cp_dismiss' ), wp_get_referer() ); 86 | wp_safe_redirect( $redirect ); 87 | } -------------------------------------------------------------------------------- /includes/templates/collabpress/content-activity.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 |
8 |
9 |
10 |

11 | $paged ); 23 | 24 | echo '
'; 25 | 26 | if ( cp_has_activities( $activities_args ) ) : 27 | $activityCount = 1; 28 | while( cp_activities() ) : cp_the_activity(); 29 | global $post; 30 | 31 | $row_class = ($activityCount % 2) ? 'even' : 'odd'; 32 | 33 | // Avatar 34 | $activity_user = get_post_meta( get_the_ID(), '_cp-activity-author', true); 35 | $activity_user = get_userdata( $activity_user ); 36 | $activity_action = get_post_meta(get_the_ID(), '_cp-activity-action', true); 37 | $activity_type = get_post_meta(get_the_ID(), '_cp-activity-type', true); 38 | $activity_id = get_post_meta(get_the_ID(), '_cp-activity-ID', true); 39 | 40 | if ( $activity_user ) : ?> 41 |
42 | ID, 32) ?> 43 |
44 |

display_name . ' ' . $activity_action . ' ' . __('a', 'collabpress') . ' '. $activity_type ?>:

45 |
46 |
47 | '.__( 'No Activities...', 'collabpress' ).'

'; 52 | endif; 53 | 54 | // Pagination 55 | if ( $cp->activities->max_num_pages > 1 ) { 56 | echo '

'; 57 | for ( $i = 1; $i <= $cp->activities->max_num_pages; $i++ ) { 58 | echo '' . $i . ' '; 59 | } 60 | echo '

'; 61 | } ?> 62 | 63 | 89 | 90 | '; ?> 91 |
92 | 93 |
-------------------------------------------------------------------------------- /includes/templates/collabpress/content-single-project-users.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 |

11 |

 » 

12 |
13 |
14 | ID ); 16 | } ?> 17 |
18 | 19 | 20 | 21 |
22 |
23 |
24 |

25 | 26 | 27 |

28 | 29 | 30 |

31 | ID .'" checked="checked" /> ' .$current_user->user_login .'
'; 36 | }else{ 37 | // @todo This fails on huge userbases 38 | $wp_user_search = new WP_User_Query( array( 'fields' => 'all' ) ); 39 | $wp_users = $wp_user_search->get_results(); 40 | 41 | foreach ( $wp_users as $wp_user ) { 42 | echo 'ID ), false ) . ' /> ' .$wp_user->user_login .'
'; 43 | } 44 | } 45 | ?> 46 |

47 | 48 |

49 |
50 |
51 | -------------------------------------------------------------------------------- /includes/css/bp.css: -------------------------------------------------------------------------------- 1 | /****************/ 2 | /* ADMIN STYLES */ 3 | /****************/ 4 | 5 | table.group-collabpress-options { 6 | margin-bottom: 15px; 7 | } 8 | table.group-collabpress-options th { 9 | width: 300px; 10 | text-align: left; 11 | } 12 | 13 | /*****************/ 14 | /* HEADERS */ 15 | /*****************/ 16 | 17 | .cp-bp-header { 18 | background: url(../images/collabpress-page-icon.png) no-repeat scroll -10px -5px transparent; 19 | padding-left: 45px; 20 | min-height: 40px; 21 | } 22 | 23 | /***************/ 24 | /* SORTING */ 25 | /***************/ 26 | 27 | body.collabpress th.sorted > a { 28 | text-decoration: none; 29 | } 30 | 31 | body.collabpress th.sorted.desc > a:after { 32 | content: "\25BC"; 33 | } 34 | 35 | body.collabpress th.sorted.asc > a:after { 36 | content: "\25B2"; 37 | } 38 | 39 | body.collabpress th.sorted.asc > a:hover:after { 40 | content: "\25BC"; 41 | } 42 | 43 | body.collabpress th.sortable.desc > a:hover:after { 44 | content: "\25B2"; 45 | } 46 | 47 | body.collabpress th.sortable.asc > a:hover:after { 48 | content: "\25BC"; 49 | } 50 | 51 | body.collabpress table.cb-tasks-list th { 52 | width: 25%; 53 | } 54 | 55 | body.collabpress .currently-viewing { 56 | font-size: 85%; 57 | } 58 | 59 | /*******************/ 60 | /* FAUX META BOXES */ 61 | /*******************/ 62 | 63 | .cp-meta-box { 64 | border: 2px solid #ddd; 65 | margin: 15px 45px; 66 | border-radius: 3px; 67 | } 68 | .cp-meta-box.cp-new-project { 69 | margin: 15px 0; 70 | } 71 | 72 | 73 | .cp-meta-box h4 { 74 | background-color: #f1f1f1; 75 | padding: 4px 8px; 76 | margin: 0; 77 | cursor: pointer; 78 | } 79 | 80 | .cp-meta-box .handlediv { 81 | width: 27px; 82 | height: 30px; 83 | float: right; 84 | cursor: pointer; 85 | } 86 | 87 | .cp-meta-box .inside { 88 | border-top: 2px solid #ddd; 89 | padding: 10px 15px; 90 | } 91 | 92 | .cp-meta-box .inside h4 { 93 | background: none; 94 | } 95 | 96 | .cp-meta-box table tr th { 97 | text-align: left; 98 | } 99 | 100 | .cp_task_summary { 101 | margin: 15px 0; 102 | } 103 | 104 | .cp_task_summary p { 105 | margin: 0; 106 | } 107 | 108 | .cp_task_summary img { 109 | margin-right: 7px; 110 | } 111 | 112 | /*******************/ 113 | /* CALENDAR */ 114 | /*******************/ 115 | 116 | #cp-calendar-wrap { 117 | padding: 10px; 118 | } 119 | #cp-calendar-wrap h3 { 120 | font-size: 1.5em; 121 | font: italic 24px/35px Georgia,"Times New Roman","Bitstream Charter",Times,serif; 122 | } 123 | .cp_previous_month {float: left; padding: 10px 0;} 124 | .cp_next_month {float: right; padding: 10px 0;} 125 | table.calendar { border-left:1px solid #f1f1f1; width: 100%; background: #fff;} 126 | 127 | table tr td.calendar-day { 128 | vertical-align: top; 129 | } 130 | 131 | tr.calendar-row {} 132 | td.calendar-day { min-height:80px; font-size:11px; position:relative; } * html div.calendar-day { height:80px; } 133 | td.calendar-day:hover { background:#eceff5; } 134 | td.calendar-day-np { background:#eee; min-height:80px; } * html div.calendar-day-np { height:80px; } 135 | 136 | td.calendar-day p { 137 | clear: both; 138 | overflow: visible; 139 | } 140 | 141 | td.calendar-day img.avatar { 142 | margin-bottom: 15px; 143 | } 144 | 145 | td.calendar-day-head { background:#F5F5F5; font-weight:bold; text-align:center; width:120px; padding:5px; border-bottom:1px solid #f1f1f1; border-top:1px solid #f1f1f1; border-right:1px solid #f1f1f1; } 146 | div.day-number { background:#f1f1f1; padding:5px; color:#21759B; font-weight:bold; float:right; margin:-5px -5px 0 0; width:20px; text-align:center; } 147 | td.calendar-day, td.calendar-day-np { width:120px; padding:5px; border-bottom:1px solid #f1f1f1; border-right:1px solid #f1f1f1; } 148 | 149 | -------------------------------------------------------------------------------- /tests/test-functions.php: -------------------------------------------------------------------------------- 1 | factory->task = new CP_UnitTest_Factory_For_Task( $this->factory ); 10 | $this->factory->tasklist = new CP_UnitTest_Factory_For_TaskList( $this->factory ); 11 | } 12 | 13 | function test_cp_get_tasklist_project_id() { 14 | $tasklist_id = $this->factory->tasklist->create( array( 'project_id' => 3 ) ); 15 | 16 | $this->assertEquals( cp_get_tasklist_project_id( $tasklist_id ), 3 ); 17 | 18 | // Check the null case. Should never happen 19 | $tasklist_id2 = $this->factory->tasklist->create(); 20 | $this->assertFalse( cp_get_tasklist_project_id( $tasklist_id2 ) ); 21 | } 22 | 23 | function test_cp_get_task_tasklist_id() { 24 | $tasklist_id = $this->factory->tasklist->create(); 25 | $task_id = $this->factory->task->create( array( 'task_list_id' => $tasklist_id ) ); 26 | 27 | $this->assertEquals( cp_get_task_tasklist_id( $task_id ), $tasklist_id ); 28 | 29 | // Check the null case. Should never happen 30 | $task_id2 = $this->factory->task->create(); 31 | $this->assertFalse( cp_get_task_tasklist_id( $task_id2 ) ); 32 | } 33 | 34 | function test_cp_get_task_project_id() { 35 | $tasklist_id = $this->factory->tasklist->create( array( 'project_id' => 4 ) ); 36 | $task_id = $this->factory->task->create( array( 'task_list_id' => $tasklist_id ) ); 37 | $this->assertEquals( cp_get_task_project_id( $task_id ), 4 ); 38 | } 39 | 40 | function test_cp_get_tasks_orderby_status() { 41 | 42 | $args1 = array( 43 | 'task_list_id' => 1, 44 | 'status' => 'open', 45 | ); 46 | $task_id1 = $this->factory->task->create( $args1 ); 47 | 48 | $args2 = array( 49 | 'task_list_id' => 1, 50 | 'status' => 'complete', 51 | ); 52 | $task_id2 = $this->factory->task->create( $args2 ); 53 | 54 | $args3 = array( 55 | 'task_list_id' => 1, 56 | 'status' => 'zzz', 57 | ); 58 | $task_id3 = $this->factory->task->create( $args3 ); 59 | 60 | // Shouldn't show up in results 61 | // Included here to test that meta_value ordering works 62 | // alongside meta_query 63 | $args4 = array( 64 | 'task_list_id' => 2, 65 | 'status' => 'aaa', 66 | ); 67 | $task_id4 = $this->factory->task->create( $args4 ); 68 | 69 | $tasks = cp_get_tasks( 70 | array( 71 | 'orderby' => 'status', 72 | 'order' => 'asc', 73 | 'task_list_id' => 1, 74 | ) 75 | ); 76 | 77 | $this->assertEquals( $tasks, array( get_post( $task_id2 ), get_post( $task_id1 ), get_post( $task_id3 ) ) ); 78 | } 79 | 80 | /** 81 | * old argument format: cp_get_tasks( $task_list_id, $status ) 82 | */ 83 | function test_cp_get_tasks_argument_backpat() { 84 | 85 | $args1 = array( 86 | 'status' => 'open', 87 | 'task_list_id' => 3, 88 | ); 89 | $task_id1 = $this->factory->task->create( $args1 ); 90 | 91 | $args2 = array( 92 | 'status' => 'complete', 93 | 'task_list_id' => 3, 94 | ); 95 | $task_id2 = $this->factory->task->create( $args2 ); 96 | 97 | $args3 = array( 98 | 'status' => 'open', 99 | 'task_list_id' => 4, 100 | ); 101 | $task_id3 = $this->factory->task->create( $args3 ); 102 | 103 | $args4 = array( 104 | 'status' => 'complete', 105 | 'task_list_id' => 4, 106 | ); 107 | $task_id4 = $this->factory->task->create( $args4 ); 108 | 109 | $tasks = cp_get_tasks( 4, 'complete' ); 110 | 111 | $this->assertEquals( $tasks, array( get_post( $task_id4 ) ) ); 112 | } 113 | 114 | function test_cp_get_tasks_by_assigned_user() { 115 | 116 | $args1 = array( 117 | 'assigned_user_id' => 2, 118 | ); 119 | $task_id1 = $this->factory->task->create( $args1 ); 120 | 121 | $args2 = array( 122 | 'assigned_user_id' => 1, 123 | ); 124 | $task_id2 = $this->factory->task->create( $args2 ); 125 | 126 | $tasks = cp_get_tasks( array( 'assigned_user_id' => 1 ) ); 127 | 128 | $this->assertEquals( $tasks, array( get_post( $task_id2 ) ) ); 129 | } 130 | } 131 | 132 | -------------------------------------------------------------------------------- /includes/menus/dashboard.php: -------------------------------------------------------------------------------- 1 | tables = new stdClass; 72 | $cp->tables->project_users = $wpdb->prefix . 'cp_project_users'; 73 | 74 | // If we're not on a CollabPress page, bail. 75 | if ( ! is_collabpress_page() ) 76 | return; 77 | 78 | // Set up the default keys 79 | $defaults = array( 80 | 'project' => false, 81 | 'task' => false, 82 | 'cp_page' => false, 83 | 'view' => false, 84 | ); 85 | // Parse query string variables and set CollabPress global appropriately 86 | foreach ( $defaults as $key => $value ) { 87 | if ( ! empty( $_REQUEST[$key] ) ) { 88 | switch ( $key ) { 89 | case 'project': 90 | $cp->project = get_post( $_REQUEST[$key] ); 91 | break; 92 | case 'task': 93 | $cp->task = get_post( $_REQUEST[$key] ); 94 | $cp->project = get_post( cp_get_task_project_id( $cp->task->ID ) ); 95 | break; 96 | default: 97 | $cp->$key = $_REQUEST[$key]; 98 | break; 99 | } 100 | } 101 | } 102 | 103 | // Set the view if it's not declared in the query string. 104 | // We'll use it later for choosing the template to be loaded. 105 | if ( empty( $cp->view ) ) { 106 | if ( ! empty( $cp->task ) ) { 107 | $cp->view = 'task'; 108 | } else if ( ! empty( $cp->project ) ) { 109 | $cp->view = 'project'; 110 | } else { 111 | $cp->view = 'dashboard'; 112 | } 113 | } 114 | 115 | do_action( 'cp_global_setup' ); 116 | } 117 | 118 | /** 119 | * Callback for add_menu_page, calls the proper CollabPress template 120 | * 121 | */ 122 | function cp_admin_menu_page_load() { 123 | global $cp; 124 | // Find the template depending on the view. 125 | if ( ! empty( $cp->project ) ) { 126 | if ( $cp->view == 'task' ) { 127 | $template = 'collabpress/content-single-task.php'; 128 | } else if ( $cp->view != 'project' ) { 129 | if ( $cp->view == 'files' ) 130 | wp_enqueue_media(); // todo: maybe move this to an enqueue function 131 | $template = 'collabpress/content-single-project-' . $cp->view . '.php'; 132 | } else { 133 | $template = 'collabpress/content-single-project.php'; 134 | } 135 | } else { 136 | if ( $cp->view != 'dashboard' ) 137 | $template = 'collabpress/content-' . $cp->view . '.php'; 138 | else 139 | $template = 'collabpress/dashboard.php'; 140 | } 141 | cp_load_template( $template ); 142 | } 143 | 144 | /** 145 | * Requires the referenced CollabPress template 146 | */ 147 | function cp_load_template( $template ) { 148 | if ( ! $located_template = locate_template( $template ) ) { 149 | // If no template is found, load the one from the plugin 150 | $located_template = COLLABPRESS_PLUGIN_DIR . 'includes/templates/' . $template; 151 | } 152 | require( $located_template ); 153 | } -------------------------------------------------------------------------------- /includes/templates/collabpress/content-single-project-files.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 |

11 |

 » 

12 |
13 |
14 | 15 | 16 |
17 | 18 |
19 | 20 | 21 | 22 |
23 |
24 |
25 |

26 | 27 | 28 | 29 | 30 | 31 | 32 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 57 | 58 | 59 | 60 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
33 |

34 |

35 | 36 |

37 |

/>

46 |

47 | '; 49 | foreach ( cp_get_project_users() as $wp_user ) 50 | $user_list .= ''; 51 | $user_list .= ''; 52 | $user_list = apply_filters( 'cp_task_user_list_html', $user_list, false ); 53 | echo $user_list; 54 | ?> 55 |

56 |
61 | 69 |

/>

77 |

78 | 79 |

80 |

81 |
82 |
83 |
84 | 85 | -------------------------------------------------------------------------------- /includes/templates/collabpress/buddypress/dashboard.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 5 | 6 | 7 |
8 |

9 | 10 |

11 |
12 | 13 | 14 | 15 | 16 | 22 | 23 |
24 |
25 |
26 |

27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | 68 | 69 | 70 | 71 |

37 |

38 |

39 | 40 |

41 |
48 |

49 | 50 | 51 |

52 | ID .'" checked="checked" /> ' .$current_user->user_login .'
'; 57 | }else{ 58 | // @todo This fails on huge userbases 59 | $wp_user_search = new WP_User_Query( array( 'fields' => 'all' ) ); 60 | $wp_users = $wp_user_search->get_results(); 61 | 62 | foreach ( $wp_users as $wp_user ) { 63 | echo ' ' .$wp_user->user_login .'
'; 64 | } 65 | } 66 | ?> 67 |
72 |

73 |
74 |
75 |
76 |
77 | -------------------------------------------------------------------------------- /includes/templates/collabpress/dashboard.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 | 12 |
13 |

14 | 15 |

16 |
17 | 18 | 19 | 20 | 21 | 27 | 28 |
29 |
30 |
31 |

32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 73 | 74 | 75 | 76 |

42 |

43 |

44 | 45 |

46 |
53 |

54 | 55 | 56 |

57 | ID .'" checked="checked" /> ' .$current_user->user_login .'
'; 62 | }else{ 63 | // @todo This fails on huge userbases 64 | $wp_user_search = new WP_User_Query( array( 'fields' => 'all' ) ); 65 | $wp_users = $wp_user_search->get_results(); 66 | 67 | foreach ( $wp_users as $wp_user ) { 68 | echo ' ' .$wp_user->user_login .'
'; 69 | } 70 | } 71 | ?> 72 |
77 |

78 |
79 |
80 |
81 |
82 | -------------------------------------------------------------------------------- /includes/templates/collabpress/content-single-project.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 |

11 | 12 |
13 |
14 | 15 |
16 |
17 |
18 |
19 | ID ); 21 | } ?> 22 | 23 |
24 |
25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |
33 | 34 | 35 | 36 |
37 |
38 |
39 | 40 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 |
49 |
50 | 51 |
52 |
53 |
54 |
55 |

56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 74 | 75 |

68 |

69 |

70 | 71 |

72 |
76 |

77 | 78 | 79 |

80 |

81 |
82 |
83 |
84 | -------------------------------------------------------------------------------- /includes/cp-core.php: -------------------------------------------------------------------------------- 1 | __( 'Projects', 'collabpress' ), 57 | 'description' => __( 'Custom Post Type for CollabPress Projects', 'collabpress' ), 58 | 'public' => $cp_debug_mode, 59 | 'supports' => array( 'title', 'author', 'thumbnail', 'comments', 'custom-fields' ), 60 | 'exclude_from_search' => true, 61 | ) ); 62 | 63 | register_post_type( 64 | 'cp-task-lists', 65 | array( 66 | 'label' => __('Task Lists', 'collabpress'), 67 | 'description' => __('Custom Post Type for CollabPress Task Lists', 'collabpress'), 68 | 'public' => $cp_debug_mode, 69 | 'supports' => array( 'title', 'author', 'thumbnail', 'comments', 'custom-fields' ), 70 | 'exclude_from_search' => true, 71 | ) ); 72 | 73 | register_post_type( 74 | 'cp-tasks', 75 | array( 76 | 'label' => __('Tasks', 'collabpress'), 77 | 'description' => __('Custom Post Type for CollabPress Tasks', 'collabpress'), 78 | 'public' => $cp_debug_mode, 79 | 'supports' => array( 'title', 'author', 'thumbnail', 'comments', 'custom-fields' ), 80 | 'exclude_from_search' => true, 81 | ) ); 82 | 83 | register_post_type( 84 | 'cp-meta-data', 85 | array( 86 | 'label' => __('Meta Data', 'collabpress'), 87 | 'description' => __('Custom Post Type for CollabPress Meta Data', 'collabpress' ), 88 | 'public' => $cp_debug_mode, 89 | 'supports' => array( 'title', 'author', 'thumbnail', 'comments', 'custom-fields' ), 90 | 'exclude_from_search' => true, 91 | ) ); 92 | 93 | // Let other plugins (and the BuddyPress compatibility module) know that we've registered 94 | do_action( 'cp_registered_post_types' ); 95 | 96 | } 97 | 98 | 99 | add_action( 'plugins_loaded', 'cp_load_plugin_textdomain' ); 100 | 101 | /** 102 | * Load plugin textdomain for translation files. 103 | */ 104 | function cp_load_plugin_textdomain() { 105 | load_plugin_textdomain( 'collabpress', false, basename( dirname( dirname( __FILE__ ) ) ) . '/languages' ); 106 | } 107 | 108 | // Add "View CollabPress Dashboard" link on plugins page 109 | add_filter( 'plugin_action_links_' . COLLABPRESS_BASENAME, 'cp_filter_plugin_actions' ); 110 | 111 | function cp_filter_plugin_actions( $links ) { 112 | $settings_link = ''.__('View Dashboard', 'collabpress').''; 113 | array_unshift( $links, $settings_link ); 114 | return $links; 115 | } 116 | 117 | // Show Dashboard Meta Box 118 | add_action( 'wp_dashboard_setup', 'cp_wp_add_dashboard_widgets' ); 119 | function cp_wp_add_dashboard_widgets() { 120 | 121 | //check if dashboard widget is enabled 122 | $options = cp_get_options(); 123 | if ( isset( $options['dashboard_meta_box'] ) && $options['dashboard_meta_box'] == 'enabled' ) { 124 | wp_add_dashboard_widget('cp_wp_dashboard_widget', __('CollabPress - Recent Activity', 'collabpress'), 'cp_wp_dashboard_widget_function'); 125 | } 126 | 127 | } 128 | function cp_wp_dashboard_widget_function() { 129 | cp_recent_activity(); 130 | } 131 | 132 | // Load BuddyPress integration, if BP is enabled 133 | add_action( 'bp_init', 'cp_load_bp_functions' ); 134 | 135 | /** 136 | * Loads CP's BuddyPress functionality 137 | * 138 | * A few things are required for BuddyPress functionality to work: 139 | * - Must be running at least BP 1.5 140 | * - Must have the Groups component enabled 141 | */ 142 | function cp_load_bp_functions() { 143 | $error_message = ''; 144 | 145 | if ( ! bp_is_active( 'groups' ) ) { 146 | $error_type = 'no_bp_groups'; 147 | $error_message = __( 'CollabPress BuddyPress integration requires the BP Groups component to be activated. Not using BP Groups? No problem - you’ll still be able to use CollabPress on the Dashboard.', 'collabpress' ); 148 | } else if ( version_compare( BP_VERSION, '1.5', '<' ) ) { 149 | $error_type = 'no_bp_15'; 150 | $error_message = __( 'CollabPress BuddyPress integration requires v1.5+ of BuddyPress to work. Download a copy from buddypress.org. Not ready to upgrade to BuddyPress 1.5? No problem. You can continue to use CollabPress - you just won’t get any BuddyPress integration yet.', 'collabpress' ); 151 | } 152 | 153 | // If an error message has been set, see whether we should throw an 154 | // an error, then bail 155 | if ( $error_message && $error_type ) { 156 | if ( current_user_can( 'activate_plugins' ) ) { 157 | $dismissed = (array) get_option( 'cp_dismissed_messages' ); 158 | 159 | if ( ! isset( $dismissed[ $error_type ] ) ) { 160 | // Groan 161 | $dismiss_url = add_query_arg( 'cp_dismiss', $error_type, $_SERVER['REQUEST_URI'] ); 162 | $dismiss_url = wp_nonce_url( $dismiss_url, 'cp_dismiss_notice' ); 163 | 164 | $error_message .= ' ' . __( 'Dismiss this message.', 'collabpress' ) . ''; 165 | 166 | add_action( 'admin_notices', create_function( '', 'echo \'

' . $error_message . '

\';' ) ); 167 | } 168 | } 169 | 170 | return; 171 | } 172 | 173 | // Still here? Load BP functionality 174 | require_once( COLLABPRESS_PLUGIN_DIR . 'includes/cp-bp.php' ); 175 | } 176 | 177 | // PressTrends Tracking 178 | include ( 'presstrends.php' ); 179 | 180 | // End 181 | do_action( 'cp_end' ); 182 | -------------------------------------------------------------------------------- /includes/tools/fancybox/jquery.easing-1.3.pack.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 3 | * 4 | * Uses the built in easing capabilities added In jQuery 1.1 5 | * to offer multiple easing options 6 | * 7 | * TERMS OF USE - jQuery Easing 8 | * 9 | * Open source under the BSD License. 10 | * 11 | * Copyright © 2008 George McGinley Smith 12 | * All rights reserved. 13 | * 14 | * Redistribution and use in source and binary forms, with or without modification, 15 | * are permitted provided that the following conditions are met: 16 | * 17 | * Redistributions of source code must retain the above copyright notice, this list of 18 | * conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright notice, this list 20 | * of conditions and the following disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * Neither the name of the author nor the names of contributors may be used to endorse 24 | * or promote products derived from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 27 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 29 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 32 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 34 | * OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | */ 37 | 38 | // t: current time, b: begInnIng value, c: change In value, d: duration 39 | eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t__construct(); 37 | } 38 | 39 | /** 40 | * PHP 5 constructor 41 | * 42 | * @package Boone's Pagination 43 | * @since 1.0 44 | */ 45 | function __construct( $query = false ) { 46 | // Set up the $_GET keys (which are customizable) 47 | $this->setup_get_keys(); 48 | 49 | // Get the pagination parameters out of $_GET 50 | $this->setup_get_params(); 51 | } 52 | 53 | /** 54 | * Sets up query vars. 55 | * 56 | * I recommend that you instantiate this class right away when you start rendering the page, 57 | * so that it can do some of the $_GET argument parsing for you, which you can use to 58 | * construct your CPT query (query_posts() or new WP_Query). Then, after you have made the 59 | * query, call this function manually, in order to populate the class with query-specific 60 | * data. 61 | * 62 | * If you use query_posts() to construct the query, there's no need to pass along a $query 63 | * parameter - the function will simply look inside of the $wp_query global. However, if 64 | * you use WP_Query to run your query (so that the data is not in $wp_query), you should 65 | * pass your query object along to setup_query(). 66 | * 67 | * @package Boone's Pagination 68 | * @since 1.0 69 | */ 70 | function setup_query( $query = false ) { 71 | global $wp_query; 72 | 73 | if ( !$query ) 74 | $query =& $wp_query; 75 | 76 | $this->query = $query; 77 | 78 | // Get the total number of items 79 | $this->setup_total_items(); 80 | 81 | // Get the total number of pages 82 | $this->setup_total_pages(); 83 | } 84 | 85 | /** 86 | * Sets up the $_GET param keys. 87 | * 88 | * You can either override this function in your own extended class, or filter the default 89 | * values. I have provided both options because I love you so very much. 90 | * 91 | * @package Boone's Pagination 92 | * @since 1.0 93 | */ 94 | function setup_get_keys() { 95 | $this->get_per_page_key = apply_filters( 'bbg_cpt_pag_per_page_key', 'per_page' ); 96 | 97 | /** 98 | * I chose 'paged' as the default not because I like it - I don't - but because 99 | * other choices threatened to interfere with native WP functions. In particular, 100 | * 'page' is already used in the Dashboard area to signify a plugin settings page. 101 | */ 102 | $this->get_paged_key = apply_filters( 'bbg_cpt_pag_paged_key', 'paged' ); 103 | } 104 | 105 | /** 106 | * Gets params out of $_GET global 107 | * 108 | * Does some basic checks to ensure that the values are integers and that they are non-empty 109 | * 110 | * @package Boone's Pagination 111 | * @since 1.0 112 | */ 113 | function setup_get_params() { 114 | // Per page 115 | $per_page = isset( $_GET[$this->get_per_page_key] ) ? $_GET[$this->get_per_page_key] : 10; 116 | 117 | // Basic per_page sanity and security 118 | if ( !(int)$per_page ) 119 | $per_page = 10; 120 | 121 | $this->get_per_page = $per_page; 122 | 123 | // Page number 124 | $paged = isset( $_GET[$this->get_paged_key] ) ? $_GET[$this->get_paged_key] : 1; 125 | 126 | // Basic paged sanity and security 127 | if ( !(int)$paged ) 128 | $paged = 1; 129 | 130 | $this->get_paged = $paged; 131 | } 132 | 133 | /** 134 | * Get the total number of items out of the query 135 | * 136 | * @package Boone's Pagination 137 | * @since 1.0 138 | */ 139 | function setup_total_items() { 140 | $this->total_items = $this->query->found_posts; 141 | } 142 | 143 | /** 144 | * Get the total number of pages out of the query 145 | * 146 | * @package Boone's Pagination 147 | * @since 1.0 148 | */ 149 | function setup_total_pages() { 150 | $this->total_pages = $this->query->max_num_pages; 151 | } 152 | 153 | /** 154 | * Get the start number for the current view (ie "Viewing *5* - 8 of 12") 155 | * 156 | * Here's the math: Subtract one from the current page number; multiply times posts_per_page 157 | * to get the last post on the previous page; add one to get the start for this page. 158 | * 159 | * @package Boone's Pagination 160 | * @since 1.0 161 | * 162 | * @return int $start The start number 163 | */ 164 | function get_start_number() { 165 | $start = ( ( $this->get_paged - 1 ) * $this->get_per_page ) + 1; 166 | 167 | return $start; 168 | } 169 | 170 | /** 171 | * Get the end number for the current view (ie "Viewing 5 - *8* of 12") 172 | * 173 | * Here's the math: Multiply the posts_per_page by the current page number. If it's the last 174 | * page (ie if the result is greater than the total number of docs), just use the total doc 175 | * count 176 | * 177 | * @package Boone's Pagination 178 | * @since 1.0 179 | * 180 | * @return int $end The start number 181 | */ 182 | function get_end_number() { 183 | global $wp_query; 184 | 185 | $end = $this->get_paged * $this->get_per_page; 186 | 187 | if ( $end > $this->total_items ) 188 | $end = $this->total_items; 189 | 190 | return $end; 191 | } 192 | 193 | /** 194 | * Return or echo the "Viewing x-y of z" message 195 | * 196 | * @package Boone's Pagination 197 | * @since 1.0 198 | * 199 | * @param str $type Optional. 'echo' will echo the results, anything else will return them 200 | * @return str $page_links The "viewing" text 201 | */ 202 | function currently_viewing_text( $type = 'echo' ) { 203 | $start = $this->get_start_number(); 204 | $end = $this->get_end_number(); 205 | 206 | $string = sprintf( __( 'Viewing %1$d - %2$d of a total of %3$d', 'bbg-cpt-pag' ), $start, $end, $this->total_items ); 207 | 208 | if ( 'echo' == $type ) 209 | echo $string; 210 | else 211 | return $string; 212 | } 213 | 214 | /** 215 | * Return or echo the pagination links 216 | * 217 | * @package Boone's Pagination 218 | * @since 1.0 219 | * 220 | * @param str $type Optional. 'echo' will echo the results, anything else will return them 221 | * @return str $page_links The pagination links 222 | */ 223 | function paginate_links( $type = 'echo' ) { 224 | $page_links = paginate_links( array( 225 | 'base' => add_query_arg( $this->get_paged_key, '%#%' ), 226 | 'format' => '', 227 | 'prev_text' => __( '«' ), 228 | 'next_text' => __( '»' ), 229 | 'total' => $this->total_pages, 230 | 'current' => $this->get_paged, 231 | 'add_args' => array( $this->get_per_page_key => $this->get_per_page ) 232 | )); 233 | 234 | if ( 'echo' == $type ) 235 | echo $page_links; 236 | else 237 | return $page_links; 238 | } 239 | } 240 | 241 | endif; 242 | 243 | ?> -------------------------------------------------------------------------------- /includes/css/collabpress.css: -------------------------------------------------------------------------------- 1 | .collabpress-project { 2 | background-color: #808080; 3 | float: left; 4 | height: 190px; 5 | margin: 0 5px 5px 0; 6 | padding: 5px; 7 | width: 190px; 8 | position: relative; 9 | } 10 | 11 | .collabpress-project .edit-project { 12 | position: absolute; 13 | bottom: .83em; 14 | right: .83em; 15 | } 16 | .edit-project a { 17 | color: #ccc; 18 | } 19 | .collabpress-project.new { 20 | background-color: #0072ff; 21 | text-align: center; 22 | } 23 | 24 | .collabpress-project.new .plus-sign { 25 | font-size: 3em; 26 | line-height: 1em; 27 | margin: .25em 0; 28 | } 29 | 30 | 31 | .collabpress .project-links { 32 | margin-right: 20px; 33 | } 34 | 35 | .collabpress .project-links a, .collabpress .overall-links a { 36 | padding: 5px; 37 | } 38 | .collabpress .project-links a.current, .collabpress .overall-links a.current { 39 | background-color: #ddd; 40 | font-weight: bold; 41 | } 42 | 43 | .collabpress .collabpress-project a { 44 | color: white; 45 | text-decoration: none; 46 | } 47 | 48 | .collabpress .menu-item-settings { 49 | display: none; 50 | } 51 | 52 | .collabpress .menu-item-handle { 53 | background: #f1f1f1; 54 | border: 1px solid #dfdfdf; 55 | position: relative; 56 | padding-left: 10px; 57 | height: auto; 58 | width: 400px; 59 | line-height: 35px; 60 | overflow: hidden; 61 | word-wrap: break-word; 62 | -webkit-border-radius: 3px; 63 | border-radius: 3px; 64 | border-width: 1px; 65 | border-style: solid; 66 | } 67 | 68 | .collabpress .menu-item-handle .item-title { 69 | display: inline; 70 | } 71 | 72 | .collabpress #menu-to-edit .menu-item-invalid .menu-item-handle { 73 | background: #f6c9cc; 74 | } 75 | 76 | .collabpress .menu .sortable-placeholder { 77 | border-color: #bbb; 78 | background-color: #f5f5f5; 79 | border-width: 1px; 80 | border-style: dashed; 81 | height: 35px; 82 | width: 410px; 83 | margin-top: 13px; 84 | } 85 | 86 | .collabpress .menu-item-depth-0 { 87 | margin-left: 0; 88 | } 89 | 90 | .collabpress .menu-item-depth-1 { 91 | margin-left: 30px; 92 | } 93 | 94 | .collabpress .menu-item.complete .item-title, .collabpress-task h1.complete { 95 | text-decoration: line-through; 96 | } 97 | 98 | a.view-all-link { 99 | display: block; 100 | margin-top: 10px; 101 | } 102 | 103 | .overall-links { 104 | margin: 20px 20px 0 0; 105 | } 106 | 107 | .collabpress .projects { 108 | clear: both; 109 | padding: 20px 0 0; 110 | } 111 | 112 | .collabpress #menu-to-edit { 113 | margin: 0 0 30px 0; 114 | padding: 0; 115 | } 116 | 117 | .collabpress .sortable-placeholder { 118 | list-style-type: none; 119 | } 120 | 121 | .collabpress dl { 122 | margin: 0; 123 | } 124 | 125 | .collabpress .menu-item-bar { 126 | clear: both; 127 | line-height: 1.5em; 128 | position: relative; 129 | margin: 9px 0 0; 130 | } 131 | 132 | .collabpress .item-controls { 133 | font-size: 12px; 134 | position: absolute; 135 | right: 20px; 136 | top: -1px; 137 | } 138 | 139 | .collabpress-task h1 input[type="checkbox"] { 140 | margin-right: 5px; 141 | vertical-align: middle; 142 | } 143 | 144 | .toggle-view-completed-tasks { 145 | cursor: pointer; 146 | } 147 | 148 | .collabpress div.tabbed-list { 149 | overflow: hidden; 150 | } 151 | 152 | .collabpress div.tabbed-list ul { 153 | margin: 0; 154 | padding: 0; 155 | } 156 | 157 | .collabpress div.tabbed-list ul li { 158 | float: left; 159 | margin: 0; 160 | list-style: none; 161 | } 162 | 163 | .collabpress div.tabbed-list ul li.current { 164 | background-color: 165 | } 166 | 167 | .collabpress div.tabbed-list ul li a { 168 | display: block; 169 | padding: 5px 10px; 170 | text-decoration: none; 171 | } 172 | 173 | .collabpress div.tabbed-list ul li.current a { 174 | background-color: #eee; 175 | color: #555; 176 | opacity: .8; 177 | font-weight: bold; 178 | } 179 | 180 | .collabpress .project-breadcrumb h3 { 181 | display: inline-block; 182 | } 183 | 184 | .collabpress .project-breadcrumb a.edit-project-link, .collabpress .project-breadcrumb a.edit-task-link { 185 | font-size: 90%; 186 | padding-left: 5px; 187 | } 188 | 189 | .collabpress h5 { 190 | margin: 0; 191 | } 192 | 193 | .collabpress-dashboard-widget { 194 | margin-bottom: 30px; 195 | } 196 | 197 | /* Activity ---------------------------------------- */ 198 | #cp_wp_dashboard_widget div.inside, #cp-recent-activity div.inside { 199 | margin: 0; 200 | } 201 | .cp-activity-list { 202 | position: relative; 203 | } 204 | .cp-activity-list p { 205 | font-size: 11px; 206 | margin: 6px 6px 8px; 207 | } 208 | .cp-activity-list .even { 209 | background-color: #FFFFE0; 210 | } 211 | .cp-activity-list .cp-activity-row.hover { 212 | } 213 | .cp-activity-row { 214 | margin:0; 215 | padding: 2px 10px; 216 | overflow: hidden; 217 | } 218 | .cp-activity-list .cp-activity-author { 219 | float:left; 220 | margin:5px 0; 221 | } 222 | .cp-activity-list .cp-activity-wrap { 223 | overflow:hidden; 224 | word-wrap:break-word; 225 | margin: 6px 0; 226 | } 227 | .cp-activity-list .cp-activity-wrap blockquote, .cp-activity-list .cp-activity-wrap blockquote p { 228 | display:inline; 229 | margin:0; 230 | padding:0; 231 | } 232 | 233 | /* Calendar ---------------------------------------- */ 234 | #cp-calendar-wrap { 235 | padding: 10px; 236 | } 237 | #cp-calendar-wrap h3 { 238 | font-size: 1.5em; 239 | font: italic 24px/35px Georgia,"Times New Roman","Bitstream Charter",Times,serif; 240 | } 241 | .cp_previous_month { 242 | float: left; padding: 10px 0; 243 | } 244 | .cp_next_month { 245 | float: right; 246 | padding: 10px 0; 247 | } 248 | table.calendar { 249 | border-left: 1px solid #f1f1f1; 250 | width: 100%; 251 | background: #fff; 252 | } 253 | tr.calendar-row {} 254 | td.calendar-day { 255 | min-height:80px; 256 | font-size:11px; 257 | position:relative; 258 | } 259 | 260 | div.calendar-day { 261 | height:80px; 262 | } 263 | 264 | td.calendar-day:hover { 265 | background:#eceff5; 266 | } 267 | 268 | td.calendar-day-np { 269 | background:#eee; 270 | min-height:80px; 271 | } 272 | 273 | div.calendar-day-np { 274 | height:80px; 275 | } 276 | 277 | td.calendar-day-head { 278 | background:#F5F5F5; 279 | font-weight:bold; 280 | text-align:center; 281 | width:120px; 282 | padding:5px; 283 | border-bottom: 1px solid #f1f1f1; 284 | border-top: 1px solid #f1f1f1; 285 | border-right:1px solid #f1f1f1; 286 | } 287 | 288 | div.day-number { 289 | background: #f1f1f1; 290 | padding: 5px; 291 | color: #21759B; 292 | font-weight:bold; 293 | float:right; 294 | margin:-5px -5px 0 0; 295 | width:20px; 296 | text-align:center; 297 | } 298 | 299 | td.calendar-day, td.calendar-day-np { 300 | width: 120px; 301 | padding: 5px; 302 | border-bottom: 1px solid #f1f1f1; 303 | border-right:1px solid #f1f1f1; 304 | } 305 | 306 | /* Comments ---------------------------------------- */ 307 | #cp_task_comments_wrap { 308 | background: #ffffff; 309 | overflow: hidden; 310 | margin: 0; 311 | padding: 0; 312 | border: 1px solid #DFDFDF; 313 | -moz-border-radius:4px 4px 4px 4px; 314 | } 315 | #cp_task_comments_wrap .even { 316 | background-color: #FFFFE0; 317 | } 318 | .cp_task_comment { 319 | clear: both; 320 | overflow: hidden; 321 | margin: 0; 322 | padding: 8px 10px; 323 | } 324 | .cp_task_comment .avatar { 325 | float: left; 326 | overflow: hidden; 327 | height: 64px; 328 | width: 64px; 329 | margin: 0; 330 | padding: 0 8px 8px 0; 331 | } 332 | .cp_task_comment_content { 333 | display: block; 334 | overflow: hidden; 335 | } 336 | .cp_task_comment_content p { 337 | margin: 0; 338 | padding: 0; 339 | line-height: 20px; 340 | } 341 | .cp_task_comment_content .cp_comment_author { 342 | font-weight: bold; 343 | } 344 | 345 | /* Footer */ 346 | .cp_about { 347 | text-align: center; 348 | } 349 | 350 | #task-title { 351 | display: inline-block; 352 | } 353 | 354 | #task-title #item-completed { 355 | margin-right: 3px; 356 | } -------------------------------------------------------------------------------- /includes/ajax-handlers.php: -------------------------------------------------------------------------------- 1 | $data['project_name'], 13 | 'project_description' => $data['project_description'] 14 | ); 15 | 16 | if ( ! empty( $data['users'] ) ) 17 | $args['project_users'] = $data['users']; 18 | 19 | $project_id = cp_insert_project( $args ); 20 | 21 | $permalink = cp_get_project_permalink( $project_id ); 22 | wp_send_json_success( array( 'redirect' => $permalink ) ); 23 | } 24 | 25 | add_action( 'wp_ajax_cp_modify_project_users', 'cp_modify_project_users_handler' ); 26 | 27 | function cp_modify_project_users_handler() { 28 | global $wpdb, $cp; 29 | 30 | // Nonce check 31 | check_admin_referer( 'modify-project-users', 'nonce' ); 32 | 33 | $data = $_REQUEST['data']; 34 | extract( $data ); 35 | 36 | $wpdb->query( 37 | $wpdb->prepare( 38 | "DELETE FROM {$cp->tables->project_users} 39 | WHERE project_id = %d", 40 | $project_id 41 | ) 42 | ); 43 | 44 | foreach ( $users as $user_id ) 45 | cp_add_user_to_project( $project_id, $user_id ); 46 | 47 | //update project metadata user IDs 48 | update_post_meta( $project_id, '_cp-project-users', $users ); 49 | 50 | $permalink = cp_get_project_users_permalink( $project_id ); 51 | wp_send_json_success( array( 'redirect' => $permalink ) ); 52 | } 53 | 54 | add_action( 'wp_ajax_cp_add_new_task', 'cp_add_new_task_handler' ); 55 | 56 | function cp_add_new_task_handler() { 57 | global $wpdb, $cp; 58 | 59 | // Nonce check 60 | check_admin_referer( 'add-new-task', 'nonce' ); 61 | 62 | $data = $_REQUEST['data']; 63 | extract( $data ); 64 | 65 | cp_insert_task( $data ); 66 | 67 | $permalink = cp_get_project_tasks_permalink( $project_id ); 68 | 69 | wp_send_json_success( array( 'redirect' => $permalink ) ); 70 | } 71 | 72 | 73 | add_action( 'wp_ajax_cp_delete_task', 'cp_delete_task_handler' ); 74 | 75 | function cp_delete_task_handler() { 76 | global $wpdb, $cp; 77 | 78 | $data = $_REQUEST['data']; 79 | extract( $data ); 80 | 81 | // Nonce check 82 | check_admin_referer( 'delete-task_' . $task_id, 'nonce' ); 83 | 84 | $task = get_post( $task_id ); 85 | 86 | // If we're deleting a task list, move all tasks related 87 | // to it up to the project level 88 | if ( $task->post_type == 'cp-task-lists' ) { 89 | $task_list_tasks = get_posts( array( 90 | 'posts_per_page' => -1, 91 | 'post_type' => 'cp-tasks', 92 | 'meta_query' => array( 93 | array( 94 | 'key' => '_cp-task-list-id', 95 | 'value' => $task->ID, 96 | ), 97 | ), 98 | 'orderby' => 'menu_order', 99 | 'order' => 'ASC', 100 | ) ); 101 | foreach ( $task_list_tasks as $task_list_task ) 102 | update_post_meta( $task_list_task->ID, '_cp-task-list-id', '0' ); 103 | } 104 | wp_delete_post( $task_id, true ); 105 | 106 | wp_send_json_success(); 107 | } 108 | 109 | add_action( 'wp_ajax_cp_add_new_task_list', 'cp_add_new_task_list_handler' ); 110 | 111 | function cp_add_new_task_list_handler() { 112 | global $wpdb, $cp; 113 | 114 | // Nonce check 115 | check_admin_referer( 'add-new-task-list', 'nonce' ); 116 | 117 | $data = $_REQUEST['data']; 118 | extract( $data ); 119 | 120 | cp_insert_task_list( $data ); 121 | 122 | $permalink = cp_get_project_tasks_permalink( $project_id ); 123 | 124 | wp_send_json_success( array( 'redirect' => $permalink ) ); 125 | } 126 | 127 | 128 | add_action( 'wp_ajax_cp_edit_task', 'cp_edit_task_handler' ); 129 | 130 | function cp_edit_task_handler() { 131 | global $wpdb, $cp; 132 | 133 | // Nonce check 134 | check_admin_referer( 'edit-task', 'nonce' ); 135 | 136 | $data = $_REQUEST['data']; 137 | extract( $data ); 138 | cp_update_task( $data ); 139 | $permalink = cp_get_task_permalink( $ID ); 140 | 141 | wp_send_json_success( array( 'redirect' => $permalink ) ); 142 | } 143 | 144 | 145 | 146 | add_action( 'wp_ajax_cp_attach_new_file', 'cp_attach_new_file_handler' ); 147 | 148 | function cp_attach_new_file_handler() { 149 | global $wpdb, $cp; 150 | 151 | // Nonce check 152 | check_admin_referer( 'cp_add_new_file', 'nonce' ); 153 | 154 | $data = $_REQUEST['data']; 155 | extract( $data ); 156 | 157 | $attachment = get_post( $attachment_id ); 158 | 159 | wp_insert_attachment( $attachment, '', $project_id ); 160 | 161 | wp_send_json_success(); 162 | } 163 | 164 | add_action( 'wp_ajax_cp_save_task_list_order', 'cp_save_task_list_order' ); 165 | 166 | function cp_save_task_list_order() { 167 | global $wpdb, $cp; 168 | 169 | // Nonce check 170 | check_admin_referer( 'save-task-list-order', 'nonce' ); 171 | 172 | $data = $_REQUEST['data']; 173 | extract( $data ); 174 | 175 | foreach ( $items as $item ) { 176 | $post = get_post( $item['ID'] ); 177 | wp_update_post( $item ); 178 | if ( isset( $item['task_list'] ) ) { 179 | cp_add_task_to_task_list( $item['ID'], $item['task_list'] ); 180 | } else if ( $post->post_type == 'cp-tasks' ) 181 | update_post_meta( $item['ID'], '_cp-task-list-id', 0 ); 182 | } 183 | wp_send_json_success(); 184 | } 185 | 186 | add_action( 'wp_ajax_cp_update_task_status', 'cp_update_task_status_handler' ); 187 | 188 | function cp_update_task_status_handler() { 189 | $data = $_REQUEST['data']; 190 | extract( $data ); 191 | 192 | // Nonce check 193 | check_admin_referer( 'item-complete-status-change_' . $task_id, 'nonce' ); 194 | 195 | $task_status = $data['task_status']; 196 | cp_update_task_status( $task_id, $task_status ); 197 | wp_send_json_success(); 198 | } 199 | 200 | add_action( 'wp_ajax_cp_add_comment_to_task', 'cp_add_comment_to_task_handler' ); 201 | 202 | function cp_add_comment_to_task_handler() { 203 | // Nonce check 204 | check_admin_referer( 'add-task-comment', 'nonce' ); 205 | 206 | $data = $_REQUEST['data']; 207 | extract( $data ); 208 | cp_insert_comment_on_task( 209 | array( 210 | 'comment_post_ID' => $task_id, 211 | 'comment_content' => apply_filters( 'cp_comment_content', wp_kses_post( $comment_content ) ) 212 | ) 213 | ); 214 | 215 | $permalink = cp_get_task_permalink( $task_id ); 216 | wp_send_json_success( array( 'redirect' => $permalink ) ); 217 | } 218 | 219 | add_action( 'wp_ajax_cp_delete_comment', 'cp_delete_comment_handler' ); 220 | 221 | function cp_delete_comment_handler() { 222 | $data = $_REQUEST['data']; 223 | extract( $data ); 224 | 225 | // Nonce check 226 | check_admin_referer( 'delete-task-comment_' . $comment_id, 'nonce' ); 227 | 228 | wp_delete_comment( $comment_id, true ); 229 | wp_send_json_success(); 230 | } 231 | 232 | add_action( 'wp_ajax_cp_edit_project', 'cp_edit_project_handler' ); 233 | 234 | function cp_edit_project_handler() { 235 | // Nonce check 236 | check_admin_referer( 'edit-project', 'nonce' ); 237 | 238 | $data = $_REQUEST['data']; 239 | extract( $data ); 240 | wp_update_post( $data ); 241 | cp_set_project_description( $ID, $project_description ); 242 | $permalink = cp_get_project_permalink( $ID ); 243 | wp_send_json_success( array( 'redirect' => $permalink ) ); 244 | } 245 | 246 | add_action( 'wp_ajax_cp_delete_project', 'cp_delete_project_handler' ); 247 | 248 | function cp_delete_project_handler() { 249 | // Nonce check 250 | check_admin_referer( 'delete-project', 'nonce' ); 251 | 252 | $data = $_REQUEST['data']; 253 | extract( $data ); 254 | 255 | wp_delete_post( $ID, true ); 256 | $permalink = COLLABPRESS_DASHBOARD; 257 | wp_send_json_success( array( 'redirect' => $permalink ) ); 258 | } 259 | 260 | add_action( 'wp_ajax_cp_set_user_preferences_for_displaying_completed_tasks', 'cp_set_user_preferences_for_displaying_completed_tasks_handler' ); 261 | 262 | function cp_set_user_preferences_for_displaying_completed_tasks_handler() { 263 | // Nonce check 264 | check_admin_referer( 'toggle-user-preference-view-completed-task', 'nonce' ); 265 | 266 | $data = $_REQUEST['data']; 267 | extract( $data ); 268 | 269 | $current_user = wp_get_current_user(); 270 | update_user_option( $current_user->ID, 'display_completed_tasks', $display_completed_tasks ); 271 | wp_send_json_success(); 272 | } -------------------------------------------------------------------------------- /includes/templates/collabpress/buddypress/content-single-task.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |

>

6 | 7 | Edit
8 | Due date: ' . $due_date . '
'; 10 | } ?> 11 | Priority: ' . $priority . '
'; 13 | } ?> 14 | Assigned to: ' . get_avatar( $user_assigned->ID ) . '
'; ?> 17 | 18 | 19 |
20 |
21 |
22 |

23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 55 | 56 | 57 | 58 | 68 | 69 | 70 |
31 |

32 |

33 | 34 |

35 |

/>

44 |

45 | '; 47 | foreach ( cp_get_project_users() as $wp_user ) 48 | $user_list .= ''; 49 | $user_list .= ''; 50 | $user_list = apply_filters( 'cp_task_user_list_html', $user_list, false ); 51 | echo $user_list; 52 | ?> 53 |

54 |
59 | 67 |
71 |

72 | 73 |

74 |

75 |
76 |
77 |
78 | 79 | 192 | -------------------------------------------------------------------------------- /includes/content-actions.php: -------------------------------------------------------------------------------- 1 | 'New Project', 10 | 'post_status' => 'publish', 11 | 'post_type' => 'cp-projects', 12 | 'project_description' => '', 13 | 'project_users' => array( 1 ), 14 | ); 15 | 16 | $args = wp_parse_args( $args, $defaults ); 17 | 18 | extract( $args ); 19 | 20 | $project_id = wp_insert_post( $args ); 21 | 22 | cp_set_project_description( $project_id, $project_description ); 23 | 24 | // Project users 25 | update_post_meta( 26 | $project_id, 27 | '_cp-project-users', 28 | $project_users 29 | ); 30 | 31 | $current_user = wp_get_current_user(); 32 | if ( ! empty( $current_user ) ) { 33 | // Add CollabPress Activity entry 34 | cp_add_activity( 35 | __('added', 'collabpress'), 36 | __('project', 'collabpress'), 37 | $current_user->ID, 38 | $project_id 39 | ); 40 | } 41 | 42 | $project_users[] = $current_user->ID; 43 | $project_users = array_unique( $project_users ); 44 | foreach ( $project_users as $user_id ) 45 | cp_add_user_to_project( $project_id, $user_id ); 46 | 47 | do_action( 'cp_project_added', $project_id ); 48 | 49 | return $project_id; 50 | } 51 | 52 | /*********************/ 53 | /** TASK MANAGEMENT **/ 54 | /*********************/ 55 | 56 | /** 57 | * Create new CollabPress task. 58 | * 59 | */ 60 | function cp_insert_task( $args = array() ) { 61 | 62 | $defaults = array( 63 | 'post_title' => 'New Task', 64 | 'post_status' => 'publish', 65 | 'post_type' => 'cp-tasks', 66 | 'project_id' => NULL, 67 | 'task_due_date' => NULL, 68 | 'task_assigned_to' => NULL, 69 | 'task_priority' => 'None', 70 | 'task_list' => 0, 71 | 'send_email_notification' => true 72 | ); 73 | 74 | $args = wp_parse_args( $args, $defaults ); 75 | extract( $args ); 76 | $task_id = wp_insert_post( $args ); 77 | 78 | // Where we get the project_id from depends on whether this is a BP installation 79 | if ( ! $project_id ) { 80 | if ( is_object( $cp_bp_integration ) && method_exists( $cp_bp_integration, 'get_current_item_project' ) ) { 81 | $project_id = $cp_bp_integration->get_current_item_project(); 82 | } 83 | } 84 | 85 | if ( $project_id ) 86 | update_post_meta( $task_id, '_cp-project-id', $project_id ); 87 | 88 | //add task status 89 | update_post_meta( $task_id, '_cp-task-status', 'open' ); 90 | 91 | if ( $task_due_date ) { 92 | // Validate Date 93 | if ( cp_validate_date( $task_due_date ) ) 94 | $taskDate = esc_html( $task_due_date ); 95 | 96 | update_post_meta( $task_id, '_cp-task-due', $taskDate ); 97 | } 98 | 99 | // update task list 100 | update_post_meta( $task_id, '_cp-task-list-id', $task_list ); 101 | 102 | //save the user assignment 103 | if ( $task_assigned_to ) 104 | update_post_meta( $task_id, '_cp-task-assign', $task_assigned_to ); 105 | 106 | //save the task priority 107 | if ( $task_priority ) 108 | update_post_meta( $task_id, '_cp-task-priority', $task_priority ); 109 | 110 | // Add CollabPress Activity entry 111 | $current_user = wp_get_current_user(); 112 | cp_add_activity( 113 | __('added', 'collabpress'), 114 | __('task', 'collabpress'), 115 | $current_user->ID, 116 | $task_id 117 | ); 118 | 119 | do_action( 'cp_task_added', $task_id ); 120 | 121 | // check if email notification is checked, and a user is assigned to a project 122 | if( $send_email_notification && $task_assigned_to ) { 123 | 124 | // send email 125 | $task_author_data = get_userdata( $task_assigned_to ); 126 | $author_email = $task_author_data->user_email; 127 | 128 | $subject = sprintf( __('You have been assigned the task %s.', 'collabpress'), 129 | esc_attr( get_the_title( $task_id ) ) 130 | ); 131 | 132 | $message = sprintf( __('You have been assigned the task %s.', 'collabpress'), 133 | esc_attr( get_the_title( $task_id ) ) 134 | ); 135 | 136 | cp_send_email( $author_email, $subject, $message ); 137 | 138 | } 139 | } 140 | 141 | 142 | /** 143 | * Update existing CollabPress task. 144 | * 145 | */ 146 | function cp_update_task( $args = array() ) { 147 | if ( empty( $args['ID'] ) ) 148 | return false; 149 | extract( $args ); 150 | if ( ! empty( $priority ) ) 151 | update_post_meta( $ID, '_cp-task-priority', $priority ); 152 | if ( ! empty( $task_assigned_to ) ) 153 | update_post_meta( $ID, '_cp-task-assign', $task_assigned_to ); 154 | if ( ! empty( $task_due_date ) ) 155 | update_post_meta( $ID, '_cp-task-due', $task_due_date ); 156 | return wp_update_post( $args ); 157 | } 158 | 159 | 160 | /**************************/ 161 | /** TASK LIST MANAGEMENT **/ 162 | /**************************/ 163 | 164 | 165 | /** 166 | * Create new CollabPress task list 167 | * 168 | */ 169 | function cp_insert_task_list( $args = array() ) { 170 | global $cp_bp_integration; 171 | 172 | $defaults = array( 173 | 'post_title' => 'New Task List', 174 | 'post_status' => 'publish', 175 | 'post_type' => 'cp-task-lists', 176 | 'project_id' => NULL, 177 | 'task_list_description' => '', 178 | ); 179 | $args = wp_parse_args( $args, $defaults ); 180 | 181 | extract( $args ); 182 | $task_list_id = wp_insert_post( $args ); 183 | 184 | if ( $project_id ) 185 | update_post_meta( $task_list_id, '_cp-project-id', $project_id ); 186 | 187 | update_post_meta( $task_list_id, '_cp-task-list-description', esc_html( $task_list_description ) ); 188 | 189 | // Add CollabPress Activity entry 190 | $current_user = wp_get_current_user(); 191 | cp_add_activity( 192 | __('added', 'collabpress'), 193 | __('task list', 'collabpress'), 194 | $current_user->ID, 195 | $task_list_id 196 | ); 197 | 198 | do_action( 'cp_task_list_added', $task_list_id ); 199 | 200 | } 201 | 202 | 203 | /************************/ 204 | /** COMMENT MANAGEMENT **/ 205 | /************************/ 206 | 207 | /** 208 | * Create a new commment on a task. 209 | * 210 | * @uses wp_insert_comment 211 | */ 212 | function cp_insert_comment_on_task( $args = array() ) { 213 | 214 | global $cp_task, $cp; 215 | global $current_user; 216 | get_currentuserinfo(); 217 | 218 | $time = current_time( 'mysql' ); 219 | 220 | $defaults = array( 221 | 'comment_author' => $current_user->display_name, 222 | 'comment_author_email' => $current_user->user_email, 223 | 'comment_author_url' => $current_user->user_email, 224 | 'comment_type' => 'collabpress', 225 | 'comment_parent' => 0, 226 | 'user_id' => $current_user->ID, 227 | 'comment_author_IP' => preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] ), 228 | 'comment_agent' => substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ), 229 | 'comment_date' => $time, 230 | 'comment_approved' => 1, 231 | 'send_email_notification' => true, 232 | ); 233 | 234 | // $cp may not be defined, check here 235 | if ( isset( $cp->task->ID ) ) 236 | $defaults['comment_post_ID'] = $cp->task->ID; 237 | if ( isset( $_POST['cp-comment-content'] ) ) 238 | $defaults['comment_content'] = wp_kses_post( $_POST['cp-comment-content'] ); 239 | 240 | $args = wp_parse_args( $args, $defaults ); 241 | 242 | wp_insert_comment( $args ); 243 | 244 | //check if email notification is checked 245 | if ( $args['send_email_notification'] ) { 246 | 247 | $task_author_id = get_post_meta( $args['comment_post_ID'], '_cp-task-assign', true ); 248 | $task_author_data = get_userdata( $task_author_id ); 249 | 250 | // Add user assigned to the task to the email list. 251 | $to[] = $task_author_data->user_email; 252 | 253 | // Add all users that have commented on the task to the email list. 254 | 255 | $comments = get_comments( array( 256 | 'post_id' => $args['comment_post_ID'], 257 | 'order' => 'ASC', 258 | ) ); 259 | 260 | foreach ( $comments as $comment ) { 261 | $to[] = $comment->comment_author_email; 262 | } 263 | 264 | // Remove duplicates from the email list. 265 | array_unique( $to ); 266 | 267 | $subject = __('New comment on task ', 'collabpress') .get_the_title( $args['comment_post_ID'] ); 268 | 269 | 270 | $subject = apply_filters( 'cp_new_comment_email_subject', $subject ); 271 | 272 | $message = sprintf( __("There is a new comment on the task %s from %s", "collabpress"), 273 | get_the_title( $args['comment_post_ID'] ), 274 | $current_user->display_name 275 | ); 276 | 277 | $message .= "\n\n"; 278 | $message .= __("Comment:", "collabpress") . "\n"; 279 | $message .= esc_html( $args['comment_content'] ); 280 | $message = apply_filters( 'cp_new_comment_email_body', $message ); 281 | 282 | cp_send_email( $to, $subject, $message ); 283 | } 284 | // Add Activity 285 | cp_add_activity( __('commented', 'collabpress'), __('task', 'collabpress'), $args['user_id'], $args['comment_post_ID'] ); 286 | 287 | } 288 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === CollabPress === 2 | Contributors: scottbasgaard, williamsba1, cochran, boonebgorges, ericlewis 3 | Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056 4 | Tags: project management, task, management, basecamp, to do, lists, team, planning, tracking, reporting, shortcode, widget, multisite, buddypress 5 | Requires at least: 3.5 6 | Tested up to: 3.5.1 7 | Stable tag: 1.3.1.2 8 | 9 | Project management and task tracking software for WordPress 10 | 11 | == Description == 12 | 13 | CollabPress adds project and task management functionality to WordPress. Easily create projects and assign tasks to users. 14 | 15 | Features include: 16 | 17 | * Unlimited projects, task lists, tasks, and comments 18 | * Easily edit/delete projects, task lists, tasks, and comments 19 | * Front-end shortcode support 20 | * BuddyPress group integration 21 | * File upload on projects, task lists, task, and comments 22 | * Email notifications for new tasks and comments 23 | * Task due dates with a calendar view 24 | * Uses built-in WordPress user accounts 25 | * Activity log tracking all activity 26 | 27 | Works with WordPress, Multisite, and BuddyPress! 28 | 29 | = Get Involved = 30 | 31 | CollabPress is an Open Source project. If you are a developer, make sure to check out and contribute to CollabPress on the [CollabPress GitHub Repository](https://github.com/WebDevStudios/CollabPress/ "CollabPress GitHub Repository"). 32 | 33 | == Screenshots == 34 | 35 | 1. CollabPress Dashboard showing recent activity, users, overview, and more 36 | 2. Task list view showing active and completed tasks and who is assigned to each 37 | 3. Single task view with comments 38 | 4. Calendar view with tasks and due dates 39 | 5. Shortcode support example 40 | 6. BuddyPress Group integration 41 | 42 | == Changelog == 43 | 44 | = 1.3.1.2 = 45 | * Fix checking off tasks not working under task lists in project tasks screen 46 | 47 | = 1.3.1.1 = 48 | * Bug fixes 49 | 50 | = 1.3.1 = 51 | * Bug fixes from the 1.3 UI overhaul 52 | 53 | = 1.3 = 54 | * Complete user interface overhaul 55 | * Themes can now override any CollabPress template 56 | * Calendar overview of all projects, displaying tasks of projects the logged-in user has access to 57 | * File uploads use new WordPress media manager 58 | * Added Arabic translation [props Muneerah-Salah] 59 | 60 | = 1.2.4 = 61 | * Hardened security for all projects, task lists, and tasks 62 | * Added new task and comment email filters for subject and body 63 | * Added Slovak translation [props Branco](http://webhostinggeeks.com/user-reviews/) 64 | 65 | = 1.2.3 = 66 | * Removed remaining Google Hosted jQuery 67 | * Show comments and comment form while viewing a task in BuddyPress on the front-end 68 | 69 | = 1.2.2 = 70 | * Calls to $wpdb have been replaced with calls to the WP APIs 71 | * Fixed issue with screen options and missing columns 72 | * Hardened security 73 | * Use bundled jQuery UI and Datepicker instead of Google's 74 | * WordPress 3.5 support 75 | 76 | = 1.2.1 = 77 | * Fixed bug when adding tasks without BuddyPress installed 78 | 79 | = 1.2 = 80 | * BuddyPress Group integration ( requires BP v1.5+ ) 81 | * Assign specific users to each project 82 | * Task item priority setting 83 | * Updated missing __() and _e() for translation 84 | * Fixed missing styles for "Recent Activity" on WP Dashboard 85 | 86 | = 1.1.3 = 87 | * Fixed JS conflict with WordPress navigation menus 88 | * Fixed WP nonce bug when adding a project/task list or task 89 | * Added https with is_ssl() for Google jQuery API 90 | 91 | = 1.1.2 = 92 | * Fixed bug showing help menu to all users 93 | * Exclude custom post type content from search 94 | * Fixed bug to only show recent five projects 95 | * Created a dedicated project page to view all projects 96 | * Added translation file for internationalization support 97 | 98 | = 1.1.1 = 99 | * Fixed front-end shortcode viewing bug 100 | 101 | = 1.1 = 102 | * Front-end shortcode support using [collabpress] 103 | * Set user level to view shortcode front-end 104 | * File uploads on projects, task lists, tasks, and comments 105 | * New CollabPress overview widget 106 | * New setting to clear the activity log 107 | * Limit number of users displayed 108 | * New view all users page 109 | * Various bug fixes 110 | 111 | = 1.0 = 112 | * Complete rebuild using custom post types 113 | 114 | = 0.5.3 = 115 | * Added CollabPress styles to necessary admin pages 116 | * Updated readme.txt to display CollabPress screencast (0.4b) 117 | 118 | = 0.5.2 = 119 | * Fixed JavaScript bug conflicting w/ plugins and themes 120 | 121 | = 0.5.1 = 122 | * Fixed date formatting bug on comments and tasks 123 | 124 | = 0.5 = 125 | * Add and view comments for tasks 126 | * Edit tasks 127 | * Added single task detail page 128 | * Added uninstall script 129 | * fixed various bugs 130 | 131 | = 0.4 = 132 | * Added ability to edit projects 133 | * Added minimum user role setting 134 | * If a task is past the due date it will display in red 135 | 136 | = 0.3 = 137 | * Added ability to delete projects 138 | * Added task level email notification toggle for new tasks 139 | * Added different views for users, view more, etc 140 | * Added links to user page for gravatars and usernames 141 | * Fixed multiple PHP warnings 142 | 143 | = 0.2 = 144 | * Fixed PHP warning when loading My Tasks 145 | * When task is completed stay on project page 146 | 147 | = 0.1 = 148 | * First beta release 149 | 150 | == Upgrade Notice == 151 | 152 | = 1.3.1.1 = 153 | * Critical bug fix 154 | 155 | = 1.3 = 156 | * New user interface 157 | * Calendar overview of all projects, displaying tasks of projects the logged-in user has access to 158 | * File uploads use new WordPress media manager 159 | 160 | = 1.2.4 = 161 | * Hardened security for all projects, task lists, and tasks 162 | * Added new task and comment email filters for subject and body 163 | * Added Slovak translation [props Branco](http://webhostinggeeks.com/user-reviews/) 164 | 165 | = 1.2.3 = 166 | * Removed remaining Google Hosted jQuery 167 | * Show comments and comment form while viewing a task in BuddyPress on the front-end 168 | 169 | = 1.2.2 = 170 | * Calls to $wpdb have been replaced with calls to the WP APIs 171 | * Fixed issue with screen options and missing columns 172 | * Hardened security 173 | * Use bundled jQuery UI and Datepicker instead of Google's 174 | * WordPress 3.5 support 175 | 176 | = 1.2.1 = 177 | * Fixed bug when adding tasks without BuddyPress installed 178 | 179 | = 1.2 = 180 | * BuddyPress Group integration ( requires BP v1.5+ ) 181 | * Assign specific users to each project 182 | * Task item priority setting 183 | * Updated missing __() and _e() for translation 184 | * Fixed missing styles for "Recent Activity" on WP Dashboard 185 | 186 | = 1.1.3 = 187 | * Fixed JS conflict with WordPress navigation menus 188 | * Fixed WP nonce bug when adding a project/task list or task 189 | * Added https with is_ssl() for Google jQuery API 190 | 191 | = 1.1.2 = 192 | * Fixed bug showing help menu to all users 193 | * Exclude custom post type content from search 194 | * Fixed bug to only show recent five projects 195 | * Created a dedicated project page to view all projects 196 | * Added translation file for internationalization support 197 | 198 | = 1.1.1 = 199 | * Fixed front-end shortcode viewing bug 200 | 201 | = 1.1 = 202 | * Front-end shortcode support using [collabpress] 203 | * Set user level to view shortcode front-end 204 | * File uploads on projects, task lists, tasks, and comments 205 | * New CollabPress overview widget 206 | * New setting to clear the activity log 207 | * Limit number of users displayed 208 | * New view all users page 209 | * Various bug fixes 210 | 211 | = 1.0 = 212 | * CollabPress v1.0 does NOT support legacy CollabPress data at this time. If you are running a previous version, your data will not be lost, but it will not be displayed or used in the new version. 213 | 214 | = 0.5.3 = 215 | * Added CollabPress styles to necessary admin pages 216 | 217 | = 0.5.2 = 218 | * Fixed JavaScript bug conflicting w/ plugins and themes 219 | 220 | = 0.5 = 221 | * Adds a bunch of new features including task editing, task comments, uninstallation script, and more 222 | 223 | == Installation == 224 | 225 | 1. Upload the CollabPress folder to the plugins directory in your WordPress installation 226 | 2. Activate the plugin 227 | 3. Navigate to the CollabPress menu 228 | 229 | That's it! Now you can easily start adding new projects and tasks 230 | 231 | == Frequently Asked Questions == 232 | 233 | = Why are some features not implemented? = 234 | 235 | CollabPress is currently in early development. If you have any bugs to report, ideas or anything else please visit the support forum. [CollabPress Support](http://wordpress.org/support/plugin/collabpress "Task Management Plugin Support") 236 | 237 | = Does this plugin work with WordPress Multisite? = 238 | 239 | Absolutely! This plugin has been tested and verified to work on the most current version of WordPress Multisite 240 | 241 | == Plugin Support == 242 | [CollabPress Support](http://wordpress.org/support/plugin/collabpress "CollabPress Plugin Support") 243 | -------------------------------------------------------------------------------- /includes/cp-bp-notifications.php: -------------------------------------------------------------------------------- 1 | 'collabpress', 109 | 'user_id' => $author, 110 | 'secondary_item_id' => $cp_post_id 111 | ); 112 | 113 | // Get the user display name 114 | $display_name = bp_core_get_user_displayname( $author ); 115 | 116 | switch( $type ) { 117 | case 'task' : 118 | $task_link = cp_bp_get_task_permalink( $cp_post_id ); 119 | $bp_activity_add_args['primary_link'] = $task_link; 120 | 121 | $task_obj = get_post( $cp_post_id ); 122 | $task_name = $task_obj->post_title; 123 | 124 | switch( $action ) { 125 | case 'updated' : 126 | $bp_activity_add_args['type'] = 'cp_task_updated'; 127 | $bp_activity_add_args['action'] = sprintf( __( '%1$s updated the task "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $task_name . '' ); 128 | break; 129 | 130 | case 'opened' : 131 | $bp_activity_add_args['type'] = 'cp_task_opened'; 132 | $bp_activity_add_args['action'] = sprintf( __( '%1$s reopened the task "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $task_name . '' ); 133 | break; 134 | 135 | case 'deleted' : 136 | $bp_activity_add_args['type'] = 'cp_task_deleted'; 137 | $bp_activity_add_args['action'] = sprintf( __( '%1$s deleted the task "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $task_name . '' ); 138 | break; 139 | 140 | case 'edited' : 141 | $bp_activity_add_args['type'] = 'cp_task_edited'; 142 | $bp_activity_add_args['action'] = sprintf( __( '%1$s edited the task "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $task_name . '' ); 143 | break; 144 | 145 | case 'added' : 146 | $bp_activity_add_args['type'] = 'cp_task_added'; 147 | $bp_activity_add_args['action'] = sprintf( __( '%1$s added the task "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $task_name . '' ); 148 | break; 149 | 150 | case 'completed' : 151 | $bp_activity_add_args['type'] = 'cp_task_completed'; 152 | $bp_activity_add_args['action'] = sprintf( __( '%1$s completed the task "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $task_name . '' ); 153 | break; 154 | 155 | case 'commented' : 156 | $bp_activity_add_args['type'] = 'cp_task_commented'; 157 | $bp_activity_add_args['action'] = sprintf( __( '%1$s commented on the task "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $task_name . '' ); 158 | break; 159 | } 160 | break; 161 | 162 | case 'task-list' : 163 | $task_list_link = cp_bp_get_task_list_permalink( $cp_post_id ); 164 | $bp_activity_add_args['primary_link'] = $task_list_link; 165 | 166 | $task_list_obj = get_post( $cp_post_id ); 167 | $task_list_name = $task_list_obj->post_title; 168 | 169 | switch( $action ) { 170 | case 'deleted' : 171 | $bp_activity_add_args['type'] = 'cp_task_list_deleted'; 172 | $bp_activity_add_args['action'] = sprintf( __( '%1$s deleted the task list "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $task_list_name . '' ); 173 | break; 174 | 175 | case 'edited' : 176 | $bp_activity_add_args['type'] = 'cp_task_list_edited'; 177 | $bp_activity_add_args['action'] = sprintf( __( '%1$s edited the task list "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $task_list_name . '' ); 178 | break; 179 | 180 | case 'added' : 181 | $bp_activity_add_args['type'] = 'cp_task_list_added'; 182 | $bp_activity_add_args['action'] = sprintf( __( '%1$s added the task list "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $task_list_name . '' ); 183 | break; 184 | } 185 | break; 186 | 187 | case 'project' : 188 | $project_link = cp_bp_get_project_permalink( $cp_post_id ); 189 | $bp_activity_add_args['primary_link'] = $project_link; 190 | 191 | $project_obj = get_post( $cp_post_id ); 192 | $project_name = $project_obj->post_title; 193 | 194 | switch( $action ) { 195 | case 'deleted' : 196 | $bp_activity_add_args['type'] = 'cp_project_deleted'; 197 | $bp_activity_add_args['action'] = sprintf( __( '%1$s deleted the project "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $project_name . '' ); 198 | break; 199 | 200 | case 'edited' : 201 | $bp_activity_add_args['type'] = 'cp_project_edited'; 202 | $bp_activity_add_args['action'] = sprintf( __( '%1$s edited the project "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $project_name . '' ); 203 | break; 204 | 205 | case 'added' : 206 | $bp_activity_add_args['type'] = 'cp_project_added'; 207 | $bp_activity_add_args['action'] = sprintf( __( '%1$s added the project "%2$s"', 'collabpress' ), bp_core_get_userlink( $author ), '' . $project_name . '' ); 208 | break; 209 | } 210 | break; 211 | } 212 | 213 | if ( bp_is_active( 'groups' ) && bp_is_group() ) { 214 | $bp_activity_add_args['component'] = 'groups'; 215 | $bp_activity_add_args['item_id'] = bp_get_current_group_id(); 216 | $bp_activity_add_args['hide_sitewide'] = 'public' != $bp->groups->current_group->status; 217 | 218 | $bp_activity_add_args['action'] .= sprintf( __( ' in the group %s', 'collabpress' ), '' . bp_get_current_group_name() . '' ); 219 | 220 | } 221 | 222 | bp_activity_add( $bp_activity_add_args ); 223 | } 224 | 225 | ?> -------------------------------------------------------------------------------- /includes/templates/collabpress/content-single-task.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 | 7 | 8 | 9 |
10 | 11 |
12 |

13 |
14 | 15 | 16 | 17 | 18 |

>

19 | Edit
20 | ' . __( 'Due date: ', 'collabpress' ) . $due_date . '
'; 22 | } ?> 23 | ' . __( 'Priority: ', 'collabpress' ) . $priority . '
'; 25 | } ?> 26 |
27 |
ID ); ?>
28 |
display_name ?>
29 |
30 |
31 | 32 | 33 | 34 |
35 |
36 |
37 |

38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 51 | 52 | 53 | 54 | 60 | 61 | 62 | 63 | 75 | 76 | 77 | 78 | 88 | 89 | 90 |
46 |

47 |

48 | 49 |

50 |
55 |

56 | /> 57 | 58 |

59 |
64 |

65 | '; 67 | foreach ( cp_get_project_users() as $wp_user ) 68 | $user_list .= ''; 69 | $user_list .= ''; 70 | $user_list = apply_filters( 'cp_task_user_list_html', $user_list, false ); 71 | echo $user_list; 72 | ?> 73 |

74 |
79 | 87 |
91 |

92 | 93 |

94 |

95 |
96 |
97 |
98 | 99 | 221 | -------------------------------------------------------------------------------- /includes/js/jquery.colorbox-min.js: -------------------------------------------------------------------------------- 1 | /* 2 | jQuery ColorBox v1.3.32 - 2013-01-31 3 | (c) 2013 Jack Moore - jacklmoore.com/colorbox 4 | license: http://www.opensource.org/licenses/mit-license.php 5 | */ 6 | (function(e,t,i){function o(i,o,n){var h=t.createElement(i);return o&&(h.id=U+o),n&&(h.style.cssText=n),e(h)}function n(e){var t=b.length,i=(A+e)%t;return 0>i?t+i:i}function h(e,t){return Math.round((/%/.test(e)?("x"===t?T.width():T.height())/100:1)*parseInt(e,10))}function l(e){return _.photo||/\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i.test(e)}function r(){var t,i=e.data(N,J);null==i?(_=e.extend({},$),console&&console.log&&console.log("Error: cboxElement missing settings object")):_=e.extend({},i);for(t in _)e.isFunction(_[t])&&"on"!==t.slice(0,2)&&(_[t]=_[t].call(N));_.rel=_.rel||N.rel||e(N).data("rel")||"nofollow",_.href=_.href||e(N).attr("href"),_.title=_.title||N.title,"string"==typeof _.href&&(_.href=e.trim(_.href))}function s(i,o){e(t).trigger(i),rt.trigger(i),e.isFunction(o)&&o.call(N)}function a(){var e,t,i,o,n,h=U+"Slideshow_",l="click."+U;_.slideshow&&b[1]?(t=function(){clearTimeout(e)},i=function(){(_.loop||b[A+1])&&(e=setTimeout(G.next,_.slideshowSpeed))},o=function(){I.html(_.slideshowStop).unbind(l).one(l,n),rt.bind(et,i).bind(Z,t).bind(tt,n),p.removeClass(h+"off").addClass(h+"on")},n=function(){t(),rt.unbind(et,i).unbind(Z,t).unbind(tt,n),I.html(_.slideshowStart).unbind(l).one(l,function(){G.next(),o()}),p.removeClass(h+"on").addClass(h+"off")},_.slideshowAuto?o():n()):p.removeClass(h+"off "+h+"on")}function d(t){j||(N=t,r(),b=e(N),A=0,"nofollow"!==_.rel&&(b=e("."+V).filter(function(){var t,i=e.data(this,J);return i&&(t=e(this).data("rel")||i.rel||this.rel),t===_.rel}),A=b.index(N),-1===A&&(b=b.add(N),A=b.length-1)),P||(P=R=!0,p.css({visibility:"hidden",display:"block"}),C=o(st,"LoadedContent","width:0; height:0; overflow:hidden").appendTo(w),K=g.height()+x.height()+w.outerHeight(!0)-w.height(),z=y.width()+v.width()+w.outerWidth(!0)-w.width(),D=C.outerHeight(!0),B=C.outerWidth(!0),_.returnFocus&&(e(N).blur(),rt.one(it,function(){e(N).focus()})),f.css({opacity:parseFloat(_.opacity),cursor:_.overlayClose?"pointer":"auto",visibility:"visible"}).show(),_.w=h(_.initialWidth,"x"),_.h=h(_.initialHeight,"y"),G.position(),ht&&T.bind("resize."+lt+" scroll."+lt,function(){f.css({width:T.width(),height:T.height(),top:T.scrollTop(),left:T.scrollLeft()})}).trigger("resize."+lt),a(),s(Y,_.onOpen),S.add(H).hide(),F.html(_.close).show()),G.load(!0))}function c(){!p&&t.body&&(X=!1,T=e(i),p=o(st).attr({id:J,"class":nt?U+(ht?"IE6":"IE"):""}).hide(),f=o(st,"Overlay",ht?"position:absolute":"").hide(),W=o(st,"LoadingOverlay").add(o(st,"LoadingGraphic")),m=o(st,"Wrapper"),w=o(st,"Content").append(H=o(st,"Title"),E=o(st,"Current"),L=o(st,"Next"),M=o(st,"Previous"),I=o(st,"Slideshow"),F=o(st,"Close")),m.append(o(st).append(o(st,"TopLeft"),g=o(st,"TopCenter"),o(st,"TopRight")),o(st,!1,"clear:left").append(y=o(st,"MiddleLeft"),w,v=o(st,"MiddleRight")),o(st,!1,"clear:left").append(o(st,"BottomLeft"),x=o(st,"BottomCenter"),o(st,"BottomRight"))).find("div div").css({"float":"left"}),k=o(st,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),S=L.add(M).add(E).add(I),e(t.body).append(f,p.append(m,k)))}function u(){function i(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||(e.preventDefault(),d(this))}return p?(X||(X=!0,L.click(function(){G.next()}),M.click(function(){G.prev()}),F.click(function(){G.close()}),f.click(function(){_.overlayClose&&G.close()}),e(t).bind("keydown."+U,function(e){var t=e.keyCode;P&&_.escKey&&27===t&&(e.preventDefault(),G.close()),P&&_.arrowKey&&b[1]&&(37===t?(e.preventDefault(),M.click()):39===t&&(e.preventDefault(),L.click()))}),e.isFunction(e.fn.on)?e(t).on("click."+U,"."+V,i):e("."+V).live("click."+U,i)),!0):!1}var f,p,m,w,g,y,v,x,b,T,C,k,W,H,E,I,L,M,F,S,_,K,z,D,B,N,A,O,P,R,j,q,G,Q,X,$={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,className:!1,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0},J="colorbox",U="cbox",V=U+"Element",Y=U+"_open",Z=U+"_load",et=U+"_complete",tt=U+"_cleanup",it=U+"_closed",ot=U+"_purge",nt=!e.support.leadingWhitespace,ht=nt&&!i.XMLHttpRequest,lt=U+"_IE6",rt=e({}),st="div";e.colorbox||(e(c),G=e.fn[J]=e[J]=function(t,i){var o=this;if(t=t||{},c(),u()){if(e.isFunction(o))o=e(""),t.open=!0;else if(!o[0])return o;i&&(t.onComplete=i),o.each(function(){e.data(this,J,e.extend({},e.data(this,J)||$,t))}).addClass(V),(e.isFunction(t.open)&&t.open.call(o)||t.open)&&d(o[0])}return o},G.position=function(e,t){function i(e){g[0].style.width=x[0].style.width=w[0].style.width=parseInt(e.style.width,10)-z+"px",w[0].style.height=y[0].style.height=v[0].style.height=parseInt(e.style.height,10)-K+"px"}var o,n,l,r=0,s=0,a=p.offset();T.unbind("resize."+U),p.css({top:-9e4,left:-9e4}),n=T.scrollTop(),l=T.scrollLeft(),_.fixed&&!ht?(a.top-=n,a.left-=l,p.css({position:"fixed"})):(r=n,s=l,p.css({position:"absolute"})),s+=_.right!==!1?Math.max(T.width()-_.w-B-z-h(_.right,"x"),0):_.left!==!1?h(_.left,"x"):Math.round(Math.max(T.width()-_.w-B-z,0)/2),r+=_.bottom!==!1?Math.max(T.height()-_.h-D-K-h(_.bottom,"y"),0):_.top!==!1?h(_.top,"y"):Math.round(Math.max(T.height()-_.h-D-K,0)/2),p.css({top:a.top,left:a.left,visibility:"visible"}),e=p.width()===_.w+B&&p.height()===_.h+D?0:e||0,m[0].style.width=m[0].style.height="9999px",o={width:_.w+B+z,height:_.h+D+K,top:r,left:s},0===e&&p.css(o),p.dequeue().animate(o,{duration:e,complete:function(){i(this),R=!1,m[0].style.width=_.w+B+z+"px",m[0].style.height=_.h+D+K+"px",_.reposition&&setTimeout(function(){T.bind("resize."+U,G.position)},1),t&&t()},step:function(){i(this)}})},G.resize=function(e){P&&(e=e||{},e.width&&(_.w=h(e.width,"x")-B-z),e.innerWidth&&(_.w=h(e.innerWidth,"x")),C.css({width:_.w}),e.height&&(_.h=h(e.height,"y")-D-K),e.innerHeight&&(_.h=h(e.innerHeight,"y")),e.innerHeight||e.height||(C.css({height:"auto"}),_.h=C.height()),C.css({height:_.h}),G.position("none"===_.transition?0:_.speed))},G.prep=function(t){function i(){return _.w=_.w||C.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function h(){return _.h=_.h||C.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(P){var r,a="none"===_.transition?0:_.speed;C.empty().remove(),C=o(st,"LoadedContent").append(t),C.hide().appendTo(k.show()).css({width:i(),overflow:_.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(w),k.hide(),e(O).css({"float":"none"}),r=function(){function t(){nt&&p[0].style.removeAttribute("filter")}var i,h,r=b.length,d="frameBorder",c="allowTransparency";P&&(h=function(){clearTimeout(q),W.remove(),s(et,_.onComplete)},nt&&O&&C.fadeIn(100),H.html(_.title).add(C).show(),r>1?("string"==typeof _.current&&E.html(_.current.replace("{current}",A+1).replace("{total}",r)).show(),L[_.loop||r-1>A?"show":"hide"]().html(_.next),M[_.loop||A?"show":"hide"]().html(_.previous),_.slideshow&&I.show(),_.preloading&&e.each([n(-1),n(1)],function(){var t,i,o=b[this],n=e.data(o,J);n&&n.href?(t=n.href,e.isFunction(t)&&(t=t.call(o))):t=o.href,l(t)&&(i=new Image,i.src=t)})):S.hide(),_.iframe?(i=o("iframe")[0],d in i&&(i[d]=0),c in i&&(i[c]="true"),_.scrolling||(i.scrolling="no"),e(i).attr({src:_.href,name:(new Date).getTime(),"class":U+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",h).appendTo(C),rt.one(ot,function(){i.src="//about:blank"}),_.fastIframe&&e(i).trigger("load")):h(),"fade"===_.transition?p.fadeTo(a,1,t):t())},"fade"===_.transition?p.fadeTo(a,0,function(){G.position(0,r)}):G.position(a,r)}},G.load=function(t){var i,n,a,d=G.prep;R=!0,O=!1,N=b[A],t||r(),Q&&p.add(f).removeClass(Q),_.className&&p.add(f).addClass(_.className),Q=_.className,s(ot),s(Z,_.onLoad),_.h=_.height?h(_.height,"y")-D-K:_.innerHeight&&h(_.innerHeight,"y"),_.w=_.width?h(_.width,"x")-B-z:_.innerWidth&&h(_.innerWidth,"x"),_.mw=_.w,_.mh=_.h,_.maxWidth&&(_.mw=h(_.maxWidth,"x")-B-z,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.maxHeight&&(_.mh=h(_.maxHeight,"y")-D-K,_.mh=_.h&&_.h<_.mh?_.h:_.mh),i=_.href,q=setTimeout(function(){W.appendTo(w)},100),_.inline?(a=o(st).hide().insertBefore(e(i)[0]),rt.one(ot,function(){a.replaceWith(C.children())}),d(e(i))):_.iframe?d(" "):_.html?d(_.html):l(i)?(e(O=new Image).addClass(U+"Photo").bind("error",function(){_.title=!1,d(o(st,"Error").html(_.imgError))}).one("load",function(){var e;_.scalePhotos&&(n=function(){O.height-=O.height*e,O.width-=O.width*e},_.mw&&O.width>_.mw&&(e=(O.width-_.mw)/O.width,n()),_.mh&&O.height>_.mh&&(e=(O.height-_.mh)/O.height,n())),_.h&&(O.style.marginTop=Math.max(_.h-O.height,0)/2+"px"),b[1]&&(_.loop||b[A+1])&&(O.style.cursor="pointer",O.onclick=function(){G.next()}),nt&&(O.style.msInterpolationMode="bicubic"),setTimeout(function(){d(O)},1)}),setTimeout(function(){O.src=i},1)):i&&k.load(i,_.data,function(t,i){d("error"===i?o(st,"Error").html(_.xhrError):e(this).contents())})},G.next=function(){!R&&b[1]&&(_.loop||b[A+1])&&(A=n(1),G.load())},G.prev=function(){!R&&b[1]&&(_.loop||A)&&(A=n(-1),G.load())},G.close=function(){P&&!j&&(j=!0,P=!1,s(tt,_.onCleanup),T.unbind("."+U+" ."+lt),f.fadeTo(200,0),p.stop().fadeTo(300,0,function(){p.add(f).css({opacity:1,cursor:"auto"}).hide(),s(ot),C.empty().remove(),setTimeout(function(){j=!1,s(it,_.onClosed)},1)}))},G.remove=function(){e([]).add(p).add(f).remove(),p=null,e("."+V).removeData(J).removeClass(V),e(t).unbind("click."+U)},G.element=function(){return e(N)},G.settings=$)})(jQuery,document,window); -------------------------------------------------------------------------------- /includes/tools/fancybox/jquery.fancybox-1.3.4.css: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyBox - jQuery Plugin 3 | * Simple and fancy lightbox alternative 4 | * 5 | * Examples and documentation at: http://fancybox.net 6 | * 7 | * Copyright (c) 2008 - 2010 Janis Skarnelis 8 | * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. 9 | * 10 | * Version: 1.3.4 (11/11/2010) 11 | * Requires: jQuery v1.3+ 12 | * 13 | * Dual licensed under the MIT and GPL licenses: 14 | * http://www.opensource.org/licenses/mit-license.php 15 | * http://www.gnu.org/licenses/gpl.html 16 | */ 17 | 18 | #fancybox-loading { 19 | position: fixed; 20 | top: 50%; 21 | left: 50%; 22 | width: 40px; 23 | height: 40px; 24 | margin-top: -20px; 25 | margin-left: -20px; 26 | cursor: pointer; 27 | overflow: hidden; 28 | z-index: 1104; 29 | display: none; 30 | } 31 | 32 | #fancybox-loading div { 33 | position: absolute; 34 | top: 0; 35 | left: 0; 36 | width: 40px; 37 | height: 480px; 38 | background-image: url('fancybox.png'); 39 | } 40 | 41 | #fancybox-overlay { 42 | position: absolute; 43 | top: 0; 44 | left: 0; 45 | width: 100%; 46 | z-index: 1100; 47 | display: none; 48 | } 49 | 50 | #fancybox-tmp { 51 | padding: 0; 52 | margin: 0; 53 | border: 0; 54 | overflow: auto; 55 | display: none; 56 | } 57 | 58 | #fancybox-wrap { 59 | position: absolute; 60 | top: 0; 61 | left: 0; 62 | padding: 20px; 63 | z-index: 1101; 64 | outline: none; 65 | display: none; 66 | } 67 | 68 | #fancybox-outer { 69 | position: relative; 70 | width: 100%; 71 | height: 100%; 72 | background: #fff; 73 | } 74 | 75 | #fancybox-content { 76 | width: 0; 77 | height: 0; 78 | padding: 0; 79 | outline: none; 80 | position: relative; 81 | overflow: hidden; 82 | z-index: 1102; 83 | border: 0px solid #fff; 84 | } 85 | 86 | #fancybox-hide-sel-frame { 87 | position: absolute; 88 | top: 0; 89 | left: 0; 90 | width: 100%; 91 | height: 100%; 92 | background: transparent; 93 | z-index: 1101; 94 | } 95 | 96 | #fancybox-close { 97 | position: absolute; 98 | top: -15px; 99 | right: -15px; 100 | width: 30px; 101 | height: 30px; 102 | background: transparent url('fancybox.png') -40px 0px; 103 | cursor: pointer; 104 | z-index: 1103; 105 | display: none; 106 | } 107 | 108 | #fancybox-error { 109 | color: #444; 110 | font: normal 12px/20px Arial; 111 | padding: 14px; 112 | margin: 0; 113 | } 114 | 115 | #fancybox-img { 116 | width: 100%; 117 | height: 100%; 118 | padding: 0; 119 | margin: 0; 120 | border: none; 121 | outline: none; 122 | line-height: 0; 123 | vertical-align: top; 124 | } 125 | 126 | #fancybox-frame { 127 | width: 100%; 128 | height: 100%; 129 | border: none; 130 | display: block; 131 | } 132 | 133 | #fancybox-left, #fancybox-right { 134 | position: absolute; 135 | bottom: 0px; 136 | height: 100%; 137 | width: 35%; 138 | cursor: pointer; 139 | outline: none; 140 | background: transparent url('blank.gif'); 141 | z-index: 1102; 142 | display: none; 143 | } 144 | 145 | #fancybox-left { 146 | left: 0px; 147 | } 148 | 149 | #fancybox-right { 150 | right: 0px; 151 | } 152 | 153 | #fancybox-left-ico, #fancybox-right-ico { 154 | position: absolute; 155 | top: 50%; 156 | left: -9999px; 157 | width: 30px; 158 | height: 30px; 159 | margin-top: -15px; 160 | cursor: pointer; 161 | z-index: 1102; 162 | display: block; 163 | } 164 | 165 | #fancybox-left-ico { 166 | background-image: url('fancybox.png'); 167 | background-position: -40px -30px; 168 | } 169 | 170 | #fancybox-right-ico { 171 | background-image: url('fancybox.png'); 172 | background-position: -40px -60px; 173 | } 174 | 175 | #fancybox-left:hover, #fancybox-right:hover { 176 | visibility: visible; /* IE6 */ 177 | } 178 | 179 | #fancybox-left:hover span { 180 | left: 20px; 181 | } 182 | 183 | #fancybox-right:hover span { 184 | left: auto; 185 | right: 20px; 186 | } 187 | 188 | .fancybox-bg { 189 | position: absolute; 190 | padding: 0; 191 | margin: 0; 192 | border: 0; 193 | width: 20px; 194 | height: 20px; 195 | z-index: 1001; 196 | } 197 | 198 | #fancybox-bg-n { 199 | top: -20px; 200 | left: 0; 201 | width: 100%; 202 | background-image: url('fancybox-x.png'); 203 | } 204 | 205 | #fancybox-bg-ne { 206 | top: -20px; 207 | right: -20px; 208 | background-image: url('fancybox.png'); 209 | background-position: -40px -162px; 210 | } 211 | 212 | #fancybox-bg-e { 213 | top: 0; 214 | right: -20px; 215 | height: 100%; 216 | background-image: url('fancybox-y.png'); 217 | background-position: -20px 0px; 218 | } 219 | 220 | #fancybox-bg-se { 221 | bottom: -20px; 222 | right: -20px; 223 | background-image: url('fancybox.png'); 224 | background-position: -40px -182px; 225 | } 226 | 227 | #fancybox-bg-s { 228 | bottom: -20px; 229 | left: 0; 230 | width: 100%; 231 | background-image: url('fancybox-x.png'); 232 | background-position: 0px -20px; 233 | } 234 | 235 | #fancybox-bg-sw { 236 | bottom: -20px; 237 | left: -20px; 238 | background-image: url('fancybox.png'); 239 | background-position: -40px -142px; 240 | } 241 | 242 | #fancybox-bg-w { 243 | top: 0; 244 | left: -20px; 245 | height: 100%; 246 | background-image: url('fancybox-y.png'); 247 | } 248 | 249 | #fancybox-bg-nw { 250 | top: -20px; 251 | left: -20px; 252 | background-image: url('fancybox.png'); 253 | background-position: -40px -122px; 254 | } 255 | 256 | #fancybox-title { 257 | font-family: Helvetica; 258 | font-size: 12px; 259 | z-index: 1102; 260 | } 261 | 262 | .fancybox-title-inside { 263 | padding-bottom: 10px; 264 | text-align: center; 265 | color: #333; 266 | background: #fff; 267 | position: relative; 268 | } 269 | 270 | .fancybox-title-outside { 271 | padding-top: 10px; 272 | color: #fff; 273 | } 274 | 275 | .fancybox-title-over { 276 | position: absolute; 277 | bottom: 0; 278 | left: 0; 279 | color: #FFF; 280 | text-align: left; 281 | } 282 | 283 | #fancybox-title-over { 284 | padding: 10px; 285 | background-image: url('fancy_title_over.png'); 286 | display: block; 287 | } 288 | 289 | .fancybox-title-float { 290 | position: absolute; 291 | left: 0; 292 | bottom: -20px; 293 | height: 32px; 294 | } 295 | 296 | #fancybox-title-float-wrap { 297 | border: none; 298 | border-collapse: collapse; 299 | width: auto; 300 | } 301 | 302 | #fancybox-title-float-wrap td { 303 | border: none; 304 | white-space: nowrap; 305 | } 306 | 307 | #fancybox-title-float-left { 308 | padding: 0 0 0 15px; 309 | background: url('fancybox.png') -40px -90px no-repeat; 310 | } 311 | 312 | #fancybox-title-float-main { 313 | color: #FFF; 314 | line-height: 29px; 315 | font-weight: bold; 316 | padding: 0 0 3px 0; 317 | background: url('fancybox-x.png') 0px -40px; 318 | } 319 | 320 | #fancybox-title-float-right { 321 | padding: 0 0 0 15px; 322 | background: url('fancybox.png') -55px -90px no-repeat; 323 | } 324 | 325 | /* IE6 */ 326 | 327 | .fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); } 328 | 329 | .fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); } 330 | .fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); } 331 | 332 | .fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } 333 | .fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); } 334 | .fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); } 335 | .fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); } 336 | 337 | .fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { 338 | height: expression(this.parentNode.clientHeight + "px"); 339 | } 340 | 341 | #fancybox-loading.fancybox-ie6 { 342 | position: absolute; margin-top: 0; 343 | top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); 344 | } 345 | 346 | #fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); } 347 | 348 | /* IE6, IE7, IE8 */ 349 | 350 | .fancybox-ie .fancybox-bg { background: transparent !important; } 351 | 352 | .fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); } 353 | .fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } 354 | .fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); } 355 | .fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); } 356 | .fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); } 357 | .fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } 358 | .fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); } 359 | .fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); } -------------------------------------------------------------------------------- /includes/templates/collabpress/content-single-project-tasks.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 |

12 |

 » 

13 | 14 |
15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |
25 |
26 |
27 |

28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 60 | 61 | 62 | 63 | 73 | 74 | 75 | 76 | 80 | 81 | 82 | 83 |
36 |

37 |

38 | 39 |

40 |

/>

49 |

50 | '; 52 | foreach ( cp_get_project_users() as $wp_user ) 53 | $user_list .= ''; 54 | $user_list .= ''; 55 | $user_list = apply_filters( 'cp_task_user_list_html', $user_list, false ); 56 | echo $user_list; 57 | ?> 58 |

59 |
64 | 72 |

/>

84 |

85 | 86 |

87 |

88 |
89 |
90 |

91 | 92 | 93 | 94 | 95 | 96 | 97 | 102 | 103 | 104 | 105 | 110 | 111 | 112 |
98 |

99 | 100 |

101 |
106 |

107 | 108 |

109 |
113 |

114 | 115 |

116 |

117 |
118 |
119 | 120 | -------------------------------------------------------------------------------- /includes/menus/settings.php: -------------------------------------------------------------------------------- 1 | 5 |
6 | 7 |

8 | 13 |
14 | 15 | 16 | 17 | 18 | 'cp-meta-data', 24 | 'showposts' => '-1' 25 | ); 26 | $activity_query = new WP_Query( $tasks_args ); 27 | 28 | // WP_Query(); 29 | if ( $activity_query->have_posts() ) : 30 | while( $activity_query->have_posts() ) : $activity_query->the_post(); 31 | 32 | //delete the activity 33 | wp_delete_post( get_the_ID(), true ); 34 | 35 | endwhile; 36 | endif; 37 | 38 | endif; 39 | 40 | // Load option values into local PHP variables 41 | $cp_rss_feed_num = ( isset( $options['num_recent_activity'] ) ) ? absint( $options['num_recent_activity'] ) : 4; 42 | $num_users_display = ( isset( $options['num_users_display'] ) ) ? absint( $options['num_users_display'] ) : 10; 43 | $cp_user_role = ( isset( $options['user_role'] ) ) ? esc_attr( $options['user_role'] ) : 'manage_options'; 44 | $cp_settings_user_role = ( isset( $options['settings_user_role'] ) ) ? esc_attr( $options['settings_user_role'] ) : 'manage_options'; 45 | $cp_shortcode_user_role = ( isset( $options['shortcode_user_role'] ) ) ? esc_attr( $options['shortcode_user_role'] ) : ''; 46 | $cp_presstrends = ( isset( $options['presstrends'] ) ) ? $options['presstrends'] : 'no'; 47 | $date_format = ( isset( $options['date_format'] ) ) ? $options['date_format'] : 'F j, Y'; 48 | $date_format_custom = ( isset( $options['date_format_custom'] ) ) ? $options['date_format_custom'] : ''; 49 | 50 | ?> 51 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 72 | 73 | 74 | 75 | 89 | 90 | 91 | 92 | 101 | 102 | 103 | 104 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 149 | 150 | 151 | 152 | 161 | 162 | 163 | 164 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 186 | 187 | 188 | 189 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 |


58 | 62 |
67 | 71 |
76 | 88 |
93 | 100 |
105 | ' . date_i18n( $format ) . "
\n"; 122 | } 123 | 124 | echo ' ' . date_i18n( $date_format ) . " \n"; 130 | 131 | echo "\t

" . __('Documentation on date and time formatting.') . "

\n"; 132 | ?> 133 |


141 | 148 |
153 | 160 |
165 | 173 |


181 | 185 |
190 | 194 |
203 |
204 |
205 | 206 | 207 | 208 | 209 | publish ); //checky checky, you better be a positive int 213 | ?> 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 |


';?>
222 |
223 |
224 | 225 | 226 | -------------------------------------------------------------------------------- /includes/templates/collabpress/buddypress/content-single-project.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |

4 |
5 |
6 |

7 |
8 | 9 | 10 | 11 |
12 | + 13 |
14 |
15 | + 16 |
17 | 18 |
19 |
20 |
21 |
22 |
23 |

Edit Project

24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 41 | 42 | 43 |

36 |

37 |

38 | 39 |

40 |
44 |

45 | 46 | 47 |

48 |

49 |
50 |
51 |
52 |

53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 85 | 86 | 87 | 88 | 98 | 99 | 100 | 101 | 105 | 106 | 107 | 108 |
61 |

62 |

63 | 64 |

65 |

/>

74 |

75 | '; 77 | foreach ( cp_get_project_users() as $wp_user ) 78 | $user_list .= ''; 79 | $user_list .= ''; 80 | $user_list = apply_filters( 'cp_task_user_list_html', $user_list, false ); 81 | echo $user_list; 82 | ?> 83 |

84 |
89 | 97 |

/>

109 |

110 | 111 |

112 |

113 |
114 |
115 |

116 | 117 | 118 | 119 | 120 | 121 | 122 | 127 | 128 | 129 | 130 | 135 | 136 | 137 |
123 |

124 | 125 |

126 |
131 |

132 | 133 |

134 |
138 |

139 | 140 |

141 |

142 |
143 |
144 | 348 | 349 | 350 | --------------------------------------------------------------------------------