From f94b2ba8eb7367895aecaaa5cba9ab2618a425f4 Mon Sep 17 00:00:00 2001 From: Leland Smith Date: Thu, 16 Aug 2012 22:04:47 +0000 Subject: [PATCH 01/86] Overwrote what was there. Fixed issue that allowed all users to see all projects regardless of membership. --- functions.php | 55 ++++++++++++++++++++--- metaboxes/add-task.php | 17 ++++---- metaboxes/edit-task.php | 97 +++++++++++++++++++++++++++++++++++++++++ metaboxes/task-meta.php | 9 ++-- plugins/users.php | 21 +++++---- post-types/project.php | 5 ++- post-types/task.php | 5 ++- widgets/all-tasks.php | 0 8 files changed, 179 insertions(+), 30 deletions(-) create mode 100644 metaboxes/edit-task.php create mode 100755 widgets/all-tasks.php diff --git a/functions.php b/functions.php index 7f072dc..0a480f5 100644 --- a/functions.php +++ b/functions.php @@ -1,4 +1,35 @@ 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ); + $query->set('tax_query', $taxquery); + } + if ('propel_project' == $queried_post_type ) { + $taxquery = array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ); + $query->set('tax_query', $taxquery); + } + return $query; +} +add_filter('pre_get_posts', 'get_authored_posts'); + + /* CURRENT PROJECTS */ function dashboard_client_current_projects_metabox() { @@ -84,15 +115,20 @@ function dashboard_client_support_requests_content() { add_action('wp_dashboard_setup', 'dashboard_client_support_requests_metabox'); - - - - function dashboard_widget_function() { + global $user_ID; + $u = get_userdata($user_ID); $args = array( 'numberposts' => -1, 'post_type' => 'propel_project', - 'post_status' => 'publish' + 'post_status' => 'publish', + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) ); $projects = get_posts( $args ); echo ""; @@ -102,7 +138,14 @@ function dashboard_widget_function() { 'numberposts' => -1, 'post_type' => 'propel_task', 'post_status' => 'publish', - 'post_parent' => $project->ID + 'post_parent' => $project->ID, + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) ); $tasks = get_posts( $argv ); diff --git a/metaboxes/add-task.php b/metaboxes/add-task.php index 7eeaed6..dcc5242 100644 --- a/metaboxes/add-task.php +++ b/metaboxes/add-task.php @@ -38,19 +38,20 @@ 'task-owner', - 'show_option_none' => 'Unassigned', - 'name' => 'propel_post_author', - 'selected' => $current_user->ID - ) + $args = array( + 'name' => 'propel_post_author', + 'show_option_none' => 'Unassigned', + 'orderby' => 'display_name', + 'selected' => $current_user->ID ); + wp_dropdown_users( $args ); ?> - +
+ +
\ No newline at end of file diff --git a/metaboxes/edit-task.php b/metaboxes/edit-task.php new file mode 100644 index 0000000..f2cc197 --- /dev/null +++ b/metaboxes/edit-task.php @@ -0,0 +1,97 @@ + + 'propel_project', 'numberposts' => -1 ) ); + if( count( $projects ) > 0 ) : + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Project + "; + foreach($projects as $project) : + if($project->ID == $parent) { + echo ''; + } else { + echo ''; + } + endforeach; + ?> +

Start Date

End Date

Priority

+ +

Type

+ +

Progress

+ +

Manager

+ 'propel_post_author', + 'show_option_none' => 'Unassigned', + 'orderby' => 'display_name', + 'name' => 'propel_post_author', + 'selected' => $post->post_author + ); + wp_dropdown_users( $args ); + ?> +
\ No newline at end of file diff --git a/metaboxes/task-meta.php b/metaboxes/task-meta.php index 1d8ebbc..35b7111 100644 --- a/metaboxes/task-meta.php +++ b/metaboxes/task-meta.php @@ -1,7 +1,7 @@ 'propel_project', 'numberposts' => -1 ) ); - if( count( $projects ) > 0 ) : + if( count( $projects ) > 0 ) : ?> @@ -81,12 +81,15 @@ diff --git a/plugins/users.php b/plugins/users.php index 6202229..3074529 100644 --- a/plugins/users.php +++ b/plugins/users.php @@ -228,7 +228,7 @@ public static function comment_post( $comment_ID ) { $post = get_post( $comment->comment_post_ID ); $parent = get_post( $post->post_parent ); - $domain_name = $_SERVER['SERVER_NAME']; + $domain = preg_replace('/^www\./','',$_SERVER['HTTP_HOST']); if( $post->post_type == "propel_task" ) { $headers = "From: $comment->comment_author " . "\r\n"; @@ -531,18 +531,21 @@ public static function notify_coauthors( $to, $post_id ) { if( Propel_Options::get_option('email_notifications') ) { $post = get_post( $post_id ); $parent = get_post( $post->post_parent ); - $headers = "From: $current_user->ID " . "\r\n"; + $domain = preg_replace('/^www\./','',$_SERVER['HTTP_HOST']); + $current_user = wp_get_current_user(); + + $headers = "From: $current_user->display_name " . "\r\n"; $subject = "New Task Assigned ($parent->post_title): $post->post_title"; + $message .= " +
+

$current_user->display_name assigned the following to you on the "$parent->post_title" project:

+

"$post->post_title"

+

Details: "$post->post_content"

+
+ "; foreach( $to as $login ) { $user = get_user_by( 'login', $login ); - $message .= " -
-

The task following task has been assigned to you on the "$parent->post_title" project:

-

"$post->post_title"

-

Details: "$post->post_title"

-
- "; add_filter('wp_mail_content_type',create_function('', 'return "text/html";')); wp_mail($user->user_email, $subject, $message, $headers); diff --git a/post-types/project.php b/post-types/project.php index 00e62ff..74f68d8 100644 --- a/post-types/project.php +++ b/post-types/project.php @@ -180,6 +180,7 @@ public static function action_complete( $post_id ) { update_post_meta( $post_id, '_propel_complete', 100 ); $tasks = get_children( "post_parent=$post_id" ); + foreach( $tasks as $task ) { $end = get_post_meta( $task->ID, '_propel_end_date', true); if( !$end && empty( $_POST['end_date'] ) ) { @@ -437,7 +438,7 @@ public static function save_post($post_id) { update_post_meta( $post_id, '_propel_end_date', $end ); update_post_meta( $post_id, '_propel_priority', (int)$_POST['priority'] ); update_post_meta( $post_id, '_propel_complete', (int)$_POST['complete'] ); - update_post_meta( $post_id, '_propel_owner', (int)$_POST['owner'] ); + update_post_meta( $post_id, '_propel_owner', (int)$_POST['propel_post_author'] ); } @@ -490,7 +491,7 @@ public static function admin_footer() { ?> description: $('textarea[name=task_description]').val(), end_date: $('input[name=task_end_date]').val(), priority: $('select[name=task_priority]').val(), - user: $('#task_author option:selected').val() + user: $('#propel_post_author option:selected').val() }; jQuery.post(ajaxurl, data, function(response) { diff --git a/post-types/task.php b/post-types/task.php index 707dadf..cd4d5d1 100644 --- a/post-types/task.php +++ b/post-types/task.php @@ -31,6 +31,7 @@ public static function init() { } public static function wp_insert_post_data( $data, $postarr ) { + if( ! isset( $postarr['propel_post_author'] ) ) return $data; $data['post_author'] = $postarr['propel_post_author']; return $data; } @@ -395,7 +396,7 @@ public static function add_meta_boxes() { add_meta_box('custom-fields', __('Custom Fields'), 'post_custom_meta_box', self::POST_TYPE, 'normal', 'low'); - add_meta_box( 'propel_task_meta', __( 'Task', 'propel' ), + add_meta_box( 'propel_task_meta', __( 'Edit Task', 'propel' ), array( __CLASS__, 'edit_task_meta'), self::POST_TYPE, 'side' ); } @@ -431,7 +432,7 @@ public static function edit_task_meta() { $type = 0; } - require_once( dirname(__FILE__) . '/../metaboxes/task-meta.php' ); + require_once( dirname(__FILE__) . '/../metaboxes/edit-task.php' ); } /** diff --git a/widgets/all-tasks.php b/widgets/all-tasks.php new file mode 100755 index 0000000..e69de29 From f713f01465b4b6de0bb3f9b48fe5a37357ad2b98 Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 22 Aug 2012 21:08:52 +0800 Subject: [PATCH 02/86] comment the jquery(.tasks-table tbody tr) transfered to project file.. --- js/functions.js | 4 +- metaboxes/add-task.php | 4 +- metaboxes/tasks.php | 93 +++++------ post-types/project.php | 345 ++++++++++++++++++++++++++++++++++++++--- 4 files changed, 380 insertions(+), 66 deletions(-) diff --git a/js/functions.js b/js/functions.js index 7ecbf4e..3217c6f 100644 --- a/js/functions.js +++ b/js/functions.js @@ -36,6 +36,7 @@ jQuery(document).ready(function($) { "aoColumns" : asdf }); + /* jQuery('.tasks-table tbody tr').click(function() { if(jQuery('#details-' + jQuery(this).attr('id')).length > 0) { jQuery('#details-' + jQuery(this).attr('id')).remove(); @@ -46,6 +47,7 @@ jQuery(document).ready(function($) { } }); + */ /* $('.tasks-table tbody tr').hover( @@ -58,7 +60,7 @@ jQuery(document).ready(function($) { } ); */ -} ); +}); function get_details(id) { var data = { diff --git a/metaboxes/add-task.php b/metaboxes/add-task.php index dcc5242..a619574 100644 --- a/metaboxes/add-task.php +++ b/metaboxes/add-task.php @@ -1,13 +1,13 @@
Project

Manager

- 'propel_post_author', + 'show_option_none' => 'Unassigned', + 'orderby' => 'display_name', 'selected' => $post->post_author ); - wp_dropdown_users( $args ); ?> + wp_dropdown_users( $args ); + ?>
diff --git a/metaboxes/tasks.php b/metaboxes/tasks.php index 300daa5..78928c9 100644 --- a/metaboxes/tasks.php +++ b/metaboxes/tasks.php @@ -13,7 +13,7 @@ - + @@ -23,71 +23,76 @@ $progress = get_post_meta( $task->ID, '_propel_complete', true ); $priority = get_post_meta( $task->ID, '_propel_priority', true ); $start = get_post_meta( $task->ID, '_propel_start_date', true ); - if( $start ) $start = date( get_option( 'date_format' ), $start ); $end = get_post_meta( $task->ID, '_propel_end_date', true ); - if( $end ) $end = date( get_option( 'date_format' ), $end); if( $task->post_author ) { $userdata = get_userdata( $task->post_author ); + $authid = $userdata->ID; $author = $userdata->display_name; } else { + $authid = '-1'; $author = "Unassigned"; - } - + } + $x = ($progress == 100) ? "" : "un"; $nonce = wp_create_nonce('propel-trash'); + + + + /* + * rob_eyouth : added by rob to show task for the current user and if user is admin + */ + //if user is admin + $current_user = wp_get_current_user(); + if ( $current_user->ID == $userdata->ID || $current_user->ID == 1) { ?> - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +
- +
- +

Progress

-

post_title); ?>

-

-

-
-

-
-

-

%

- Delete - Edit - Complete
+

post_title); ?>

+

+

+

+

+

%

+ Delete + Complete
- - + + //rob_eyouth : added this to remove the deleted data from the current task table + $("#propel-tasks tbody td.gen-delete-icon").live('click',function(){ + var $parent = $(this).parent(); + $parent.fadeOut('slow',function(){ + var _href = $(this).find('a').attr('href'); + jQuery.post(_href,function() { + $parent.remove(); + }); + + }); + return false; + }); + + //rob_eyouth : added this to remove the checked data from the current task table + // and added to the completed task table + $("#propel-tasks tbody td.gen-unchecked-icon").live('click',function(){ + var task_id = $(this).parent().attr('id'); + var $parent = $(this).parent(); + var data = { + action: 'update_task', + security: '', + postid: task_id, + end_date: '', + priority: $('#propel_edit_prior').val(), + complete: 100, + propel_post_author: $('#propel_post_author').val() + }; + + jQuery.post(ajaxurl, data, function(response) { + $('#propel_completed_tasks #propel-tasks tbody').fadeOut('slow',function(){ + $parent.fadeOut('slow',function(){ + $parent.remove(); + $('#propel_completed_tasks #propel-tasks tbody').prepend(response).fadeIn('slow'); + }) + }); + }); + + return false; + }); + + $("#propel_project_tasks #propel-tasks tbody tr.toggle").live('click',function(event){ + + var task_id = $(this).attr('id'); + + if(jQuery('#details-' + task_id).length > 0) { + + jQuery('#details-' + task_id).remove(); + + } else { + + var data = { + action: 'get_task_detail', + security: '', + postid: task_id, + }; + + jQuery.post(ajaxurl, data, function(response) { + $("#" + task_id).closest( "tr" ).after( response ); + }); + } + + return false; + }).live('mouseenter',function(){ + $(this).css({'cursor':'pointer'}); + }).live('mouseleave',function(){ + $(this).css({'cursor':'default'}); + }); + + $('#propel_task_update').live('click',function(){ + + var _task_id = $.trim($(this).closest('tr').attr('id').substr(8,5)); + var _tr_id = $(this).closest('tr').attr('id'); + var _tr_before_id = $('#'+_task_id).prev('tr').attr('id'); + + var data = { + action: 'update_task', + security: '', + parent: '', + postid: _task_id, + end_date: '', + title: $('#propel_edit_task').val(), + priority: $('#propel_edit_prior').val(), + complete: $('#propel_edit_progress').val(), + user: $('#propel_edit_author').val() + }; + + jQuery.post(ajaxurl, data, function(response) { + $('#'+_task_id).fadeOut('slow',function(){ + $(this).remove(); + $('#'+_tr_id).fadeOut('slow',function(){ + $(this).remove(); + }); + if ( parseInt($('#propel_edit_progress').val()) < 100 ) { + if ( _tr_before_id === undefined ) + $("#propel_project_tasks #propel-tasks tbody").prepend(response).fadeIn('slow'); + else + $("#" + _tr_before_id).closest( "tr" ).after( response ).fadeIn('slow'); + } else { + $('#propel_completed_tasks #propel-tasks tbody').prepend(response).fadeIn('slow'); + } + }) + }); + + return false; + }); + }) + ID, '_propel_complete', true ); + $priority = get_post_meta( $task->ID, '_propel_priority', true ); + $start = get_post_meta( $task->ID, '_propel_start_date', true ); + if( $start ) + $start = date( get_option( 'date_format' ), $start ); + + $end = get_post_meta( $task->ID, '_propel_end_date', true ); + if( $end ) + $end = date( get_option( 'date_format' ), $end); + + if( $task->post_author ) { + $userdata = get_userdata( $task->post_author ); + $authid = $userdata->ID; + $author = $userdata->display_name; + } else { + $authid = '-1'; + $author = "Unassigned"; + } + + $x = ($progress == 100) ? "" : "un"; + $nonce = wp_create_nonce('propel-trash'); + + ?> + + +

post_title); ?>

+ + +

+ + +

+ + + +

+ + + + +

+ + + +

%

+ + + + + Delete + + + Complete + + + (int)$post_id, + 'post_title' => $_POST['title'], + 'post_parent' => $_POST['parent'], + 'post_type' => 'propel_task', + 'post_status' => 'publish' + ); + wp_update_post( $post ); + } + + $start = !empty( $_POST['start_date'] ) ? strtotime( $_POST['start_date'] ) : time(); + + update_post_meta( $post_id, '_propel_start_date', $start ); + + $end = strtotime($_POST['end_date']); + if( empty( $_POST['end_date'] ) && $_POST['complete'] == 100 ) { + $end = time(); + } + + update_post_meta( $post_id, '_propel_end_date', $end ); + + if ( isset( $_POST['priority'] ) ) + update_post_meta( $post_id, '_propel_priority', (int)$_POST['priority'] ); + + if ( isset( $_POST['complete'] ) ) + update_post_meta( $post_id, '_propel_complete', (int)$_POST['complete'] ); + + if ( isset( $_POST['user'] ) ) + update_post_meta( $post_id, '_propel_owner', (int)$_POST['user'] ); + + do_action('project_get_task',$post_id); + + die($post_id); + } + + /** + * @since 2.0 + * rob: added this function.. + */ + public static function wp_ajax_get_task_detail() { + $id = $_POST["postid"]; + $task = get_post($id); + $nonce = wp_create_nonce('propel-trash'); + if( $task->post_author ) { + $userdata = get_userdata( $task->post_author ); + $authid = $userdata->ID; + $author = $userdata->display_name; + } else { + $authid = '-1'; + $author = "Unassigned"; + } + ?> + + +

+ + +

+ + +

+ + + +

+ 'propel_edit_author', + 'show_option_none' => 'Unassigned', + 'orderby' => 'display_name', + 'name' => 'propel_edit_author', + 'selected' => $project->post_author + ); + wp_dropdown_users( $args ); + ?> +

+ + + +

+ +

+ + + + + + + \ No newline at end of file From 5abb98b0b30b0aa7f7bb5a344c3b8a18b6addaff Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 23 Aug 2012 11:23:21 +0800 Subject: [PATCH 03/86] Added hierarchy for the task panel.. --- metaboxes/tasks.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/metaboxes/tasks.php b/metaboxes/tasks.php index 78928c9..19b9451 100644 --- a/metaboxes/tasks.php +++ b/metaboxes/tasks.php @@ -16,6 +16,16 @@ + + +

+ post_parent); + $parent_obj = get_post($parent); + esc_html_e($parent_obj->post_title); + ?> +

+ -

post_title); ?>

+

+ post_title); ?> +

+

Date: Wed, 22 Aug 2012 22:45:09 -0700 Subject: [PATCH 04/86] functions.php: 1.) add ajax scripts for preference options 2.) add php scripts that checks selected preference option. 3.) add metabox for past due 4.) add metabox for due today and tomorrow USERS.PHP 1.) Notify contributors if Task was reassigned 2.) Notify contributors if task was completed. 3.) Disable Self Notifications Added ajax-admin.php and ajax-personal.php --- ajax-admin.php | 15 + ajax-personal.php | 15 + changelog.txt | 53 ++ deprecated.php | 98 +++ functions.php | 624 ++++++++++++++ gen/images/checked.png | Bin 0 -> 243 bytes gen/images/delete.png | Bin 0 -> 150 bytes gen/images/edit.png | Bin 0 -> 167 bytes gen/images/info.png | Bin 0 -> 166 bytes gen/images/unchecked.png | Bin 0 -> 194 bytes gen/ui.css | 115 +++ images/alert.png | Bin 0 -> 1556 bytes images/details_close.png | Bin 0 -> 841 bytes images/details_open.png | Bin 0 -> 881 bytes images/icon.png | Bin 0 -> 3580 bytes images/later.png | Bin 0 -> 2954 bytes images/notice.png | Bin 0 -> 1458 bytes images/overdue.png | Bin 0 -> 2955 bytes images/sprite.png | Bin 0 -> 558 bytes images/today.png | Bin 0 -> 2967 bytes js/functions.js | 75 ++ js/jquery.dataTables.min.js | 143 ++++ js/jquery.ui.datepicker.min.js | 82 ++ js/jquery.ui.progressbar.min.js | 16 + js/jquery.ui.widget.min.js | 15 + meta.php | 24 + metaboxes/add-task.php | 57 ++ metaboxes/edit-task.php | 97 +++ metaboxes/list-authors.php | 53 ++ metaboxes/project-meta.php | 69 ++ metaboxes/task-meta.php | 96 +++ metaboxes/tasks.php | 97 +++ metaboxes/time-entity-select.php | 3 + migrate.php | 177 ++++ plugins/users.php | 774 ++++++++++++++++++ post-types/project.php | 507 ++++++++++++ post-types/task.php | 452 ++++++++++ post-types/time.php | 279 +++++++ propel.php | 278 +++++++ readme.txt | 37 + style.css | 50 ++ test.php | 91 ++ .../images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_75_ffffff_40x100.png | Bin 0 -> 178 bytes .../images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 0 -> 120 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 105 bytes .../images/ui-bg_glass_75_dadada_1x400.png | Bin 0 -> 111 bytes .../images/ui-bg_glass_75_e6e6e6_1x400.png | Bin 0 -> 110 bytes .../images/ui-bg_glass_95_fef1ec_1x400.png | Bin 0 -> 119 bytes .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin 0 -> 101 bytes .../images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_2e83ff_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_454545_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_888888_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_cd0a0a_256x240.png | Bin 0 -> 4369 bytes themes/smoothness/jquery-ui-1.8.6.custom.css | 572 +++++++++++++ uninstall.php | 22 + widgets/all-tasks.php | 0 58 files changed, 4986 insertions(+) create mode 100755 ajax-admin.php create mode 100755 ajax-personal.php create mode 100755 changelog.txt create mode 100755 deprecated.php create mode 100755 functions.php create mode 100755 gen/images/checked.png create mode 100755 gen/images/delete.png create mode 100755 gen/images/edit.png create mode 100755 gen/images/info.png create mode 100755 gen/images/unchecked.png create mode 100755 gen/ui.css create mode 100755 images/alert.png create mode 100755 images/details_close.png create mode 100755 images/details_open.png create mode 100755 images/icon.png create mode 100755 images/later.png create mode 100755 images/notice.png create mode 100755 images/overdue.png create mode 100755 images/sprite.png create mode 100755 images/today.png create mode 100755 js/functions.js create mode 100755 js/jquery.dataTables.min.js create mode 100755 js/jquery.ui.datepicker.min.js create mode 100755 js/jquery.ui.progressbar.min.js create mode 100755 js/jquery.ui.widget.min.js create mode 100755 meta.php create mode 100755 metaboxes/add-task.php create mode 100755 metaboxes/edit-task.php create mode 100755 metaboxes/list-authors.php create mode 100755 metaboxes/project-meta.php create mode 100755 metaboxes/task-meta.php create mode 100755 metaboxes/tasks.php create mode 100755 metaboxes/time-entity-select.php create mode 100755 migrate.php create mode 100755 plugins/users.php create mode 100755 post-types/project.php create mode 100755 post-types/task.php create mode 100755 post-types/time.php create mode 100755 propel.php create mode 100755 readme.txt create mode 100755 style.css create mode 100755 test.php create mode 100755 themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png create mode 100755 themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png create mode 100755 themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png create mode 100755 themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png create mode 100755 themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png create mode 100755 themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png create mode 100755 themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png create mode 100755 themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png create mode 100755 themes/smoothness/images/ui-icons_222222_256x240.png create mode 100755 themes/smoothness/images/ui-icons_2e83ff_256x240.png create mode 100755 themes/smoothness/images/ui-icons_454545_256x240.png create mode 100755 themes/smoothness/images/ui-icons_888888_256x240.png create mode 100755 themes/smoothness/images/ui-icons_cd0a0a_256x240.png create mode 100755 themes/smoothness/jquery-ui-1.8.6.custom.css create mode 100755 uninstall.php create mode 100755 widgets/all-tasks.php diff --git a/ajax-admin.php b/ajax-admin.php new file mode 100755 index 0000000..2d0ea24 --- /dev/null +++ b/ajax-admin.php @@ -0,0 +1,15 @@ +ID; + $id = $part1 . $part2; + $static_id = (int)($id); + update_post_meta( $static_id, '_propel_preference',"admin"); + +?> \ No newline at end of file diff --git a/ajax-personal.php b/ajax-personal.php new file mode 100755 index 0000000..52a5761 --- /dev/null +++ b/ajax-personal.php @@ -0,0 +1,15 @@ +ID; + $id = $part1 . $part2; + $static_id = (int)($id); + update_post_meta( $static_id, '_propel_preference',"personal"); + +?> \ No newline at end of file diff --git a/changelog.txt b/changelog.txt new file mode 100755 index 0000000..916726d --- /dev/null +++ b/changelog.txt @@ -0,0 +1,53 @@ +== Changelog == + += 1.0 = +* Added ability to create projects +* Added ability to create tasks + += 1.1 = +* Added short tag [project] + += 1.2 = +* Added "Quick-tasks" dashboard widget +* Added "Tasks At-a-Glance" dashboard widget +* Added uninstall option +* Added [pl-project] short code +* Added [pl-bug-report] short code +* Included jQuery library +* jQuery widget UI +* Created [pl-project] interface +* Deprecated [project] short code + += 1.5 = +* Added jQuery UI Themes + += 1.5.6 = +* User authorization +* Fixed character escaping issue + += 1.5.7 = +* Dashboard widget +* Fixed JavaScript include issues + += 2.0 = +* Use custom post type UI +* Change database to use individual meta keys rather than a serialized array +* Changed priority to use high, medium, and low rather than 1-10 +* Changed progress intervals from 1 to 5 +* Removed shortcode for frontend display +* Added ability to categorize tasks +* Added ability to assign terms to tasks +* Added ability to assign clients to projects +* Added ability to turn on/off certain UI options +* Created a "type" taxonomy for tasks + += 2.0.1 = +* Fixed bug with activation hook + += 2.0.2 = +* Replaced PHP 5.3 specific code with 5.2 equivalent + += 2.0.3 = +* Updated changelog format +* Added "Project Overview" dashboard widget +* Readded shortcode for frontend display \ No newline at end of file diff --git a/deprecated.php b/deprecated.php new file mode 100755 index 0000000..7dfdc12 --- /dev/null +++ b/deprecated.php @@ -0,0 +1,98 @@ + NULL ), $atts ) ); + + if( $id == NULL ) { + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish' + ); + $projects = get_posts( $args ); + } else { + $projects = array(); + $projects[] = get_post( $id ); + } + + ob_start(); + ?> +

+ + + -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID + ); + $tasks = get_posts( $argv ); + ?> + + +
+ + ID, '_propel_complete', true ); + $priority = get_post_meta( $task->ID, '_propel_priority', true ); + $end = get_post_meta( $task->ID, '_propel_end_date', true ); + $due = ''; + if( ! empty( $end ) ) { + $due = "Due: " . date( 'Y-m-d', $end ); + } + ?> + + + + + + + + + + + + + + + + + + +

post_title; ?>

+
+

%

 

post_content; ?>

 

Priority:      

+
+ +
+ + + (default: ' . WP_PLUGIN_URL . '/propel/themes/smoothness/jquery-ui-1.8.6.custom.css)

'; + echo '
'; +} +?> \ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100755 index 0000000..bb93569 --- /dev/null +++ b/functions.php @@ -0,0 +1,624 @@ + + +remove_menu('updates'); +$customerSupportURL = $current_url; +$wp_admin_bar->add_menu( array( + 'parent' => false, + 'id' => 'customer_support', + 'title' => __('Preference') +)); + +$contactUsURL = $current_url; +$wp_admin_bar->add_menu(array( + 'parent' => 'customer_support', + 'id' => 'adminpref', + 'title' => __('Admin'), + 'href' => $contactUsURL, + 'meta' => array( 'onclick' => 'ajax_update("admin")' ) + )); + + $contactUsURL = $current_url; + $wp_admin_bar->add_menu(array( + 'parent' => 'customer_support', + 'id' => 'personalpref', + 'title' => __('Personal'), + 'href' => $contactUsURL, + 'meta' => array( 'onclick' => 'ajax_update("personal")' ) + )); +} + +add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' ); + +/* TASKS FOR SIGNED IN USERS ONLY aps2012 */ +function get_authored_posts($query) { + global $user_ID; + $u = get_userdata($user_ID); + $queried_post_type = get_query_var('post_type'); + $part1 = "889999999999"; + $current_user = wp_get_current_user(); + $part2 = $current_user->ID; + $id = $part1 . $part2; + $static_id = (int)($id); + $profile = get_post_meta( $static_id, '_propel_preference',true); + if(empty($profile)){ + $profile = "personal"; + } + if (('propel_task' == $queried_post_type ) && ($profile == 'personal' )) { + $taxquery = array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ); + $query->set('tax_query', $taxquery); + } + if (('propel_project' == $queried_post_type ) && ($profile == 'personal' )) { + $taxquery = array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ); + $query->set('tax_query', $taxquery); + } + return $query; +} +add_filter('pre_get_posts', 'get_authored_posts'); + + +/* CURRENT PROJECTS */ +function dashboard_client_current_projects_metabox() { + + function dashboard_client_current_projects_content() { + echo " + + "; + } + + wp_add_dashboard_widget( 'dashboard_client_current_projects_content', __( 'Current Projects' ), 'dashboard_client_current_projects_content' ); + +} + +add_action('wp_dashboard_setup', 'dashboard_client_current_projects_metabox'); + + +/* COMPLETED PROJECTS */ +function dashboard_client_completed_projects_metabox() { + + function dashboard_client_completed_projects_content() { + echo " + + "; + } + + wp_add_dashboard_widget( 'dashboard_client_completed_projects_content', __( 'Completed Projects' ), 'dashboard_client_completed_projects_content' ); +} + +add_action('wp_dashboard_setup', 'dashboard_client_completed_projects_metabox'); + + +/* ARCHIVED PROJECTS */ +function dashboard_client_archived_projects_metabox() { + + function dashboard_client_archived_projects_content() { + echo " + + "; + } + + wp_add_dashboard_widget( 'dashboard_client_archived_projects_content', __( 'Archived Projects' ), 'dashboard_client_archived_projects_content' ); +} + +add_action('wp_dashboard_setup', 'dashboard_client_archived_projects_metabox'); + + +/* GANTT CHART */ +function dashboard_client_gantt_chart_metabox() { + + function dashboard_client_gantt_chart_content() { + echo " + Gannt Chart + "; + } + + wp_add_dashboard_widget( 'dashboard_client_gantt_chart_content', __( 'Timeline' ), 'dashboard_client_gantt_chart_content' ); + +} +add_action('wp_dashboard_setup', 'dashboard_client_gantt_chart_metabox'); + + +/* SUPPORT REQUESTS */ +function dashboard_client_support_requests_metabox() { + + function dashboard_client_support_requests_content() { + echo " +

If you have an inquiry or support request use the form below to have it added to the queue so it can be addressed promptly.

+ "; + } + + wp_add_dashboard_widget( 'dashboard_client_support_requests_content', __( 'Support Requests' ), 'dashboard_client_support_requests_content' ); + +} + +add_action('wp_dashboard_setup', 'dashboard_client_support_requests_metabox'); + +function dashboard_widget_function() { + global $user_ID; + $u = get_userdata($user_ID); + $part1 = "889999999999"; + $current_user = wp_get_current_user(); + $part2 = $current_user->ID; + $id = $part1 . $part2; + $static_id = (int)($id); + $profile = get_post_meta( $static_id, '_propel_preference',true); + if(empty($profile)){ + $profile = "personal"; + } + if($profile == "personal"){ + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish', + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) ); + } else { + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish' + ); + } + $projects = get_posts( $args ); + echo ""; + foreach( $projects as $project ) { + echo ''; + + if($profile == "personal"){ + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID, + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) + ); + } else { + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID + ); + } + $tasks = get_posts( $argv ); + + + foreach( $tasks as $task ) { + $progress = get_post_meta( $task->ID, '_propel_complete', true ); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + } + echo "
' . $project->post_title . '
" . $task->post_title . "
" . $progress . "%
"; +?> + +ID; + $id = $part1 . $part2; + $static_id = (int)($id); + $profile = get_post_meta( $static_id, '_propel_preference',true); + if(empty($profile)){ + $profile = "personal"; + } + if($profile == "personal"){ + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish', + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) ); + } else { + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish' + ); + } + $projects = get_posts( $args ); + echo ""; + foreach( $projects as $project ) { + if($profile == "personal"){ + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID, + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) + ); + } else { + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID + ); + } + $tasks = get_posts( $argv ); + foreach( $tasks as $task ) { + $progress = get_post_meta( $task->ID, '_propel_complete', true ); + $date = get_post_meta( $task->ID, '_propel_end_date', true ); + if($date) { + + //echo date( get_option( 'date_format' ) , $date ); // Project's actual due date. + + $day = date('d'); // Day of the countdown + $month = date('m'); // Month of the countdown + $year = date('Y'); // Year of the countdown + $hour = date('H'); // Hour of the day (east coast time) + + $calculation = ( $date - time() ) / 3600; + $hours = (int)$calculation + 24; + $days = (int)( $hours / 24 ) - 1; + + $hours_remaining = $hours-($days*24)-24; + + if ( $hours < 0 && $hours > -24 ) { + + echo ""; + echo ""; + echo " "; + echo ""; + } + + if ( $hours < -24 ) { + echo ""; + echo ""; + echo " "; + echo ""; + } + + } + } + } + echo "
" . $task->post_title . "" . str_replace( '-', '', $hours) + . " hours past due.
" . $task->post_title . "" + . str_replace( '-', '', $days) . " days past due.
"; +} + +function Past_Due_Hook() { + wp_add_dashboard_widget('pastdue_dashboard_widget', 'Past Due Tasks', 'Past_Due_Function'); +} +add_action('wp_dashboard_setup', 'Past_Due_Hook' ); + +/*---------------------- + +------------------------*/ +function Due_Today_Tomorrow_Function() { + global $user_ID; + $u = get_userdata($user_ID); + $part1 = "889999999999"; + $current_user = wp_get_current_user(); + $part2 = $current_user->ID; + $id = $part1 . $part2; + $static_id = (int)($id); + $profile = get_post_meta( $static_id, '_propel_preference',true); + if(empty($profile)){ + $profile = "personal"; + } + if($profile == "personal"){ + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish', + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) ); + } else { + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish' + ); + } + $projects = get_posts( $args ); + echo ""; + foreach( $projects as $project ) { + echo ''; + + if($profile == "personal"){ + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID, + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) + ); + } else { + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID + ); + } + $tasks = get_posts( $argv ); + foreach( $tasks as $task ) { + $progress = get_post_meta( $task->ID, '_propel_complete', true ); + $date = get_post_meta( $task->ID, '_propel_end_date', true ); + if($date) { + + //echo date( get_option( 'date_format' ) , $date ); // Project's actual due date. + + $day = date('d'); // Day of the countdown + $month = date('m'); // Month of the countdown + $year = date('Y'); // Year of the countdown + $hour = date('H'); // Hour of the day (east coast time) + + $calculation = ( $date - time() ) / 3600; + $hours = (int)$calculation + 24; + $days = (int)( $hours / 24 ) - 1; + + $hours_remaining = $hours-($days*24)-24; + + if ( $hours <= 48 && $hours >= 24 ) { + + echo ""; + echo ""; + echo " "; + echo ""; + } + + if ( $hours <= 24 && $hours >= 0 ) { + echo ""; + echo ""; + echo " "; + echo ""; + } + + } + } + } + echo "
' . $project->post_title . '
" . $task->post_title . "Due tomorrow.
" . $task->post_title . "Due today.
"; +} + +function Due_Today_Tomorrow_Hook() { + wp_add_dashboard_widget('duetodaytomorrow_dashboard_widget', 'Due Today And Tomorrow Tasks', 'Due_Today_Tomorrow_Function'); +} +add_action('wp_dashboard_setup', 'Due_Today_Tomorrow_Hook' ); + +class Propel_Functions { + + var $args = array(); + var $post_type; + var $post; + var $action; + var $status; + var $cb; + + public static function register_post_status( $status, $args ) { + register_post_status( $status ); + $functions = new Propel_Functions(); + $functions->status = $status; + $functions->args = $args; + add_filter( 'parse_query', array( $functions, 'parse_query' ) ); + add_action( 'admin_footer', array( $functions, 'admin_footer' ) ); + } + + /** + * $args['post_type'] + * $args['action'] + */ + public static function add_post_action( $args, $cb ) { + if( isset($_GET['post_type']) && $_GET['post_type'] != $args['post_type']) return; + + $functions = new Propel_Functions(); + $functions->args = $args; + $functions->args['cb'] = $cb; + + add_action( 'admin_footer', array( $functions, 'admin_footer_action' ) ); + add_filter( 'post_row_actions', array( $functions, 'post_row_actions' ) ); + add_action( 'admin_action_' . $args['action'], array( $functions, 'do_action' ) ); + } + + /** + * @todo verify that the current user can perform said action + */ + public function do_action() { + + if( is_array( $_REQUEST['post'] ) ) { + foreach( $_REQUEST['post'] as $post => $post_id) { + call_user_func($this->args['cb'], $post_id); + } + } else { + call_user_func($this->args['cb'], $_GET['post']); + } + + wp_redirect( $_SERVER['HTTP_REFERER'] ); + die(); + } + + public function post_row_actions( $actions ) { + if( !isset($_GET['post_type']) || $_GET['post_type'] != $this->args['post_type']) return $actions; + $actions[$this->args['action']] = "" . $this->args['label'] . ""; + return $actions; + } + + public function admin_footer_action() { + if( !isset($_GET['post_type']) || $_GET['post_type'] != $this->args['post_type']) return; + ?> + + args['post_type'] ) + return $query; + + if( isset($_GET['post_status'] ) && $_GET['post_status'] == $this->status ) { + $query->query_vars['post_type'] = $this->args['post_type']; + $query->query_vars['post_status'] = $this->status; + } + } + + /** + * JavaScript hacks to add custom bulk action and custom post status + * @since 2.0 + */ + public function admin_footer() { + global $wpdb; + + if(isset($_GET['post'])) : + $post = get_post($_GET['post']); + if( $post->post_type == $this->args['post_type']) : + ?> + + args['post_type']) return; + $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = '".$this->args['post_type']."' && post_status = '$this->status';" ) ); + ?> + + \ No newline at end of file diff --git a/gen/images/checked.png b/gen/images/checked.png new file mode 100755 index 0000000000000000000000000000000000000000..8ca5395d729e99774a5765f2151859f38ffaef10 GIT binary patch literal 243 zcmVbP0l+XkKw!<{Z literal 0 HcmV?d00001 diff --git a/gen/images/edit.png b/gen/images/edit.png new file mode 100755 index 0000000000000000000000000000000000000000..957ff737d14d18dbb245b77f9c19b7bc69da79ff GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`d7dtgAr-f_P7dTdpupk$^vQvf z+dnjBN=?#T@Yl&%euYN1#!fba&Fo1(Sv`U!l)|n)eODcOkmYP9hwGd}ds(J2m~9dY zVcNj$)Ugvf^S3jHI+?K^$Qn^YbJFHhFs)+ Q1hkpK)78&qol`;+0J<$ZtpET3 literal 0 HcmV?d00001 diff --git a/gen/images/info.png b/gen/images/info.png new file mode 100755 index 0000000000000000000000000000000000000000..733ab319f008ae37a01776e808a39f725bbc0a7f GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`xt=bLAr-goP7dTdpupk$_GIJa ze8ZWXeN2(l{+`iq{t_r+cp~Vka_3_?X5lW5%lyXN3KfNFDGOK~RpUfAZ|1DzuSlBf zcp>z?-qwLcx>{t!7 On8DN4&t;ucLK6Vu{y6FY literal 0 HcmV?d00001 diff --git a/gen/images/unchecked.png b/gen/images/unchecked.png new file mode 100755 index 0000000000000000000000000000000000000000..11765214ba8bb1ffe932876f7aa5949c6f053feb GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`ot`d^Ar-flp1I4$swmO=@a|o; zNs7u7y;PJZd6e(2zoGuvI&yL8hI9AY_nIBA6L+ex=iSe{oAF+?MW12N0ZVpfO;xUl z>_mmM2Re$u)78&qol`;+00jp`bN~PV literal 0 HcmV?d00001 diff --git a/gen/ui.css b/gen/ui.css new file mode 100755 index 0000000..f898c45 --- /dev/null +++ b/gen/ui.css @@ -0,0 +1,115 @@ +.gen-table { + background-color: #F9F9F9; + border-color: #DFDFDF; + border-radius: 3px; + border-spacing: 0; + border-style: solid; + border-width: 1px; + text-align: left; +} + +.gen-table thead tr { + background-color: #F1F1F1; +} + +.gen-table .gen-hidden { + display: none; +} +/* +.gen-table tbody:hover { + background-color: #F1F1F1; + cursor: pointer; +} +*/ + +.gen-table td { + border-top: 1px solid #DFDFDF; + padding-left: 10px; +} + +.gen-icon { + width: 24px; + text-align: center; +} + +.gen-icon a:hover { + opacity: 1; +} + +.gen-icon a { + text-align: center; + height: 16px; + margin-top: 1px; + opacity: 0.5; + text-indent: -9999px; + width: 16px; + display: block; + background-position: center; +} + +.gen-delete-icon a { + background: url('images/delete.png') no-repeat; +} + +.gen-edit-icon a { + background: url('images/edit.png') no-repeat; +} + +.gen-unchecked-icon a { + background: url('images/unchecked.png') no-repeat; +} + +.gen-checked-icon a { + background: url('images/checked.png') no-repeat; +} + +.gen-table th.sortable { + color: #000; + cursor: pointer; + text-decoration: underline; + padding-left: 10px; +} + + +.dataTables_length { + width: 40%; + float: left; + margin: 5px; +} + +.dataTables_filter { + width:30%; + float: right; + text-align: right; + margin: 5px; +} + +.dataTables_info { + width:40%; + float: left; + margin: 5px; + margin-top: 15px; +} + +.dataTables_paginate { + float: right; + text-align: right; + margin: 5px; + margin-top: 15px; +} + +.paginate_active, .paginate_button { + margin: 2px; + border: 1px solid lightGrey; + font-weight: normal; + color: #555; + padding: 4px; + cursor: pointer; + background: #E6E6E6; +} + +.paginate_active { + font-weight: bold; + border: 1px solid darkGrey; + +} \ No newline at end of file diff --git a/images/alert.png b/images/alert.png new file mode 100755 index 0000000000000000000000000000000000000000..4e5b1a8db0d3de3be34b381ba53919cd2186d9d6 GIT binary patch literal 1556 zcmcIkT}T{P6dr3JRtZfDHqr{6P9K_x=ljmN-#wfYb+vo80)6)F~JognqR z^WPr%6B`T7ss^)CM}jG<3K@~(i15&?hi1y2KCt&4g4pt;?a&a~$BAm(DM)G)a$0eX z;L9yd5M#(Bn^06%d=yEN6e&wS>djptCZtuO7P+QVN8!%eh}anuy%JUK&*v=;gX72) zNGsl^7@Xy!(wrPV+h&>~(=KMrM^)It$c9iIS*hxX^f+A(k#T!SPl=N)Wxb^(uaIHE zB=-sm$(E8V!{CMGTrSSz!pWou<QUO| z^?GTBrCHX2Jsid%#S|=uV!V(cdB_t$hN#P0S}vPcXi_^&A4S=LvSamef|d=W7^~u8 z8EH$trbq1L z{|F|DS-rFly)FGMl1QUA6i13_V9i_`HIqcHS=Hl$>6ha|6w#Uz<>@u!f999T8kYqw zOFCPZ4^z*6<)$3gbl(*E4C!VDS^0RT5qFPbyE%l_W-}q^i1?R^9a*fl+vmk#pdwN< zj0Ot|lCN&>-Sc_kjVW&77Vmza|K;*u(0z5;@qA0;>9N6gmyX_<|9YNJK6}-7=hqi= zx^hB0mIE&p-VPG8sr{cs_7ANbFP{73^)1Eyk6m7<{_0chG*R|N>%>6u2jcjbt;$%B zXSnO<;}xkBTSs?%_(1>ZR?&|=i{I4$cC@cc{`>p)uEeHF7v~=={P6OTqL$mbx;*vV fM`8*lr#o|t+6#a0-)fcPbctY9ZQ!%rjmdui6TSI~ literal 0 HcmV?d00001 diff --git a/images/details_close.png b/images/details_close.png new file mode 100755 index 0000000000000000000000000000000000000000..fcc23c63e22f9883bef72c9e3adae3d5ddfb35cc GIT binary patch literal 841 zcmV-P1GfB$P)DA_on|3pY;aiIaw_AzX~% z0wEzG!5U~A62!y<6#_3!Y0@BA($@0c+jVBUFF+~kfo;CbzTKH`cV=g%b|^n=hzi67 zM5UV3FcF6cUCnu^p}pjrsWm6Ug}98UR-~ZFvWN`g0Fg%+2vP1rl3*$mmwr5rOIH=?}WDABr;u?U4@YDw`9eOu1C&^?L7Z zY;1fZBc9KT-2A-Q9Uc}tJv}1T-7R)sycF4)8NstzNldzAgSOWc2V?31C|17Z<>j$J zAke}0_aQSe0l9^R;<1c^#DEC_0!d$>Do3Jo15TlYl9m;-_3M7y&8+fGbP>p=udnZ^^3rY*Ry8&@-XZS}=H{ef zDUJ>}0_oCdYHA|eDvG0BC2ghK?XIQGd^|3d(Ko2a8%4c^+ z2RQuxqA|Bf6p=-Yhg81x*8ObQBJv5%iB0 zU9{XrXRDi=!8bAj&V~kvL?Uy+VDJ@gXo|Fa=^duiBKhvUSnKK%G5>85_4~!w&Q6gS z9~Xt4ozl{)vr6y0nuGJKj&rJgrBbPcMMU#|wJ-Lc4fdkiFZ`>)vh)56_#?mow%h=n ThIkt{00000NkvXXu0mjfW_^Rc literal 0 HcmV?d00001 diff --git a/images/details_open.png b/images/details_open.png new file mode 100755 index 0000000000000000000000000000000000000000..6f034d0f2d5c7902dce190355b12defdc07d6c9a GIT binary patch literal 881 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 CysT;f literal 0 HcmV?d00001 diff --git a/images/later.png b/images/later.png new file mode 100755 index 0000000000000000000000000000000000000000..903db3c39839b2975f1f7db3af20259bd7853d78 GIT binary patch literal 2954 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 literal 0 HcmV?d00001 diff --git a/images/notice.png b/images/notice.png new file mode 100755 index 0000000000000000000000000000000000000000..31ace010fa85a512810e031e8bb760a77957dab4 GIT binary patch literal 1458 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJbFq_W2nPqp?T7vkfZT)tpAgso zK=Ak5|L;$p{`vpx-;-aTUtIt8|HjW#|6lF<|9H)TSO3qxU$+0<%xzEq|G(C@^;PTt z%k_)z{9kbE|LfCp7Cwxfdq3>;*0`qQDfK7)@2-r?+WG&^lE9QLPp(b3P1@>VHtYY4 z!1H^7c5xPXL>4nJa0`JjL3Q7u@DYi=C zroINg18?t&$_iGKC1=00rm#qErPFJwx4O17i~f6Ei&{b0bT0GaZHC#1aLs#5@Hf za|I&<10Z2!WoT$+VhD5$7%16s0co3}lr*a#7dNP#K%T8qMoCG5mA-y?dAVM>v0i>r zy1t>MrKP@sk-m|UE>MMTab;dfVufyAu`oQUnVXoDUs__Tqy(}E z4xpY(EPz{-R}2k2U@+=eBo^o!>KW+6O$KVT0Sa1yBO<>jBtJjL4&r^c%%art{G#k) z1?OO68<0*EMF?9F`cqvJOH%EC;bEa`V4`be5@KLrWolq$Y#4>4AEF3NyKjCiCt!HVtT56L0-CzK0*+$`yj3cCJSJ))Q6`_nA71=NfQPl z+-YJw#86sV@^Hby1YqeQ11cPX^V3So6N^$Au%y@-*W5sbU$du+V~E7m&|XKeW(6MB z;Du2fBEGKC-B12)*Liqy^SM{)V!{qb_BQZpeE(kh|IPnHCEMRA&3l%pmn3;SHGiqn zrZX{K3aSU*m}H1Ya~AP5%Q@vNReJW|kW9bOpQ^^AM4*0u*(L{|a~M2b{an^LB{Ts5O*goi literal 0 HcmV?d00001 diff --git a/images/overdue.png b/images/overdue.png new file mode 100755 index 0000000000000000000000000000000000000000..5380aef2880c4c326e97c0fda4898e319417061d GIT binary patch literal 2955 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 Be!2hv literal 0 HcmV?d00001 diff --git a/images/sprite.png b/images/sprite.png new file mode 100755 index 0000000000000000000000000000000000000000..de7fe29f786e9a37c9395db60233e5c6eef74ef6 GIT binary patch literal 558 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 N002ovPDHLkV1fl9e53#X literal 0 HcmV?d00001 diff --git a/js/functions.js b/js/functions.js new file mode 100755 index 0000000..7ecbf4e --- /dev/null +++ b/js/functions.js @@ -0,0 +1,75 @@ +jQuery(document).ready(function($) { + + jQuery.fn.dataTableExt.oSort['percent-asc'] = function(a,b) { + var x = (a == "-") ? 0 : a.replace( /%/, "" ); + var y = (b == "-") ? 0 : b.replace( /%/, "" ); + x = parseFloat( x ); + y = parseFloat( y ); + return ((x < y) ? -1 : ((x > y) ? 1 : 0)); + }; + + jQuery.fn.dataTableExt.oSort['percent-desc'] = function(a,b) { + var x = (a == "-") ? 0 : a.replace( /%/, "" ); + var y = (b == "-") ? 0 : b.replace( /%/, "" ); + x = parseFloat( x ); + y = parseFloat( y ); + return ((x < y) ? 1 : ((x > y) ? -1 : 0)); + }; + + cols = jQuery(".tasks-table:first th").size() + var asdf = [] + for(i = 0; i < cols; i++) { + asdf.push(null) + } + + var oTable = jQuery('.tasks-table').dataTable( + { + "bStateSave": true, + //"sPaginationType": "full_numbers", + "bFilter": false, + "bPaginate": false, + "bInfo": false, + "aoColumnDefs": [ + { "bSortable": false, "aTargets": [ 0 ] } + ], + "aaSorting": [[1, 'asc']], + "aoColumns" : asdf + }); + + jQuery('.tasks-table tbody tr').click(function() { + if(jQuery('#details-' + jQuery(this).attr('id')).length > 0) { + jQuery('#details-' + jQuery(this).attr('id')).remove(); + } else { + id = jQuery(this).attr('id'); + jQuery(this).after('

 

'); + get_details(id); + + } + }); + + /* + $('.tasks-table tbody tr').hover( + function() { + console.log($(this).children(':first')); + $(this).children(':first').toggleClass('toggle-arrow'); + }, + function() { + $(this).children(':first').toggleClass('toggle-arrow'); + } + ); + */ +} ); + +function get_details(id) { + var data = { + action: 'get_task_description', + id: id + }; + + jQuery.post(ajaxurl, data, function(response) { + if(response == "") + jQuery('#detail-' + id).html(" "); + else + jQuery('#detail-' + id).html(response); + }); +} \ No newline at end of file diff --git a/js/jquery.dataTables.min.js b/js/jquery.dataTables.min.js new file mode 100755 index 0000000..947fba4 --- /dev/null +++ b/js/jquery.dataTables.min.js @@ -0,0 +1,143 @@ +/* + * File: jquery.dataTables.min.js + * Version: 1.7.6 + * Author: Allan Jardine (www.sprymedia.co.uk) + * Info: www.datatables.net + * + * Copyright 2008-2011 Allan Jardine, all rights reserved. + * + * This source file is free software, under either the GPL v2 license or a + * BSD style license, as supplied with this software. + * + * This source file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. + */ +(function(j,ra,p){j.fn.dataTableSettings=[];var D=j.fn.dataTableSettings;j.fn.dataTableExt={};var n=j.fn.dataTableExt;n.sVersion="1.7.6";n.sErrMode="alert";n.iApiIndex=0;n.oApi={};n.afnFiltering=[];n.aoFeatures=[];n.ofnSearch={};n.afnSortData=[];n.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active", +sPageButtonStaticDisabled:"paginate_button",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled", +sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:""};n.oJUIClasses={sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled", +sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl", +sPagePrevious:"previous",sPageNext:"next",sPageLast:"last ui-corner-tr ui-corner-br",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default", +sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortColumn:"sorting_",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead ui-state-default",sScrollHeadInner:"dataTables_scrollHeadInner", +sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot ui-state-default",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"ui-state-default"};n.oPagination={two_button:{fnInit:function(g,m,r){var s,w,y;if(g.bJUI){s=p.createElement("a");w=p.createElement("a");y=p.createElement("span");y.className=g.oClasses.sPageJUINext;w.appendChild(y);y=p.createElement("span");y.className=g.oClasses.sPageJUIPrev;s.appendChild(y)}else{s=p.createElement("div");w=p.createElement("div")}s.className= +g.oClasses.sPagePrevDisabled;w.className=g.oClasses.sPageNextDisabled;s.title=g.oLanguage.oPaginate.sPrevious;w.title=g.oLanguage.oPaginate.sNext;m.appendChild(s);m.appendChild(w);j(s).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&r(g)});j(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&r(g)});j(s).bind("selectstart.DT",function(){return false});j(w).bind("selectstart.DT",function(){return false});if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){m.setAttribute("id", +g.sTableId+"_paginate");s.setAttribute("id",g.sTableId+"_previous");w.setAttribute("id",g.sTableId+"_next")}},fnUpdate:function(g){if(g.aanFeatures.p)for(var m=g.aanFeatures.p,r=0,s=m.length;r=w-s){s= +w-r+1;x=w}else{s=y-Math.ceil(r/2)+1;x=s+r-1}for(r=s;r<=x;r++)F+=y!=r?''+r+"":''+r+"";x=g.aanFeatures.p;var z,U=function(){g._iDisplayStart=(this.innerHTML*1-1)*g._iDisplayLength;m(g);return false},C=function(){return false};r=0;for(s=x.length;rm?1:0},"string-desc":function(g,m){g=g.toLowerCase();m=m.toLowerCase();return gm?-1:0},"html-asc":function(g,m){g=g.replace(/<.*?>/g,"").toLowerCase();m=m.replace(/<.*?>/g,"").toLowerCase();return gm?1:0},"html-desc":function(g,m){g=g.replace(/<.*?>/g,"").toLowerCase();m=m.replace(/<.*?>/g,"").toLowerCase();return gm?-1:0},"date-asc":function(g,m){g=Date.parse(g);m=Date.parse(m); +if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(m)||m==="")m=Date.parse("01/01/1970 00:00:00");return g-m},"date-desc":function(g,m){g=Date.parse(g);m=Date.parse(m);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(m)||m==="")m=Date.parse("01/01/1970 00:00:00");return m-g},"numeric-asc":function(g,m){return(g=="-"||g===""?0:g*1)-(m=="-"||m===""?0:m*1)},"numeric-desc":function(g,m){return(m=="-"||m===""?0:m*1)-(g=="-"||g===""?0:g*1)}};n.aTypes=[function(g){if(g.length=== +0)return"numeric";var m,r=false;m=g.charAt(0);if("0123456789-".indexOf(m)==-1)return null;for(var s=1;s")!=-1)return"html";return null}];n.fnVersionCheck=function(g){var m=function(x,u){for(;x.length=parseInt(w,10)};n._oExternConfig={iNextUnique:0};j.fn.dataTable=function(g){function m(){this.fnRecordsTotal=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length};this.fnRecordsDisplay=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length};this.fnDisplayEnd=function(){return this.oFeatures.bServerSide? +this.oFeatures.bPaginate===false||this._iDisplayLength==-1?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd};this.sInstance=this.oInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false};this.oScroll={sX:"",sXInner:"",sY:"",bCollapse:false,bInfinite:false,iLoadGap:100,iBarWidth:0,bAutoCss:true}; +this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...",sLengthMenu:"Show _MENU_ entries",sZeroRecords:"

No matching records found.

",sEmptyTable:"

No data available in table.

",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"},fnInfoCallback:null};this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster= +[];this.aoColumns=[];this.iNextId=0;this.asDataSearch=[];this.oPreviousSearch={sSearch:"",bRegex:false,bSmart:true};this.aoPreSearchCols=[];this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripClasses=[];this.asDestoryStrips=[];this.sDestroyWidth=0;this.fnFooterCallback=this.fnHeaderCallback=this.fnRowCallback=null;this.aoDrawCallback=[];this.fnInitComplete=null;this.sTableId="";this.nTableWrapper=this.nTBody=this.nTFoot=this.nTHead=this.nTable=null;this.bInitialised=false;this.aoOpenRows= +[];this.sDom="lfrtip";this.sPaginationType="two_button";this.iCookieDuration=7200;this.sCookiePrefix="SpryMedia_DataTables_";this.fnCookieCallback=null;this.aoStateSave=[];this.aoStateLoad=[];this.sAjaxSource=this.oLoadedState=null;this.bAjaxDataGet=true;this.fnServerData=function(a,b,c){j.ajax({url:a,data:b,success:c,dataType:"json",cache:false,error:function(d,f){f=="parsererror"&&alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})}; +this.fnFormatNumber=function(a){if(a<1E3)return a;else{var b=a+"";a=b.split("");var c="";b=b.length;for(var d=0;d=a.fnRecordsDisplay()?0:a.iInitDisplayStart;a.iInitDisplayStart=-1;E(a)}if(!(!a.bDestroying&&a.oFeatures.bServerSide&&!ta(a))){a.oFeatures.bServerSide||a.iDraw++;if(a.aiDisplay.length!==0){var i=a._iDisplayStart, +h=a._iDisplayEnd;if(a.oFeatures.bServerSide){i=0;h=a.aoData.length}for(i=i;itr",a.nTHead)[0], +V(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);typeof a.fnFooterCallback=="function"&&a.fnFooterCallback.call(a.oInstance,j(">tr",a.nTFoot)[0],V(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);f=p.createDocumentFragment();b=p.createDocumentFragment();if(a.nTBody){e=a.nTBody.parentNode;b.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered){c=a.nTBody.childNodes;for(b=c.length-1;b>=0;b--)c[b].parentNode.removeChild(c[b])}b=0;for(c=d.length;b=0;b--)a.aoDrawCallback[b].fn.call(a.oInstance,a);a.bSorted=false;a.bFiltered=false;a.bDrawing=false;if(a.oFeatures.bServerSide){K(a,false);typeof a._bInitComplete=="undefined"&&w(a)}}}function W(a){if(a.oFeatures.bSort)O(a,a.oPreviousSearch);else if(a.oFeatures.bFilter)P(a,a.oPreviousSearch);else{E(a);C(a)}}function ta(a){if(a.bAjaxDataGet){K(a,true);var b=a.aoColumns.length,c=[],d;a.iDraw++;c.push({name:"sEcho", +value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:ca(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:a.oFeatures.bPaginate!==false?a._iDisplayLength:-1});if(a.oFeatures.bFilter!==false){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(d=0;d")c=c.parentNode;else if(i=="l"&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange){f=wa(a);e=1}else if(i=="f"&&a.oFeatures.bFilter){f=xa(a);e=1}else if(i=="r"&&a.oFeatures.bProcessing){f=ya(a);e=1}else if(i=="t"){f=za(a);e=1}else if(i=="i"&&a.oFeatures.bInfo){f=Aa(a);e=1}else if(i=="p"&&a.oFeatures.bPaginate){f=Ba(a);e=1}else if(n.aoFeatures.length!==0){h=n.aoFeatures;q=0;for(k=h.length;qcaption",a.nTable);i=0;for(k=d.length;ij(a.nTable).height()-a.oScroll.iLoadGap)if(a.fnDisplayEnd()0&&a.nTable.removeChild(i[0]);if(a.nTFoot!==null){k=a.nTable.getElementsByTagName("tfoot");k.length>0&&a.nTable.removeChild(k[0])}i=a.nTHead.cloneNode(true);a.nTable.insertBefore(i,a.nTable.childNodes[0]);if(a.nTFoot!==null){k=a.nTFoot.cloneNode(true);a.nTable.insertBefore(k,a.nTable.childNodes[1])}var J=fa(i);f=0;for(e=J.length;ff-a.oScroll.iBarWidth)a.nTable.style.width=v(f)}else a.nTable.style.width= +v(f);f=j(a.nTable).outerWidth();e=a.nTHead.getElementsByTagName("tr");i=i.getElementsByTagName("tr");L(function(B,I){l=B.style;l.paddingTop="0";l.paddingBottom="0";l.borderTopWidth="0";l.borderBottomWidth="0";l.height=0;t=j(B).width();I.style.width=v(t);G.push(t)},i,e);j(i).height(0);if(a.nTFoot!==null){h=k.getElementsByTagName("tr");k=a.nTFoot.getElementsByTagName("tr");L(function(B,I){l=B.style;l.paddingTop="0";l.paddingBottom="0";l.borderTopWidth="0";l.borderBottomWidth="0";l.height=0;t=j(B).width(); +I.style.width=v(t);G.push(t)},h,k);j(h).height(0)}L(function(B){B.innerHTML="";B.style.width=v(G.shift())},i);a.nTFoot!==null&&L(function(B){B.innerHTML="";B.style.width=v(G.shift())},h);if(j(a.nTable).outerWidth()d.offsetWidth?a.oScroll.iBarWidth:0;if(a.nTable.offsetHeight';var c=j("input",b);c.val(a.oPreviousSearch.sSearch.replace('"',"""));c.bind("keyup.DT",function(){for(var d=a.aanFeatures.f,f=0,e=d.length;f=0;d--){f=ja(a.aoData[a.aiDisplay[d]]._aData[c],a.aoColumns[c].sType);if(!b.test(f)){a.aiDisplay.splice(d,1);e++}}}}function Da(a,b,c,d,f){var e=ia(b,d,f);if(typeof c=="undefined"||c===null)c=0;if(n.afnFiltering.length!==0)c=1;if(b.length<=0){a.aiDisplay.splice(0,a.aiDisplay.length);a.aiDisplay=a.aiDisplayMaster.slice()}else if(a.aiDisplay.length==a.aiDisplayMaster.length||a.oPreviousSearch.sSearch.length>b.length||c==1||b.indexOf(a.oPreviousSearch.sSearch)!== +0){a.aiDisplay.splice(0,a.aiDisplay.length);ha(a,1);for(c=0;c/g,"");else if(typeof a=="string")return a.replace(/\n/g," ");return a}function O(a,b){var c,d,f,e,i,h,k=[],l=[],q=n.oSort,t=a.aoData,G=a.aoColumns;if(!a.oFeatures.bServerSide&&(a.aaSorting.length!==0||a.aaSortingFixed!==null)){k=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(f=0;f=i)for(b=0;b=0?a._iDisplayStart-a._iDisplayLength:0;if(a._iDisplayStart<0)a._iDisplayStart=0}else if(b=="next")if(a._iDisplayLength>=0){if(a._iDisplayStart+a._iDisplayLength=0){b=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(b-1)*a._iDisplayLength}else a._iDisplayStart=0;else H(a,0,"Unknown paging action: "+b);return c!=a._iDisplayStart}function Aa(a){var b=p.createElement("div");b.className=a.oClasses.sInfo;if(typeof a.aanFeatures.i=="undefined"){a.aoDrawCallback.push({fn:Ga,sName:"information"});a.sTableId!==""&&b.setAttribute("id",a.sTableId+"_info")}return b} +function Ga(a){if(!(!a.oFeatures.bInfo||a.aanFeatures.i.length===0)){var b=a._iDisplayStart+1,c=a.fnDisplayEnd(),d=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),e=a.fnFormatNumber(b),i=a.fnFormatNumber(c),h=a.fnFormatNumber(d),k=a.fnFormatNumber(f);if(a.oScroll.bInfinite)e=a.fnFormatNumber(1);e=a.fnRecordsDisplay()===0&&a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfoEmpty+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()===0?a.oLanguage.sInfoEmpty+" "+a.oLanguage.sInfoFiltered.replace("_MAX_", +h)+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfo.replace("_START_",e).replace("_END_",i).replace("_TOTAL_",k)+a.oLanguage.sInfoPostFix:a.oLanguage.sInfo.replace("_START_",e).replace("_END_",i).replace("_TOTAL_",k)+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+a.oLanguage.sInfoPostFix;if(a.oLanguage.fnInfoCallback!==null)e=a.oLanguage.fnInfoCallback(a,b,c,d,f,e);a=a.aanFeatures.i;b=0;for(c=a.length;b",c,d;if(a.aLengthMenu.length==2&&typeof a.aLengthMenu[0]=="object"&&typeof a.aLengthMenu[1]=="object"){c=0;for(d=a.aLengthMenu[0].length;c'+a.aLengthMenu[1][c]+""}else{c=0;for(d=a.aLengthMenu.length;c'+a.aLengthMenu[c]+""}b+="";var f=p.createElement("div"); +a.sTableId!==""&&typeof a.aanFeatures.l=="undefined"&&f.setAttribute("id",a.sTableId+"_length");f.className=a.oClasses.sLength;f.innerHTML=a.oLanguage.sLengthMenu.replace("_MENU_",b);j('select option[value="'+a._iDisplayLength+'"]',f).attr("selected",true);j("select",f).bind("change.DT",function(){var e=j(this).val(),i=a.aanFeatures.l;c=0;for(d=i.length;ca.aiDisplay.length||a._iDisplayLength==-1?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Ha(a,b){if(!a||a===null||a==="")return 0;if(typeof b=="undefined")b=p.getElementsByTagName("body")[0];var c=p.createElement("div");c.style.width=a;b.appendChild(c);a=c.offsetWidth; +b.removeChild(c);return a}function $(a){var b=0,c,d=0,f=a.aoColumns.length,e,i=j("th",a.nTHead);for(e=0;etd",b);e.each(function(h){this.style.width="";h=ga(a,h);if(h!==null&&a.aoColumns[h].sWidthOrig!=="")this.style.width=a.aoColumns[h].sWidthOrig});for(e=0;etd",b);if(f.length===0)f=j("thead tr:eq(0)>th",b);for(e=c=0;e0)a.aoColumns[e].sWidth=v(d);c++}a.nTable.style.width=v(j(b).outerWidth());b.parentNode.removeChild(b)}}function Ja(a,b){if(a.oScroll.sX===""&&a.oScroll.sY!==""){j(b).width();b.style.width=v(j(b).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sX!=="")b.style.width=v(j(b).outerWidth())}function Ia(a,b,c){if(typeof c=="undefined"||c){c=Ka(a,b);b=M(a,b);if(c<0)return null;return a.aoData[c].nTr.getElementsByTagName("td")[b]}var d=-1,f,e;c=-1;var i=p.createElement("div");i.style.visibility="hidden"; +i.style.position="absolute";p.body.appendChild(i);f=0;for(e=a.aoData.length;fd){d=i.offsetWidth;c=f}}p.body.removeChild(i);if(c>=0){b=M(a,b);if(a=a.aoData[c].nTr.getElementsByTagName("td")[b])return a}return null}function Ka(a,b){for(var c=-1,d=-1,f=0;fc){c=e.length;d=f}}return d}function v(a){if(a===null)return"0px";if(typeof a=="number"){if(a<0)return"0px";return a+"px"}var b= +a.charCodeAt(a.length-1);if(b<48||b>57)return a;return a+"px"}function Oa(a,b){if(a.length!=b.length)return 1;for(var c=0;cb&&a[d]--;c!=-1&&a.splice(c,1)}function va(a,b){b=b.split(",");for(var c=[],d=0,f=a.aoColumns.length;d4096){a=p.cookie.split(";");for(var h=0,k=a.length;h=d.aiDisplay.length){d._iDisplayStart-=d._iDisplayLength;if(d._iDisplayStart<0)d._iDisplayStart=0}if(typeof c=="undefined"||c){E(d);C(d)}return f};this.fnClearTable=function(a){var b=A(this[n.iApiIndex]);da(b);if(typeof a=="undefined"||a)C(b)};this.fnOpen=function(a,b,c){var d=A(this[n.iApiIndex]);this.fnClose(a);var f= +p.createElement("tr"),e=p.createElement("td");f.appendChild(e);e.className=c;e.colSpan=S(d);e.innerHTML=b;b=j("tr",d.nTBody);j.inArray(a,b)!=-1&&j(f).insertAfter(a);d.aoOpenRows.push({nTr:f,nParent:a});return f};this.fnClose=function(a){for(var b=A(this[n.iApiIndex]),c=0;ctr",d.nTHead)[0];i=j(">tr",d.nTFoot)[0];q=[];h=[];for(f=0;f=S(d)){l.appendChild(q[a]);l=j(">tr", +d.nTHead);f=1;for(e=l.length;ftr",d.nTFoot);f=1;for(e=l.length;ftr",d.nTHead);f=1;for(e=l.length;ftr",d.nTFoot);f=1;for(e=l.length;ftd:eq("+k+")",d.aoData[f].nTr)[0])}}d.aoColumns[a].bVisible=true}else{l.removeChild(q[a]);f=0;for(e=d.aoColumns[a].anThExtra.length;ftr>td."+a.oClasses.sRowEmpty,a.nTable).parent().remove();if(a.nTable!=a.nTHead.parentNode){j(">thead",a.nTable).remove();a.nTable.appendChild(a.nTHead)}if(a.nTFoot&&a.nTable!=a.nTFoot.parentNode){j(">tfoot",a.nTable).remove();a.nTable.appendChild(a.nTFoot)}a.nTable.parentNode.removeChild(a.nTable); +j(a.nTableWrapper).remove();a.aaSorting=[];a.aaSortingFixed=[];T(a);j(R(a)).removeClass(a.asStripClasses.join(" "));if(a.bJUI){j("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oJUIClasses.sSortableAsc,n.oJUIClasses.sSortableDesc,n.oJUIClasses.sSortableNone].join(" "));j("th span",a.nTHead).remove()}else j("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oStdClasses.sSortableAsc,n.oStdClasses.sSortableDesc,n.oStdClasses.sSortableNone].join(" "));b.appendChild(a.nTable);d=0;for(f=a.aoData.length;d< +f;d++)c.appendChild(a.aoData[d].nTr);a.nTable.style.width=v(a.sDestroyWidth);j(">tr:even",c).addClass(a.asDestoryStrips[0]);j(">tr:odd",c).addClass(a.asDestoryStrips[1]);d=0;for(f=D.length;dt<"F"ip>'}if(e.oScroll.sX!==""||e.oScroll.sY!=="")e.oScroll.iBarWidth=Na();if(typeof g.iDisplayStart!="undefined"&&typeof e.iInitDisplayStart=="undefined"){e.iInitDisplayStart=g.iDisplayStart;e._iDisplayStart=g.iDisplayStart}if(typeof g.bStateSave!="undefined"){e.oFeatures.bStateSave=g.bStateSave;Ma(e,g);e.aoDrawCallback.push({fn:na,sName:"state_save"})}if(typeof g.aaData!="undefined")h= +true;if(typeof g!="undefined"&&typeof g.aoData!="undefined")g.aoColumns=g.aoData;if(typeof g.oLanguage!="undefined")if(typeof g.oLanguage.sUrl!="undefined"&&g.oLanguage.sUrl!==""){e.oLanguage.sUrl=g.oLanguage.sUrl;j.getJSON(e.oLanguage.sUrl,null,function(q){y(e,q,true)});i=true}else y(e,g.oLanguage,false)}else g={};if(typeof g.asStripClasses=="undefined"){e.asStripClasses.push(e.oClasses.sStripOdd);e.asStripClasses.push(e.oClasses.sStripEven)}c=false;d=j(">tbody>tr",this);a=0;for(b=e.asStripClasses.length;a< +b;a++)if(d.filter(":lt(2)").hasClass(e.asStripClasses[a])){c=true;break}if(c){e.asDestoryStrips=["",""];if(j(d[0]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[0]+=e.oClasses.sStripOdd+" ";if(j(d[0]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[0]+=e.oClasses.sStripEven;if(j(d[1]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[1]+=e.oClasses.sStripOdd+" ";if(j(d[1]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[1]+=e.oClasses.sStripEven;d.removeClass(e.asStripClasses.join(" "))}a=this.getElementsByTagName("thead"); +c=a.length===0?[]:fa(a[0]);var k;if(typeof g.aoColumns=="undefined"){k=[];a=0;for(b=c.length;a=0;a--){var l=g.aoColumnDefs[a].aTargets;j.isArray(l)||H(e,1,"aTargets must be an array of targets, not a "+typeof l); +c=0;for(d=l.length;c=0){for(;e.aoColumns.length<=l[c];)F(e);x(e,l[c],g.aoColumnDefs[a])}else if(typeof l[c]=="number"&&l[c]<0)x(e,e.aoColumns.length+l[c],g.aoColumnDefs[a]);else if(typeof l[c]=="string"){b=0;for(f=e.aoColumns.length;b=e.aoColumns.length)e.aaSorting[a][0]= +0;k=e.aoColumns[e.aaSorting[a][0]];if(typeof e.aaSorting[a][2]=="undefined")e.aaSorting[a][2]=0;if(typeof g.aaSorting=="undefined"&&typeof e.saved_aaSorting=="undefined")e.aaSorting[a][1]=k.asSorting[0];c=0;for(d=k.asSorting.length;c0)e.nTFoot=this.getElementsByTagName("tfoot")[0];if(h)for(a=0;a')}function F(a,b){d.extend(a,b);for(var c in b)if(b[c]== +null||b[c]==A)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.12"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){F(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase(); +f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
')}}, +_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& +b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== +""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, +c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), +true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}F(a.settings,e||{}); +b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass); +this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup", +this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs, +function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null: +f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target); +if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a); +d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");F(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-= +document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim"); +var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst= +b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover"); +this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+ +this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&& +a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth(): +0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a), +"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"? +"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a= +d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a= +d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c== +"M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth= +b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker(); +this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0); +a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c? +c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l)throw"Invalid date";return w},ATOM:"MMM dd yyyy",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y", +RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"MMM dd yyyy",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay= +a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(), +b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n= +this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
'+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z= +this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",D=0;D1)switch(E){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]- +1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
'+(/all|left/.test(t)&&D==0?c?f:n:"")+(/all|right/.test(t)&&D==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,D>0||E>0,z,w)+'
';var B=j?'":"";for(t=0;t<7;t++){var q= +(t+h)%7;B+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=B+"";B=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,B);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;B=l?6:Math.ceil((t+B)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O";var P=!j?"":'";for(t=0;t<7;t++){var G= +p?p.apply(a.input?a.input[0]:null,[q]):[true,""],C=q.getMonth()!=g,J=C&&!H||!G[0]||k&&qo;P+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+= +P+""}g++;if(g>11){g=0;m++}x+="
'+this._get(a,"weekHeader")+"
'+this._get(a,"calculateWeek")(q)+""+(C&&!v?" ":J?''+q.getDate()+"":''+q.getDate()+"")+"
"+(l?""+(i[0]>0&&E==i[1]-1?'
':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
', +o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&& +l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";if(d.browser.mozilla)k+='";else{k+=a.yearshtml;a.yearshtml=null}}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
";return k},_adjustInstDate:function(a,b,c){var e= +a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, +"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); +c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, +"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= +function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker, +[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.12";window["DP_jQuery_"+y]=d})(jQuery); diff --git a/js/jquery.ui.progressbar.min.js b/js/jquery.ui.progressbar.min.js new file mode 100755 index 0000000..46dca8f --- /dev/null +++ b/js/jquery.ui.progressbar.min.js @@ -0,0 +1,16 @@ +/* + * jQuery UI Progressbar 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* +this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.13"})})(jQuery); diff --git a/js/jquery.ui.widget.min.js b/js/jquery.ui.widget.min.js new file mode 100755 index 0000000..9a703a2 --- /dev/null +++ b/js/jquery.ui.widget.min.js @@ -0,0 +1,15 @@ +/*! + * jQuery UI Widget 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h, +a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h; +e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options, +this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")}, +widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this}, +enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); diff --git a/meta.php b/meta.php new file mode 100755 index 0000000..ac84870 --- /dev/null +++ b/meta.php @@ -0,0 +1,24 @@ + self::make_labels('Promo Box','Promo Boxes'), + 'public_queryable'=> false, + 'hierarchical' => true, // IMPORTANT!!! wp_dropdown_pages() requires 'hierarchical'=>true + 'show_ui' => true, + 'query_var' => false, + 'supports' => array('title','editor','thumbnail','custom-fields'), + 'show_in_nav_menus'=>true, + 'exclude_from_search'=>true, + )); + } + +} +?> \ No newline at end of file diff --git a/metaboxes/add-task.php b/metaboxes/add-task.php new file mode 100755 index 0000000..a183216 --- /dev/null +++ b/metaboxes/add-task.php @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + +
+ + 'propel_post_author', + 'show_option_none' => 'Unassigned', + 'orderby' => 'display_name', + 'selected' => $current_user->ID + ); + wp_dropdown_users( $args ); + ?> +
+ +
\ No newline at end of file diff --git a/metaboxes/edit-task.php b/metaboxes/edit-task.php new file mode 100755 index 0000000..f72f3b7 --- /dev/null +++ b/metaboxes/edit-task.php @@ -0,0 +1,97 @@ + + 'propel_project', 'numberposts' => -1 ) ); + if( count( $projects ) > 0 ) : + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Project + "; + foreach($projects as $project) : + if($project->ID == $parent) { + echo ''; + } else { + echo ''; + } + endforeach; + ?> +

Start Date

End Date

Priority

+ +

Type

+ +

Progress

+ +

Manager

+ 'propel_post_author', + 'show_option_none' => 'Unassigned', + 'orderby' => 'display_name', + 'name' => 'propel_post_author', + 'selected' => $post->post_author + ); + wp_dropdown_users( $args ); + ?> +
\ No newline at end of file diff --git a/metaboxes/list-authors.php b/metaboxes/list-authors.php new file mode 100755 index 0000000..7b40d96 --- /dev/null +++ b/metaboxes/list-authors.php @@ -0,0 +1,53 @@ + 'display_name', 'order' => 'ASC' ) ); ?> + +
+ + +
+
    + + + + +
+
+
+ +ID == $user_id) return true; + } + return false; +} + +function propel_is_parent_coauthor( $user_id ) { + $post = get_post( get_the_ID() ); + if( $post->post_type != 'propel_task' || $post->post_parent == 0 ) return false; + + $coauthors = Propel_Authors::get_coauthors( $post->post_parent ); + foreach($coauthors as $coauthor) { + if($coauthor->ID == $user_id) return true; + } + return false; +} \ No newline at end of file diff --git a/metaboxes/project-meta.php b/metaboxes/project-meta.php new file mode 100755 index 0000000..dc26fca --- /dev/null +++ b/metaboxes/project-meta.php @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Start Date
End Date
Priority + +
Progress + +
Client + + ID == $owner) : + $assigned_to_client = $user->ID; + endif; + endforeach; + + wp_dropdown_users( array( 'orderby' => 'display_name', 'order' => 'ASC', 'show' => 'display_name', 'name' => 'owner', 'selected' => $assigned_to_client ) ); ?> + +
+ +
\ No newline at end of file diff --git a/metaboxes/task-meta.php b/metaboxes/task-meta.php new file mode 100755 index 0000000..a8ab384 --- /dev/null +++ b/metaboxes/task-meta.php @@ -0,0 +1,96 @@ + + 'propel_project', 'numberposts' => -1 ) ); + if( count( $projects ) > 0 ) : + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Project + "; + foreach($projects as $project) : + if($project->ID == $parent) { + echo ''; + } else { + echo ''; + } + endforeach; + ?> +

Start Date

End Date

Priority

+ +

Type

+ +

Progress

+ +

Manager

+ 'propel_post_author', + 'show_option_none' => 'Unassigned', + 'orderby' => 'display_name', + 'selected' => $post->post_author + ); + wp_dropdown_users( $args ); + ?> +
\ No newline at end of file diff --git a/metaboxes/tasks.php b/metaboxes/tasks.php new file mode 100755 index 0000000..71255e7 --- /dev/null +++ b/metaboxes/tasks.php @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + post_id); + $progress = get_post_meta( $task->ID, '_propel_complete', true ); + $priority = get_post_meta( $task->ID, '_propel_priority', true ); + $start = get_post_meta( $task->ID, '_propel_start_date', true ); + + if( $start ) + $start = date( get_option( 'date_format' ), $start ); + + $end = get_post_meta( $task->ID, '_propel_end_date', true ); + + if( $end ) + $end = date( get_option( 'date_format' ), $end); + + if( $task->post_author ) { + $userdata = get_userdata( $task->post_author ); + $author = $userdata->display_name; + } else { + $author = "Unassigned"; + } + + $x = ($progress == 100) ? "" : "un"; + $nonce = wp_create_nonce('propel-trash'); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Priority

Owner

Start

Due

Progress

+

post_title); ?>

+

+

+
+

+
+

+

%

+ Delete + Edit + Complete
+
+ + + \ No newline at end of file diff --git a/metaboxes/time-entity-select.php b/metaboxes/time-entity-select.php new file mode 100755 index 0000000..7327523 --- /dev/null +++ b/metaboxes/time-entity-select.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/migrate.php b/migrate.php new file mode 100755 index 0000000..ba3b19b --- /dev/null +++ b/migrate.php @@ -0,0 +1,177 @@ + + +
+ +

Propel

+ +

It is strongly recommended you backup your database before you continue.

+ +

+ Version 1.7 of Propel has changed its database structure in an effort to take full advantage of more advanced + WordPress features. To continue using 1.7 you must update your database structure by clicking the update button below. + It is highly recommended you take a FULL backup of your database prior to updating the Propel database structure. + If you do not wish to continue, you may download an older version of Propel and upload it to your plugins directory. + Using an OLDER version will not affect your database. However, older versions will no longer be officially supported. + If you have any questions regarding this migration, you can post a comment at + http://www.johnciacia.com/propel/ or use the official + WordPress forum. +

+ + +
+ + +
+ + Go to projects + +
+ + + +
+ +

Propel

+ + +

It is strongly recommended you backup your database before you continue.

+ +

+ Version 2.0 of Propel has changed its database structure in an effort to take full advantage of more advanced + WordPress features. To continue using 2.0 you must update your database structure by clicking the update button below. + Although no data is deleted, it is highly recommended you take a FULL backup of your database prior to updating the Propel database structure. + If you do not wish to continue, you may download an older version of Propel and upload it to your plugins directory. + Using an OLDER version will not affect your database. However, older versions will no longer be officially supported. + If you have any questions regarding this migration, you can post a comment at + http://www.johnciacia.com/propel/ or use the official + WordPress forum. +

+
+ + +
+ + Go to projects + +
+ 'propel_task', 'numberposts' => -1, 'post_status' => null, 'post_parent' => null ); + $posts = get_posts( $args ); + foreach( $posts as $post ) { + $meta = get_post_meta( $post->ID, '_propel_task_metadata', true ); + + if( isset( $meta['start'] ) ) + update_post_meta( $post->ID, '_propel_start_date', strtotime($meta['start'] ) ); + + if( isset( $meta['end'] ) ) + update_post_meta( $post->ID, '_propel_end_date', strtotime($meta['end'] ) ); + + if( isset( $meta['priority'] ) ) { + if( $meta['priority'] >= 0 && $meta['priority'] < 3 ) { + $priority = 0; + } else if( $meta['priority'] >= 3 && $meta['priority'] < 7 ) { + $priority = 1; + } else { + $priority = 2; + } + update_post_meta( $post->ID, '_propel_priority', $priority ); + } + + if( isset( $meta['complete'] ) ) { + $complete = (int)( round( $meta['complete'] / 5 ) * 5 ); + update_post_meta( $post->ID, '_propel_complete', $complete ); + } + } + + $args = array( 'post_type' => 'propel_project', 'numberposts' => -1, 'post_status' => null, 'post_parent' => null ); + $posts = get_posts( $args ); + foreach( $posts as $post ) { + update_post_meta( $post->ID, '_propel_start_date', time() ); + update_post_meta( $post->ID, '_propel_end_date', time() ); + update_post_meta( $post->ID, '_propel_priority', 1 ); + update_post_meta( $post->ID, '_propel_complete', 0 ); + update_post_meta( $post->ID, '_propel_owner', 0 ); + } + update_option("PROPEL_DBVERSION", 1.6); +} + + +function do_1_4_to_1_5_update() { + $sql = "SELECT * FROM {$wpdb->prefix}projects"; + $projects = $wpdb->get_results($sql, OBJECT); + + + foreach($projects as $project) { + $p = array( + 'post_title' => $project->title, + 'post_content' => $project->description, + 'post_status' => 'publish', + 'post_type' => "propel_project" + ); + + $id = wp_insert_post($p); + + $sql = "SELECT * FROM {$wpdb->prefix}tasks WHERE `pid` = {$project->id}"; + $tasks = $wpdb->get_results($sql, OBJECT); + foreach($tasks as $task) { + create_task($task, $project, $id); + } + } + + update_option("PROPEL_DBVERSION", 1.5); +} + + +function create_task($task, $project, $id) { + + $t = array( + 'post_title' => $task->title, + 'post_content' => $task->description, + 'post_status' => 'publish', + 'post_parent' => $id, + 'post_type' => "propel_task" + ); + //create a custom post type + $id = wp_insert_post($t); + + //create the posts metadata + $meta = array( + 'start' => $task->start, + 'end' => $task->end, + 'priority' => $task->priority, + 'complete' => $task->complete, + 'assigned_to' => $task->uid + ); + + add_post_meta($id, "_propel_task_metadata", $meta); + add_post_meta($id, "_propel_task_user", $task->uid); + +} + +?> \ No newline at end of file diff --git a/plugins/users.php b/plugins/users.php new file mode 100755 index 0000000..c760417 --- /dev/null +++ b/plugins/users.php @@ -0,0 +1,774 @@ + + + Enable Email Notifications'; + echo '
'; + echo ' Enable Contributors'; + echo '
'; + echo ' Enable User Restrictions'; + } + + /** + * When user restrictions are enabled, add each task author + * to the author taxonomy for each task, and add each project + * author to the author taxonomy for each project and each + * task associated with the project + */ + public static function user_restrictions_enabled() { + global $wpdb; + // get_posts cannot be used since the pre_get_posts filter is called + $tasks_querystr = " + SELECT $wpdb->posts.ID, $wpdb->posts.post_author, $wpdb->posts.post_title + FROM $wpdb->posts + WHERE $wpdb->posts.post_type = 'propel_task'"; + $tasks = $wpdb->get_results( $tasks_querystr, OBJECT ); + foreach( $tasks as $task ) { + $user = get_userdata($task->post_author); + self::add_coauthors( $task->ID, array( $user->user_login ), true ); + } + + $projects_querystr = " + SELECT $wpdb->posts.ID, $wpdb->posts.post_author, $wpdb->posts.post_title + FROM $wpdb->posts + WHERE $wpdb->posts.post_type = 'propel_project'"; + $projects = $wpdb->get_results( $projects_querystr, OBJECT ); + foreach( $projects as $project ) { + $user = get_userdata($project->post_author); + self::add_coauthors( $project->ID, array( $user->user_login ), true ); + $tasks_querystr = " + SELECT $wpdb->posts.ID, $wpdb->posts.post_author, $wpdb->posts.post_title + FROM $wpdb->posts + WHERE $wpdb->posts.post_type = 'propel_task' + AND $wpdb->posts.post_parent = '$project->ID'"; + $tasks = $wpdb->get_results( $tasks_querystr, OBJECT ); + foreach( $tasks as $task ) { + $user = get_userdata($project->post_author); + self::add_coauthors( $task->ID, array( $user->user_login ) ); + $user = get_userdata($task->post_author); + self::add_coauthors( $task->ID, array( $user->user_login ) ); + } + } + } + + /** + * If this plugin is enabled remove the author metabox + * from the propel_project and propel_task post type since + * the author functionality is replaced by author taxonomy + */ + public static function admin_menu() { + remove_meta_box( 'authordiv', 'propel_project', 'normal' ); + remove_meta_box( 'authordiv', 'propel_task', 'normal' ); + } + + /** + * + */ + public static function post_wp_ajax_add_task( $post_id ) { + $post = get_post( $post_id ); + $user = get_userdata( $post->post_author ); + $coauthors = array( $user->user_login ); + + $project_managers = self::get_coauthors( $post->post_parent ); + foreach( $project_managers as $project_manager ) { + $coauthors[] = $project_manager->user_login; + } + $coauthors = array_unique( $coauthors ); + + self::add_coauthors( $post_id, $coauthors ); + } + + /** + * @param $comment_ID + * @todo: do emails get sent for projects? + * @todo: I believe they should. If a project's status, title, description or other data is updated the contributors should be notified. + */ + public static function comment_post( $comment_ID ) { + if( Propel_Options::get_option('email_notifications') ) { + + $comment = get_comment( $comment_ID ); + $post = get_post( $comment->comment_post_ID ); + $parent = get_post( $post->post_parent ); + + $domain = preg_replace('/^www\./','',$_SERVER['HTTP_HOST']); + + if( $post->post_type == "propel_task" ) { + $headers = "From: $comment->comment_author " . "\r\n"; + $subject = "New Comment ($parent->post_title): $post->post_title"; + $message = "\n\n"; + $message .= "

$comment->comment_author said: "$comment->comment_content"

"; + $message .= "

Respond ⇒

"; + $coauthors = wp_get_post_terms( $post->ID, self::COAUTHOR_TAXONOMY ); + + foreach($coauthors as $login) { + $user = get_user_by( 'login', $login->slug ); + + if ( $comment->comment_author_email != $user->user_email ) { + add_filter('wp_mail_content_type',create_function('', 'return "text/html";')); + wp_mail($user->user_email, $subject, $message, $headers); + } + } + } + } + } + + /** + * @param $columns an array of registered columns + * @return $columns an array of registered columns + * This function adds the 'Contributors' column on the + * edit.php screen for propel_task and propel_project + * post types + */ + public static function register_columns( $columns ) { + $columns = array_slice($columns, 0, 4, true) + + array('contributor' => __( 'Contributors', 'propel' )) + + array_slice($columns, 4, count($columns) - 1, true) ; + return $columns; + } + + /** + * + */ + public static function get_coauthors( $post_id = 0, $args = array() ) { + global $post, $post_ID, $coauthors_plus, $wpdb; + + $coauthors = array(); + $post_id = (int)$post_id; + if( !$post_id && $post_ID ) $post_id = $post_ID; + if( !$post_id && $post ) $post_id = $post->ID; + + $defaults = array( 'orderby' => 'term_order', 'order' => 'ASC' ); + $args = wp_parse_args( $args, $defaults ); + + if($post_id) { + $coauthor_terms = wp_get_post_terms( $post_id, self::COAUTHOR_TAXONOMY, $args ); + + if(is_array($coauthor_terms) && !empty($coauthor_terms)) { + foreach($coauthor_terms as $coauthor) { + $post_author = get_user_by( 'login', $coauthor->name ); + // In case the user has been deleted while plugin was deactivated + if(!empty($post_author)) $coauthors[] = $post_author; + } + } else { + if($post) { + $post_author = get_userdata($post->post_author); + } else { + $post_author = get_userdata($wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d", $post_id))); + } + if(!empty($post_author)) $coauthors[] = $post_author; + } + } + return $coauthors; + } + + /** + * + */ + public static function manage_columns($column_name, $id) { + if( $column_name == 'contributor' ) { + $authors = self::get_coauthors( $id ); + $count = 1; + foreach( $authors as $author ) : + ?> + display_name ?> + false, + 'update_count_callback' => '_update_post_term_count', + 'label' => false, + 'query_var' => false, + 'rewrite' => false, + 'sort' => true, + 'show_ui' => false) + ); + } + + /** + * + */ + public static function add_meta_boxes() { + add_meta_box( 'propel_list_authors', __( 'Contributors' ), + array( __CLASS__, 'list_authors'), 'propel_project', 'side' ); + add_meta_box( 'propel_list_authors', __( 'Contributors' ), + array( __CLASS__, 'list_authors'), 'propel_task', 'side' ); + } + + /** + * + */ + public static function list_authors() { + require_once( dirname(__FILE__) . '/../metaboxes/list-authors.php') ; + } + + /** + * + */ + public static function pre_get_posts( $query ) { + global $post_id; + + $pr1 = get_post_meta( $post_id, '_propel_complete',true); + $pr2 = get_post_meta( $post_id, '_propel_complete_before',true); + + if ($pr2 == 0){ + update_post_meta( $post_id, '_propel_complete_before',$pr1); + } + + return $query; + } + + /** + * + */ + public static function wp_insert_post_data( $data, $post ) { + + // bail on autosave + if ( defined( 'DOING_AUTOSAVE' ) && !DOING_AUTOSAVE ) + return $data; + + // bail on revisions + if( $data['post_type'] == 'revision' ) + return $data; + + if( isset( $_REQUEST['coauthors-nonce'] ) && is_array( $_POST['coauthors'] ) ) { + $author = $_POST['coauthors'][0]; + if( $author ) { + $data['post_author'] = $post['propel_post_author']; + } + } else { + // if for some reason we don't have the coauthors fields set + if( ! isset( $data['post_author'] ) ) { + $data['post_author'] = $post['propel_post_author']; + } + } + return $data; + } + + /** + * + */ + public static function save_post($post_id, $post) { + global $typenow; + + // sanity checks + if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) + return; + + if ( wp_is_post_revision( $post_id ) ) + return; + + if ( !current_user_can( 'edit_post', $post_id ) ) + return; + + $post_type = $post->post_type; + if( isset( $_POST['coauthors-nonce'] ) ) { + + if( !isset( $_POST['coauthors'] ) ) { + $user = wp_get_current_user(); + $coauthors = array( $user->user_login ); + } else { + $coauthors = (array) $_POST['coauthors']; + } + + check_admin_referer( 'coauthors-edit', 'coauthors-nonce' ); + $coauthors = array_map( 'esc_html', $coauthors ); + + // if a contributor is added/removed from a project, add/remove to/from + // ALL THE TASKS associated with that project + if( 'propel_project' == $typenow ) { + $project_managers = self::get_coauthors( $post_id ); + $p = array(); + foreach( $project_managers as $pm) { + $p[] = $pm->data->user_login; + } + + $p = array_diff( $p, $coauthors ); + $posts = get_posts( array( 'post_type' => 'propel_task', 'post_parent' => $post_id ) ); + + foreach( $posts as $post ) { + self::add_coauthors( $post->ID, $p ); + } + } + + // add project contributors to new tasks + if( 'propel_task' == $typenow ) { + $project_managers = self::get_coauthors( $post->post_parent ); + foreach( $project_managers as $project_manager ) { + $coauthors[] = $project_manager->user_login; + } + $author = get_userdata($post->post_author); + $coauthors[] = $author->user_login; + $coauthors = array_unique( $coauthors ); + } + + return self::add_coauthors( $post_id, $coauthors ); + } + } + + /** + * @param $post_id int + * @param $coauthors mixed array or integer + * @param $append bool + * @param $notify bool + */ + public static function add_coauthors( $post_id, $coauthors, $append = false, $notify = true ) { + global $current_user, $post; + $notify = array(); + $post_id = (int) $post_id; + $insert = false; + + if ( !is_array( $coauthors ) || 0 == count( $coauthors ) || empty( $coauthors ) ) { + $coauthors = array( $current_user->user_login ); + } + + $terms = wp_get_post_terms( $post_id, self::COAUTHOR_TAXONOMY ); + + foreach( array_unique( $coauthors ) as $author ) { + $name = $author; + if( !term_exists( $name, self::COAUTHOR_TAXONOMY ) ) { + $args = array( 'slug' => sanitize_title( $name ) ); + $insert = wp_insert_term( $name, self::COAUTHOR_TAXONOMY, $args ); + } + $notify[] = $name; + } + + if( !is_wp_error( $insert ) ) { + $set = wp_set_post_terms( $post_id, $coauthors, self::COAUTHOR_TAXONOMY, $append ); + } + + $notify = self::select_notifications($post_id, $notify); + + if( $notify ) { + self::notify_coauthors( $notify, $post_id ); + } + } + + /** + * aps2012 updates + * + */ + public static function pre_post_update($post_id) { + global $wpdb; + $p = get_post($post_id); + $u = get_userdata($p->post_author); + update_post_meta($post_id,'_propel_before_author', $u->user_login); + } + /** + * aps2012 updates + * + */ + public static function transition_post_status($new_status, $old_status=null, $post=null){ + $static_id = self::set_id(); + if ($new_status == "draft"){ + update_post_meta( $static_id, '_propel_before_author_new',"New"); + } + } + + /** + * aps2012 updates + * + */ + public static function set_id(){ + $part1 = "999999999999"; + $current_user = wp_get_current_user(); + $part2 = $current_user->ID; + $id = $part1 . $part2; + return (int)($id); + } + + /** + * aps2012 updates + * + */ + public static function select_notifications($post_id, $notified) { + global $wpdb; + + $b4_complete = get_post_meta( $post_id, '_propel_complete_before',true); + $now_complete = get_post_meta( $post_id, '_propel_complete',true); + + if(!$complete_tag){ + $complete_tag = get_post_meta( $post_id, '_propel_complete_tag',true); + } + + if(!$before_author){ + $before_author = get_post_meta( $post_id, '_propel_before_author',true); + } + + $current_user = wp_get_current_user(); + $currname = $current_user->display_name; + + if (($b4_complete < 100) && ($now_complete == 100)){ + update_post_meta( $post_id, '_propel_complete_tag','completed'); + } elseif(($b4_complete == 100) && ($now_complete == 100)){ + update_post_meta( $post_id, '_propel_complete_tag','sent'); + } elseif(($b4_complete == 100) && ($now_complete < 100)){ + update_post_meta( $post_id, '_propel_complete_tag','reverse'); + } else { + update_post_meta( $post_id, '_propel_complete_tag','null'); + } + + $p = get_post($post_id); + $u = get_userdata($p->post_author); + + if(($before_author != $u->user_login) && ($before_author != 'NULL')){ + update_post_meta( $post_id, '_propel_notify','proceed'); + } elseif ($before_author == $u->user_login) { + update_post_meta( $post_id, '_propel_notify','sent'); + } elseif($before_author == 'NULL'){ + update_post_meta( $post_id, '_propel_notify','new'); + } else { + update_post_meta( $post_id, '_propel_notify','null'); + } + + $static_id = self::set_id(); + $new = get_post_meta( $static_id, '_propel_before_author_new',true); + if($new == 'New'){ + update_post_meta( $post_id, '_propel_notify','new'); + } + + delete_post_meta( $static_id, '_propel_before_author_new'); + update_post_meta($post_id, '_propel_complete_before', $now_complete); + $pos = array_search($currname, $notified); + unset($notified[$pos]); + return $notified; + } + /** + * When a user is deleted, remove the term information and reassign + * if requested. + */ + public static function delete_user( $delete_id ) { + global $wpdb; + + $reassign_id = absint( $_POST['reassign_user'] ); + + if($reassign_id) { + $reassign_user = get_user_by( 'id', $reassign_id ); + if( $reassign_user ) { + $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $delete_id ) ); + + if ( $post_ids ) { + foreach ( $post_ids as $post_id ) { + self::add_coauthors( $post_id, array( $reassign_user->user_login ), true, false ); + } + } + } + } + + $delete_user = get_user_by( 'id', $delete_id ); + if( $delete_user ) { + wp_delete_term( $delete_user->user_login, self::COAUTHOR_TAXONOMY ); + } + } + + /** + * @completed email when assigned to a task + * @todo email when unassigned a task + * @todo email when task was updated (exclude users from the aforementioned two) + * @todo email when the task status is modified (if it's completed say that in the message, if it's pending review, etc...) + */ + public static function notify_coauthors( $to, $post_id ) { + + if( Propel_Options::get_option('email_notifications') ) { + $post = get_post( $post_id ); + $parent = get_post( $post->post_parent ); + $domain = preg_replace('/^www\./','',$_SERVER['HTTP_HOST']); + $current_user = wp_get_current_user(); + + $post_owner = get_userdata( $post->post_author ); + $complete_tag = get_post_meta( $post_id, '_propel_complete_tag',true); + $pnotify = get_post_meta( $post_id, '_propel_notify',true); + $headers = "From: $current_user->display_name " . "\r\n"; + $subject = ""; + $subject = self::set_subject($pnotify, $complete_tag, $parent->post_title, $post->post_title); + $message = self::set_message($pnotify, $complete_tag, $current_user->display_name, + $post_owner->user_login, $parent->post_title, + $post->guid,$post->post_title,$post->post_content); + + + if($subject != ""){ + foreach( $to as $login ) { + $user = get_user_by( 'login', $login ); + add_filter('wp_mail_content_type',create_function('', 'return "text/html";')); + wp_mail($user->user_email, $subject, $message, $headers); + } + } + + } + + } + public static function set_subject($pnotify, $complete_tag, $parent_title, $post_title){ + if($pnotify == 'new'){ + $subject = "New Task Assigned ($parent_title): $post_title"; + } elseif($pnotify == 'proceed'){ + $subject = " - Task is Re-Assigned ($parent_title): $post_title"; + } + + if($complete_tag == 'completed'){ + $subject .= " - Task Completed ($parent_title): $post_title"; + } elseif($complete_tag == 'reverse'){ + $subject .= " - Task is Re-Opened ($parent_title): $post_title"; + } + + return $subject; + } + public static function set_message($pnotify, $complete_tag, $dname, $ulogin, + $parent_title, $guid, $post_title, $content){ + if ($pnotify == 'new'){ + $message = " +
+

$dname assigned the following to $ulogin on the "$parent_title" project:

+

"$post_title"

+

Details: "$content"

+
+ "; + } elseif ($pnotify == 'proceed'){ + $message = " +
+

$dname re-assigned the following to $ulogin on the "$post_title" project:

+

"$post_title"

+

Details: "$content"

+
+ "; + } + + if($complete_tag == 'completed'){ + $message .= " +
+

$dname has updated the project as 100% complete "$parent_title" project:

+

"$post_title"

+

Details: "$content"

+
+ "; + } elseif($complete_tag == 'reverse'){ + $message .= " +
+

$dname has reopened the project "$parent_title" project:

+

"$post_title"

+

Details: "$content"

+
+ "; + } + + + return $message; + } + + /** + * + */ + public static function views_edit_post( $views ) { + global $wpdb, $avail_post_stati, $typenow; + if( $typenow != 'propel_project' && $typenow != 'propel_task' ) return $views; + + $user = wp_get_current_user(); + + $query = "SELECT P.post_status, COUNT(*) AS num_posts FROM {$wpdb->terms} AS T + LEFT JOIN {$wpdb->term_taxonomy} AS TT ON T.term_id = TT.term_id + LEFT JOIN {$wpdb->term_relationships} AS TR ON TT.term_taxonomy_id = TR.term_taxonomy_id + LEFT JOIN {$wpdb->posts} AS P ON TR.object_id = P.id + WHERE T.name = (SELECT U.user_login FROM {$wpdb->users} AS U WHERE U.ID = {$user->ID}) + AND TT.taxonomy = 'author' + AND P.post_type = '{$typenow}' + AND P.post_status <> 'auto-draft' + AND P.post_status <> 'inherit' + GROUP BY P.post_status"; + + /** + * @todo cache $count + */ + $count = $wpdb->get_results( $query, ARRAY_A ); + + $stats = array(); + foreach ( get_post_stati() as $state ) { + $stats[$state] = 0; + } + + foreach ( (array) $count as $row ) { + $stats[$row['post_status']] = $row['num_posts']; + } + + $num_posts = (object)$stats; + + + $class = ''; + $allposts = ''; + + $current_user_id = get_current_user_id(); + + $total_posts = array_sum( (array) $num_posts ); + + + $class = empty( $class ) && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['show_sticky'] ) ? ' class="current"' : ''; + $status_links['all'] = "" . sprintf( _nx( 'All (%s)', 'All (%s)', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . ''; + + foreach ( get_post_stati(array('show_in_admin_status_list' => true), 'objects') as $status ) { + $class = ''; + + $status_name = $status->name; + + if ( !in_array( $status_name, $avail_post_stati ) ) + continue; + + if ( empty( $num_posts->$status_name ) ) + continue; + + if ( isset($_REQUEST['post_status']) && $status_name == $_REQUEST['post_status'] ) + $class = ' class="current"'; + + $status_links[$status_name] = "" . sprintf( translate_nooped_plural( $status->label_count, $num_posts->$status_name ), number_format_i18n( $num_posts->$status_name ) ) . ''; + } + return $status_links; + } +} + +?> \ No newline at end of file diff --git a/post-types/project.php b/post-types/project.php new file mode 100755 index 0000000..aa6ef99 --- /dev/null +++ b/post-types/project.php @@ -0,0 +1,507 @@ + '_propel_priority', + 'orderby' => 'meta_value_num') ); + } + + if ( isset( $vars['orderby'] ) && 'complete' == $vars['orderby'] ) { + $vars = array_merge( $vars, array( + 'meta_key' => '_propel_complete', + 'orderby' => 'meta_value_num') ); + } + + if ( isset( $vars['orderby'] ) && 'start' == $vars['orderby'] ) { + $vars = array_merge( $vars, array( + 'meta_key' => '_propel_start_date', + 'orderby' => 'meta_value_num') ); + } + + if ( isset( $vars['orderby'] ) && 'end' == $vars['orderby'] ) { + $vars = array_merge( $vars, array( + 'meta_key' => '_propel_end_date', + 'orderby' => 'meta_value_num') ); + } + + if ( isset( $vars['orderby'] ) && 'client' == $vars['orderby'] ) { + $vars = array_merge( $vars, array( + 'meta_key' => '_propel_owner', + 'orderby' => 'meta_value_num') ); + } + return $vars; + } + + /** + * + */ + public static function post() { + + if( isset($_GET['_wpnonce'], $_GET['action'], $_GET['post'] ) && $_GET['action'] == "propel-delete" ) { + if ( !wp_verify_nonce($_GET['_wpnonce'], 'propel-trash') ) die('Security check'); + + wp_delete_post($_GET['post']); + wp_redirect( $_SERVER['HTTP_REFERER'] ); + die(); + } + + } + + /** + * @since 2.0 + */ + public static function parse_query($query) { + global $pagenow; + if ( !isset( $_GET['post_type'] ) ) + return $query; + + if( $pagenow != "edit.php" && $_GET['post_type'] != self::POST_TYPE ) + return $query; + + if( isset( $_GET['client'] ) ) { + $query->query_vars['meta_key'] = "_propel_owner"; + $query->query_vars['meta_value'] = $_GET['client']; + $query->query_vars['post_type'] = "propel_project"; + return $query; + } + } + + /** + * @since 2.0 + */ + public static function restrict_manage_posts() { + echo ""; + } + + /** + * @since 2.0 + */ + public static function register_post_type() { + $labels = array( + 'name' => _x( 'Categories', 'taxonomy general name' ), + 'singular_name' => _x( 'Category', 'taxonomy singular name' ), + 'search_items' => __( 'Search Categories' ), + 'all_items' => __( 'All Categories' ), + 'parent_item' => __( 'Parent Category' ), + 'parent_item_colon' => __( 'Parent Category:' ), + 'edit_item' => __( 'Edit Category' ), + 'update_item' => __( 'Update Category' ), + 'add_new_item' => __( 'Add New Category' ), + 'new_item_name' => __( 'New Category Name' ), + 'menu_name' => __( 'Categories' )); + + register_taxonomy('propel_category', 'propel_project', array( + 'hierarchical' => true, + 'labels' => $labels, + 'show_ui' => true, + 'query_var' => true, + 'rewrite' => array( 'slug' => 'propel_category' ), + )); + + unset($labels); + $labels = array( + 'name' => _x( 'Propel', 'post type general name' ), + 'singular_name' => _x( 'Propel', 'post type singular name' ), + 'add_new' => _x( 'Add New', 'project' ), + 'add_new_item' => __( 'Add New Project' ), + 'edit_item' => __( 'Edit Project' ), + 'new_item' => __( 'New Project' ), + 'all_items' => __( 'All Projects' ), + 'view_item' => __( 'View Project' ), + 'search_items' => __( 'Search Projects' ), + 'not_found' => __( 'No projects found' ), + 'not_found_in_trash' => __( 'No projects found in Trash' ), + 'parent_item_colon' => '', + 'menu_name' => 'Propel' + ); + + $args = array( + 'labels' => $labels, + 'public' => true, + 'publicly_queryable' => true, + 'show_ui' => true, + 'show_in_menu' => true, + 'query_var' => true, + 'rewrite' => true, + 'capability_type' => 'post', + 'has_archive' => true, + 'hierarchical' => false, + 'menu_position' => null, + 'menu_icon' => WP_PLUGIN_URL . '/propel/images/icon.png', + 'supports' => array( 'title','editor','comments', 'author', 'custom-fields', 'revisions' ) + ); + + register_post_type( self::POST_TYPE, $args ); + + $argz = array( + 'post_type' => 'propel_project', + 'action' => 'complete', + 'label' => 'Complete' ); + Propel_Functions::add_post_action( $argz, array( __CLASS__, 'action_complete' ) ); + + } + + /** + * @since 2.0 + */ + public static function action_complete( $post_id ) { + $end = get_post_meta( $post_id, '_propel_end_date', true); + if( !$end && empty( $_POST['end_date'] ) ) { + update_post_meta( $post_id, '_propel_end_date', time() ); + } + update_post_meta( $post_id, '_propel_complete', 100 ); + + $tasks = get_children( "post_parent=$post_id" ); + + foreach( $tasks as $task ) { + $end = get_post_meta( $task->ID, '_propel_end_date', true); + if( !$end && empty( $_POST['end_date'] ) ) { + update_post_meta( $task->ID, '_propel_end_date', time() ); + } + update_post_meta( $task->ID, '_propel_complete', 100 ); + } + } + + /** + * @since 2.0 + */ + public static function admin_menu() { + global $submenu; + unset($submenu['edit.php?post_type=propel_project'][10]); + } + + /** + * @since 2.0 + */ + public static function register_columns($columns) { + $new_columns['cb'] = ''; + $new_columns['title'] = _x( 'Project Name', 'column name' ); + if( Propel_Options::option('show_client' ) ) + $new_columns['client'] = __( 'Client', 'propel' ); + $new_columns['author'] = __( 'Manager', 'propel' ); + if( Propel_Options::option('show_start_date' ) ) + $new_columns['start'] = __( 'Start Date', 'propel' ); + if( Propel_Options::option('show_end_date' ) ) + $new_columns['end'] = __( 'End Date', 'propel' ); + $new_columns['priority'] = __( 'Priority', 'propel' ); + if( Propel_Options::option('show_progress' ) ) + $new_columns['complete'] = __( 'Progress', 'propel' ); + $new_columns['comments'] = $columns['comments']; + return $new_columns; + } + + /** + * @since 2.0 + */ + public static function register_sortable_columns( $x ) { + $columns['client'] = 'client'; + $columns['start'] = 'start'; + $columns['end'] = 'end'; + $columns['priority'] = 'priority'; + $columns['complete'] = 'complete'; + $columns['author'] = 'author'; + return $columns; + } + + /** + * @since 2.0 + */ + public static function manage_columns($column_name, $id) { + global $wpdb; + + switch ($column_name) { + case 'id': + echo $id; + break; + + case 'client': + $id = get_post_meta($id, '_propel_owner', true); + if(!$id) { + echo "admin"; + break; + } + + $user = get_userdata($id); + if(!$user) { + echo "admin"; + break; + } + + echo "" . $user->display_name . ""; + break; + + case 'start': + $date = get_post_meta( $id, '_propel_start_date', true ); + if($date) { + echo date( "M. jS, Y" , $date ); + } + break; + + case 'end': + $date = get_post_meta( $id, '_propel_end_date', true ); + if($date) { + + echo date( get_option( 'date_format' ) , $date ); // Project's actual due date. + echo "
" . date( get_option( 'date_format' ) . " G:i" ); // Todays date. + + $day = date('d'); // Day of the countdown + $month = date('m'); // Month of the countdown + $year = date('Y'); // Year of the countdown + $hour = date('H'); // Hour of the day (east coast time) + + $calculation = ( $date - time() ) / 3600; + $hours = (int)$calculation + 24; + $days = (int)( $hours / 24 ) - 1; + + $hours_remaining = $hours-($days*24)-24; + + // Used for debugging. + // date_default_timezone_set('America/Los_Angeles'); + // echo "
"; + // print_r(date_default_timezone_get()); + + if ( $hours >= 48 ) { + echo "
Due in " . $days . " days " . $hours_remaining . " hours."; + } elseif ( $hours <= 48 && $hours >= 24 ) { + echo "
Due tomorrow."; + } elseif ( $hours <= 24 && $hours >= 0 ) { + echo "
Due today."; + } elseif ( $hours < 0 && $hours > -24 ) { + echo "
" . str_replace( '-', '', $hours) . " hours past due."; + } elseif ( $hours < -24 ) { + echo "
" . str_replace( '-', '', $days) . " days past due."; + } + + else { + echo "
Recurring Project"; + } + + } + break; + + case 'priority': + $priorities = propel_get_priorities(); + echo $priorities[get_post_meta( $id, '_propel_priority', true )]; + break; + + case 'complete': + echo get_post_meta( $id, '_propel_complete', true ) . "%"; + break; + + default: + break; + } + } + + /** + * @since 2.0 + */ + public static function add_meta_boxes() { + add_meta_box( 'propel_project_meta', __('Project', 'propel' ), + array( __CLASS__, 'edit_project_meta'), 'propel_project', 'side' ); + + if( isset($_GET['action']) && $_GET['action'] == "edit" ) { + add_meta_box('propel_project_tasks', __('Project Tasks', 'propel'), array( __CLASS__, 'project_tasks'), 'propel_project', 'normal', 'high', 10, 2 ); + add_meta_box('propel_completed_tasks', __('Completed Tasks', 'propel'), array( __CLASS__, 'completed_tasks'), 'propel_project', 'normal', 'high', 10, 2 ); + add_meta_box('propel_add_task', __('Add Task', 'propel'), array( __CLASS__, 'add_task' ), 'propel_project', 'side'); + } + } + + /** + * + */ + public static function completed_tasks( $post, $id ) { + global $wpdb; + $parent = get_the_ID(); + //@todo: profile query / use WP_Query + $query = "SELECT `post_id`, `meta_value` AS `progress` + FROM `{$wpdb->postmeta}` + WHERE `meta_key` = '_propel_complete' + AND `meta_value` = 100 AND `{$wpdb->postmeta}`.`post_id` + IN (SELECT `ID` FROM {$wpdb->posts} + WHERE `post_parent`={$parent} AND `post_status` = 'publish') + ORDER BY `meta_value` DESC, `post_id` DESC;"; + + $posts = $wpdb->get_results($query); + require( dirname(__FILE__) . '/../metaboxes/tasks.php'); + } + + /** + * @since 2.0 + */ + public static function project_tasks( $post, $id ) { + global $wpdb; + $parent = get_the_ID(); + //@todo: profile query / use WP_Query? + $query = "SELECT `post_id`, `meta_value` AS `progress` + FROM `{$wpdb->postmeta}` + WHERE `meta_key` = '_propel_complete' + AND `meta_value` < 100 AND `{$wpdb->postmeta}`.`post_id` + IN (SELECT `ID` FROM {$wpdb->posts} + WHERE `post_parent`={$parent} AND `post_status` = 'publish') + ORDER BY `meta_value` DESC, `post_id` DESC;"; + + $posts = $wpdb->get_results($query); + require( dirname(__FILE__) . '/../metaboxes/tasks.php' ); + } + + /** + * @since 2.0 + */ + public static function edit_project_meta() { + wp_nonce_field( plugin_basename( __FILE__ ), 'propel_nonce' ); + + $start = get_post_meta( get_the_ID(), '_propel_start_date', true ); + if($start) + $start = date( "M. jS, Y", $start ); + + $end = get_post_meta( get_the_ID(), '_propel_end_date', true ); + if($end) + $end = date( "M. jS, Y", $end ); + + $priority = get_post_meta( get_the_ID(), '_propel_priority', true ); + if(!$priority) + $priority = 1; + + $complete = get_post_meta( get_the_ID(), '_propel_complete', true ); + if(!$complete) + $complete = 0; + + $owner = get_post_meta( get_the_ID(), '_propel_owner', true ); + if(!$owner) + $owner = 0; + + $users = get_users(); + + require_once( dirname(__FILE__) . '/../metaboxes/project-meta.php' ); + } + + /** + * @since 2.0 + */ + public static function save_post($post_id) { + if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) + return; + + if ( !isset( $_POST['propel_nonce'] ) ) + return; + + if ( !wp_verify_nonce( $_POST['propel_nonce'], plugin_basename( __FILE__ ) ) ) + return; + + if ( 'page' == $_POST['post_type'] ) { + if ( !current_user_can( 'edit_page', $post_id ) ) + return; + } else { + if ( !current_user_can( 'edit_post', $post_id ) ) + return; + } + + if( !isset( $_POST['complete'] ) ) + $_POST['complete'] = ''; //@todo: probably shouldn't set the value of a superglobal like this + + $start = !empty( $_POST['start_date'] ) ? strtotime( $_POST['start_date'] ) : time(); + update_post_meta( $post_id, '_propel_start_date', $start ); + + $end = strtotime($_POST['end_date']); + if( empty( $_POST['end_date'] ) && $_POST['complete'] == 100 ) { + $end = time(); + } + update_post_meta( $post_id, '_propel_end_date', $end ); + update_post_meta( $post_id, '_propel_priority', (int)$_POST['priority'] ); + update_post_meta( $post_id, '_propel_complete', (int)$_POST['complete'] ); + update_post_meta( $post_id, '_propel_owner', (int)$_POST['propel_post_author'] ); + + } + + /** + * @since 2.0 + */ + public static function add_task() { + require_once( dirname(__FILE__) . '/../metaboxes/add-task.php' ); + } + + /** + * @since 2.0 + */ + public static function wp_ajax_add_task() { + + check_ajax_referer( 'add-task', 'security' ); + $post = array( + 'post_title' => $_POST['title'], + 'post_content' => $_POST['description'], + 'post_parent' => $_POST['parent'], + 'post_author' => $_POST['user'], + 'post_type' => 'propel_task', + 'post_status' => 'publish' + ); + + $id = wp_insert_post( $post ); + if( !$id ) die(0); + + update_post_meta( $id, '_propel_start_date', time() ); + update_post_meta( $id, '_propel_end_date', strtotime( $_POST['end_date'] ) ); + update_post_meta( $id, '_propel_complete', 0 ); + update_post_meta( $id, '_propel_priority', $_POST['priority'] ); + do_action( 'post_wp_ajax_add_task', $id ); + die($id); + } + + /** + * @since 2.0 + */ + public static function admin_footer() { ?> + + \ No newline at end of file diff --git a/post-types/task.php b/post-types/task.php new file mode 100755 index 0000000..1d1b74e --- /dev/null +++ b/post-types/task.php @@ -0,0 +1,452 @@ + + + ID, '_propel_complete', true ); + $priority = get_post_meta( $post->ID, '_propel_priority', true ); + $actions['inline hide-if-no-js'] = '"; + $actions['inline hide-if-no-js'] .= __( 'Quick Edit' ); + $actions['inline hide-if-no-js'] .= ''; + + return $actions; + } + + public static function quick_edit_custom_box($column_name, $post_type) { + if ($column_name != 'complete') return; + ?> +
+
+ Progress + +
+
+ Priority + +
+ +
+ post_content; + die(); + } + + /** + * @since 2.0 + */ + public static function admin_menu() { + remove_meta_box( 'postcustom', 'propel_task', 'core' ); + } + + /** + * @since 2.0 + */ + public static function parse_query($query) { + global $pagenow; + if ( !isset( $_GET['post_type'] ) ) + return $query; + + if( $pagenow != "edit.php" && $_GET['post_type'] != self::POST_TYPE ) + return $query; + + if( isset( $_GET['project'] ) ) { + $query->query_vars['post_parent'] = (int)$_GET['project']; + return $query; + } + + return $query; + } + + /** + * @since 2.0 + */ + public static function save_post($post_id) { + if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) + return; + + if ( !isset( $_POST['propel_nonce'] ) ) + return; + + if ( !wp_verify_nonce( $_POST['propel_nonce'], plugin_basename( __FILE__ ) ) ) + return; + + if ( 'page' == $_POST['post_type'] ) { + if ( !current_user_can( 'edit_page', $post_id ) ) + return; + } else { + if ( !current_user_can( 'edit_post', $post_id ) ) + return; + } + + $start = !empty( $_POST['start_date'] ) ? strtotime( $_POST['start_date'] ) : time(); + update_post_meta( $post_id, '_propel_start_date', $start ); + + $end = strtotime($_POST['end_date']); + if( empty( $_POST['end_date'] ) && $_POST['complete'] == 100 ) { + $end = time(); + } + update_post_meta( $post_id, '_propel_end_date', $end ); + + update_post_meta( $post_id, '_propel_priority', (int)$_POST['priority'] ); + update_post_meta( $post_id, '_propel_complete', (int)$_POST['complete'] ); + + + } + + public static function register_taxonomy() { + + $labels = array( + 'name' => _x( 'States', 'taxonomy general name' ), + 'singular_name' => _x( 'States', 'taxonomy singular name' ), + 'search_items' => __( 'Search states' ), + 'all_items' => __( 'All States' ), + 'parent_item' => __( 'Parent State' ), + 'parent_item_colon' => __( 'Parent State:' ), + 'edit_item' => __( 'Edit State' ), + 'update_item' => __( 'Update State' ), + 'add_new_item' => __( 'Add New State' ), + 'new_item_name' => __( 'New State Name' ), + 'menu_name' => __( 'States' )); + + register_taxonomy( 'propel_status', 'propel_project', array( + 'public' => false, + 'labels' => $labels, + // 'show_ui' => true, + // 'query_var' => true, + ) ); + + $state = array( 'Not Yet Started', 'Started', 'Finished', 'Delievered', 'Accepted', 'Rejected' ); + + foreach($state as $status) { + if( !term_exists($status, 'propel_status')) { + wp_insert_term($status, 'propel_status'); + } + } + + $labels = array( + 'name' => _x( 'Type', 'taxonomy general name' ), + 'singular_name' => _x( 'Types', 'taxonomy singular name' ), + 'search_items' => __( 'Search types' ), + 'all_items' => __( 'All Types' ), + 'parent_item' => __( 'Parent Type' ), + 'parent_item_colon' => __( 'Parent Type:' ), + 'edit_item' => __( 'Edit Type' ), + 'update_item' => __( 'Update Type' ), + 'add_new_item' => __( 'Add New Type' ), + 'new_item_name' => __( 'New Type Name' ), + 'menu_name' => __( 'Types' )); + + register_taxonomy( 'propel_type', 'propel_task', array( + 'public' => false, + 'labels' => $labels, + // 'show_ui' => true, + // 'query_var' => true, + // 'show_in_nav_menus' => true, + + ) ); + + $type = array( 'Feature', 'Bug' ); + + foreach($type as $t) { + if( !term_exists($t, 'propel_type')) { + wp_insert_term($t, 'propel_type'); + } + } + } + + /** + * @since 2.0 + */ + public static function register_post_type() { + + $labels = array( + 'name' => _x('Tasks', 'post type general name'), + 'singular_name' => _x('Tasks', 'post type singular name'), + 'add_new' => _x('Add New', 'propel'), + 'add_new_item' => __('Add New Task'), + 'edit_item' => __('Edit Task'), + 'new_item' => __('New Task'), + 'all_items' => __('All Tasks'), + 'view_item' => __('View Task'), + 'search_items' => __('Search Tasks'), + 'not_found' => __('No tasks found'), + 'not_found_in_trash' => __('No tasks found in Trash'), + 'parent_item_colon' => '', + 'menu_name' => 'Propel'); + + $args = array( + 'labels' => $labels, + 'public' => true, + 'publicly_queryable' => true, + 'show_ui' => (wp_count_posts('propel_project')->publish > 0) ? true : false, + 'show_in_menu' => 'edit.php?post_type=propel_project', + 'query_var' => true, + 'rewrite' => true, + 'taxonomies' => array('propel_category', 'post_tag'), + 'capability_type' => 'post', + 'has_archive' => true, + 'hierarchical' => false, + 'menu_position' => null, + 'supports' => array('title','editor','comments', 'author', 'custom-fields', 'revisions')); + + register_post_type(self::POST_TYPE, $args); + + $argz = array( + 'post_type' => 'propel_task', + 'action' => 'complete', + 'label' => 'Complete' ); + Propel_Functions::add_post_action( $argz, array( __CLASS__, 'action_complete' ) ); + } + + public static function default_hidden_meta_boxes( $hidden, $screen ) { + if($screen->id == 'propel_project') { + $hidden[] = 'postcustom'; + } + + if( $screen->id == 'propel_task') { + $hidden[] = 'custom-fields'; + } + + return $hidden; + } + + /** + * @since 2.0 + */ + public static function register_columns($columns) { + $new_columns['cb'] = ''; + $new_columns['title'] = _x( 'Task Name', 'column name' ); + $new_columns['project'] = __( 'Project', 'propel' ); + $new_columns['author'] = __( 'Owner', 'propel' ); + if( Propel_Options::option('show_start_date' ) ) + $new_columns['start'] = __( 'Start Date', 'propel' ); + if( Propel_Options::option('show_end_date' ) ) + $new_columns['end'] = __( 'End Date', 'propel' ); + $new_columns['priority'] = __( 'Priority', 'propel' ); + $new_columns['type'] = __( 'Type', 'propel' ); + $new_columns['complete'] = __( 'Progress', 'propel' ); + $new_columns['propel_categories'] = __( 'Categories', 'propel' ); + $new_columns['tags'] = $columns['tags']; + $new_columns['comments'] = $columns['comments']; + return $new_columns; + } + + /** + * @since 2.0 + */ + public static function register_sortable_columns( $x ) { + $columns['start'] = 'start'; + $columns['end'] = 'end'; + $columns['project'] = 'project'; + $columns['priority'] = 'priority'; + $columns['complete'] = 'complete'; + $columns['author'] = 'author'; + return $columns; + } + + /** + * @since 2.0 + */ + public static function manage_columns($column_name, $id) { + global $wpdb; + + switch ($column_name) { + case 'id': + echo $id; + break; + + case 'project': + $id = get_post( $id ); + $project = get_post( $id->post_parent ); + echo "" . $project->post_title . ""; + break; + + case 'type': + $terms = wp_get_post_terms( $id, 'propel_type' ); + if( is_array( $terms ) ) + echo $terms[0]->name; + break; + + case 'start': + $date = get_post_meta( $id, '_propel_start_date', true ); + if($date) { + echo date( "M. jS, Y" , $date ); + } + break; + + case 'end': + $date = get_post_meta( $id, '_propel_end_date', true ); + if($date) { + echo date( "M. jS, Y" , $date ); + } + break; + + case 'priority': + $priorities = propel_get_priorities(); + echo $priorities[get_post_meta( $id, '_propel_priority', true )]; + break; + + case 'complete': + echo get_post_meta( $id, '_propel_complete', true ) . "%"; + break; + + case 'propel_categories': + $categories = get_the_terms(0, "propel_category"); + $categories_html = array(); + if(is_array($categories)) { + foreach ($categories as $category) { + array_push($categories_html, '' . $category->name . ''); + } + echo implode($categories_html, ", "); + } + break; + + default: + break; + } + } + + /** + * @since 2.0 + */ + public static function add_meta_boxes() { + add_meta_box('custom-fields', __('Custom Fields'), + 'post_custom_meta_box', self::POST_TYPE, 'normal', 'low'); + + add_meta_box( 'propel_task_meta', __( 'Edit Task', 'propel' ), + array( __CLASS__, 'edit_task_meta'), self::POST_TYPE, 'side' ); + } + + /** + * @since 2.0 + */ + public static function edit_task_meta() { + wp_nonce_field( plugin_basename( __FILE__ ), 'propel_nonce' ); + + $start = get_post_meta( get_the_ID(), '_propel_start_date', true ); + if($start) + $start = date("M. jS, Y", $start); + + $end = get_post_meta( get_the_ID(), '_propel_end_date', true ); + if($end) + $end = date("M. jS, Y", $end); + + $priority = get_post_meta( get_the_ID(), '_propel_priority', true ); + if(!$priority) + $priority = 0; + + $complete = get_post_meta( get_the_ID(), '_propel_complete', true ); + if(!$complete) + $complete = 0; + + $post = get_post( get_the_ID() ); + $parent = $post->post_parent; + + $types = wp_get_post_terms( get_the_ID(), 'propel_type' ); + if( is_array( $types ) && isset( $types[0] ) ) { + $type = $types[0]->term_id; + } else { + $type = 0; + } + + require_once( dirname(__FILE__) . '/../metaboxes/edit-task.php' ); + } + + /** + * @since 2.0 + */ + public static function action_complete( $post_id ) { + $end = get_post_meta( $post_id, '_propel_end_date', true); + if( !$end && empty( $_POST['end_date'] ) ) { + update_post_meta( $post_id, '_propel_end_date', time() ); + } + update_post_meta( $post_id, '_propel_complete', 100 ); + } + +} \ No newline at end of file diff --git a/post-types/time.php b/post-types/time.php new file mode 100755 index 0000000..2690c5e --- /dev/null +++ b/post-types/time.php @@ -0,0 +1,279 @@ + _x('Time', 'post type general name'), + 'singular_name' => _x('Time', 'post type singular name'), + 'add_new' => _x('Add New', 'time'), + 'add_new_item' => __('Add New Time'), + 'edit_item' => __('Edit Time'), + 'new_item' => __('New Time'), + 'all_items' => __('All Time'), + 'view_item' => __('View Time'), + 'search_items' => __('Search Time'), + 'not_found' => __('No time found'), + 'not_found_in_trash' => __('No time found in Trash'), + 'parent_item_colon' => 'Propel', + 'menu_name' => 'Time'); + + $args = array( + 'labels' => $labels, + 'public' => true, + 'publicly_queryable' => true, + 'show_ui' => true, + 'show_in_menu' => 'edit.php?post_type=propel_project', + 'query_var' => true, + 'rewrite' => true, + 'capability_type' => 'post', + 'has_archive' => true, + 'hierarchical' => false, + 'menu_position' => null, + 'supports' => array('')); + + register_post_type(self::POST_TYPE, $args ); + + $argv = array( + 'label' => "Billed", + 'public' => true, + 'exclude_from_search' => false, + 'show_in_admin_all_list' => true, + 'show_in_admin_status_list' => true, + 'post_type' => 'propel_time' ); + + Propel_Functions::register_post_status( 'billed', $argv ); + + $argz = array( + 'post_type' => 'propel_time', + 'action' => 'bill', + 'label' => 'Bill' ); + Propel_Functions::add_post_action( $argz, array( __CLASS__, 'bill' ) ); + } + + + /** + * Add metaboxes + * @since 2.0 + */ + public static function add_meta_boxes() { + add_meta_box( 'edit_task_meta', __( 'Time', 'propel' ), + array( __CLASS__, 'edit_task_meta'), 'propel_time', 'normal', 'high' ); + } + + /** + * @since 2.0 + * @param $post + */ + public static function edit_task_meta( $post ) { + wp_nonce_field( plugin_basename( __FILE__ ), 'propel_nonce' ); + + $projects = query_posts( 'post_type=propel_project&post_status=publish' ); + echo ""; + echo ""; + + wp_reset_query(); + } + + /** + * Add custom columns in the table + * @since 2.0 + * @param $columns + * @return $new_columns + */ + public static function register_columns( $columns ) { + $new_columns['cb'] = ''; + $new_columns['title'] = __('Title', 'propel'); + $new_columns['action'] = __('Action', 'propel'); + $new_columns['client'] = __('Client', 'propel'); + $new_columns['project'] = __('Project', 'propel'); + $new_columns['task'] = __('Task', 'propel'); + $new_columns['start'] = __('Start', 'propel'); + $new_columns['end'] = __('End', 'propel'); + $new_columns['duration'] = __('Duration', 'propel'); + $new_columns['author'] = __('User', 'propel'); + return $new_columns; + } + + /** + * Make columns sortable + * @since 2.0 + * @param $columns + * @return $new_columns + */ + public static function register_sortable_columns( $columns ) { + $new_columns['client'] = 'client'; + $new_columns['project'] = 'project'; + $new_columns['task'] = 'task'; + $new_columns['start'] = 'start'; + $new_columns['end'] = 'end'; + $new_columns['duration'] = 'duration'; + $new_columns['user'] = 'user'; + return $new_columns; + } + + + /** + * Output table data + * @since 2.0 + * @param $column_name + * @param $id + */ + public static function manage_columns( $column_name, $id ) { + global $wpdb; + + $post = get_post( $id ); + + $parent = get_post( $post->post_parent ); + + if( $parent->post_type == "propel_project" ) { + $project = $parent; + } else { + $task = $parent; + $project = get_post( $task->post_parent ); + } + + $client = get_post_meta( $project->ID, '_propel_project_owner', true ); + + switch ( $column_name ) { + case 'id': + echo $id; + break; + + case 'action': + if( !get_post_meta( $id, '_propel_time_start', true) ) + echo "Start"; + else if(! get_post_meta( $id, '_propel_time_end', true) ) + echo "End"; + else + echo ""; + + break; + + case 'client': + $user = get_userdata( $client ); + if($user) + echo "" . $user->user_nicename . ""; + break; + + case 'project': + echo $project->post_title; + break; + + case 'task': + if( isset( $task->post_title ) ) + echo $task->post_title; + break; + + case 'start': + $start = get_post_meta( $id, '_propel_time_end', true ); + if($start) + echo date('G:i:s', $start ); + break; + + case 'end': + $end = get_post_meta( $id, '_propel_time_end', true ); + if($end) + echo date('G:i:s', $end ); + break; + + case 'duration': + $start = get_post_meta( $id, '_propel_time_start', true ); + $end = get_post_meta( $id, '_propel_time_end', true ); + echo date('G:i:s', $end-$start ); + break; + + default: + break; + } + } + + /** + * Create a WP-Invoice + * @since 2.0 + */ + public static function bill() { + die("Sorry, not implemented yet..."); + } +} + +?> \ No newline at end of file diff --git a/propel.php b/propel.php new file mode 100755 index 0000000..91748d5 --- /dev/null +++ b/propel.php @@ -0,0 +1,278 @@ +

Propel has changed its database structure. To continue using this plugin, you must first use our migration tool

"; +} + + +Propel_Options::initialize(); +Propel::initialize(); + + + +class Propel { + + public static function initialize() { + if(get_option('PROPEL_DBVERSION') < PROPEL_CURRENT_DBVERSION) { + add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) ); + return; + } + + add_action( 'admin_init', array(__CLASS__, 'admin_init' ) ); + add_action( 'init', array( __CLASS__, 'init')); + + require_once( dirname(__FILE__) . '/functions.php' ); + require_once( dirname(__FILE__) . '/post-types/project.php' ); + require_once( dirname(__FILE__) . '/post-types/task.php' ); + require_once( dirname(__FILE__) . '/deprecated.php' ); + if( Propel_Options::get_option('time_tracking') ) + require_once( dirname(__FILE__) . '/post-types/time.php' ); + require_once( dirname(__FILE__) . '/plugins/users.php' ); + } + + /** + * @since 1.0 + */ + public static function admin_menu() { + if( get_option( 'PROPEL_DBVERSION' ) < PROPEL_CURRENT_DBVERSION ) { + add_menu_page( null, 'Propel', 'activate_plugins', 'propel_migrate_tool', array( __CLASS__ , 'migration_tool' ) ); + return; + } + } + + public static function migration_tool() { + global $wpdb; + define( 'PROPEL_MIGRATE_DB', 1 ); + require_once( 'migrate.php' ); + } + + /** + * @since 1.6 + */ + public static function admin_init () { + wp_enqueue_script('jquery-datatables', + plugins_url( '/propel/js/jquery.dataTables.min.js' ), array('jquery', 'jquery-ui-core') ); + wp_enqueue_script('propel-functions', + plugins_url( '/propel/js/functions.js' ), array( 'jquery-datatables' ) ); + wp_register_style("propel-admin-jquery-ui", plugins_url( '/propel/themes/smoothness/jquery-ui-1.8.6.custom.css' ) ); + wp_enqueue_style('propel-admin-jquery-ui'); + } + + /** + * Initialize CSS and JavaScript + * @TODO: Only load the JavaScript when necessary + * @see http://codex.wordpress.org/Function_Reference/wp_enqueue_style + * @see http://codex.wordpress.org/Function_Reference/wp_enqueue_script + * @since 1.1 + */ + public static function init () { + + wp_enqueue_script('jquery'); + wp_enqueue_script('jquery-ui-core'); + wp_enqueue_script('jquery-ui-widget'); + + wp_enqueue_script('jquery-ui-tabs'); + wp_enqueue_script('jquery-ui-datepicker', + plugins_url( '/propel/js/jquery.ui.datepicker.min.js' ), array('jquery', 'jquery-ui-core') ); + wp_enqueue_script('jquery-ui-progressbar', + plugins_url( '/propel/js/jquery.ui.progressbar.min.js' ), array('jquery', 'jquery-ui-core', 'jquery-ui-widget') ); + + $options = get_option( 'propel_options' ); + wp_register_style("propel-jquery-ui", $options['theme'] ); + wp_register_style("genesis-ui", plugins_url( '/propel/gen/ui.css' ) ); + wp_register_style("propel-ui", plugins_url( '/propel/style.css' ) ); + + wp_enqueue_style('genesis-ui'); + wp_enqueue_style('propel-jquery-ui'); + if(get_option('PROPEL_INCLUDE_CSS') == true) + wp_enqueue_style('propel-ui'); + } + + +} + +class Propel_Options { + + /** + * Initialize Propel_Options + */ + public static function initialize() { + add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) ); + add_action( 'admin_init', array( __CLASS__, 'admin_init' ) ); + } + + /** + * @param $option Option name + * @return The option if the option exists false otherwise + */ + public static function get_option( $option ) { + $options = get_option( 'propel_options' ); + + if( isset( $options[$option] ) ) + return $options[$option]; + + return false; + } + + /** + * @param $option Option to update + * @param $value New value for the specified option + * @return bool True if option value has changed, false if not or if update failed. + */ + public static function update_option( $option, $value ) { + $options = get_option( 'propel_options' ); + $options[$option] = $value; + return update_option( 'propel_options', $options ); + } + + public static function admin_menu() { + add_options_page( 'Propel', 'Propel', 'manage_options', 'propel-options', array( __CLASS__, 'options' ) ); + } + + public static function options() { + ?> +
+

Propel Options

+
+ + + + +
+
+ +
"; + } + + public static function plugin_section_text() { + echo '

These options allow you to customize Propel.

'; + } + + public static function plugin_section_deprecated() { + echo '

These options are for deprecated features.

'; + } + + public static function propel_beta_options() { + $options = get_option( 'propel_options' ); + echo ' Enable Drag and Drop Ordering'; + echo '
'; + echo ' Enable Time Tracking'; + + do_action( 'propel_beta_options', $options ); + } + + public static function propel_ui_options() { + $options = get_option( 'propel_options' ); + + + echo ' Show Start Date'; + echo '
'; + + echo ' Show End Date'; + echo '
'; + + echo ' Show Client'; + echo '
'; + echo ' Show Project Progress'; + echo '
'; + do_action( 'propel_ui_options', $options ); + echo '

'; + } + + public static function propel_deprecated_options() { + $options = get_option( 'propel_options' ); + do_action( 'propel_deprecated_options', $options ); + echo '

'; + } + + public static function options_validate( $input ) { + do_action( 'propel_options_validate', $input ); + return $input; + } + + public static function option( $option ) { + $options = get_option('propel_options'); + return (isset($options[$option])) ? (bool)$options[$option] : false; + } +} + +function propel_get_priorities() { + return array( 'Low', 'Medium', 'High' ); +} + + + +register_activation_hook( __FILE__, 'propel_install' ); +function propel_install () { + /* + * @since 2.0.3 + */ + $options = get_option( 'propel_options' ); + if( ! isset( $options['theme'] ) || empty( $options['theme'] ) ) { + $options['theme'] = WP_PLUGIN_URL . '/propel/themes/smoothness/jquery-ui-1.8.6.custom.css'; + update_option( 'propel_options', $options ); + } + + /* + * @since 1.6 + */ + add_option( 'PROPEL_ERROR', '' ); + /* + * @since 1.7 + */ + add_option( 'PROPEL_INCLUDE_CSS', true ); + /* + * @since 1.2 + */ + add_option( 'PROPEL_DBVERSION', PROPEL_CURRENT_DBVERSION ); +} +?> \ No newline at end of file diff --git a/readme.txt b/readme.txt new file mode 100755 index 0000000..096fe5c --- /dev/null +++ b/readme.txt @@ -0,0 +1,37 @@ +=== Propel === +Contributors: johnciacia, sidewindernet +Tags: project, management, collaboration, tasks, project management, task management, basecamp +Requires at least: 3.0 +Tested up to: 3.3.1 +Stable tag: 2.0.4 + +This plugin allows users to manage projects and tasks. + +== Description == + +This plugin enables you to manage your projects from the +WordPress interface you are already comfortable with. Easily +create and track the progress of projects and tasks. + +If you are having issues with this plugin you may submit a comment here or ask on the WordPress forum. + +== Installation == + +1. Download propel.zip and unzip it. +2. Upload the plugin folder to wp-content/plugins/ and activate from the Plugin administrative menu. + +== Screenshots == +1. Front-end interface displaying one project. This is done using [pl-projects id=x]. To display all your projects use [pl-projects] +2. Quickly see important events from your WordPress dashboard +3. Create a project +4. Create a task +5. Quickly add tasks from your WordPress dashboard +6. Back-end tasks list +7. Back-end projects list + +== Frequently Asked Questions == += How do I display a projects status in a page? = +You can use the [pl-projects] short code in any page or post to show the status of all your current projects. You can show the status of an individual project by using [pl-projects id=x] where x is the id of the project. + += I don't understand the user permissions. = +Users with the super administrator or administrator role will be able to view tasks asigned to all users. Users with the role of editor, will only be able to view tasks assigned to them or to anyone. diff --git a/style.css b/style.css new file mode 100755 index 0000000..1d0417e --- /dev/null +++ b/style.css @@ -0,0 +1,50 @@ +/* beginning of metaboxes */ +/* beginning of metaboxes */ +/* beginning of metaboxes */ + + + +/* beginning of metaboxes-project-meta */ +/* beginning of metaboxes-project-meta */ +.metaboxes-project-meta { + width: 100%; +} +.metaboxes-project-meta .first-column { + font-size: 12px; + color: #999; +} +.metaboxes-project-meta .second-column { + width: 100px; +} +.metaboxes-project-meta select { + float: right; + width: 170px; +} +.metaboxes-project-meta input { + float: right; +} + + + +/* beginning of metaboxes-add-task */ +/* beginning of metaboxes-add-task */ +.metaboxes-add-task { + width: 100%; +} +.metaboxes-add-task .widefat { + width: 100% !important; +} +.metaboxes-add-task label { + float: left; + margin: 5px 0 0 0; + font-size: 12px; + color: #999; +} +.metaboxes-add-task .task-priority { + width: 200px; + float: right; +} +.metaboxes-add-task .task-owner { + width: 200px; + float: right; +} \ No newline at end of file diff --git a/test.php b/test.php new file mode 100755 index 0000000..75fc866 --- /dev/null +++ b/test.php @@ -0,0 +1,91 @@ + self::make_labels('Promo Box','Promo Boxes'), + 'public_queryable'=> false, + 'hierarchical' => true, // IMPORTANT!!! wp_dropdown_pages() requires 'hierarchical'=>true + 'show_ui' => true, + 'query_var' => false, + 'supports' => array('title','editor','thumbnail','custom-fields'), + 'show_in_nav_menus'=>true, + 'exclude_from_search'=>true, + )); + } + static function make_labels($singular,$plural=false,$args=array()) { + if ($plural===false) + $plural = $singular . 's'; + elseif ($plural===true) + $plural = $singular; + $defaults = array( + 'name' =>_x($plural,'post type general name'), + 'singular_name' =>_x($singular,'post type singular name'), + 'add_new' =>_x('Add New',$singular), + 'add_new_item' =>__("Add New $singular"), + 'edit_item' =>__("Edit $singular"), + 'new_item' =>__("New $singular"), + 'view_item' =>__("View $singular"), + 'search_items' =>__("Search $plural"), + 'not_found' =>__("No $plural Found"), + 'not_found_in_trash'=>__("No $plural Found in Trash"), + 'parent_item_colon' =>'', + ); + return wp_parse_args($args,$defaults); + } + static function action_add_meta_boxes_post($post) { + add_meta_box( + 'little-promo-boxes', // Metabox Name, used as the "id" for a wrapping div + 'Little Promo Boxes', // Metabox Title, visible to the user + array(__CLASS__,'the_little_promo_boxes_metabox'), // Callback function + 'post', // Add to the Edit screen for Post Types of 'post' + 'side', // Show it in the sidebar (if center then it would be 'normal' + 'low' // Show it below metaboxes that specify 'high' + ); + } + static function the_little_promo_boxes_metabox($post) { + $pto = get_post_type_object('promo-box'); + $default_options = array( + 'post_type' => 'promo-box', + 'show_option_none' => "Select a {$pto->labels->singular_name}", + ); + $promo_boxes = get_post_meta($post->ID,'_promo_boxes',true); + for($i=0; $i<=2; $i++) { + wp_dropdown_pages(array_merge($default_options,array( + 'id' => "promo_box_{$i}", + 'name' => 'promo_boxes[]', + 'selected' => (empty($promo_boxes[$i]) ? 0 : $promo_boxes[$i]), + ))); + } + } + static function filter_wp_insert_post_data($data, $postarr) { + update_post_meta($postarr['ID'],'_promo_boxes',$postarr['promo_boxes']); + return $data; + } + static function get_promo_boxes($post=false) { + static $promo_boxes=array(); + if (!$post) + $post = $GLOBALS['post']; + if (!isset($promo_boxes[$post->ID])) { + $promo_boxes[$post->ID] = get_post_meta($post->ID,'_promo_boxes',true); + $index = 0; + foreach($promo_boxes[$post->ID] as $promo_box_id) { + $promo_boxes[$post->ID][$index++] = (is_numeric($promo_box_id) ? get_post($promo_box_id) : false); + } + } + return $promo_boxes[$post->ID]; + } + static function get_promo_box($number,$post=false) { + $promo_boxes = self::get_promo_boxes($post); + return $promo_boxes[$number-1]; + } +} +LittlePromoBoxes::on_load(); + + +?> \ No newline at end of file diff --git a/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100755 index 0000000000000000000000000000000000000000..5b5dab2ab7b1c50dea9cfe73dc5a269a92d2d4b4 GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FscKIb$B>N1x91EQ4=4yQ7#`R^ z$vje}bP0l+XkK DSH>_4 literal 0 HcmV?d00001 diff --git a/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100755 index 0000000000000000000000000000000000000000..ac8b229af950c29356abf64a6c4aa894575445f0 GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FsY*{5$B>N1x91EQ4=4yQYz+E8 zPo9&<{J;c_6SHRil>2s{Zw^OT)6@jj2u|u!(plXsM>LJD`vD!n;OXk;vd$@?2>^GI BH@yG= literal 0 HcmV?d00001 diff --git a/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100755 index 0000000000000000000000000000000000000000..ad3d6346e00f246102f72f2e026ed0491988b394 GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^j6gJjgAK^akKnour0hLi978O6-<~(*I$*%ybaDOn z{W;e!B}_MSUQoPXhYd^Y6RUoS1yepnPx`2Kz)7OXQG!!=-jY=F+d2OOy?#DnJ32>z UEim$g7SJdLPgg&ebxsLQ09~*s;{X5v literal 0 HcmV?d00001 diff --git a/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100755 index 0000000000000000000000000000000000000000..42ccba269b6e91bef12ad0fa18be651b5ef0ee68 GIT binary patch literal 105 zcmeAS@N?(olHy`uVBq!ia0vp^j6gJjgAK^akKnouqzpV=978O6-=0?FV^9z|eBtf= z|7WztIJ;WT>{+tN>ySr~=F{k$>;_x^_y?afmf9pRKH0)6?eSP?3s5hEr>mdKI;Vst E0O;M1& literal 0 HcmV?d00001 diff --git a/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png new file mode 100755 index 0000000000000000000000000000000000000000..5a46b47cb16631068aee9e0bd61269fc4e95e5cd GIT binary patch literal 111 zcmeAS@N?(olHy`uVBq!ia0vp^j6gJjgAK^akKnouq|7{B978O6lPf+wIa#m9#>Unb zm^4K~wN3Zq+uP{vDV26o)#~38k_!`W=^oo1w6ixmPC4R1b Tyd6G3lNdZ*{an^LB{Ts5`idse literal 0 HcmV?d00001 diff --git a/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100755 index 0000000000000000000000000000000000000000..7c9fa6c6edcfcdd3e5b77e6f547b719e6fc66e30 GIT binary patch literal 101 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 literal 0 HcmV?d00001 diff --git a/themes/smoothness/images/ui-icons_2e83ff_256x240.png b/themes/smoothness/images/ui-icons_2e83ff_256x240.png new file mode 100755 index 0000000000000000000000000000000000000000..09d1cdc856c292c4ab6dd818c7543ac0828bd616 GIT binary patch literal 4369 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 literal 0 HcmV?d00001 diff --git a/themes/smoothness/images/ui-icons_454545_256x240.png b/themes/smoothness/images/ui-icons_454545_256x240.png new file mode 100755 index 0000000000000000000000000000000000000000..59bd45b907c4fd965697774ce8c5fc6b2fd9c105 GIT binary patch literal 4369 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 oBo%DI*Kv;w;*%(i9W@f3_WCF#rGn literal 0 HcmV?d00001 diff --git a/themes/smoothness/images/ui-icons_cd0a0a_256x240.png b/themes/smoothness/images/ui-icons_cd0a0a_256x240.png new file mode 100755 index 0000000000000000000000000000000000000000..2ab019b73ec11a485fa09378f3a0e155194f6a5d GIT binary patch literal 4369 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"DROP TABLE IF EXISTS {$wpdb->prefix}projects"); + $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}tasks"); + delete_option( 'propel_theme' ); + delete_option( 'PROPEL_ERROR' ); + delete_option( 'PROPEL_DBVERSION' ); + delete_option( 'PROPEL_INCLUDE_CSS' ); + delete_option( 'propel_authors_version' ); +} + +uninstall(); + +?> \ No newline at end of file diff --git a/widgets/all-tasks.php b/widgets/all-tasks.php new file mode 100755 index 0000000..e69de29 From 1f07e73666c927e68100e98e776cb5e29902c06a Mon Sep 17 00:00:00 2001 From: Leland Smith Date: Thu, 23 Aug 2012 06:20:02 +0000 Subject: [PATCH 05/86] Just fixing some styling things regarding the tasks metabox on project pages. --- metaboxes/tasks.php | 48 +++++++++++++++++++----------------------- post-types/project.php | 4 +--- readme.txt | 15 ++++++------- style.css | 23 ++++++++++++++++++++ 4 files changed, 52 insertions(+), 38 deletions(-) diff --git a/metaboxes/tasks.php b/metaboxes/tasks.php index 300daa5..b593cc6 100644 --- a/metaboxes/tasks.php +++ b/metaboxes/tasks.php @@ -1,19 +1,21 @@ + + + - + - + + - + + - - - @@ -21,7 +23,6 @@ foreach($posts as $post) { $task = get_post($post->post_id); $progress = get_post_meta( $task->ID, '_propel_complete', true ); - $priority = get_post_meta( $task->ID, '_propel_priority', true ); $start = get_post_meta( $task->ID, '_propel_start_date', true ); if( $start ) @@ -43,41 +44,36 @@ $nonce = wp_create_nonce('propel-trash'); ?> - + + - + - + + + + +

- - - - - - " . date( get_option( 'date_format' ) . " G:i" ); // Todays date. + // echo "
" . date( get_option( 'date_format' ) . " G:i" ); Todays date. $day = date('d'); // Day of the countdown $month = date('m'); // Month of the countdown diff --git a/readme.txt b/readme.txt index 096fe5c..3b3e965 100644 --- a/readme.txt +++ b/readme.txt @@ -1,8 +1,8 @@ === Propel === -Contributors: johnciacia, sidewindernet -Tags: project, management, collaboration, tasks, project management, task management, basecamp +Contributors: johnciacia, The Portland Company, sidewindernet +Tags: project, management, collaboration, tasks, project management, task management, basecamp, mavenlink, do, crm, invoicing, invoices, estimates, estimating, task manager, project manager Requires at least: 3.0 -Tested up to: 3.3.1 +Tested up to: 3.4 Stable tag: 2.0.4 This plugin allows users to manage projects and tasks. @@ -11,15 +11,12 @@ This plugin allows users to manage projects and tasks. This plugin enables you to manage your projects from the WordPress interface you are already comfortable with. Easily -create and track the progress of projects and tasks. +create and track the progress of projects and tasks. + +It seamlessly integrates with WP-CRM and WP-Invoice, provided by Usability Dynamics. If you are having issues with this plugin you may submit a comment here or ask on the WordPress forum. -== Installation == - -1. Download propel.zip and unzip it. -2. Upload the plugin folder to wp-content/plugins/ and activate from the Plugin administrative menu. - == Screenshots == 1. Front-end interface displaying one project. This is done using [pl-projects id=x]. To display all your projects use [pl-projects] 2. Quickly see important events from your WordPress dashboard diff --git a/style.css b/style.css index 4d09d3d..c18b155 100644 --- a/style.css +++ b/style.css @@ -47,4 +47,27 @@ .metaboxes-add-task .task-owner { width: 200px; float: right; +} + +.tasks-table p { + margin: 5px 0; +} +.tasks-table td { + padding: 0 0 0 1px; + min-width: auto; + color: #666; + text-shadow: 1px 1px #fff; +} +.tasks-table .title { + padding: 0 15px 0 0; +} +.tasks-table .author { + font-size: 10px; +} +.tasks-table .odd { + background: #fdfdfd; +} +.gen-icon { + margin: 0; + padding: 0; } \ No newline at end of file From 290b0e2a99c1426d4bb2d275c940c8d59248a037 Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 23 Aug 2012 16:01:47 +0800 Subject: [PATCH 06/86] Delete the script event to toggle the details. this is use for updating the task in place. --- js/functions.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/js/functions.js b/js/functions.js index 7ecbf4e..0f8f794 100755 --- a/js/functions.js +++ b/js/functions.js @@ -36,28 +36,6 @@ jQuery(document).ready(function($) { "aoColumns" : asdf }); - jQuery('.tasks-table tbody tr').click(function() { - if(jQuery('#details-' + jQuery(this).attr('id')).length > 0) { - jQuery('#details-' + jQuery(this).attr('id')).remove(); - } else { - id = jQuery(this).attr('id'); - jQuery(this).after(''); - get_details(id); - - } - }); - - /* - $('.tasks-table tbody tr').hover( - function() { - console.log($(this).children(':first')); - $(this).children(':first').toggleClass('toggle-arrow'); - }, - function() { - $(this).children(':first').toggleClass('toggle-arrow'); - } - ); - */ } ); function get_details(id) { From e466c25bf09e4048aa910aaca58012d94b58a72e Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 23 Aug 2012 16:02:40 +0800 Subject: [PATCH 07/86] Add some missing functions and scripts event on this file. --- post-types/project.php | 334 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 317 insertions(+), 17 deletions(-) diff --git a/post-types/project.php b/post-types/project.php index 91f74dd..f28b412 100755 --- a/post-types/project.php +++ b/post-types/project.php @@ -15,12 +15,16 @@ public static function init() { add_action( 'add_meta_boxes', array( __CLASS__, 'add_meta_boxes' ) ); add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) ); add_action( 'save_post', array( __CLASS__, 'save_post' ) ); - add_action( 'admin_footer', array( __CLASS__, 'admin_footer' ) ); + add_action( 'admin_footer', array( __CLASS__, 'admin_footer' ) ); add_filter( 'manage_edit-' . self::POST_TYPE . '_sortable_columns', array( __CLASS__, 'register_sortable_columns' ) ); add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( __CLASS__, 'register_columns' ) ); add_filter( 'parse_query', array( __CLASS__, 'parse_query' ) ); + add_action( 'project_get_task', array( __CLASS__, 'project_get_task' ) ); add_action( 'wp_ajax_add_task', array( __CLASS__, 'wp_ajax_add_task' ) ); + add_action( 'wp_ajax_update_task', array( __CLASS__, 'wp_ajax_update_task' ) ); + add_action( 'wp_ajax_get_task_detail', array( __CLASS__, 'wp_ajax_get_task_detail' ) ); add_action( 'load-post.php', array( __CLASS__, 'post' ) ); + add_action( 'propel_add_task', array( __CLASS__, 'add_task' ) ); add_filter( 'request', array( __CLASS__, 'request' ) ); } @@ -331,7 +335,7 @@ public static function add_meta_boxes() { if( isset($_GET['action']) && $_GET['action'] == "edit" ) { add_meta_box('propel_project_tasks', __('Project Tasks', 'propel'), array( __CLASS__, 'project_tasks'), 'propel_project', 'normal', 'high', 10, 2 ); add_meta_box('propel_completed_tasks', __('Completed Tasks', 'propel'), array( __CLASS__, 'completed_tasks'), 'propel_project', 'normal', 'high', 10, 2 ); - add_meta_box('propel_add_task', __('Add Task', 'propel'), array( __CLASS__, 'add_task' ), 'propel_project', 'side'); + //add_meta_box('propel_add_task', __('Add Task', 'propel'), array( __CLASS__, 'add_task' ), 'propel_project', 'side'); } } @@ -369,7 +373,8 @@ public static function project_tasks( $post, $id ) { WHERE `post_parent`={$parent} AND `post_status` = 'publish') ORDER BY `meta_value` DESC, `post_id` DESC;"; - $posts = $wpdb->get_results($query); + $posts = $wpdb->get_results($query); + do_action( 'propel_add_task' ); require( dirname(__FILE__) . '/../metaboxes/tasks.php' ); } @@ -472,6 +477,8 @@ public static function wp_ajax_add_task() { update_post_meta( $id, '_propel_complete', 0 ); update_post_meta( $id, '_propel_priority', $_POST['priority'] ); do_action( 'post_wp_ajax_add_task', $id ); + do_action( 'project_get_task', $id); + die($id); } @@ -480,27 +487,320 @@ public static function wp_ajax_add_task() { */ public static function admin_footer() { ?> + + //rob_eyouth : added this to remove the deleted data from the current task table + $("#propel-tasks tbody td.gen-delete-icon").live('click',function(){ + var $parent = $(this).parent(); + $parent.fadeOut('slow',function(){ + var _href = $(this).find('a').attr('href'); + jQuery.post(_href,function() { + $parent.remove(); + }); + + }); + return false; + }); + + //rob_eyouth : added this to remove the checked data from the current task table + // and added to the completed task table + $("#propel-tasks tbody td.gen-unchecked-icon").live('click',function(){ + var task_id = $(this).parent().attr('id'); + var $parent = $(this).parent(); + var data = { + action: 'update_task', + security: '', + postid: task_id, + end_date: '', + priority: $('#propel_edit_prior').val(), + complete: 100, + propel_post_author: $('#propel_post_author').val() + }; + + jQuery.post(ajaxurl, data, function(response) { + $parent.fadeOut('slow',function(){ + $parent.remove(); + $('#propel_completed_tasks #post_parent_').after(response,function(){ + $('#propel_project_tasks #propel-tasks tbody').fadeIn('slow'); + }); + }) + }); + + return false; + }); + + $("#propel_project_tasks #propel-tasks tbody tr.toggle").live('click',function(event){ + + var task_id = $(this).attr('id'); + + if(jQuery('#details-' + task_id).length > 0) { + + jQuery('#details-' + task_id).remove(); + + } else { + + var data = { + action: 'get_task_detail', + security: '', + postid: task_id, + }; + + jQuery.post(ajaxurl, data, function(response) { + $("#" + task_id).fadeIn('slow',function(){ + $(this).closest( "tr" ).after( response ); + }); + }); + } + + return false; + }).live('mouseenter',function(){ + $(this).css({'cursor':'pointer'}); + }).live('mouseleave',function(){ + $(this).css({'cursor':'default'}); + }); + + $('#propel_task_update').live('click',function(){ + + var _task_id = $.trim($(this).closest('tr').attr('id').substr(8,5)); + var _tr_id = $(this).closest('tr').attr('id'); + var _tr_before_id = $('#'+_task_id).prev('tr').attr('id'); + + var data = { + action: 'update_task', + security: '', + parent: '', + postid: _task_id, + end_date: '', + title: $('#propel_edit_task').val(), + priority: $('#propel_edit_prior').val(), + complete: $('#propel_edit_progress').val(), + user: $('#propel_edit_author').val() + }; + + jQuery.post(ajaxurl, data, function(response) { + $('#'+_task_id).fadeOut('slow',function(){ + $(this).remove(); + $('#'+_tr_id).fadeOut('slow',function(){ + $(this).remove(); + }); + if ( parseInt($('#propel_edit_progress').val()) < 100 ) { + if ( _tr_before_id === undefined ) + $("#propel_project_tasks #propel-tasks tbody").prepend(response).fadeIn('slow'); + else + $("#" + _tr_before_id).closest( "tr" ).after( response ).fadeIn('slow'); + } else { + $('#propel_completed_tasks #propel-tasks tbody').prepend(response).fadeIn('slow'); + } + }) + }); + + return false; + }); + + jQuery('#propel_project_tasks .metaboxes-add-task').css({ 'border':'1px solid #DFDFDF', 'padding':'10px', 'margin':'10px 0' }); + jQuery('#propel_post_author').addClass('task-priority'); + }) + ID, '_propel_complete', true ); + $priority = get_post_meta( $task->ID, '_propel_priority', true ); + $start = get_post_meta( $task->ID, '_propel_start_date', true ); + if( $start ) + $start = date( get_option( 'date_format' ), $start ); + + $end = get_post_meta( $task->ID, '_propel_end_date', true ); + if( $end ) + $end = date( get_option( 'date_format' ), $end); + + if( $task->post_author ) { + $userdata = get_userdata( $task->post_author ); + $authid = $userdata->ID; + $author = $userdata->display_name; + } else { + $authid = '-1'; + $author = "Unassigned"; + } + + $x = ($progress == 100) ? "" : "un"; + $nonce = wp_create_nonce('propel-trash'); + + ?> + + + + + + + + + + + + + + + + + + + + + + + + (int)$post_id, + 'post_title' => $_POST['title'], + 'post_parent' => $_POST['parent'], + 'post_type' => 'propel_task', + 'post_status' => 'publish' + ); + wp_update_post( $post ); + } + + $start = !empty( $_POST['start_date'] ) ? strtotime( $_POST['start_date'] ) : time(); + + update_post_meta( $post_id, '_propel_start_date', $start ); + + $end = strtotime($_POST['end_date']); + if( empty( $_POST['end_date'] ) && $_POST['complete'] == 100 ) { + $end = time(); + } + + update_post_meta( $post_id, '_propel_end_date', $end ); + + if ( isset( $_POST['priority'] ) ) + update_post_meta( $post_id, '_propel_priority', (int)$_POST['priority'] ); + + if ( isset( $_POST['complete'] ) ) + update_post_meta( $post_id, '_propel_complete', (int)$_POST['complete'] ); + + if ( isset( $_POST['user'] ) ) + update_post_meta( $post_id, '_propel_owner', (int)$_POST['user'] ); + + do_action('project_get_task',$post_id); + + die($post_id); } -} + + /** + * @since 2.0 + * rob: added this function.. + */ + public static function wp_ajax_get_task_detail() { + $id = $_POST["postid"]; + $task = get_post($id); + $nonce = wp_create_nonce('propel-trash'); + if( $task->post_author ) { + $userdata = get_userdata( $task->post_author ); + $authid = $userdata->ID; + $author = $userdata->display_name; + } else { + $authid = '-1'; + $author = "Unassigned"; + } + ?> + + + + + + + + + + + + \ No newline at end of file From 7d218c7f2d9d4d3e82cfa5118137a0f0348d10c8 Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 23 Aug 2012 16:03:08 +0800 Subject: [PATCH 08/86] add necessary changes to this file for the hierarchy. --- metaboxes/tasks.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/metaboxes/tasks.php b/metaboxes/tasks.php index 5a7b5b1..f5746fb 100755 --- a/metaboxes/tasks.php +++ b/metaboxes/tasks.php @@ -19,14 +19,21 @@ - - + + + + + + + ID == $userdata->ID || $current_user->ID == 1) { ?> - + From fd9d9a89fe353f8806bda42660b572fde12e5369 Mon Sep 17 00:00:00 2001 From: Leland Smith Date: Thu, 23 Aug 2012 19:21:52 +0000 Subject: [PATCH 09/86] Don't remember. --- functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.php b/functions.php index bb93569..453ccb4 100755 --- a/functions.php +++ b/functions.php @@ -39,7 +39,7 @@ function mytheme_admin_bar_render() { $wp_admin_bar->add_menu( array( 'parent' => false, 'id' => 'customer_support', - 'title' => __('Preference') + 'title' => __('Context') )); $contactUsURL = $current_url; From ea6b4a609f271ce4a803763e1f546e0b73296e96 Mon Sep 17 00:00:00 2001 From: rob Date: Fri, 24 Aug 2012 08:02:52 +0800 Subject: [PATCH 10/86] update to fix the JS error in adding a TD. Add this condition if the start_date and end_date fields is shown, this will ensure that the TD elements matched the instance of the data-tables. --- metaboxes/tasks.php | 9 ++++++++- post-types/project.php | 12 ++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/metaboxes/tasks.php b/metaboxes/tasks.php index f5746fb..9d0b686 100755 --- a/metaboxes/tasks.php +++ b/metaboxes/tasks.php @@ -33,7 +33,14 @@ - + + + + + + + + get_results($query); - do_action( 'propel_add_task' ); require( dirname(__FILE__) . '/../metaboxes/tasks.php' ); } @@ -782,7 +780,13 @@ public static function wp_ajax_get_task_detail() { ?>

+ + + + + + + + From 48e15605922abb007673b4cc1435d8b6c31af23f Mon Sep 17 00:00:00 2001 From: Leland Smith Date: Fri, 24 Aug 2012 22:37:26 +0000 Subject: [PATCH 15/86] - Moved styling files to a UI folder so theyre not separate anymore. - Minimalized the project tasks panel interface. - Integrated an actual progress bar (HMTL5). - Some other various things that I can't recall. --- metaboxes/{tasks.php => project-tasks.php} | 69 +++++++++++++-------- post-types/project.php | 4 +- propel.php | 4 +- {gen => ui/gen}/images/checked.png | Bin {gen => ui/gen}/images/delete.png | Bin {gen => ui/gen}/images/edit.png | Bin {gen => ui/gen}/images/info.png | Bin {gen => ui/gen}/images/unchecked.png | Bin {gen => ui/gen}/ui.css | 0 style.css => ui/style.css | 22 +++++++ widgets/all-tasks.php | 0 11 files changed, 69 insertions(+), 30 deletions(-) rename metaboxes/{tasks.php => project-tasks.php} (69%) rename {gen => ui/gen}/images/checked.png (100%) rename {gen => ui/gen}/images/delete.png (100%) rename {gen => ui/gen}/images/edit.png (100%) rename {gen => ui/gen}/images/info.png (100%) rename {gen => ui/gen}/images/unchecked.png (100%) rename {gen => ui/gen}/ui.css (100%) rename style.css => ui/style.css (76%) delete mode 100755 widgets/all-tasks.php diff --git a/metaboxes/tasks.php b/metaboxes/project-tasks.php similarity index 69% rename from metaboxes/tasks.php rename to metaboxes/project-tasks.php index 9d0b686..4d156b5 100755 --- a/metaboxes/tasks.php +++ b/metaboxes/project-tasks.php @@ -1,14 +1,45 @@ +

Name

Priority

Owner

Start

Start

Due

Due

Progress

-

post_title); ?>

+ Delete -

+ Edit + + Complete +

post_title); ?>

-

+

-

%

- Delete - Edit - Complete

 

+ Delete + Edit + Complete +

post_title); ?>

+

+
+

+
+

+

%

+

+
+

+ 'propel_edit_author', + 'show_option_none' => 'Unassigned', + 'orderby' => 'display_name', + 'name' => 'propel_edit_author', + 'selected' => $project->post_author + ); + wp_dropdown_users( $args ); + ?> +

+
+

+ +

+

- post_parent); - $parent_obj = get_post($parent); - esc_html_e($parent_obj->post_title); - ?> -

+

+ post_parent); + $parent_obj = get_post($parent); + esc_html_e($parent_obj->post_title); + ?> +

+
Delete

"; - foreach( $projects as $project ) { - echo ''; - - if($profile == "personal"){ - $argv = array( - 'numberposts' => -1, - 'post_type' => 'propel_task', - 'post_status' => 'publish', - 'post_parent' => $project->ID, - 'tax_query' => array( - array( - 'taxonomy' => 'author', - 'field' => 'name', - 'terms' => $u->user_login - ) - ) - ); - } else { - $argv = array( - 'numberposts' => -1, - 'post_type' => 'propel_task', - 'post_status' => 'publish', - 'post_parent' => $project->ID - ); - } - $tasks = get_posts( $argv ); - - foreach( $tasks as $task ) { - $progress = get_post_meta( $task->ID, '_propel_complete', true ); - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - } - } - echo "
' . $project->post_title . '
" . $task->post_title . "
" . $progress . "%
"; -?> - -ID; $id = $part1 . $part2; $static_id = (int)($id); - $profile = get_post_meta( $static_id, '_propel_preference',true); + $profile = get_post_meta( $static_id, '_propel_preference',true); + if(empty($profile)){ - $profile = "personal"; - } + $profile = "personal"; + } + if($profile == "personal"){ - $args = array( - 'numberposts' => -1, - 'post_type' => 'propel_project', - 'post_status' => 'publish', - 'tax_query' => array( - array( - 'taxonomy' => 'author', - 'field' => 'name', - 'terms' => $u->user_login - ) - ) ); + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish', + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) + ); } else { - $args = array( - 'numberposts' => -1, - 'post_type' => 'propel_project', - 'post_status' => 'publish' - ); - } + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish' + ); + } + $projects = get_posts( $args ); + echo ""; + foreach( $projects as $project ) { + if($profile == "personal"){ - $argv = array( - 'numberposts' => -1, - 'post_type' => 'propel_task', - 'post_status' => 'publish', - 'post_parent' => $project->ID, - 'tax_query' => array( - array( - 'taxonomy' => 'author', - 'field' => 'name', - 'terms' => $u->user_login - ) - ) - ); + + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID, + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) + ); + } else { - $argv = array( - 'numberposts' => -1, - 'post_type' => 'propel_task', - 'post_status' => 'publish', - 'post_parent' => $project->ID - ); - } - $tasks = get_posts( $argv ); - foreach( $tasks as $task ) { - $progress = get_post_meta( $task->ID, '_propel_complete', true ); - $date = get_post_meta( $task->ID, '_propel_end_date', true ); - if($date) { + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID + ); + } + + $tasks = get_posts( $argv ); - //echo date( get_option( 'date_format' ) , $date ); // Project's actual due date. - - $day = date('d'); // Day of the countdown - $month = date('m'); // Month of the countdown - $year = date('Y'); // Year of the countdown - $hour = date('H'); // Hour of the day (east coast time) - - $calculation = ( $date - time() ) / 3600; - $hours = (int)$calculation + 24; - $days = (int)( $hours / 24 ) - 1; - - $hours_remaining = $hours-($days*24)-24; - - if ( $hours < 0 && $hours > -24 ) { - - echo ""; - echo ""; - echo " "; - echo ""; - } - - if ( $hours < -24 ) { - echo ""; - echo ""; - echo " "; - echo ""; - } - - } + foreach( $tasks as $task ) { + + $progress = get_post_meta( $task->ID, '_propel_complete', true ); + $date = get_post_meta( $task->ID, '_propel_end_date', true ); + + if($date) { + + //echo date( get_option( 'date_format' ) , $date ); // Project's actual due date. + + $day = date('d'); // Day of the countdown + $month = date('m'); // Month of the countdown + $year = date('Y'); // Year of the countdown + $hour = date('H'); // Hour of the day (east coast time) + + $calculation = ( $date - time() ) / 3600; + $hours = (int)$calculation + 24; + $days = (int)( $hours / 24 ) - 1; + + $hours_remaining = $hours-($days*24)-24; + + if ( $hours < 0 && $hours > -24 ) { + echo ""; + echo ""; + echo ""; + echo ""; + } + + if ( $hours < -24 ) { + echo ""; + echo ""; + echo " "; + echo ""; + } + } } } echo "
" . $task->post_title . "" . str_replace( '-', '', $hours) - . " hours past due.
" . $task->post_title . "" - . str_replace( '-', '', $days) . " days past due.
" . $task->post_title . "" . str_replace( '-', '', $hours) + . " hours past due.
" . $task->post_title . "" + . str_replace( '-', '', $days) . " days past due.
"; @@ -417,33 +326,40 @@ function Due_Today_Tomorrow_Function() { ); } $projects = get_posts( $args ); + echo ""; + foreach( $projects as $project ) { - echo ''; - if($profile == "personal"){ + if($profile == "personal") { $argv = array( - 'numberposts' => -1, - 'post_type' => 'propel_task', - 'post_status' => 'publish', - 'post_parent' => $project->ID, - 'tax_query' => array( - array( - 'taxonomy' => 'author', - 'field' => 'name', - 'terms' => $u->user_login - ) + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID, + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login ) - ); + ) + ); } else { - $argv = array( - 'numberposts' => -1, - 'post_type' => 'propel_task', - 'post_status' => 'publish', - 'post_parent' => $project->ID - ); + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID + ); } - $tasks = get_posts( $argv ); + + $tasks = get_posts( $argv ); + + if ( !isset($tasks) ) { + echo ''; + } + foreach( $tasks as $task ) { $progress = get_post_meta( $task->ID, '_propel_complete', true ); $date = get_post_meta( $task->ID, '_propel_end_date', true ); @@ -462,22 +378,22 @@ function Due_Today_Tomorrow_Function() { $hours_remaining = $hours-($days*24)-24; - if ( $hours <= 48 && $hours >= 24 ) { - - echo ""; - echo ""; - echo " "; - echo ""; - } - - if ( $hours <= 24 && $hours >= 0 ) { - echo ""; - echo ""; - echo " "; - echo ""; - } + if ( $hours <= 48 && $hours >= 24 ) { + + echo ""; + echo ""; + echo " "; + echo ""; + } + + if ( $hours <= 24 && $hours >= 0 ) { + echo ""; + echo ""; + echo " "; + echo ""; + } } } @@ -486,7 +402,7 @@ function Due_Today_Tomorrow_Function() { } function Due_Today_Tomorrow_Hook() { - wp_add_dashboard_widget('duetodaytomorrow_dashboard_widget', 'Due Today And Tomorrow Tasks', 'Due_Today_Tomorrow_Function'); + wp_add_dashboard_widget('duetodaytomorrow_dashboard_widget', 'Tasks Due Today And Tomorrow', 'Due_Today_Tomorrow_Function'); } add_action('wp_dashboard_setup', 'Due_Today_Tomorrow_Hook' ); diff --git a/metaboxes/add-task.php b/metaboxes/add-task.php index a619574..ea8acc9 100755 --- a/metaboxes/add-task.php +++ b/metaboxes/add-task.php @@ -1,57 +1,21 @@ -
' . $project->post_title . '
' . $project->post_title . '
" . $task->post_title . "Due tomorrow.
" . $task->post_title . "Due today.
" . $task->post_title . "Due tomorrow.
" . $task->post_title . "Due today.
- - - + - - - + + + - - - - - + + 'metabox-add-task-user', +'name' => 'propel_post_author', +'show_option_none' => 'Unassigned', +'orderby' => 'display_name', +'selected' => $current_user->ID +); +wp_dropdown_users( $args ); +?> + - - - - - - - - - - - -
- -
- -
- -
- - -
- - 'propel_post_author', - 'show_option_none' => 'Unassigned', - 'orderby' => 'display_name', - 'selected' => $current_user->ID - ); - wp_dropdown_users( $args ); - ?> -
- -
\ No newline at end of file + \ No newline at end of file diff --git a/style.css b/style.css index c18b155..58cb4e6 100755 --- a/style.css +++ b/style.css @@ -70,4 +70,14 @@ .gen-icon { margin: 0; padding: 0; +} +.metabox-add-task-title { + width: 270px; +} +.metabox-add-task-description { + float: left; + clear: both; + height: 23px; + margin: 0 0 2px 0; + width: 100%; } \ No newline at end of file From 1d34dc3cc92ed114232228e8c0a997168a3c6a99 Mon Sep 17 00:00:00 2001 From: apswebdev Date: Fri, 24 Aug 2012 11:12:58 +0800 Subject: [PATCH 12/86] This change is to ensure that the title of the project associated with a task is visible from the past due task This change also has updated the filtering of tasks, from the problem of tasks that is not visible. --- functions.php | 114 +++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 62 deletions(-) diff --git a/functions.php b/functions.php index a777df5..095e21c 100755 --- a/functions.php +++ b/functions.php @@ -35,7 +35,7 @@ function mytheme_admin_bar_render() { global $wp; $current_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $wp_admin_bar->remove_menu('updates'); - $customerSupportURL = $current_url; + $customerSupportURL = $current_url; $wp_admin_bar->add_menu( array( 'parent' => false, @@ -174,9 +174,9 @@ function dashboard_client_support_requests_content() { add_action('wp_dashboard_setup', 'dashboard_client_support_requests_metabox'); - + /* DASHBOARD METABOX THAT DISPLAYS PAST DUE TASKS */ -function Past_Due_Function() { +function Past_Due_Function() { global $user_ID; $u = get_userdata($user_ID); @@ -185,41 +185,27 @@ function Past_Due_Function() { $part2 = $current_user->ID; $id = $part1 . $part2; $static_id = (int)($id); - $profile = get_post_meta( $static_id, '_propel_preference',true); + $profile = get_post_meta( $static_id, '_propel_preference',true); if(empty($profile)){ $profile = "personal"; - } + } - if($profile == "personal"){ - $args = array( - 'numberposts' => -1, - 'post_type' => 'propel_project', - 'post_status' => 'publish', - 'tax_query' => array( - array( - 'taxonomy' => 'author', - 'field' => 'name', - 'terms' => $u->user_login - ) - ) - ); - } else { - $args = array( + $args = array( 'numberposts' => -1, 'post_type' => 'propel_project', 'post_status' => 'publish' - ); - } + ); + $projects = get_posts( $args ); - + echo ""; - + foreach( $projects as $project ) { - + $display = 0; if($profile == "personal"){ - + $argv = array( 'numberposts' => -1, 'post_type' => 'propel_task', @@ -232,7 +218,7 @@ function Past_Due_Function() { 'terms' => $u->user_login ) ) - ); + ); } else { $argv = array( @@ -241,15 +227,15 @@ function Past_Due_Function() { 'post_status' => 'publish', 'post_parent' => $project->ID ); - } + } - $tasks = get_posts( $argv ); + $tasks = get_posts( $argv ); - foreach( $tasks as $task ) { - + foreach( $tasks as $task ) { + $progress = get_post_meta( $task->ID, '_propel_complete', true ); $date = get_post_meta( $task->ID, '_propel_end_date', true ); - + if($date) { //echo date( get_option( 'date_format' ) , $date ); // Project's actual due date. @@ -266,6 +252,10 @@ function Past_Due_Function() { $hours_remaining = $hours-($days*24)-24; if ( $hours < 0 && $hours > -24 ) { + if ($display == 0){ + echo ""; + $display++; + } echo ""; echo ""; echo ""; + $display++; + } echo ""; echo ""; echo " "; echo ""; } - } + } } } echo "
" .$project->post_title. "
" . $task->post_title . "" . str_replace( '-', '', $hours) @@ -274,13 +264,17 @@ function Past_Due_Function() { } if ( $hours < -24 ) { + if ($display == 0){ + echo "" .$project->post_title. "
" . $task->post_title . "" . str_replace( '-', '', $days) . " days past due.
"; @@ -306,31 +300,19 @@ function Due_Today_Tomorrow_Function() { if(empty($profile)){ $profile = "personal"; } - if($profile == "personal"){ - $args = array( - 'numberposts' => -1, - 'post_type' => 'propel_project', - 'post_status' => 'publish', - 'tax_query' => array( - array( - 'taxonomy' => 'author', - 'field' => 'name', - 'terms' => $u->user_login - ) - ) ); - } else { - $args = array( - 'numberposts' => -1, - 'post_type' => 'propel_project', - 'post_status' => 'publish' - ); - } + + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish' + ); + $projects = get_posts( $args ); - + echo ""; - + foreach( $projects as $project ) { - + $display = 0; if($profile == "personal") { $argv = array( 'numberposts' => -1, @@ -353,14 +335,15 @@ function Due_Today_Tomorrow_Function() { 'post_parent' => $project->ID ); } - - $tasks = get_posts( $argv ); - - if ( !isset($tasks) ) { - echo ''; + + $tasks = get_posts( $argv ); + + if ( !isset($tasks) ) { + echo ''; } - + foreach( $tasks as $task ) { + $progress = get_post_meta( $task->ID, '_propel_complete', true ); $date = get_post_meta( $task->ID, '_propel_end_date', true ); if($date) { @@ -379,7 +362,10 @@ function Due_Today_Tomorrow_Function() { $hours_remaining = $hours-($days*24)-24; if ( $hours <= 48 && $hours >= 24 ) { - + if ($display == 0){ + echo ""; + $display++; + } echo ""; echo ""; @@ -388,6 +374,10 @@ function Due_Today_Tomorrow_Function() { } if ( $hours <= 24 && $hours >= 0 ) { + if ($display == 0){ + echo ""; + $display++; + } echo ""; echo ""; From c6b0c34a88de340b08e742d10a613b2d9dc4bc0a Mon Sep 17 00:00:00 2001 From: apswebdev Date: Fri, 24 Aug 2012 11:15:04 +0800 Subject: [PATCH 13/86] delete this test file as this is not necessary to the propel --- test.php | 91 -------------------------------------------------------- 1 file changed, 91 deletions(-) delete mode 100755 test.php diff --git a/test.php b/test.php deleted file mode 100755 index 75fc866..0000000 --- a/test.php +++ /dev/null @@ -1,91 +0,0 @@ - self::make_labels('Promo Box','Promo Boxes'), - 'public_queryable'=> false, - 'hierarchical' => true, // IMPORTANT!!! wp_dropdown_pages() requires 'hierarchical'=>true - 'show_ui' => true, - 'query_var' => false, - 'supports' => array('title','editor','thumbnail','custom-fields'), - 'show_in_nav_menus'=>true, - 'exclude_from_search'=>true, - )); - } - static function make_labels($singular,$plural=false,$args=array()) { - if ($plural===false) - $plural = $singular . 's'; - elseif ($plural===true) - $plural = $singular; - $defaults = array( - 'name' =>_x($plural,'post type general name'), - 'singular_name' =>_x($singular,'post type singular name'), - 'add_new' =>_x('Add New',$singular), - 'add_new_item' =>__("Add New $singular"), - 'edit_item' =>__("Edit $singular"), - 'new_item' =>__("New $singular"), - 'view_item' =>__("View $singular"), - 'search_items' =>__("Search $plural"), - 'not_found' =>__("No $plural Found"), - 'not_found_in_trash'=>__("No $plural Found in Trash"), - 'parent_item_colon' =>'', - ); - return wp_parse_args($args,$defaults); - } - static function action_add_meta_boxes_post($post) { - add_meta_box( - 'little-promo-boxes', // Metabox Name, used as the "id" for a wrapping div - 'Little Promo Boxes', // Metabox Title, visible to the user - array(__CLASS__,'the_little_promo_boxes_metabox'), // Callback function - 'post', // Add to the Edit screen for Post Types of 'post' - 'side', // Show it in the sidebar (if center then it would be 'normal' - 'low' // Show it below metaboxes that specify 'high' - ); - } - static function the_little_promo_boxes_metabox($post) { - $pto = get_post_type_object('promo-box'); - $default_options = array( - 'post_type' => 'promo-box', - 'show_option_none' => "Select a {$pto->labels->singular_name}", - ); - $promo_boxes = get_post_meta($post->ID,'_promo_boxes',true); - for($i=0; $i<=2; $i++) { - wp_dropdown_pages(array_merge($default_options,array( - 'id' => "promo_box_{$i}", - 'name' => 'promo_boxes[]', - 'selected' => (empty($promo_boxes[$i]) ? 0 : $promo_boxes[$i]), - ))); - } - } - static function filter_wp_insert_post_data($data, $postarr) { - update_post_meta($postarr['ID'],'_promo_boxes',$postarr['promo_boxes']); - return $data; - } - static function get_promo_boxes($post=false) { - static $promo_boxes=array(); - if (!$post) - $post = $GLOBALS['post']; - if (!isset($promo_boxes[$post->ID])) { - $promo_boxes[$post->ID] = get_post_meta($post->ID,'_promo_boxes',true); - $index = 0; - foreach($promo_boxes[$post->ID] as $promo_box_id) { - $promo_boxes[$post->ID][$index++] = (is_numeric($promo_box_id) ? get_post($promo_box_id) : false); - } - } - return $promo_boxes[$post->ID]; - } - static function get_promo_box($number,$post=false) { - $promo_boxes = self::get_promo_boxes($post); - return $promo_boxes[$number-1]; - } -} -LittlePromoBoxes::on_load(); - - -?> \ No newline at end of file From 489cce9c1d255e480f3e1987787c45bf8136b485 Mon Sep 17 00:00:00 2001 From: apswebdev Date: Fri, 24 Aug 2012 22:14:19 +0800 Subject: [PATCH 14/86] This changes covers the ff: 1.) Context Indication has been done. 2.) Change Search Box for Authors and Contributors. 3.) Projects that are not due should not appear. --- functions.php | 22 ++++--- metaboxes/edit-task.php | 49 ++++++++++++---- metaboxes/list-authors.php | 46 ++++++++++++++- metaboxes/list-authors_ajax.php | 100 ++++++++++++++++++++++++++++++++ metaboxes/owner_ajax.php | 27 +++++++++ 5 files changed, 223 insertions(+), 21 deletions(-) create mode 100644 metaboxes/list-authors_ajax.php create mode 100644 metaboxes/owner_ajax.php diff --git a/functions.php b/functions.php index 095e21c..029d79b 100755 --- a/functions.php +++ b/functions.php @@ -17,11 +17,6 @@ function ajax_update(x){ http_req.onreadystatechange = function(){ } http_req.send(); - if (x == "admin"){ - alert("This will revert to Admin Settings."); - } else if(x == "personal"){ - alert("This will revert to Personal Settings."); - } } remove_menu('updates'); $customerSupportURL = $current_url; + $part1 = "889999999999"; + $current_user = wp_get_current_user(); + $part2 = $current_user->ID; + $id = $part1 . $part2; + $static_id = (int)($id); + $profile = get_post_meta( $static_id, '_propel_preference',true); + if(empty($profile)){ + $title = "Context - Personal"; + } elseif($profile == 'personal'){ + $title = "Context - Personal"; + } elseif($profile == 'admin'){ + $title = "Context - Admin"; + } $wp_admin_bar->add_menu( array( 'parent' => false, 'id' => 'customer_support', - 'title' => __('Context') + 'title' => __($title) )); $contactUsURL = $current_url; @@ -392,7 +400,7 @@ function Due_Today_Tomorrow_Function() { } function Due_Today_Tomorrow_Hook() { - wp_add_dashboard_widget('duetodaytomorrow_dashboard_widget', 'Tasks Due Today And Tomorrow', 'Due_Today_Tomorrow_Function'); + wp_add_dashboard_widget('duetodaytomorrow_dashboard_widget', 'Tasks Due Today And Tomorrow', 'Due_Today_Tomorrow_Function'); } add_action('wp_dashboard_setup', 'Due_Today_Tomorrow_Hook' ); diff --git a/metaboxes/edit-task.php b/metaboxes/edit-task.php index f2cc197..2fbb390 100755 --- a/metaboxes/edit-task.php +++ b/metaboxes/edit-task.php @@ -1,3 +1,33 @@ + + +
' . $project->post_title . '
' . $project->post_title . '
" .$project->post_title. "
" . $task->post_title . "" .$project->post_title. "
" . $task->post_title . "
'propel_project', 'numberposts' => -1 ) ); @@ -80,18 +110,15 @@ - + + + +

Manager

- 'propel_post_author', - 'show_option_none' => 'Unassigned', - 'orderby' => 'display_name', - 'name' => 'propel_post_author', - 'selected' => $post->post_author - ); - wp_dropdown_users( $args ); - ?> + + post_author); ?> + +
\ No newline at end of file diff --git a/metaboxes/list-authors.php b/metaboxes/list-authors.php index 630a723..72cf6e5 100755 --- a/metaboxes/list-authors.php +++ b/metaboxes/list-authors.php @@ -1,9 +1,33 @@ + + 'display_name', 'order' => 'ASC' ) ); ?>

@@ -13,10 +37,17 @@
Select Owner + + +
- - - - - + + + - + @@ -20,15 +51,7 @@ - + @@ -40,7 +63,7 @@ - + + + + -

Name

Owner

+

Title

Contributors

Start

Started

-

- post_parent); - $parent_obj = get_post($parent); - esc_html_e($parent_obj->post_title); - ?> -

-
-

%

-

- \ No newline at end of file + \ No newline at end of file diff --git a/post-types/project.php b/post-types/project.php index 865d321..33dd5e7 100755 --- a/post-types/project.php +++ b/post-types/project.php @@ -354,7 +354,7 @@ public static function completed_tasks( $post, $id ) { ORDER BY `meta_value` DESC, `post_id` DESC;"; $posts = $wpdb->get_results($query); - require( dirname(__FILE__) . '/../metaboxes/tasks.php'); + require( dirname(__FILE__) . '/../metaboxes/project-tasks.php'); } /** @@ -373,7 +373,7 @@ public static function project_tasks( $post, $id ) { ORDER BY `meta_value` DESC, `post_id` DESC;"; $posts = $wpdb->get_results($query); - require( dirname(__FILE__) . '/../metaboxes/tasks.php' ); + require( dirname(__FILE__) . '/../metaboxes/project-tasks.php' ); } /** diff --git a/propel.php b/propel.php index 91748d5..b1ae361 100755 --- a/propel.php +++ b/propel.php @@ -112,8 +112,8 @@ public static function init () { $options = get_option( 'propel_options' ); wp_register_style("propel-jquery-ui", $options['theme'] ); - wp_register_style("genesis-ui", plugins_url( '/propel/gen/ui.css' ) ); - wp_register_style("propel-ui", plugins_url( '/propel/style.css' ) ); + wp_register_style("genesis-ui", plugins_url( '/propel/ui/gen/ui.css' ) ); + wp_register_style("propel-ui", plugins_url( '/propel/ui/style.css' ) ); wp_enqueue_style('genesis-ui'); wp_enqueue_style('propel-jquery-ui'); diff --git a/gen/images/checked.png b/ui/gen/images/checked.png similarity index 100% rename from gen/images/checked.png rename to ui/gen/images/checked.png diff --git a/gen/images/delete.png b/ui/gen/images/delete.png similarity index 100% rename from gen/images/delete.png rename to ui/gen/images/delete.png diff --git a/gen/images/edit.png b/ui/gen/images/edit.png similarity index 100% rename from gen/images/edit.png rename to ui/gen/images/edit.png diff --git a/gen/images/info.png b/ui/gen/images/info.png similarity index 100% rename from gen/images/info.png rename to ui/gen/images/info.png diff --git a/gen/images/unchecked.png b/ui/gen/images/unchecked.png similarity index 100% rename from gen/images/unchecked.png rename to ui/gen/images/unchecked.png diff --git a/gen/ui.css b/ui/gen/ui.css similarity index 100% rename from gen/ui.css rename to ui/gen/ui.css diff --git a/style.css b/ui/style.css similarity index 76% rename from style.css rename to ui/style.css index 58cb4e6..e51c0f2 100755 --- a/style.css +++ b/ui/style.css @@ -49,6 +49,18 @@ float: right; } +.tasks-table thead tr th { + padding: 0 !important; +} +.tasks-table thead p { + color: #666; + font-weight: bold; + text-shadow: 1px 1px #fff; +} +.tasks-table .start-date, .tasks-table .end-date { + font-size: 10px; + color: #999; +} .tasks-table p { margin: 5px 0; } @@ -80,4 +92,14 @@ height: 23px; margin: 0 0 2px 0; width: 100%; +} +#propel_project_tasks .inside table { + border: none; +} +#propel_project_tasks .inside { + margin: 0; + padding: 0; +} +#propel_project_tasks input[type='text'] { + width: 100%; } \ No newline at end of file diff --git a/widgets/all-tasks.php b/widgets/all-tasks.php deleted file mode 100755 index e69de29..0000000 From 0cbb29480e0a820b1da417d3a265582ba42340aa Mon Sep 17 00:00:00 2001 From: Leland Smith Date: Fri, 24 Aug 2012 23:03:45 +0000 Subject: [PATCH 16/86] Fixed the datepicker so it appears in all relevant places. --- js/jquery.ui.datepicker.min.js | 85 ++-------------------------------- metaboxes/add-task.php | 4 +- 2 files changed, 5 insertions(+), 84 deletions(-) diff --git a/js/jquery.ui.datepicker.min.js b/js/jquery.ui.datepicker.min.js index 930c5a4..8385a43 100755 --- a/js/jquery.ui.datepicker.min.js +++ b/js/jquery.ui.datepicker.min.js @@ -1,82 +1,3 @@ -/* - * jQuery UI Datepicker 1.8.12 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Datepicker - * - * Depends: - * jquery.ui.core.js - */ -(function(d,A){function K(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass= -"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su", -"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10", -minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('
')}function F(a,b){d.extend(a,b);for(var c in b)if(b[c]== -null||b[c]==A)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.12"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){F(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase(); -f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
')}}, -_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& -b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== -""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, -c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), -true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}F(a.settings,e||{}); -b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass); -this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup", -this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs, -function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null: -f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target); -if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a); -d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");F(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-= -document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim"); -var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst= -b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover"); -this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+ -this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&& -a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth(): -0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a), -"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"? -"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a= -d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a= -d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c== -"M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth= -b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker(); -this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0); -a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c? -c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l)throw"Invalid date";return w},ATOM:"MMM dd yyyy",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y", -RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"MMM dd yyyy",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay= -a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(), -b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n= -this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
'+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z= -this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",D=0;D1)switch(E){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]- -1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
'+(/all|left/.test(t)&&D==0?c?f:n:"")+(/all|right/.test(t)&&D==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,D>0||E>0,z,w)+'
';var B=j?'":"";for(t=0;t<7;t++){var q= -(t+h)%7;B+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=B+"";B=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,B);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;B=l?6:Math.ceil((t+B)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O";var P=!j?"":'";for(t=0;t<7;t++){var G= -p?p.apply(a.input?a.input[0]:null,[q]):[true,""],C=q.getMonth()!=g,J=C&&!H||!G[0]||k&&qo;P+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+= -P+""}g++;if(g>11){g=0;m++}x+="
'+this._get(a,"weekHeader")+"
'+this._get(a,"calculateWeek")(q)+""+(C&&!v?" ":J?''+q.getDate()+"":''+q.getDate()+"")+"
"+(l?""+(i[0]>0&&E==i[1]-1?'
':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
', -o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&& -l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";if(d.browser.mozilla)k+='";else{k+=a.yearshtml;a.yearshtml=null}}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
";return k},_adjustInstDate:function(a,b,c){var e= -a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, -"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); -c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= -function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker, -[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.12";window["DP_jQuery_"+y]=d})(jQuery); +jQuery(function() { + jQuery( ".date" ).datepicker(); +}); \ No newline at end of file diff --git a/metaboxes/add-task.php b/metaboxes/add-task.php index ea8acc9..95f717a 100755 --- a/metaboxes/add-task.php +++ b/metaboxes/add-task.php @@ -1,7 +1,7 @@ - + - + From 03e0dc6a0612248b148e803e7e52e556577ddd36 Mon Sep 17 00:00:00 2001 From: Leland Smith Date: Fri, 24 Aug 2012 23:18:08 +0000 Subject: [PATCH 17/86] Refining styles for the datepicker. --- ui/style.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/style.css b/ui/style.css index e51c0f2..bc2711a 100755 --- a/ui/style.css +++ b/ui/style.css @@ -1,7 +1,7 @@ -/* beginning of metaboxes */ -/* beginning of metaboxes */ -/* beginning of metaboxes */ - +/* There appears to be a div in the lower left of WordPress that displays with this class, can't tell what it's related to so this should get figured out at some point. */ +#ui-datepicker-div { + display: none; +} /* beginning of metaboxes-project-meta */ From f253dfc856d3927e36a0325eecb40461bd48d1d7 Mon Sep 17 00:00:00 2001 From: rob Date: Sat, 25 Aug 2012 20:11:16 +0800 Subject: [PATCH 18/86] update and fix edit in place, prevent enter/return on add task, and sorting if data is newly added on table --- metaboxes/project-tasks.php | 40 ++++++++++++------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/metaboxes/project-tasks.php b/metaboxes/project-tasks.php index 4d156b5..dd7501b 100755 --- a/metaboxes/project-tasks.php +++ b/metaboxes/project-tasks.php @@ -33,8 +33,10 @@ - + + + + @@ -49,22 +51,6 @@ - - - - - - - - - - - - - - - - ID == $userdata->ID || $current_user->ID == 1) { ?> - + + Edit - + +

Date: Sat, 25 Aug 2012 20:11:24 +0800 Subject: [PATCH 19/86] update and fix edit in place, prevent enter/return on add task, and sorting if data is newly added on table --- post-types/project.php | 703 ++++++++++++++++++++++++++++------------- 1 file changed, 476 insertions(+), 227 deletions(-) diff --git a/post-types/project.php b/post-types/project.php index 33dd5e7..d190245 100755 --- a/post-types/project.php +++ b/post-types/project.php @@ -485,146 +485,371 @@ public static function wp_ajax_add_task() { */ public static function admin_footer() { ?> - - - - - + - - - - - - - - - - - - - - - - - - task_id= $task->ID; + $data->task_title = $task->post_title; + $data->task_author = $author; + $data->task_nonce = $nonce; + $data->task_progress = $progress; + $data->task_authid = $authid; + $data->task_author = $author; + + if( Propel_Options::option('show_start_date' ) ) : + $data->is_start = 1; + $data->task_start = $start; + else: + $data->is_start = 0; + $data->task_start = 0; + endif; + + if( Propel_Options::option('show_end_date' ) ) : + $data->is_end = 1; + $data->task_end = $end; + else: + $data->is_end = 0; + $data->task_end = 0; + endif; + + echo json_encode($data); + remove_action( 'project_get_task', array( __CLASS__, 'project_get_task' ) ); + + die(); } /** @@ -714,28 +934,37 @@ public static function wp_ajax_update_task() { 'post_type' => 'propel_task', 'post_status' => 'publish' ); - wp_update_post( $post ); + wp_update_post( $post ); } - - $start = !empty( $_POST['start_date'] ) ? strtotime( $_POST['start_date'] ) : time(); - update_post_meta( $post_id, '_propel_start_date', $start ); - - $end = strtotime($_POST['end_date']); - if( empty( $_POST['end_date'] ) && $_POST['complete'] == 100 ) { - $end = time(); + if( isset( $_POST['user'] ) ){ + $post = array( + 'ID' => (int)$post_id, + 'post_author' => (int)$_POST['user'] + ); + wp_update_post( $post ); + } + + if ( isset($_POST['start']) ){ + $start = !empty( $_POST['start_date'] ) ? strtotime( $_POST['start_date'] ) : time(); + update_post_meta( $post_id, '_propel_start_date', $start ); } - update_post_meta( $post_id, '_propel_end_date', $end ); + if ( isset($_POST['end']) ){ + $end = strtotime($_POST['end_date']); + if( empty( $_POST['end_date'] ) && $_POST['complete'] == 100 ) { + $end = time(); + } + + update_post_meta( $post_id, '_propel_end_date', $end ); + } - if ( isset( $_POST['priority'] ) ) + if ( isset( $_POST['priority'] ) ){ update_post_meta( $post_id, '_propel_priority', (int)$_POST['priority'] ); - - if ( isset( $_POST['complete'] ) ) + } + if ( isset( $_POST['complete'] ) ){ update_post_meta( $post_id, '_propel_complete', (int)$_POST['complete'] ); - - if ( isset( $_POST['user'] ) ) - update_post_meta( $post_id, '_propel_owner', (int)$_POST['user'] ); + } do_action('project_get_task',$post_id); @@ -747,61 +976,81 @@ public static function wp_ajax_update_task() { * rob: added this function.. */ public static function wp_ajax_get_task_detail() { - $id = $_POST["postid"]; - $task = get_post($id); - $nonce = wp_create_nonce('propel-trash'); - if( $task->post_author ) { - $userdata = get_userdata( $task->post_author ); - $authid = $userdata->ID; - $author = $userdata->display_name; - } else { - $authid = '-1'; - $author = "Unassigned"; - } - ?> - - - - - - + + ; + post_author ) { + $userdata = get_userdata( $task->post_author ); + $authid = $userdata->ID; + $author = $userdata->display_name; + } else { + $authid = '-1'; + $author = "Unassigned"; + } + $args = array( + 'class' => 'metabox-add-task-user', + 'name' => 'propel_post_author', 'show_option_none' => 'Unassigned', 'orderby' => 'display_name', - 'name' => 'propel_edit_author', - 'selected' => $project->post_author - ); - wp_dropdown_users( $args ); - ?> -

- - - - - - - - - + 'selected' => $userdata->ID + ); + wp_dropdown_users( $args ); + die(0); + break; + case 3: + ?> + + - - Date: Sat, 25 Aug 2012 20:12:01 +0800 Subject: [PATCH 20/86] added and fix add task elements out of the metabox --- ui/style.css | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/style.css b/ui/style.css index bc2711a..c568da9 100755 --- a/ui/style.css +++ b/ui/style.css @@ -87,12 +87,13 @@ width: 270px; } .metabox-add-task-description { - float: left; - clear: both; - height: 23px; - margin: 0 0 2px 0; + height: 33px; + margin: 5px 0 2px 0; width: 100%; } +#propel_add_task .inside p { + margin:0; +} #propel_project_tasks .inside table { border: none; } From a697b58c849f7526097f2ba14359dab1a0c1ca77 Mon Sep 17 00:00:00 2001 From: Leland Smith Date: Mon, 27 Aug 2012 19:46:28 +0000 Subject: [PATCH 21/86] Just some styling and naming convention changes. --- metaboxes/add-task.php | 4 ++-- ui/style.css | 28 +++++++++++++++++----------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/metaboxes/add-task.php b/metaboxes/add-task.php index 95f717a..b8631a5 100755 --- a/metaboxes/add-task.php +++ b/metaboxes/add-task.php @@ -1,10 +1,10 @@ - + - + Date: Tue, 28 Aug 2012 23:38:44 +0000 Subject: [PATCH 22/86] Anwar fixed the contributors bug and a few others. --- functions.php | 1104 ++++++++++++++++++------------------ metaboxes/edit-task.php | 2 +- metaboxes/list-authors.php | 11 +- 3 files changed, 571 insertions(+), 546 deletions(-) diff --git a/functions.php b/functions.php index 029d79b..3b787cd 100755 --- a/functions.php +++ b/functions.php @@ -1,538 +1,568 @@ - - -remove_menu('updates'); - $customerSupportURL = $current_url; - $part1 = "889999999999"; - $current_user = wp_get_current_user(); - $part2 = $current_user->ID; - $id = $part1 . $part2; - $static_id = (int)($id); - $profile = get_post_meta( $static_id, '_propel_preference',true); - if(empty($profile)){ - $title = "Context - Personal"; - } elseif($profile == 'personal'){ - $title = "Context - Personal"; - } elseif($profile == 'admin'){ - $title = "Context - Admin"; - } - - $wp_admin_bar->add_menu( array( - 'parent' => false, - 'id' => 'customer_support', - 'title' => __($title) - )); - - $contactUsURL = $current_url; - $wp_admin_bar->add_menu(array( - 'parent' => 'customer_support', - 'id' => 'adminpref', - 'title' => __('Admin'), - 'href' => $contactUsURL, - 'meta' => array( 'onclick' => 'ajax_update("admin")' ) - )); - - $contactUsURL = $current_url; - $wp_admin_bar->add_menu(array( - 'parent' => 'customer_support', - 'id' => 'personalpref', - 'title' => __('Personal'), - 'href' => $contactUsURL, - 'meta' => array( 'onclick' => 'ajax_update("personal")' ) - )); -} - -add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' ); - -/* TASKS FOR SIGNED IN USERS ONLY aps2012 */ -function get_authored_posts($query) { - global $user_ID; - $u = get_userdata($user_ID); - $queried_post_type = get_query_var('post_type'); - $part1 = "889999999999"; - $current_user = wp_get_current_user(); - $part2 = $current_user->ID; - $id = $part1 . $part2; - $static_id = (int)($id); - $profile = get_post_meta( $static_id, '_propel_preference',true); - if(empty($profile)){ - $profile = "personal"; - } - if (('propel_task' == $queried_post_type ) && ($profile == 'personal' )) { - $taxquery = array( - array( - 'taxonomy' => 'author', - 'field' => 'name', - 'terms' => $u->user_login - ) - ); - $query->set('tax_query', $taxquery); - } - if (('propel_project' == $queried_post_type ) && ($profile == 'personal' )) { - $taxquery = array( - array( - 'taxonomy' => 'author', - 'field' => 'name', - 'terms' => $u->user_login - ) - ); - $query->set('tax_query', $taxquery); - } - return $query; -} -add_filter('pre_get_posts', 'get_authored_posts'); - - -/* CURRENT PROJECTS */ -function dashboard_client_current_projects_metabox() { - - function dashboard_client_current_projects_content() { - echo " - - "; - } - - wp_add_dashboard_widget( 'dashboard_client_current_projects_content', __( 'Current Projects' ), 'dashboard_client_current_projects_content' ); - -} - -add_action('wp_dashboard_setup', 'dashboard_client_current_projects_metabox'); - - -/* COMPLETED PROJECTS */ -function dashboard_client_completed_projects_metabox() { - - function dashboard_client_completed_projects_content() { - echo " - - "; - } - - wp_add_dashboard_widget( 'dashboard_client_completed_projects_content', __( 'Completed Projects' ), 'dashboard_client_completed_projects_content' ); -} - -add_action('wp_dashboard_setup', 'dashboard_client_completed_projects_metabox'); - - -/* ARCHIVED PROJECTS */ -function dashboard_client_archived_projects_metabox() { - - function dashboard_client_archived_projects_content() { - echo " - - "; - } - - wp_add_dashboard_widget( 'dashboard_client_archived_projects_content', __( 'Archived Projects' ), 'dashboard_client_archived_projects_content' ); -} - -add_action('wp_dashboard_setup', 'dashboard_client_archived_projects_metabox'); - - -/* SUPPORT REQUESTS */ -function dashboard_client_support_requests_metabox() { - - function dashboard_client_support_requests_content() { - echo " -

If you have an inquiry or support request use the form below to have it added to the queue so it can be addressed promptly.

- "; - } - - wp_add_dashboard_widget( 'dashboard_client_support_requests_content', __( 'Support Requests' ), 'dashboard_client_support_requests_content' ); - -} - -add_action('wp_dashboard_setup', 'dashboard_client_support_requests_metabox'); - - - -/* DASHBOARD METABOX THAT DISPLAYS PAST DUE TASKS */ -function Past_Due_Function() { - - global $user_ID; - $u = get_userdata($user_ID); - $part1 = "889999999999"; - $current_user = wp_get_current_user(); - $part2 = $current_user->ID; - $id = $part1 . $part2; - $static_id = (int)($id); - $profile = get_post_meta( $static_id, '_propel_preference',true); - - if(empty($profile)){ - $profile = "personal"; - } - - $args = array( - 'numberposts' => -1, - 'post_type' => 'propel_project', - 'post_status' => 'publish' - ); - - - $projects = get_posts( $args ); - - echo "
-

Title

Contributors

Progress

Delete - Edit Complete -

post_title); ?>

+

post_title); ?>

-

+

-

+

-

- - +

+

- Delete - Edit - Complete -

post_title); ?>

-

-
-

-
-

-

%

-

-
-

- 'propel_edit_author', + + check_ajax_referer( 'get-task-detail', 'security' ); + + if (isset($_POST["postid"])){ + + $id = $_POST["postid"]; + + switch($_POST['retnum']){ + + case 1: + global $wpdb; + $parent = get_the_ID(); + //@todo: profile query / use WP_Query? + $query = "SELECT `post_id`, `meta_value` AS `progress` + FROM `{$wpdb->postmeta}` + WHERE `meta_key` = '_propel_complete' + AND `meta_value` < 100 AND `{$wpdb->postmeta}`.`post_id` + IN (SELECT `ID` FROM {$wpdb->posts} + WHERE `post_parent`={$parent} AND `post_status` = 'publish') + ORDER BY `meta_value` DESC, `post_id` DESC;"; + $posts = $wpdb->get_results($query); + ?> +

-

- -

-
"; - - foreach( $projects as $project ) { - $display = 0; - if($profile == "personal"){ - - $argv = array( - 'numberposts' => -1, - 'post_type' => 'propel_task', - 'post_status' => 'publish', - 'post_parent' => $project->ID, - 'tax_query' => array( - array( - 'taxonomy' => 'author', - 'field' => 'name', - 'terms' => $u->user_login - ) - ) - ); - - } else { - $argv = array( - 'numberposts' => -1, - 'post_type' => 'propel_task', - 'post_status' => 'publish', - 'post_parent' => $project->ID - ); - } - - $tasks = get_posts( $argv ); - - foreach( $tasks as $task ) { - - $progress = get_post_meta( $task->ID, '_propel_complete', true ); - $date = get_post_meta( $task->ID, '_propel_end_date', true ); - - if($date) { - - //echo date( get_option( 'date_format' ) , $date ); // Project's actual due date. - - $day = date('d'); // Day of the countdown - $month = date('m'); // Month of the countdown - $year = date('Y'); // Year of the countdown - $hour = date('H'); // Hour of the day (east coast time) - - $calculation = ( $date - time() ) / 3600; - $hours = (int)$calculation + 24; - $days = (int)( $hours / 24 ) - 1; - - $hours_remaining = $hours-($days*24)-24; - - if ( $hours < 0 && $hours > -24 ) { - if ($display == 0){ - echo ""; - $display++; - } - echo ""; - echo ""; - echo ""; - echo ""; - } - - if ( $hours < -24 ) { - if ($display == 0){ - echo ""; - $display++; - } - echo ""; - echo ""; - echo " "; - echo ""; - } - } - } - } - echo "
" .$project->post_title. "
" . $task->post_title . "" . str_replace( '-', '', $hours) - . " hours past due.
" .$project->post_title. "
" . $task->post_title . "" - . str_replace( '-', '', $days) . " days past due.
"; -} - -function Past_Due_Hook() { - wp_add_dashboard_widget('pastdue_dashboard_widget', 'Past Due Tasks', 'Past_Due_Function'); -} -add_action('wp_dashboard_setup', 'Past_Due_Hook' ); - -/*---------------------- - -------------------------*/ -function Due_Today_Tomorrow_Function() { - global $user_ID; - $u = get_userdata($user_ID); - $part1 = "889999999999"; - $current_user = wp_get_current_user(); - $part2 = $current_user->ID; - $id = $part1 . $part2; - $static_id = (int)($id); - $profile = get_post_meta( $static_id, '_propel_preference',true); - if(empty($profile)){ - $profile = "personal"; - } - - $args = array( - 'numberposts' => -1, - 'post_type' => 'propel_project', - 'post_status' => 'publish' - ); - - $projects = get_posts( $args ); - - echo ""; - - foreach( $projects as $project ) { - $display = 0; - if($profile == "personal") { - $argv = array( - 'numberposts' => -1, - 'post_type' => 'propel_task', - 'post_status' => 'publish', - 'post_parent' => $project->ID, - 'tax_query' => array( - array( - 'taxonomy' => 'author', - 'field' => 'name', - 'terms' => $u->user_login - ) - ) - ); - } else { - $argv = array( - 'numberposts' => -1, - 'post_type' => 'propel_task', - 'post_status' => 'publish', - 'post_parent' => $project->ID - ); - } - - $tasks = get_posts( $argv ); - - if ( !isset($tasks) ) { - echo ''; - } - - foreach( $tasks as $task ) { - - $progress = get_post_meta( $task->ID, '_propel_complete', true ); - $date = get_post_meta( $task->ID, '_propel_end_date', true ); - if($date) { - - //echo date( get_option( 'date_format' ) , $date ); // Project's actual due date. - - $day = date('d'); // Day of the countdown - $month = date('m'); // Month of the countdown - $year = date('Y'); // Year of the countdown - $hour = date('H'); // Hour of the day (east coast time) - - $calculation = ( $date - time() ) / 3600; - $hours = (int)$calculation + 24; - $days = (int)( $hours / 24 ) - 1; - - $hours_remaining = $hours-($days*24)-24; - - if ( $hours <= 48 && $hours >= 24 ) { - if ($display == 0){ - echo ""; - $display++; - } - echo ""; - echo ""; - echo " "; - echo ""; - } - - if ( $hours <= 24 && $hours >= 0 ) { - if ($display == 0){ - echo ""; - $display++; - } - echo ""; - echo ""; - echo " "; - echo ""; - } - - } - } - } - echo "
' . $project->post_title . '
" .$project->post_title. "
" . $task->post_title . "Due tomorrow.
" .$project->post_title. "
" . $task->post_title . "Due today.
"; -} - -function Due_Today_Tomorrow_Hook() { - wp_add_dashboard_widget('duetodaytomorrow_dashboard_widget', 'Tasks Due Today And Tomorrow', 'Due_Today_Tomorrow_Function'); -} -add_action('wp_dashboard_setup', 'Due_Today_Tomorrow_Hook' ); - -class Propel_Functions { - - var $args = array(); - var $post_type; - var $post; - var $action; - var $status; - var $cb; - - public static function register_post_status( $status, $args ) { - register_post_status( $status ); - $functions = new Propel_Functions(); - $functions->status = $status; - $functions->args = $args; - add_filter( 'parse_query', array( $functions, 'parse_query' ) ); - add_action( 'admin_footer', array( $functions, 'admin_footer' ) ); - } - - /** - * $args['post_type'] - * $args['action'] - */ - public static function add_post_action( $args, $cb ) { - if( isset($_GET['post_type']) && $_GET['post_type'] != $args['post_type']) return; - - $functions = new Propel_Functions(); - $functions->args = $args; - $functions->args['cb'] = $cb; - - add_action( 'admin_footer', array( $functions, 'admin_footer_action' ) ); - add_filter( 'post_row_actions', array( $functions, 'post_row_actions' ) ); - add_action( 'admin_action_' . $args['action'], array( $functions, 'do_action' ) ); - } - - /** - * @todo verify that the current user can perform said action - */ - public function do_action() { - - if( is_array( $_REQUEST['post'] ) ) { - foreach( $_REQUEST['post'] as $post => $post_id) { - call_user_func($this->args['cb'], $post_id); - } - } else { - call_user_func($this->args['cb'], $_GET['post']); - } - - wp_redirect( $_SERVER['HTTP_REFERER'] ); - die(); - } - - public function post_row_actions( $actions ) { - if( !isset($_GET['post_type']) || $_GET['post_type'] != $this->args['post_type']) return $actions; - $actions[$this->args['action']] = "" . $this->args['label'] . ""; - return $actions; - } - - public function admin_footer_action() { - if( !isset($_GET['post_type']) || $_GET['post_type'] != $this->args['post_type']) return; - ?> - - args['post_type'] ) - return $query; - - if( isset($_GET['post_status'] ) && $_GET['post_status'] == $this->status ) { - $query->query_vars['post_type'] = $this->args['post_type']; - $query->query_vars['post_status'] = $this->status; - } - } - - /** - * JavaScript hacks to add custom bulk action and custom post status - * @since 2.0 - */ - public function admin_footer() { - global $wpdb; - - if(isset($_GET['post'])) : - $post = get_post($_GET['post']); - if( $post->post_type == $this->args['post_type']) : - ?> - - args['post_type']) return; - $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = '".$this->args['post_type']."' && post_status = '$this->status';" ) ); - ?> - - ID; + $id = $part1 . $part2; + $static_id = (int)($id); + + if ($_REQUEST['context'] == 'admin'){ + update_post_meta( $static_id, '_propel_preference',"admin"); + } elseif ($_REQUEST['context'] == 'personal'){ + update_post_meta( $static_id, '_propel_preference',"personal"); + } + +} +add_action( 'admin_init', 'set_context' ); + +function mytheme_admin_bar_render() { + global $wp_admin_bar; + global $url_curr; + global $wp; + $current_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; + $wp_admin_bar->remove_menu('updates'); + $customerSupportURL = $current_url; + $part1 = "889999999999"; + $current_user = wp_get_current_user(); + $part2 = $current_user->ID; + $id = $part1 . $part2; + $static_id = (int)($id); + $profile = get_post_meta( $static_id, '_propel_preference',true); + if(empty($profile)){ + $title = "Context - Personal"; + } elseif($profile == 'personal'){ + $title = "Context - Personal"; + } elseif($profile == 'admin'){ + $title = "Context - Admin"; + } + + $wp_admin_bar->add_menu( array( + 'parent' => false, + 'id' => 'customer_support', + 'title' => __($title) + )); + + $contactUsURL = $current_url; + $wp_admin_bar->add_menu(array( + 'parent' => 'customer_support', + 'id' => 'adminpref', + 'title' => __('Admin'), + 'href' => parse_url(get_admin_url(),PHP_URL_PATH)."?context=admin", + 'meta' => array( 'onclick' => 'ajax_update("admin")' ) + )); + + $contactUsURL = $current_url; + $wp_admin_bar->add_menu(array( + 'parent' => 'customer_support', + 'id' => 'personalpref', + 'title' => __('Personal'), + 'href' => parse_url(get_admin_url(),PHP_URL_PATH)."?context=personal", + 'meta' => array( 'onclick' => 'ajax_update("personal")' ) + )); +} + +add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' ); + +/* TASKS FOR SIGNED IN USERS ONLY aps2012 */ +function get_authored_posts($query) { + global $user_ID; + $u = get_userdata($user_ID); + $queried_post_type = get_query_var('post_type'); + $part1 = "889999999999"; + $current_user = wp_get_current_user(); + $part2 = $current_user->ID; + $id = $part1 . $part2; + $static_id = (int)($id); + $profile = get_post_meta( $static_id, '_propel_preference',true); + if(empty($profile)){ + $profile = "personal"; + } + if (('propel_task' == $queried_post_type ) && ($profile == 'personal' )) { + $taxquery = array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ); + $query->set('tax_query', $taxquery); + } + if (('propel_project' == $queried_post_type ) && ($profile == 'personal' )) { + $taxquery = array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ); + $query->set('tax_query', $taxquery); + } + return $query; +} +add_filter('pre_get_posts', 'get_authored_posts'); + + +/* CURRENT PROJECTS */ +function dashboard_client_current_projects_metabox() { + + function dashboard_client_current_projects_content() { + echo " + + "; + } + + wp_add_dashboard_widget( 'dashboard_client_current_projects_content', __( 'Current Projects' ), 'dashboard_client_current_projects_content' ); + +} + +add_action('wp_dashboard_setup', 'dashboard_client_current_projects_metabox'); + + +/* COMPLETED PROJECTS */ +function dashboard_client_completed_projects_metabox() { + + function dashboard_client_completed_projects_content() { + echo " + + "; + } + + wp_add_dashboard_widget( 'dashboard_client_completed_projects_content', __( 'Completed Projects' ), 'dashboard_client_completed_projects_content' ); +} + +add_action('wp_dashboard_setup', 'dashboard_client_completed_projects_metabox'); + + +/* ARCHIVED PROJECTS */ +function dashboard_client_archived_projects_metabox() { + + function dashboard_client_archived_projects_content() { + echo " + + "; + } + + wp_add_dashboard_widget( 'dashboard_client_archived_projects_content', __( 'Archived Projects' ), 'dashboard_client_archived_projects_content' ); +} + +add_action('wp_dashboard_setup', 'dashboard_client_archived_projects_metabox'); + + +/* SUPPORT REQUESTS */ +function dashboard_client_support_requests_metabox() { + + function dashboard_client_support_requests_content() { + echo " +

If you have an inquiry or support request use the form below to have it added to the queue so it can be addressed promptly.

+ "; + } + + wp_add_dashboard_widget( 'dashboard_client_support_requests_content', __( 'Support Requests' ), 'dashboard_client_support_requests_content' ); + +} + +add_action('wp_dashboard_setup', 'dashboard_client_support_requests_metabox'); + + + +/* DASHBOARD METABOX THAT DISPLAYS PAST DUE TASKS */ +function Past_Due_Function() { + + global $user_ID; + $u = get_userdata($user_ID); + $part1 = "889999999999"; + $current_user = wp_get_current_user(); + $part2 = $current_user->ID; + $id = $part1 . $part2; + $static_id = (int)($id); + $profile = get_post_meta( $static_id, '_propel_preference',true); + + if(empty($profile)){ + $profile = "personal"; + } + + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish' + ); + + + $projects = get_posts( $args ); + + echo " + +
+ + + "; + + foreach( $projects as $project ) { + $display = 0; + if($profile == "personal"){ + + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID, + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) + ); + + } else { + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID + ); + } + + $tasks = get_posts( $argv ); + + foreach( $tasks as $task ) { + + $progress = get_post_meta( $task->ID, '_propel_complete', true ); + $date = get_post_meta( $task->ID, '_propel_end_date', true ); + + if($date) { + + //echo date( get_option( 'date_format' ) , $date ); // Project's actual due date. + + $day = date('d'); // Day of the countdown + $month = date('m'); // Month of the countdown + $year = date('Y'); // Year of the countdown + $hour = date('H'); // Hour of the day (east coast time) + + $calculation = ( $date - time() ) / 3600; + $hours = (int)$calculation + 24; + $days = (int)( $hours / 24 ) - 1; + + $hours_remaining = $hours-($days*24)-24; + + if ( $hours < 0 && $hours > -24 ) { + if ($display == 0){ + echo " + +
+ "; + $display++; + } + echo ""; + echo "
+ " . str_replace( '-', '', $hours) + . " hours past due.
"; + } + + if ( $hours < -24 ) { + if ($display == 0){ + echo " + +
+ "; + $display++; + } + echo ""; + echo "
" + . str_replace( '-', '', $days) . " days past due.
"; + } + }// if date + } // foreach + echo '
'; + } + echo "
"; +} + +function Past_Due_Hook() { + wp_add_dashboard_widget('pastdue_dashboard_widget', 'Past Due Tasks', 'Past_Due_Function'); +} +add_action('wp_dashboard_setup', 'Past_Due_Hook' ); + +/*---------------------- + +------------------------*/ +function Due_Today_Tomorrow_Function() { + global $user_ID; + $u = get_userdata($user_ID); + $part1 = "889999999999"; + $current_user = wp_get_current_user(); + $part2 = $current_user->ID; + $id = $part1 . $part2; + $static_id = (int)($id); + $profile = get_post_meta( $static_id, '_propel_preference',true); + if(empty($profile)){ + $profile = "personal"; + } + + $args = array( + 'numberposts' => -1, + 'post_type' => 'propel_project', + 'post_status' => 'publish' + ); + + $projects = get_posts( $args ); + + echo ""; + + foreach( $projects as $project ) { + $display = 0; + if($profile == "personal") { + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID, + 'tax_query' => array( + array( + 'taxonomy' => 'author', + 'field' => 'name', + 'terms' => $u->user_login + ) + ) + ); + } else { + $argv = array( + 'numberposts' => -1, + 'post_type' => 'propel_task', + 'post_status' => 'publish', + 'post_parent' => $project->ID + ); + } + + $tasks = get_posts( $argv ); + + if ( !isset($tasks) ) { + echo ''; + } + + foreach( $tasks as $task ) { + + $progress = get_post_meta( $task->ID, '_propel_complete', true ); + $date = get_post_meta( $task->ID, '_propel_end_date', true ); + if($date) { + + //echo date( get_option( 'date_format' ) , $date ); // Project's actual due date. + + $day = date('d'); // Day of the countdown + $month = date('m'); // Month of the countdown + $year = date('Y'); // Year of the countdown + $hour = date('H'); // Hour of the day (east coast time) + + $calculation = ( $date - time() ) / 3600; + $hours = (int)$calculation + 24; + $days = (int)( $hours / 24 ) - 1; + + $hours_remaining = $hours-($days*24)-24; + + if ( $hours <= 48 && $hours >= 24 ) { + if ($display == 0){ + echo ""; + $display++; + } + echo ""; + echo ""; + echo " "; + echo ""; + } + + if ( $hours <= 24 && $hours >= 0 ) { + if ($display == 0){ + echo ""; + $display++; + } + echo ""; + echo ""; + echo " "; + echo ""; + } + + } + } + } + echo "
' . $project->post_title . '
" .$project->post_title. "
" . $task->post_title . "Due tomorrow.
" .$project->post_title. "
" . $task->post_title . "Due today.
"; +} + +function Due_Today_Tomorrow_Hook() { + wp_add_dashboard_widget('duetodaytomorrow_dashboard_widget', 'Tasks Due Today And Tomorrow', 'Due_Today_Tomorrow_Function'); +} +add_action('wp_dashboard_setup', 'Due_Today_Tomorrow_Hook' ); + +class Propel_Functions { + + var $args = array(); + var $post_type; + var $post; + var $action; + var $status; + var $cb; + + public static function register_post_status( $status, $args ) { + register_post_status( $status ); + $functions = new Propel_Functions(); + $functions->status = $status; + $functions->args = $args; + add_filter( 'parse_query', array( $functions, 'parse_query' ) ); + add_action( 'admin_footer', array( $functions, 'admin_footer' ) ); + } + + /** + * $args['post_type'] + * $args['action'] + */ + public static function add_post_action( $args, $cb ) { + if( isset($_GET['post_type']) && $_GET['post_type'] != $args['post_type']) return; + + $functions = new Propel_Functions(); + $functions->args = $args; + $functions->args['cb'] = $cb; + + add_action( 'admin_footer', array( $functions, 'admin_footer_action' ) ); + add_filter( 'post_row_actions', array( $functions, 'post_row_actions' ) ); + add_action( 'admin_action_' . $args['action'], array( $functions, 'do_action' ) ); + } + + /** + * @todo verify that the current user can perform said action + */ + public function do_action() { + + if( is_array( $_REQUEST['post'] ) ) { + foreach( $_REQUEST['post'] as $post => $post_id) { + call_user_func($this->args['cb'], $post_id); + } + } else { + call_user_func($this->args['cb'], $_GET['post']); + } + + wp_redirect( $_SERVER['HTTP_REFERER'] ); + die(); + } + + public function post_row_actions( $actions ) { + if( !isset($_GET['post_type']) || $_GET['post_type'] != $this->args['post_type']) return $actions; + $actions[$this->args['action']] = "" . $this->args['label'] . ""; + return $actions; + } + + public function admin_footer_action() { + if( !isset($_GET['post_type']) || $_GET['post_type'] != $this->args['post_type']) return; + ?> + + args['post_type'] ) + return $query; + + if( isset($_GET['post_status'] ) && $_GET['post_status'] == $this->status ) { + $query->query_vars['post_type'] = $this->args['post_type']; + $query->query_vars['post_status'] = $this->status; + } + } + + /** + * JavaScript hacks to add custom bulk action and custom post status + * @since 2.0 + */ + public function admin_footer() { + global $wpdb; + + if(isset($_GET['post'])) : + $post = get_post($_GET['post']); + if( $post->post_type == $this->args['post_type']) : + ?> + + args['post_type']) return; + $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = '".$this->args['post_type']."' && post_status = '$this->status';" ) ); + ?> + + \ No newline at end of file diff --git a/metaboxes/edit-task.php b/metaboxes/edit-task.php index 2fbb390..1f04abe 100755 --- a/metaboxes/edit-task.php +++ b/metaboxes/edit-task.php @@ -5,7 +5,7 @@ -ID; + $id = $part1 . $part2; + $static_id = (int)($id); -add_action('admin_head','ajax_scripts'); + if ($_REQUEST['context'] == 'admin'){ + update_post_meta( $static_id, '_propel_preference',"admin"); + } elseif ($_REQUEST['context'] == 'personal'){ + update_post_meta( $static_id, '_propel_preference',"personal"); + } + +} +add_action( 'admin_init', 'set_context' ); function mytheme_admin_bar_render() { global $wp_admin_bar; @@ -56,7 +74,7 @@ function mytheme_admin_bar_render() { 'parent' => 'customer_support', 'id' => 'adminpref', 'title' => __('Admin'), - 'href' => $contactUsURL, + 'href' => parse_url(get_admin_url(),PHP_URL_PATH)."?context=admin", 'meta' => array( 'onclick' => 'ajax_update("admin")' ) )); @@ -65,7 +83,7 @@ function mytheme_admin_bar_render() { 'parent' => 'customer_support', 'id' => 'personalpref', 'title' => __('Personal'), - 'href' => $contactUsURL, + 'href' => parse_url(get_admin_url(),PHP_URL_PATH)."?context=personal", 'meta' => array( 'onclick' => 'ajax_update("personal")' ) )); } @@ -208,7 +226,30 @@ function Past_Due_Function() { $projects = get_posts( $args ); - echo ""; + echo " +
+
+ + + "; foreach( $projects as $project ) { $display = 0; @@ -261,31 +302,43 @@ function Past_Due_Function() { if ( $hours < 0 && $hours > -24 ) { if ($display == 0){ - echo "
"; + echo " + +
+ "; $display++; } - echo "
"; - echo ""; - echo ""; - echo ""; + echo ""; + echo "
+ " . str_replace( '-', '', $hours) + . " hours past due.
"; } if ( $hours < -24 ) { if ($display == 0){ - echo ""; + echo " + +
+ "; $display++; } - echo "
"; - echo ""; - echo " "; - echo ""; + echo ""; + echo "
" + . str_replace( '-', '', $days) . " days past due.
"; } - } - } + }// if date + } // foreach + echo '
'; } - echo "
" .$project->post_title. "
" . $task->post_title . "" . str_replace( '-', '', $hours) - . " hours past due.
" .$project->post_title. "
" . $task->post_title . "" - . str_replace( '-', '', $days) . " days past due.
"; + echo ""; } function Past_Due_Hook() { diff --git a/metaboxes/edit-task.php b/metaboxes/edit-task.php index 2fbb390..5bdc83b 100755 --- a/metaboxes/edit-task.php +++ b/metaboxes/edit-task.php @@ -5,7 +5,7 @@ - + 'propel_project', 'numberposts' => -1 ) ); @@ -112,8 +127,16 @@ function _list_owners(){ From 9fb604063f1b54a539e4abd514cc3e68f9feec47 Mon Sep 17 00:00:00 2001 From: eyouth Date: Thu, 30 Aug 2012 13:20:13 +0800 Subject: [PATCH 26/86] Add description and hover effect. --- metaboxes/project-tasks.php | 21 ++++-- post-types/project.php | 146 +++++++++++++++++++++++++++++++++--- 2 files changed, 151 insertions(+), 16 deletions(-) diff --git a/metaboxes/project-tasks.php b/metaboxes/project-tasks.php index dd7501b..d224fd5 100755 --- a/metaboxes/project-tasks.php +++ b/metaboxes/project-tasks.php @@ -10,15 +10,17 @@ 'metabox-add-task-user', 'name' => 'propel_post_author', 'show_option_none' => 'Unassigned', 'orderby' => 'display_name', - 'selected' => $current_user->ID + 'selected' => $current_user->ID ); wp_dropdown_users( $args ); + */ ?> @@ -82,8 +84,8 @@ * rob_eyouth : added by rob to show task for the current user and if user is admin */ //if user is admin - $current_user = wp_get_current_user(); - if ( $current_user->ID == $userdata->ID || $current_user->ID == 1) { + //$current_user = wp_get_current_user(); + //if ( $current_user->ID == $userdata->ID || $current_user->ID == 1) { ?> @@ -97,7 +99,16 @@ Complete +

post_title); ?>

+
+ post_content); + if ($len > 75 ) + esc_html_e(substr($task->post_content,0,75).' ...'); + else + esc_html_e(substr($task->post_content,0,75)); + ?>
+ diff --git a/post-types/project.php b/post-types/project.php index a2a3167..aad9730 100755 --- a/post-types/project.php +++ b/post-types/project.php @@ -24,6 +24,7 @@ public static function init() { add_action( 'wp_ajax_update_task', array( __CLASS__, 'wp_ajax_update_task' ) ); add_action( 'wp_ajax_get_task_detail', array( __CLASS__, 'wp_ajax_get_task_detail' ) ); add_action( 'load-post.php', array( __CLASS__, 'post' ) ); + add_action( 'admin_head', array( __CLASS__, 'tooltip_css' ) ); add_filter( 'request', array( __CLASS__, 'request' ) ); } @@ -858,7 +859,10 @@ public static function admin_footer() { ?> jQuery('#propel_project_tasks .metaboxes-add-task').css({ 'border':'1px solid #DFDFDF', 'padding':'10px', 'margin':'10px 0' }); jQuery('#propel_post_author').addClass('task-priority'); - }) + + tooltip(); + + });//End of document.ready function get_JSON(response,whichTable){ @@ -887,10 +891,21 @@ function get_JSON(response,whichTable){ var nTr = oTable.fnSettings().aoData[ a[0] ].nTr; jQuery(nTr).find('td:eq(2)').addClass('gen-icon gen-unchecked-icon'); } - jQuery(nTr).attr('id',_obj.task_id); + var _html + var len = _obj.task_content.length; + if (len > 85 ) { + var _content = _obj.task_content.substr(0,85)+' ...'; + _html = '
'+ _content +'
'; + }else{ + var _content = _obj.task_content.substr(0,85); + _html = '
'+ _content +'
'; + } + + + jQuery(nTr).attr('id',_obj.task_id); jQuery(nTr).find('td:eq(0)').addClass('gen-icon gen-delete-icon'); jQuery(nTr).find('td:eq(1)').addClass('gen-icon gen-edit-icon'); - jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}); + jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}).find('p').after(_html); jQuery(nTr).find('td:eq(4)').attr('data-value',_obj.task_start); jQuery(nTr).find('td:eq(5)').addClass('owner').attr('data-value',_obj.task_author); jQuery(nTr).find('td:eq(6)').attr('data-value',_obj.task_progress); @@ -921,10 +936,21 @@ function get_JSON(response,whichTable){ var nTr = oTable.fnSettings().aoData[ a[0] ].nTr; jQuery(nTr).find('td:eq(2)').addClass('gen-icon gen-unchecked-icon'); } - jQuery(nTr).attr('id',_obj.task_id); + var _html + var len = _obj.task_content.length; + if (len > 85 ) { + var _content = _obj.task_content.substr(0,85)+' ...'; + _html = '
'+ _content +'
'; + }else{ + var _content = _obj.task_content.substr(0,85); + _html = '
'+ _content +'
'; + } + + + jQuery(nTr).attr('id',_obj.task_id); jQuery(nTr).find('td:eq(0)').addClass('gen-icon gen-delete-icon'); jQuery(nTr).find('td:eq(1)').addClass('gen-icon gen-edit-icon'); - jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}); + jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}).find('p').after(_html); jQuery(nTr).find('td:eq(4)').attr('data-value',_obj.task_end); jQuery(nTr).find('td:eq(5)').addClass('owner').attr('data-value',_obj.task_author); jQuery(nTr).find('td:eq(6)').attr('data-value',_obj.task_progress); @@ -956,10 +982,22 @@ function get_JSON(response,whichTable){ var nTr = oTable.fnSettings().aoData[ a[0] ].nTr; jQuery(nTr).find('td:eq(2)').addClass('gen-icon gen-unchecked-icon'); } - jQuery(nTr).attr('id',_obj.task_id); + + var _html + var len = _obj.task_content.length; + if (len > 85 ) { + var _content = _obj.task_content.substr(0,75)+' ...'; + _html = '
'+ _content +'
'; + }else{ + var _content = _obj.task_content.substr(0,75); + _html = '
'+ _content +'
'; + } + + + jQuery(nTr).attr('id',_obj.task_id); jQuery(nTr).find('td:eq(0)').addClass('gen-icon gen-delete-icon'); - jQuery(nTr).find('td:eq(1)').addClass('gen-icon gen-edit-icon'); - jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}); + jQuery(nTr).find('td:eq(1)').addClass('gen-icon gen-edit-icon'); + jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}).find('p').after(_html); jQuery(nTr).find('td:eq(4)').attr('data-value',_obj.task_start); jQuery(nTr).find('td:eq(5)').attr('data-value',_obj.task_end); jQuery(nTr).find('td:eq(6)').addClass('owner').attr('data-value',_obj.task_author); @@ -991,11 +1029,22 @@ function get_JSON(response,whichTable){ var nTr = oTable.fnSettings().aoData[ a[0] ].nTr; jQuery(nTr).find('td:eq(2)').addClass('gen-icon gen-unchecked-icon'); } + + var _html + var len = _obj.task_content.length; + if (len > 85 ) { + var _content = _obj.task_content.substr(0,85)+' ...'; + _html = '
'+ _content +'
'; + }else{ + var _content = _obj.task_content.substr(0,85); + _html = '
'+ _content +'
'; + } + jQuery(nTr).attr('id',_obj.task_id); jQuery(nTr).find('td:eq(0)').addClass('gen-icon gen-delete-icon'); jQuery(nTr).find('td:eq(1)').addClass('gen-icon gen-edit-icon'); - jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}); + jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}).find('p').after(_html); jQuery(nTr).find('td:eq(4)').addClass('owner').attr('data-value',_obj.task_author); jQuery(nTr).find('td:eq(5)').attr('data-value',_obj.task_progress); jQuery(nTr).stop().animate({'backgroundColor':'#0F3'},'slow',function(){ @@ -1003,14 +1052,87 @@ function get_JSON(response,whichTable){ }); }//End of if.... + } + + this.tooltip = function(){ + + xOffset = 30; + yOffset = 20; + + jQuery(".tooltip").hover(function(e){ + this.t = this.title; + this.title = ""; + jQuery("body").append("

"+ this.t +"

"); + + e.pageX > 750 ? e.pageX = 600 : e.pageX; + + jQuery("#tooltip") + .css("top",(e.pageY - xOffset) + "px") + .css("left",(e.pageX + yOffset + 10) + "px") + .fadeIn("slow"); + }, + + function(){ + this.title = this.t; + jQuery("#tooltip").remove(); + }); + + jQuery(".tooltip").mousemove(function(e){ + jQuery("#tooltip") + .css("top",(e.pageY - 30) + "px") + .css("left",(e.pageX + (yOffset)) + "px"); + }).live('click',function(){ + jQuery("#tooltip").remove(); + }); + }; - + + + + task_progress = $progress; $data->task_authid = $authid; $data->task_author = $author; + $data->task_content = $task->post_content; if( Propel_Options::option('show_start_date' ) ) : $data->is_start = 1; @@ -1065,6 +1188,7 @@ public static function project_get_task( $id ) { $data->task_end = 0; endif; + echo json_encode($data); remove_action( 'project_get_task', array( __CLASS__, 'project_get_task' ) ); From 48eae68c036d821a14665a58cfbce830f5c4c1c5 Mon Sep 17 00:00:00 2001 From: apswebdev Date: Thu, 30 Aug 2012 16:07:42 +0800 Subject: [PATCH 27/86] Have reinstate some lost files from the ftp and put it back to repo --- functions.php | 25 +- js/jquery.ui.datepicker.min.js | 85 +--- metaboxes/add-task.php | 6 +- metaboxes/edit-task.php | 29 +- metaboxes/edit-task2.php | 124 +++++ metaboxes/list-authors.php | 11 +- metaboxes/list-authors2.php | 93 ++++ metaboxes/project-tasks.php | 128 +++++ post-types/project.php | 861 ++++++++++++++++++++++++--------- propel.php | 4 +- readme.txt | 4 +- ui/gen/images/checked.png | Bin 0 -> 243 bytes ui/gen/images/delete.png | Bin 0 -> 150 bytes ui/gen/images/edit.png | Bin 0 -> 167 bytes ui/gen/images/info.png | Bin 0 -> 166 bytes ui/gen/images/unchecked.png | Bin 0 -> 194 bytes ui/gen/ui.css | 115 +++++ ui/style.css | 112 +++++ 18 files changed, 1222 insertions(+), 375 deletions(-) create mode 100644 metaboxes/edit-task2.php create mode 100644 metaboxes/list-authors2.php create mode 100644 metaboxes/project-tasks.php create mode 100644 ui/gen/images/checked.png create mode 100644 ui/gen/images/delete.png create mode 100644 ui/gen/images/edit.png create mode 100644 ui/gen/images/info.png create mode 100644 ui/gen/images/unchecked.png create mode 100644 ui/gen/ui.css create mode 100644 ui/style.css diff --git a/functions.php b/functions.php index 4064423..a34effb 100755 --- a/functions.php +++ b/functions.php @@ -1,31 +1,8 @@ ID)=='propel_project'){ - $post_def = get_post($post->ID); - return 'Propel >' . $post_def->post_title; - } - if (get_post_type($post->ID)=='propel_task'){ - $post_def = get_post($post->ID); - $post_parent_def = get_post($post_def->post_parent); - return 'Propel > ' . $post_def->post_title . ' > ' .$post_parent_def->post_title ; - } - -} - -function remove_discussion() -{ - remove_meta_box( 'commentstatusdiv' , 'propel_project' , 'normal' ); - remove_meta_box( 'commentstatusdiv' , 'propel_task' , 'normal' ); -} -add_filter('admin_menu', 'remove_discussion'); - function set_context(){ $part1 = "889999999999"; $current_user = wp_get_current_user(); diff --git a/js/jquery.ui.datepicker.min.js b/js/jquery.ui.datepicker.min.js index 930c5a4..8317173 100755 --- a/js/jquery.ui.datepicker.min.js +++ b/js/jquery.ui.datepicker.min.js @@ -1,82 +1,3 @@ -/* - * jQuery UI Datepicker 1.8.12 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Datepicker - * - * Depends: - * jquery.ui.core.js - */ -(function(d,A){function K(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass= -"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su", -"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10", -minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('
')}function F(a,b){d.extend(a,b);for(var c in b)if(b[c]== -null||b[c]==A)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.12"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){F(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase(); -f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
')}}, -_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& -b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== -""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, -c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), -true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}F(a.settings,e||{}); -b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass); -this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup", -this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs, -function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null: -f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target); -if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a); -d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");F(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-= -document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim"); -var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst= -b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover"); -this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+ -this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&& -a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth(): -0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a), -"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"? -"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a= -d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a= -d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c== -"M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth= -b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker(); -this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0); -a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c? -c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l)throw"Invalid date";return w},ATOM:"MMM dd yyyy",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y", -RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"MMM dd yyyy",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay= -a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(), -b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n= -this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
'+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z= -this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",D=0;D1)switch(E){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]- -1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
'+(/all|left/.test(t)&&D==0?c?f:n:"")+(/all|right/.test(t)&&D==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,D>0||E>0,z,w)+'

Manager

post_author); ?> - - +
+ +
+

Search Tips

+
+ 1.) Type in combination of letters that can be found in the Users Login;
+ 2.) Leave it to blanks to search for all available Users;
+

+ +
-

post_title); ?>

@@ -120,7 +131,7 @@
';var B=j?'":"";for(t=0;t<7;t++){var q= -(t+h)%7;B+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=B+"";B=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,B);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;B=l?6:Math.ceil((t+B)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O";var P=!j?"":'";for(t=0;t<7;t++){var G= -p?p.apply(a.input?a.input[0]:null,[q]):[true,""],C=q.getMonth()!=g,J=C&&!H||!G[0]||k&&qo;P+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+= -P+""}g++;if(g>11){g=0;m++}x+="
'+this._get(a,"weekHeader")+"
'+this._get(a,"calculateWeek")(q)+""+(C&&!v?" ":J?''+q.getDate()+"":''+q.getDate()+"")+"
"+(l?""+(i[0]>0&&E==i[1]-1?'
':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
', -o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&& -l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";if(d.browser.mozilla)k+='";else{k+=a.yearshtml;a.yearshtml=null}}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
";return k},_adjustInstDate:function(a,b,c){var e= -a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, -"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); -c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= -function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker, -[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.12";window["DP_jQuery_"+y]=d})(jQuery); +jQuery(function() { + jQuery( ".date" ).datepicker(); +}); \ No newline at end of file diff --git a/metaboxes/add-task.php b/metaboxes/add-task.php index ea8acc9..b8631a5 100755 --- a/metaboxes/add-task.php +++ b/metaboxes/add-task.php @@ -1,10 +1,10 @@ - + - + - + - + 'propel_project', 'numberposts' => -1 ) ); @@ -127,16 +112,8 @@ function _list_owners(){ diff --git a/metaboxes/edit-task2.php b/metaboxes/edit-task2.php new file mode 100644 index 0000000..1f04abe --- /dev/null +++ b/metaboxes/edit-task2.php @@ -0,0 +1,124 @@ + + + +

Manager

post_author); ?> -
- -
-

Search Tips

-
- 1.) Type in combination of letters that can be found in the Users Login;
- 2.) Leave it to blanks to search for all available Users;
-

- -
+ +
+ 'propel_project', 'numberposts' => -1 ) ); + if( count( $projects ) > 0 ) : + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Project + "; + foreach($projects as $project) : + if($project->ID == $parent) { + echo ''; + } else { + echo ''; + } + endforeach; + ?> +

Start Date

End Date

Priority

+ +

Type

+ +

Progress

+ +

Manager

+ post_author); ?> + + +
\ No newline at end of file diff --git a/metaboxes/list-authors.php b/metaboxes/list-authors.php index 72cf6e5..013fc0b 100755 --- a/metaboxes/list-authors.php +++ b/metaboxes/list-authors.php @@ -7,7 +7,7 @@ + 'display_name', 'order' => 'ASC' ) ); ?> + +
+ + +
+
    + + + + +
+
+
+ +ID == $user_id) return true; + } + return false; +} + +function propel_is_parent_coauthor( $user_id ) { + $post = get_post( get_the_ID() ); + if( $post->post_type != 'propel_task' || $post->post_parent == 0 ) return false; + + $coauthors = Propel_Authors::get_coauthors( $post->post_parent ); + foreach($coauthors as $coauthor) { + if($coauthor->ID == $user_id) return true; + } + return false; +}?> + + + + + +
+ +
+ diff --git a/metaboxes/project-tasks.php b/metaboxes/project-tasks.php new file mode 100644 index 0000000..6e6c034 --- /dev/null +++ b/metaboxes/project-tasks.php @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + post_id); + $progress = get_post_meta( $task->ID, '_propel_complete', true ); + $start = get_post_meta( $task->ID, '_propel_start_date', true ); + if( $start ) + $start = date( get_option( 'date_format' ), $start ); + + $end = get_post_meta( $task->ID, '_propel_end_date', true ); + if( $end ) + $end = date( get_option( 'date_format' ), $end); + + if( $task->post_author ) { + $userdata = get_userdata( $task->post_author ); + $authid = $userdata->ID; + $author = $userdata->display_name; + } else { + $authid = '-1'; + $author = "Unassigned"; + } + + $x = ($progress == 100) ? "" : "un"; + $nonce = wp_create_nonce('propel-trash'); + + + + /* + * rob_eyouth : added by rob to show task for the current user and if user is admin + */ + //if user is admin + //$current_user = wp_get_current_user(); + //if ( $current_user->ID == $userdata->ID || $current_user->ID == 1) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + +

Title

Contributors

Started

Due

Progress

+ Delete + Edit + Complete +

post_title); ?>

+

+
+

+
+

+

+

+
\ No newline at end of file diff --git a/post-types/project.php b/post-types/project.php index 865d321..a2a3167 100755 --- a/post-types/project.php +++ b/post-types/project.php @@ -354,7 +354,7 @@ public static function completed_tasks( $post, $id ) { ORDER BY `meta_value` DESC, `post_id` DESC;"; $posts = $wpdb->get_results($query); - require( dirname(__FILE__) . '/../metaboxes/tasks.php'); + require( dirname(__FILE__) . '/../metaboxes/project-tasks.php'); } /** @@ -373,7 +373,7 @@ public static function project_tasks( $post, $id ) { ORDER BY `meta_value` DESC, `post_id` DESC;"; $posts = $wpdb->get_results($query); - require( dirname(__FILE__) . '/../metaboxes/tasks.php' ); + require( dirname(__FILE__) . '/../metaboxes/project-tasks.php' ); } /** @@ -485,146 +485,527 @@ public static function wp_ajax_add_task() { */ public static function admin_footer() { ?> - - - - Delete - - - Edit + - - Complete - - -

post_title); ?>

- - -

- - - - -

- - - - - -

- - - -

%

- - - task_id= $task->ID; + $data->task_title = $task->post_title; + $data->task_author = $author; + $data->task_nonce = $nonce; + $data->task_progress = $progress; + $data->task_authid = $authid; + $data->task_author = $author; + + if( Propel_Options::option('show_start_date' ) ) : + $data->is_start = 1; + $data->task_start = $start; + else: + $data->is_start = 0; + $data->task_start = 0; + endif; + + if( Propel_Options::option('show_end_date' ) ) : + $data->is_end = 1; + $data->task_end = $end; + else: + $data->is_end = 0; + $data->task_end = 0; + endif; + + echo json_encode($data); + remove_action( 'project_get_task', array( __CLASS__, 'project_get_task' ) ); + + die(); } /** @@ -714,28 +1090,37 @@ public static function wp_ajax_update_task() { 'post_type' => 'propel_task', 'post_status' => 'publish' ); - wp_update_post( $post ); + wp_update_post( $post ); } - - $start = !empty( $_POST['start_date'] ) ? strtotime( $_POST['start_date'] ) : time(); - update_post_meta( $post_id, '_propel_start_date', $start ); - - $end = strtotime($_POST['end_date']); - if( empty( $_POST['end_date'] ) && $_POST['complete'] == 100 ) { - $end = time(); + if( isset( $_POST['user'] ) ){ + $post = array( + 'ID' => (int)$post_id, + 'post_author' => (int)$_POST['user'] + ); + wp_update_post( $post ); + } + + if ( isset($_POST['start']) ){ + $start = !empty( $_POST['start_date'] ) ? strtotime( $_POST['start_date'] ) : time(); + update_post_meta( $post_id, '_propel_start_date', $start ); } - update_post_meta( $post_id, '_propel_end_date', $end ); + if ( isset($_POST['end']) ){ + $end = strtotime($_POST['end_date']); + if( empty( $_POST['end_date'] ) && $_POST['complete'] == 100 ) { + $end = time(); + } + + update_post_meta( $post_id, '_propel_end_date', $end ); + } - if ( isset( $_POST['priority'] ) ) + if ( isset( $_POST['priority'] ) ){ update_post_meta( $post_id, '_propel_priority', (int)$_POST['priority'] ); - - if ( isset( $_POST['complete'] ) ) + } + if ( isset( $_POST['complete'] ) ){ update_post_meta( $post_id, '_propel_complete', (int)$_POST['complete'] ); - - if ( isset( $_POST['user'] ) ) - update_post_meta( $post_id, '_propel_owner', (int)$_POST['user'] ); + } do_action('project_get_task',$post_id); @@ -747,61 +1132,81 @@ public static function wp_ajax_update_task() { * rob: added this function.. */ public static function wp_ajax_get_task_detail() { - $id = $_POST["postid"]; - $task = get_post($id); - $nonce = wp_create_nonce('propel-trash'); - if( $task->post_author ) { - $userdata = get_userdata( $task->post_author ); - $authid = $userdata->ID; - $author = $userdata->display_name; - } else { - $authid = '-1'; - $author = "Unassigned"; - } - ?> - - - - -

- - - -

- 'propel_edit_author', + + check_ajax_referer( 'get-task-detail', 'security' ); + + if (isset($_POST["postid"])){ + + $id = $_POST["postid"]; + + switch($_POST['retnum']){ + + case 1: + global $wpdb; + $parent = get_the_ID(); + //@todo: profile query / use WP_Query? + $query = "SELECT `post_id`, `meta_value` AS `progress` + FROM `{$wpdb->postmeta}` + WHERE `meta_key` = '_propel_complete' + AND `meta_value` < 100 AND `{$wpdb->postmeta}`.`post_id` + IN (SELECT `ID` FROM {$wpdb->posts} + WHERE `post_parent`={$parent} AND `post_status` = 'publish') + ORDER BY `meta_value` DESC, `post_id` DESC;"; + $posts = $wpdb->get_results($query); + ?> + + + ; + post_author ) { + $userdata = get_userdata( $task->post_author ); + $authid = $userdata->ID; + $author = $userdata->display_name; + } else { + $authid = '-1'; + $author = "Unassigned"; + } + $args = array( + 'class' => 'metabox-add-task-user', + 'name' => 'propel_post_author', 'show_option_none' => 'Unassigned', 'orderby' => 'display_name', - 'name' => 'propel_edit_author', - 'selected' => $project->post_author - ); - wp_dropdown_users( $args ); - ?> -

- - - - - - - - - -

- -

- + 'selected' => $userdata->ID + ); + wp_dropdown_users( $args ); + die(0); + break; + case 3: + ?> + + - - Usability Dynamics. If you are having issues with this plugin you may submit a comment here or ask on the WordPress forum. diff --git a/ui/gen/images/checked.png b/ui/gen/images/checked.png new file mode 100644 index 0000000000000000000000000000000000000000..8ca5395d729e99774a5765f2151859f38ffaef10 GIT binary patch literal 243 zcmVbP0l+XkKw!<{Z literal 0 HcmV?d00001 diff --git a/ui/gen/images/edit.png b/ui/gen/images/edit.png new file mode 100644 index 0000000000000000000000000000000000000000..957ff737d14d18dbb245b77f9c19b7bc69da79ff GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`d7dtgAr-f_P7dTdpupk$^vQvf z+dnjBN=?#T@Yl&%euYN1#!fba&Fo1(Sv`U!l)|n)eODcOkmYP9hwGd}ds(J2m~9dY zVcNj$)Ugvf^S3jHI+?K^$Qn^YbJFHhFs)+ Q1hkpK)78&qol`;+0J<$ZtpET3 literal 0 HcmV?d00001 diff --git a/ui/gen/images/info.png b/ui/gen/images/info.png new file mode 100644 index 0000000000000000000000000000000000000000..733ab319f008ae37a01776e808a39f725bbc0a7f GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`xt=bLAr-goP7dTdpupk$_GIJa ze8ZWXeN2(l{+`iq{t_r+cp~Vka_3_?X5lW5%lyXN3KfNFDGOK~RpUfAZ|1DzuSlBf zcp>z?-qwLcx>{t!7 On8DN4&t;ucLK6Vu{y6FY literal 0 HcmV?d00001 diff --git a/ui/gen/images/unchecked.png b/ui/gen/images/unchecked.png new file mode 100644 index 0000000000000000000000000000000000000000..11765214ba8bb1ffe932876f7aa5949c6f053feb GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`ot`d^Ar-flp1I4$swmO=@a|o; zNs7u7y;PJZd6e(2zoGuvI&yL8hI9AY_nIBA6L+ex=iSe{oAF+?MW12N0ZVpfO;xUl z>_mmM2Re$u)78&qol`;+00jp`bN~PV literal 0 HcmV?d00001 diff --git a/ui/gen/ui.css b/ui/gen/ui.css new file mode 100644 index 0000000..41f55b0 --- /dev/null +++ b/ui/gen/ui.css @@ -0,0 +1,115 @@ +.gen-table { + background-color: #F9F9F9; + border-color: #DFDFDF; + border-radius: 3px; + border-spacing: 0; + border-style: solid; + border-width: 1px; + text-align: left; +} + +.gen-table thead tr { + background-color: #F1F1F1; +} + +.gen-table .gen-hidden { + display: none; +} +/* +.gen-table tbody:hover { + background-color: #F1F1F1; + cursor: pointer; +} +*/ + +.gen-table td { + border-top: 1px solid #DFDFDF; + padding-left: 10px; +} + +.gen-icon { + width: 24px; + text-align: center; +} + +.gen-icon a:hover { + opacity: 1; +} + +.gen-icon a { + text-align: center; + height: 16px; + margin-top: 1px; + opacity: 0.5; + text-indent: -9999px; + width: 16px; + display: block; + background-position: center; +} + +.gen-delete-icon a { + background: url('images/delete.png') no-repeat; +} + +.gen-edit-icon a { + background: url('images/edit.png') no-repeat; +} + +.gen-unchecked-icon a { + background: url('images/unchecked.png') no-repeat; +} + +.gen-checked-icon a { + background: url('images/checked.png') no-repeat; +} + +.gen-table th.sortable { + color: #000; + cursor: pointer; + text-decoration: underline; + padding-left: 10px; +} + + +.dataTables_length { + width: 40%; + float: left; + margin: 5px; +} + +.dataTables_filter { + width:30%; + float: right; + text-align: right; + margin: 5px; +} + +.dataTables_info { + width:40%; + float: left; + margin: 5px; + margin-top: 15px; +} + +.dataTables_paginate { + float: right; + text-align: right; + margin: 5px; + margin-top: 15px; +} + +.paginate_active, .paginate_button { + margin: 2px; + border: 1px solid lightGrey; + font-weight: normal; + color: #555; + padding: 4px; + cursor: pointer; + background: #E6E6E6; +} + +.paginate_active { + font-weight: bold; + border: 1px solid darkGrey; + +} \ No newline at end of file diff --git a/ui/style.css b/ui/style.css new file mode 100644 index 0000000..ce9c1e3 --- /dev/null +++ b/ui/style.css @@ -0,0 +1,112 @@ +/* There appears to be a div in the lower left of WordPress that displays with this class, can't tell what it's related to so this should get figured out at some point. */ +#ui-datepicker-div { + display: none; +} + + +/* beginning of metaboxes-project-meta */ +/* beginning of metaboxes-project-meta */ +.metaboxes-project-meta { + width: 100%; +} +.metaboxes-project-meta .first-column { + font-size: 12px; + color: #999; +} +.metaboxes-project-meta .second-column { + width: 100px; +} +.metaboxes-project-meta select { + float: right; + width: 170px; +} +.metaboxes-project-meta input { + float: right; +} + + + +/* beginning of metaboxes-add-task */ +/* beginning of metaboxes-add-task */ +.metaboxes-add-task { + width: 100%; +} +.metaboxes-add-task .widefat { + width: 100% !important; +} +.metaboxes-add-task label { + float: left; + margin: 5px 0 0 0; + font-size: 12px; + color: #999; +} +.metaboxes-add-task .task-priority { + width: 200px; + float: right; +} +.metaboxes-add-task .task-owner { + float: right; +} +.metabox-add-task-title { + width: 270px; +} +.metabox-add-task-date { + width: 150px; +} +.metabox-add-task-description { + height: 33px; + margin: 5px 0 2px 0; + width: 100%; +} + +.tasks-table thead tr th { + padding: 0 !important; +} +.tasks-table thead p { + color: #666; + font-weight: bold; + text-shadow: 1px 1px #fff; +} +.tasks-table .start-date, .tasks-table .end-date { + font-size: 10px; + color: #999; +} +.tasks-table p { + margin: 5px 0; +} +.tasks-table td { + padding: 0 0 0 1px; + min-width: auto; + color: #666; + text-shadow: 1px 1px #fff; +} +.tasks-table .title { + padding: 0 15px 0 0; +} +.tasks-table .author { + font-size: 10px; +} +.tasks-table .odd { + background: #fdfdfd; +} +.gen-icon { + margin: 0; + padding: 0; +} +#propel_add_task .inside p { + margin:0; +} +#propel_project_tasks .inside table, #propel_completed_tasks .inside table { + border: none; +} +#propel_project_tasks .inside, #propel_completed_tasks .inside { + margin: 0; + padding: 0; +} +.dataTables_empty p { + color: #999; + padding: 0 0 0 5px; +} +#propel_project_tasks input[type='text'] { + width: 100%; +} \ No newline at end of file From 3ddb26930b99f782f6196cb38a95bcf1e0c211c2 Mon Sep 17 00:00:00 2001 From: apswebdev Date: Thu, 30 Aug 2012 16:56:24 +0800 Subject: [PATCH 28/86] this changes are for the following task: Integrate Tool Tip on Hover of Search Ensure that the "Discussion" metabox is hidden on all Propel pages by default. Ensure the page title changes to the title of the project. --- functions.php | 20 ++++++++++++++++++++ metaboxes/edit-task.php | 28 +++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/functions.php b/functions.php index a34effb..d5ebe82 100755 --- a/functions.php +++ b/functions.php @@ -3,6 +3,26 @@ /* * aps2012 */ +function set_page_title($admin_title, $title){ + global $post; + if(get_post_type($post->ID) == 'propel_project' ){ + return 'Propel > ' . $post->post_title; + } + if(get_post_type($post->ID) == 'propel_task' ){ + $parent = get_post($post->post_parent); + return 'Propel > ' . $parent->post_title . ' > ' . $post->post_title; + } +} + +add_filter('admin_title','set_page_title',10,2); + +function remove_box(){ + remove_meta_box('commentstatusdiv', 'propel_project','normal'); + remove_meta_box('commentstatusdiv', 'propel_task','normal'); +} + +add_filter('add_meta_boxes','remove_box'); + function set_context(){ $part1 = "889999999999"; $current_user = wp_get_current_user(); diff --git a/metaboxes/edit-task.php b/metaboxes/edit-task.php index 1f04abe..d5d46ea 100755 --- a/metaboxes/edit-task.php +++ b/metaboxes/edit-task.php @@ -25,9 +25,24 @@ function _list_owners(){ $state("#propel_post_author").live('change',function(){ document.getElementById('propel_post_author2').value = $state("#propel_post_author option:selected").text(); }); + $state("#sr_tip").hover(function(){ + $state("#ttip").toggle(); + }); }); - + 'propel_project', 'numberposts' => -1 ) ); @@ -112,8 +127,15 @@ function _list_owners(){ From 513aa09dfa5d91a51b742b104db3038b73dedc42 Mon Sep 17 00:00:00 2001 From: eyouth Date: Fri, 31 Aug 2012 10:09:49 +0800 Subject: [PATCH 29/86] Fix edit description and hover --- post-types/project.php | 302 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 282 insertions(+), 20 deletions(-) diff --git a/post-types/project.php b/post-types/project.php index a2a3167..8de2a82 100755 --- a/post-types/project.php +++ b/post-types/project.php @@ -24,6 +24,7 @@ public static function init() { add_action( 'wp_ajax_update_task', array( __CLASS__, 'wp_ajax_update_task' ) ); add_action( 'wp_ajax_get_task_detail', array( __CLASS__, 'wp_ajax_get_task_detail' ) ); add_action( 'load-post.php', array( __CLASS__, 'post' ) ); + add_action( 'admin_head', array( __CLASS__, 'tooltip_css' ) ); add_filter( 'request', array( __CLASS__, 'request' ) ); } @@ -648,11 +649,14 @@ public static function admin_footer() { ?> var _this_id; this_id === undefined ? _this_id = 0 : _this_id = this_id.substr(0,10); var _tr_before_id = jQuery('#'+task_id).prev('tr').attr('id'); - + + + switch(_this_id){ case 'edit_title': var _val = jQuery('#'+this_id).text(); jQuery('#'+this_id).empty().append(''); + jQuery('#propel_edit_title_'+ task_id).focus(); jQuery('#propel_edit_title_'+ task_id).live('keypress',function(event){ if ( event.which == 13){ var data = { @@ -664,18 +668,36 @@ public static function admin_footer() { ?> }; var _data = jQuery('#propel_edit_title_'+ task_id).val(); jQuery.post(ajaxurl, data, function(response) { + var _obj = jQuery.parseJSON(response); jQuery('tr#'+task_id).fadeIn('slow',function(){ var aPos = oTable.fnGetPosition( this ); - oTable.fnUpdate( '

'+ _data +'

', aPos, 3 ) - //var _pos = jQuery(this).index(); - //oTable.fnDeleteRow( _pos, get_JSON( response )); + var _html =""; + var len = _obj.task_content.length; + if (len > 75 ) { + var _content = _obj.task_content.substr(0,75)+' ...'; + _html = '
'+ _content +'
'; + }else{ + var _content = _obj.task_content.substr(0,75); + _html = '
'+ _content +'
'; + } + + oTable.fnUpdate( '

'+ _obj.task_title +'

'+_html, aPos, 3 ) + jQuery('.tooltip').each(function(){ + var _content = jQuery(this).attr('title'); + var _id = jQuery(this).attr('id'); + jQuery(this).tooltip({ + id : _id, + content : _content + }); + }); + }); }); return false; } - }).live('click',function(){ + }).live('click',function(){ return false; }).live('focusout',function(){ jQuery('#propel_edit_title_'+ task_id).remove(); @@ -694,6 +716,7 @@ public static function admin_footer() { ?> jQuery.post(ajaxurl, data, function(response) { var _html = jQuery('#'+this_id).html(); jQuery('#'+this_id).empty().append(response); + jQuery('#'+this_id +' select').focus(); jQuery('#'+this_id +' select').live('click',function(){ return false; }).live('change',function(){ @@ -749,6 +772,7 @@ public static function admin_footer() { ?> jQuery.post(ajaxurl, data, function(response) { var _html = jQuery('#'+this_id).html(); jQuery('#'+this_id).empty().append(response); + jQuery('#'+this_id +' select').focus(); jQuery('#'+this_id +' select').live('click',function(){ return false; }).live('change',function(){ @@ -858,7 +882,17 @@ public static function admin_footer() { ?> jQuery('#propel_project_tasks .metaboxes-add-task').css({ 'border':'1px solid #DFDFDF', 'padding':'10px', 'margin':'10px 0' }); jQuery('#propel_post_author').addClass('task-priority'); - }) + + jQuery('.tooltip').each(function(){ + var _content = jQuery(this).attr('title'); + var _id = jQuery(this).attr('id'); + jQuery(this).tooltip({ + id : _id, + content : _content + }); + }); + + });//End of document.ready function get_JSON(response,whichTable){ @@ -887,10 +921,21 @@ function get_JSON(response,whichTable){ var nTr = oTable.fnSettings().aoData[ a[0] ].nTr; jQuery(nTr).find('td:eq(2)').addClass('gen-icon gen-unchecked-icon'); } - jQuery(nTr).attr('id',_obj.task_id); + var _html = ""; + var len = _obj.task_content.length; + if (len > 75 ) { + var _content = _obj.task_content.substr(0,75)+' ...'; + _html = '
'+ _content +'
'; + }else{ + var _content = _obj.task_content.substr(0,75); + _html = '
'+ _content +'
'; + } + + + jQuery(nTr).attr('id',_obj.task_id); jQuery(nTr).find('td:eq(0)').addClass('gen-icon gen-delete-icon'); jQuery(nTr).find('td:eq(1)').addClass('gen-icon gen-edit-icon'); - jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}); + jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}).find('p').after(_html); jQuery(nTr).find('td:eq(4)').attr('data-value',_obj.task_start); jQuery(nTr).find('td:eq(5)').addClass('owner').attr('data-value',_obj.task_author); jQuery(nTr).find('td:eq(6)').attr('data-value',_obj.task_progress); @@ -921,10 +966,21 @@ function get_JSON(response,whichTable){ var nTr = oTable.fnSettings().aoData[ a[0] ].nTr; jQuery(nTr).find('td:eq(2)').addClass('gen-icon gen-unchecked-icon'); } - jQuery(nTr).attr('id',_obj.task_id); + var _html = ""; + var len = _obj.task_content.length; + if (len > 75 ) { + var _content = _obj.task_content.substr(0,75)+' ...'; + _html = '
'+ _content +'
'; + }else{ + var _content = _obj.task_content.substr(0,75); + _html = '
'+ _content +'
'; + } + + + jQuery(nTr).attr('id',_obj.task_id); jQuery(nTr).find('td:eq(0)').addClass('gen-icon gen-delete-icon'); jQuery(nTr).find('td:eq(1)').addClass('gen-icon gen-edit-icon'); - jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}); + jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}).find('p').after(_html); jQuery(nTr).find('td:eq(4)').attr('data-value',_obj.task_end); jQuery(nTr).find('td:eq(5)').addClass('owner').attr('data-value',_obj.task_author); jQuery(nTr).find('td:eq(6)').attr('data-value',_obj.task_progress); @@ -956,10 +1012,22 @@ function get_JSON(response,whichTable){ var nTr = oTable.fnSettings().aoData[ a[0] ].nTr; jQuery(nTr).find('td:eq(2)').addClass('gen-icon gen-unchecked-icon'); } - jQuery(nTr).attr('id',_obj.task_id); + + var _html = ""; + var len = _obj.task_content.length; + if (len > 75 ) { + var _content = _obj.task_content.substr(0,75)+' ...'; + _html = '
'+ _content +'
'; + }else{ + var _content = _obj.task_content.substr(0,75); + _html = '
'+ _content +'
'; + } + + + jQuery(nTr).attr('id',_obj.task_id); jQuery(nTr).find('td:eq(0)').addClass('gen-icon gen-delete-icon'); - jQuery(nTr).find('td:eq(1)').addClass('gen-icon gen-edit-icon'); - jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}); + jQuery(nTr).find('td:eq(1)').addClass('gen-icon gen-edit-icon'); + jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}).find('p').after(_html); jQuery(nTr).find('td:eq(4)').attr('data-value',_obj.task_start); jQuery(nTr).find('td:eq(5)').attr('data-value',_obj.task_end); jQuery(nTr).find('td:eq(6)').addClass('owner').attr('data-value',_obj.task_author); @@ -991,11 +1059,22 @@ function get_JSON(response,whichTable){ var nTr = oTable.fnSettings().aoData[ a[0] ].nTr; jQuery(nTr).find('td:eq(2)').addClass('gen-icon gen-unchecked-icon'); } + + var _html = ""; + var len = _obj.task_content.length; + if (len > 75 ) { + var _content = _obj.task_content.substr(0,75)+' ...'; + _html = '
'+ _content +'
'; + }else{ + var _content = _obj.task_content.substr(0,75); + _html = '
'+ _content +'
'; + } + jQuery(nTr).attr('id',_obj.task_id); jQuery(nTr).find('td:eq(0)').addClass('gen-icon gen-delete-icon'); jQuery(nTr).find('td:eq(1)').addClass('gen-icon gen-edit-icon'); - jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}); + jQuery(nTr).find('td:eq(3)').addClass('title').attr('data-value',_obj.task_title).css({"width":"400px"}).find('p').after(_html); jQuery(nTr).find('td:eq(4)').addClass('owner').attr('data-value',_obj.task_author); jQuery(nTr).find('td:eq(5)').attr('data-value',_obj.task_progress); jQuery(nTr).stop().animate({'backgroundColor':'#0F3'},'slow',function(){ @@ -1003,14 +1082,179 @@ function get_JSON(response,whichTable){ }); }//End of if.... + + jQuery('.tooltip').each(function(){ + var _content = jQuery(this).attr('title'); + var _id = jQuery(this).attr('id'); + jQuery(this).tooltip({ + id : _id, + content : _content + }); + }); } - - - "+ _title +"

"); + + e.pageX > 750 ? e.pageX = 600 : e.pageX; + + jQuery("#tooltip") + .css("top",(e.pageY - xOffset) + "px") + .css("left",(e.pageX + yOffset + 10) + "px") + .fadeIn("slow"); + + }); + + $this.live('mouseleave',function(){ + $this.attr('title',_title); + jQuery("#tooltip").fadeOut('fast'); + jQuery("#tooltip").remove(); + }); + + $this.live('mousemove',function(e){ + jQuery("#tooltip") + .css("top",(e.pageY - 30) + "px") + .css("left",(e.pageX + (yOffset)) + "px"); + + }).live('click',function(){ + + _divtooltip = $this.attr('id'); + task_id = jQuery.trim(_divtooltip.substr(5,10)); + + jQuery("#tooltip").fadeOut('slow',function(){ + jQuery("#tooltip").remove(); + jQuery("#"+_divtooltip).find('small').hide('fast','linear',function(){ + + jQuery("#"+_divtooltip).removeClass('tooltip').append(''); + + jQuery('#desc_edit_'+task_id).focus(); + + jQuery('#desc_edit_'+task_id).live('mouseleave',function(e) { + jQuery('#desc_edit_'+task_id).fadeOut('fast',function(){ + jQuery('#desc_edit_'+task_id).remove(); + }); + jQuery("#"+_divtooltip).addClass('tooltip').find('small').css("display","block").fadeIn('slow'); + + }) + + jQuery('#desc_edit_'+task_id).live('focusin',function(e) { + jQuery("#tooltip").fadeOut('slow'); + }); + + jQuery('#desc_edit_'+task_id).live('keypress',function(event){ + if ( event.which === 13 ){ + var data = { + action: 'update_task', + security: '', + parent: '', + postid: task_id, + content: jQuery('#desc_edit_'+task_id).val(), + }; + + jQuery.post(ajaxurl, data, function(response) { + var _obj = jQuery.parseJSON(response); + jQuery('tr#'+task_id).fadeIn('slow',function(){ + var aPos = oTable.fnGetPosition( this ); + var _html =""; + var len = _obj.task_content.length; + if (len > 75 ) { + var _content = _obj.task_content.substr(0,75)+' ...'; + _html = '
'+ _content +'
'; + }else{ + var _content = _obj.task_content.substr(0,75); + _html = '
'+ _content +'
'; + } + oTable.fnUpdate( '

'+ _obj.task_title +'

'+_html, aPos, 3 ); + jQuery('.tooltip').each(function(){ + var _content = jQuery(this).attr('title'); + var _id = jQuery(this).attr('id'); + jQuery(this).tooltip({ + id : _id, + content : _content + }); + }); + }); + + }); + + jQuery("#"+_divtooltip).addClass('tooltip').find('small').css("display","block").fadeIn('slow'); + + }//end of event == 13 + + });//end of desc_edit + + }); + }); + }); + + //});//end of each + + }; + + + + + + task_progress = $progress; $data->task_authid = $authid; $data->task_author = $author; + $data->task_content = $task->post_content; if( Propel_Options::option('show_start_date' ) ) : $data->is_start = 1; @@ -1082,15 +1327,32 @@ public static function wp_ajax_update_task() { $post_id = $_POST['postid']; - if ( isset($_POST["title"]) ){ + if ( isset($_POST["title"]) && isset($_POST["content"]) ){ + $post = array( + 'ID' => (int)$post_id, + 'post_title' => $_POST['title'], + 'post_content' => $_POST['content'], + 'post_parent' => $_POST['parent'], + ); + + wp_update_post( $post ); + + }else if ( isset($_POST["title"]) && !isset($_POST["content"]) ) { $post = array( 'ID' => (int)$post_id, 'post_title' => $_POST['title'], 'post_parent' => $_POST['parent'], - 'post_type' => 'propel_task', - 'post_status' => 'publish' ); wp_update_post( $post ); + + }else if ( !isset($_POST["title"]) && isset($_POST["content"]) ) { + $post = array( + 'ID' => (int)$post_id, + 'post_content' => $_POST['content'], + 'post_parent' => $_POST['parent'], + ); + wp_update_post( $post ); + } if( isset( $_POST['user'] ) ){ From 290a39378125eb8840673a2d92ee8e1f4b3ec8c0 Mon Sep 17 00:00:00 2001 From: apswebdev Date: Fri, 31 Aug 2012 02:17:01 +0800 Subject: [PATCH 30/86] This is to make the search tips and the search owner on the task edit to work as discussed --- metaboxes/edit-task.php | 52 +++++++++++++++++++++++++++++----------- metaboxes/owner_ajax.php | 6 ++--- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/metaboxes/edit-task.php b/metaboxes/edit-task.php index d5d46ea..58a217e 100755 --- a/metaboxes/edit-task.php +++ b/metaboxes/edit-task.php @@ -5,8 +5,8 @@

Manager

post_author); ?> - - +
+ +
+

Seach Tips

+
+ 1.) Type in character/s found in a User's Login.
+ 2.) Leave it to blanks to search for all Users. +
+

Manager

- - - -
post_author); ?> -
- + + +

Seach Tips

@@ -136,11 +163,8 @@ function _list_owners(){ 2.) Leave it to blanks to search for all Users.
+
\ No newline at end of file diff --git a/metaboxes/owner_ajax.php b/metaboxes/owner_ajax.php index 97ced8c..ec50ce2 100644 --- a/metaboxes/owner_ajax.php +++ b/metaboxes/owner_ajax.php @@ -15,11 +15,11 @@ Select Owner - + Date: Fri, 31 Aug 2012 16:19:09 +0800 Subject: [PATCH 31/86] Change Path on the search call program for the Owner Search --- metaboxes/edit-task.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metaboxes/edit-task.php b/metaboxes/edit-task.php index 58a217e..ba53872 100755 --- a/metaboxes/edit-task.php +++ b/metaboxes/edit-task.php @@ -5,7 +5,7 @@ + ID, '_propel_complete', true ); $priority = get_post_meta( $task->ID, '_propel_priority', true ); $start = get_post_meta( $task->ID, '_propel_start_date', true ); - if( $start ) - $start = date( get_option( 'date_format' ), $start ); + //if( $start ) + //$start = date( get_option( 'date_format' ), $start ); $end = get_post_meta( $task->ID, '_propel_end_date', true ); - if( $end ) - $end = date( get_option( 'date_format' ), $end); + //if( $end ) + //$end = date( get_option( 'date_format' ), $end); if( $task->post_author ) { $userdata = get_userdata( $task->post_author ); @@ -1480,7 +1488,7 @@ public static function project_get_task( $id ) { if( Propel_Options::option('show_start_date' ) ) : $data->is_start = 1; - $data->task_start = $start; + $data->task_start = date("m-d-y H:i", $start); else: $data->is_start = 0; $data->task_start = 0; @@ -1488,7 +1496,7 @@ public static function project_get_task( $id ) { if( Propel_Options::option('show_end_date' ) ) : $data->is_end = 1; - $data->task_end = $end; + $data->task_end = date("m-d-y H:m", $end); else: $data->is_end = 0; $data->task_end = 0; From ed38d50ff2e941f1d6d607f7b12066c522935139 Mon Sep 17 00:00:00 2001 From: apswebdev Date: Tue, 4 Sep 2012 23:51:00 +0800 Subject: [PATCH 39/86] updates the context redirect to dashboard, fix some errors on url parm --- functions.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index a869e41..0f1110a 100755 --- a/functions.php +++ b/functions.php @@ -46,6 +46,14 @@ function mytheme_admin_bar_render() { $current_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $current_url = str_replace("&context=personal", "", $current_url); $current_url = str_replace("&context=admin", "", $current_url); + $current_url = str_replace("?context=personal", "", $current_url); + $current_url = str_replace("?context=admin", "", $current_url); + $last_char = strrpos($current_url, '&'); + if ($last_char === false) { + $con = '?'; + } else { + $con = '&'; + } $wp_admin_bar->remove_menu('updates'); $part1 = "889999999999"; $current_user = wp_get_current_user(); @@ -72,7 +80,7 @@ function mytheme_admin_bar_render() { 'parent' => 'customer_support', 'id' => 'adminpref', 'title' => __('Admin'), - 'href' => $current_url ."&context=admin" + 'href' => $current_url . $con ."context=admin" )); $contactUsURL = $current_url; @@ -80,7 +88,7 @@ function mytheme_admin_bar_render() { 'parent' => 'customer_support', 'id' => 'personalpref', 'title' => __('Personal'), - 'href' => $current_url ."&context=personal" + 'href' => $current_url .$con ."context=personal" )); } From dfd2e4767813b9de84185a979d7f1ee152ff63c7 Mon Sep 17 00:00:00 2001 From: apswebdev Date: Wed, 5 Sep 2012 12:32:07 +0800 Subject: [PATCH 40/86] this should be the latest in context redirect prevention --- functions.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/functions.php b/functions.php index 0f1110a..c6128cc 100755 --- a/functions.php +++ b/functions.php @@ -48,10 +48,12 @@ function mytheme_admin_bar_render() { $current_url = str_replace("&context=admin", "", $current_url); $current_url = str_replace("?context=personal", "", $current_url); $current_url = str_replace("?context=admin", "", $current_url); - $last_char = strrpos($current_url, '&'); - if ($last_char === false) { + $and_char = strrpos($current_url, '&'); + $quest_char = strrpos($current_url, '?'); + if (($and_char === false) && ($quest_char === false)) { $con = '?'; - } else { + } elseif ((($and_char === false) && ($quest_char !== false)) || + (($and_char !== false) && ($quest_char !== false))) { $con = '&'; } $wp_admin_bar->remove_menu('updates'); From 8f4707068bfd2273cba0ad4f0fb9f881a5972e6d Mon Sep 17 00:00:00 2001 From: eyouth Date: Wed, 5 Sep 2012 07:43:03 +0800 Subject: [PATCH 41/86] Fix broken script about timepicker, add to js folder the following jquery-ui-sliderAccess.js and jquery-ui-timepicker-addon.js then update propel.php wp_enque_script and add those js files. --- propel.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/propel.php b/propel.php index b1ae361..c9782bd 100755 --- a/propel.php +++ b/propel.php @@ -107,6 +107,10 @@ public static function init () { wp_enqueue_script('jquery-ui-tabs'); wp_enqueue_script('jquery-ui-datepicker', plugins_url( '/propel/js/jquery.ui.datepicker.min.js' ), array('jquery', 'jquery-ui-core') ); + wp_enqueue_script('jquery-ui-sliderAccess', + plugins_url( '/propel/js/jquery-ui-sliderAccess.js' ), array('jquery', 'jquery-ui-core') ); + wp_enqueue_script('jquery-ui-timepicker-addon', + plugins_url( '/propel/js/jquery-ui-timepicker-addon.js' ), array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'jquery-ui-slider')); wp_enqueue_script('jquery-ui-progressbar', plugins_url( '/propel/js/jquery.ui.progressbar.min.js' ), array('jquery', 'jquery-ui-core', 'jquery-ui-widget') ); From ccba2046a556d6548228e6119942598ce70e9f23 Mon Sep 17 00:00:00 2001 From: eyouth Date: Wed, 5 Sep 2012 08:55:57 +0800 Subject: [PATCH 42/86] added two files and fix the admin in displaying the description --- js/jquery-ui-sliderAccess.js | 85 ++ js/jquery-ui-timepicker-addon.js | 1326 ++++++++++++++++++++++++++++++ metaboxes/project-tasks.php | 37 +- post-types/project.php | 76 +- 4 files changed, 1484 insertions(+), 40 deletions(-) create mode 100644 js/jquery-ui-sliderAccess.js create mode 100644 js/jquery-ui-timepicker-addon.js diff --git a/js/jquery-ui-sliderAccess.js b/js/jquery-ui-sliderAccess.js new file mode 100644 index 0000000..4c96bd5 --- /dev/null +++ b/js/jquery-ui-sliderAccess.js @@ -0,0 +1,85 @@ +/* + * jQuery UI Slider Access + * By: Trent Richardson [http://trentrichardson.com] + * Version 0.2 + * Last Modified: 12/02/2011 + * + * Copyright 2011 Trent Richardson + * Dual licensed under the MIT and GPL licenses. + * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt + * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt + * + */ + (function($){ + + $.fn.extend({ + sliderAccess: function(options){ + options = options || {}; + options.touchonly = options.touchonly !== undefined? options.touchonly : true; // by default only show it if touch device + + if(options.touchonly === true && !("ontouchend" in document)) + return $(this); + + return $(this).each(function(i,obj){ + var $t = $(this), + o = $.extend({},{ + where: 'after', + step: $t.slider('option','step'), + upIcon: 'ui-icon-plus', + downIcon: 'ui-icon-minus', + text: false, + upText: '+', + downText: '-', + buttonset: true, + buttonsetTag: 'span' + }, options), + $buttons = $('<'+ o.buttonsetTag +' class="ui-slider-access">'+ + ''+ + ''+ + ''); + + $buttons.children('button').each(function(j, jobj){ + var $jt = $(this); + $jt.button({ + text: o.text, + icons: { primary: $jt.data('icon') } + }) + .click(function(e){ + var step = $jt.data('step'), + curr = $t.slider('value'), + newval = curr += step*1, + minval = $t.slider('option','min'), + maxval = $t.slider('option','max'); + + e.preventDefault(); + + if(newval < minval || newval > maxval) + return; + + $t.slider('value', newval); + + $t.slider("option", "slide").call($t, null, { value: newval }); + }); + }); + + // before or after + $t[o.where]($buttons); + + if(o.buttonset){ + $buttons.removeClass('ui-corner-right').removeClass('ui-corner-left').buttonset(); + $buttons.eq(0).addClass('ui-corner-left'); + $buttons.eq(1).addClass('ui-corner-right'); + } + + // adjust the width so we don't break the original layout + var bOuterWidth = $buttons.css({ + marginLeft: (o.where == 'after'? 10:0), + marginRight: (o.where == 'before'? 10:0) + }).outerWidth(true) + 5; + var tOuterWidth = $t.outerWidth(true); + $t.css('display','inline-block').width(tOuterWidth-bOuterWidth); + }); + } + }); + +})(jQuery); \ No newline at end of file diff --git a/js/jquery-ui-timepicker-addon.js b/js/jquery-ui-timepicker-addon.js new file mode 100644 index 0000000..0a4ff02 --- /dev/null +++ b/js/jquery-ui-timepicker-addon.js @@ -0,0 +1,1326 @@ +/* +* jQuery timepicker addon +* By: Trent Richardson [http://trentrichardson.com] +* Version 1.0.0 +* Last Modified: 02/05/2012 +* +* Copyright 2012 Trent Richardson +* Dual licensed under the MIT and GPL licenses. +* http://trentrichardson.com/Impromptu/GPL-LICENSE.txt +* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt +* +* HERES THE CSS: +* .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } +* .ui-timepicker-div dl { text-align: left; } +* .ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } +* .ui-timepicker-div dl dd { margin: 0 10px 10px 65px; } +* .ui-timepicker-div td { font-size: 90%; } +* .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } +*/ + +(function($) { + +// Prevent "Uncaught RangeError: Maximum call stack size exceeded" +$.ui.timepicker = $.ui.timepicker || {}; +if ($.ui.timepicker.version) { + return; +} + +$.extend($.ui, { timepicker: { version: "1.0.0" } }); + +/* Time picker manager. + Use the singleton instance of this class, $.timepicker, to interact with the time picker. + Settings for (groups of) time pickers are maintained in an instance object, + allowing multiple different settings on the same page. */ + +function Timepicker() { + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + currentText: 'Now', + closeText: 'Done', + ampm: false, + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + timeFormat: 'hh:mm tt', + timeSuffix: '', + timeOnlyTitle: 'Choose Time', + timeText: 'Time', + hourText: 'Hour', + minuteText: 'Minute', + secondText: 'Second', + millisecText: 'Millisecond', + timezoneText: 'Time Zone' + }; + this._defaults = { // Global defaults for all the datetime picker instances + showButtonPanel: true, + timeOnly: false, + showHour: true, + showMinute: true, + showSecond: false, + showMillisec: false, + showTimezone: false, + showTime: true, + stepHour: 1, + stepMinute: 1, + stepSecond: 1, + stepMillisec: 1, + hour: 0, + minute: 0, + second: 0, + millisec: 0, + timezone: '+0000', + hourMin: 0, + minuteMin: 0, + secondMin: 0, + millisecMin: 0, + hourMax: 23, + minuteMax: 59, + secondMax: 59, + millisecMax: 999, + minDateTime: null, + maxDateTime: null, + onSelect: null, + hourGrid: 0, + minuteGrid: 0, + secondGrid: 0, + millisecGrid: 0, + alwaysSetTime: true, + separator: ' ', + altFieldTimeOnly: true, + showTimepicker: true, + timezoneIso8609: false, + timezoneList: null, + addSliderAccess: false, + sliderAccessArgs: null + }; + $.extend(this._defaults, this.regional['']); +}; + +$.extend(Timepicker.prototype, { + $input: null, + $altInput: null, + $timeObj: null, + inst: null, + hour_slider: null, + minute_slider: null, + second_slider: null, + millisec_slider: null, + timezone_select: null, + hour: 0, + minute: 0, + second: 0, + millisec: 0, + timezone: '+0000', + hourMinOriginal: null, + minuteMinOriginal: null, + secondMinOriginal: null, + millisecMinOriginal: null, + hourMaxOriginal: null, + minuteMaxOriginal: null, + secondMaxOriginal: null, + millisecMaxOriginal: null, + ampm: '', + formattedDate: '', + formattedTime: '', + formattedDateTime: '', + timezoneList: null, + + /* Override the default settings for all instances of the time picker. + @param settings object - the new settings to use as defaults (anonymous object) + @return the manager object */ + setDefaults: function(settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, + + //######################################################################## + // Create a new Timepicker instance + //######################################################################## + _newInst: function($input, o) { + var tp_inst = new Timepicker(), + inlineSettings = {}; + + for (var attrName in this._defaults) { + var attrValue = $input.attr('time:' + attrName); + if (attrValue) { + try { + inlineSettings[attrName] = eval(attrValue); + } catch (err) { + inlineSettings[attrName] = attrValue; + } + } + } + tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o, { + beforeShow: function(input, dp_inst) { + if ($.isFunction(o.beforeShow)) + return o.beforeShow(input, dp_inst, tp_inst); + }, + onChangeMonthYear: function(year, month, dp_inst) { + // Update the time as well : this prevents the time from disappearing from the $input field. + tp_inst._updateDateTime(dp_inst); + if ($.isFunction(o.onChangeMonthYear)) + o.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst); + }, + onClose: function(dateText, dp_inst) { + if (tp_inst.timeDefined === true && $input.val() != '') + tp_inst._updateDateTime(dp_inst); + if ($.isFunction(o.onClose)) + o.onClose.call($input[0], dateText, dp_inst, tp_inst); + }, + timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); + }); + tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) { return val.toUpperCase(); }); + tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) { return val.toUpperCase(); }); + + if (tp_inst._defaults.timezoneList === null) { + var timezoneList = []; + for (var i = -11; i <= 12; i++) + timezoneList.push((i >= 0 ? '+' : '-') + ('0' + Math.abs(i).toString()).slice(-2) + '00'); + if (tp_inst._defaults.timezoneIso8609) + timezoneList = $.map(timezoneList, function(val) { + return val == '+0000' ? 'Z' : (val.substring(0, 3) + ':' + val.substring(3)); + }); + tp_inst._defaults.timezoneList = timezoneList; + } + + tp_inst.hour = tp_inst._defaults.hour; + tp_inst.minute = tp_inst._defaults.minute; + tp_inst.second = tp_inst._defaults.second; + tp_inst.millisec = tp_inst._defaults.millisec; + tp_inst.ampm = ''; + tp_inst.$input = $input; + + if (o.altField) + tp_inst.$altInput = $(o.altField) + .css({ cursor: 'pointer' }) + .focus(function(){ $input.trigger("focus"); }); + + if(tp_inst._defaults.minDate==0 || tp_inst._defaults.minDateTime==0) + { + tp_inst._defaults.minDate=new Date(); + } + if(tp_inst._defaults.maxDate==0 || tp_inst._defaults.maxDateTime==0) + { + tp_inst._defaults.maxDate=new Date(); + } + + // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime.. + if(tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) + tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime()); + if(tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) + tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime()); + if(tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) + tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime()); + if(tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) + tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime()); + return tp_inst; + }, + + //######################################################################## + // add our sliders to the calendar + //######################################################################## + _addTimePicker: function(dp_inst) { + var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? + this.$input.val() + ' ' + this.$altInput.val() : + this.$input.val(); + + this.timeDefined = this._parseTime(currDT); + this._limitMinMaxDateTime(dp_inst, false); + this._injectTimePicker(); + }, + + //######################################################################## + // parse the time string from input value or _setTime + //######################################################################## + _parseTime: function(timeString, withDate) { + var regstr = this._defaults.timeFormat.toString() + .replace(/h{1,2}/ig, '(\\d?\\d)') + .replace(/m{1,2}/ig, '(\\d?\\d)') + .replace(/s{1,2}/ig, '(\\d?\\d)') + .replace(/l{1}/ig, '(\\d?\\d?\\d)') + .replace(/t{1,2}/ig, this._getPatternAmpm()) + .replace(/z{1}/ig, '(z|[-+]\\d\\d:?\\d\\d)?') + .replace(/\s/g, '\\s?') + this._defaults.timeSuffix + '$', + order = this._getFormatPositions(), + ampm = '', + treg; + + if (!this.inst) this.inst = $.datepicker._getInst(this.$input[0]); + + if (withDate || !this._defaults.timeOnly) { + // the time should come after x number of characters and a space. + // x = at least the length of text specified by the date format + var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat'); + // escape special regex characters in the seperator + var specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g"); + regstr = '^.{' + dp_dateFormat.length + ',}?' + this._defaults.separator.replace(specials, "\\$&") + regstr; + } + + treg = timeString.match(new RegExp(regstr, 'i')); + + if (treg) { + if (order.t !== -1) { + if (treg[order.t] === undefined || treg[order.t].length === 0) { + ampm = ''; + this.ampm = ''; + } else { + ampm = $.inArray(treg[order.t].toUpperCase(), this.amNames) !== -1 ? 'AM' : 'PM'; + this.ampm = this._defaults[ampm == 'AM' ? 'amNames' : 'pmNames'][0]; + } + } + + if (order.h !== -1) { + if (ampm == 'AM' && treg[order.h] == '12') + this.hour = 0; // 12am = 0 hour + else if (ampm == 'PM' && treg[order.h] != '12') + this.hour = (parseFloat(treg[order.h]) + 12).toFixed(0); // 12pm = 12 hour, any other pm = hour + 12 + else this.hour = Number(treg[order.h]); + } + + if (order.m !== -1) this.minute = Number(treg[order.m]); + if (order.s !== -1) this.second = Number(treg[order.s]); + if (order.l !== -1) this.millisec = Number(treg[order.l]); + if (order.z !== -1 && treg[order.z] !== undefined) { + var tz = treg[order.z].toUpperCase(); + switch (tz.length) { + case 1: // Z + tz = this._defaults.timezoneIso8609 ? 'Z' : '+0000'; + break; + case 5: // +hhmm + if (this._defaults.timezoneIso8609) + tz = tz.substring(1) == '0000' + ? 'Z' + : tz.substring(0, 3) + ':' + tz.substring(3); + break; + case 6: // +hh:mm + if (!this._defaults.timezoneIso8609) + tz = tz == 'Z' || tz.substring(1) == '00:00' + ? '+0000' + : tz.replace(/:/, ''); + else if (tz.substring(1) == '00:00') + tz = 'Z'; + break; + } + this.timezone = tz; + } + + return true; + + } + return false; + }, + + //######################################################################## + // pattern for standard and localized AM/PM markers + //######################################################################## + _getPatternAmpm: function() { + var markers = [], + o = this._defaults; + if (o.amNames) + $.merge(markers, o.amNames); + if (o.pmNames) + $.merge(markers, o.pmNames); + markers = $.map(markers, function(val) { return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&'); }); + return '(' + markers.join('|') + ')?'; + }, + + //######################################################################## + // figure out position of time elements.. cause js cant do named captures + //######################################################################## + _getFormatPositions: function() { + var finds = this._defaults.timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z)/g), + orders = { h: -1, m: -1, s: -1, l: -1, t: -1, z: -1 }; + + if (finds) + for (var i = 0; i < finds.length; i++) + if (orders[finds[i].toString().charAt(0)] == -1) + orders[finds[i].toString().charAt(0)] = i + 1; + + return orders; + }, + + //######################################################################## + // generate and inject html for timepicker into ui datepicker + //######################################################################## + _injectTimePicker: function() { + var $dp = this.inst.dpDiv, + o = this._defaults, + tp_inst = this, + // Added by Peter Medeiros: + // - Figure out what the hour/minute/second max should be based on the step values. + // - Example: if stepMinute is 15, then minMax is 45. + hourMax = parseInt((o.hourMax - ((o.hourMax - o.hourMin) % o.stepHour)) ,10), + minMax = parseInt((o.minuteMax - ((o.minuteMax - o.minuteMin) % o.stepMinute)) ,10), + secMax = parseInt((o.secondMax - ((o.secondMax - o.secondMin) % o.stepSecond)) ,10), + millisecMax = parseInt((o.millisecMax - ((o.millisecMax - o.millisecMin) % o.stepMillisec)) ,10), + dp_id = this.inst.id.toString().replace(/([^A-Za-z0-9_])/g, ''); + + // Prevent displaying twice + //if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0) { + if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0 && o.showTimepicker) { + var noDisplay = ' style="display:none;"', + html = '
' + + '
' + o.timeText + '
' + + '
' + + '
' + o.hourText + '
', + hourGridSize = 0, + minuteGridSize = 0, + secondGridSize = 0, + millisecGridSize = 0, + size = null; + + // Hours + html += '
'; + if (o.showHour && o.hourGrid > 0) { + html += '
'; + + for (var h = o.hourMin; h <= hourMax; h += parseInt(o.hourGrid,10)) { + hourGridSize++; + var tmph = (o.ampm && h > 12) ? h-12 : h; + if (tmph < 10) tmph = '0' + tmph; + if (o.ampm) { + if (h == 0) tmph = 12 +'a'; + else if (h < 12) tmph += 'a'; + else tmph += 'p'; + } + html += ''; + } + + html += '
' + tmph + '
'; + } + html += '
'; + + // Minutes + html += '
' + o.minuteText + '
'+ + '
'; + + if (o.showMinute && o.minuteGrid > 0) { + html += '
'; + + for (var m = o.minuteMin; m <= minMax; m += parseInt(o.minuteGrid,10)) { + minuteGridSize++; + html += ''; + } + + html += '
' + ((m < 10) ? '0' : '') + m + '
'; + } + html += '
'; + + // Seconds + html += '
' + o.secondText + '
'+ + '
'; + + if (o.showSecond && o.secondGrid > 0) { + html += '
'; + + for (var s = o.secondMin; s <= secMax; s += parseInt(o.secondGrid,10)) { + secondGridSize++; + html += ''; + } + + html += '
' + ((s < 10) ? '0' : '') + s + '
'; + } + html += '
'; + + // Milliseconds + html += '
' + o.millisecText + '
'+ + '
'; + + if (o.showMillisec && o.millisecGrid > 0) { + html += '
'; + + for (var l = o.millisecMin; l <= millisecMax; l += parseInt(o.millisecGrid,10)) { + millisecGridSize++; + html += ''; + } + + html += '
' + ((l < 10) ? '0' : '') + l + '
'; + } + html += '
'; + + // Timezone + html += '
' + o.timezoneText + '
'; + html += '
'; + + html += '
'; + $tp = $(html); + + // if we only want time picker... + if (o.timeOnly === true) { + $tp.prepend( + '
' + + '
' + o.timeOnlyTitle + '
' + + '
'); + $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide(); + } + + this.hour_slider = $tp.find('#ui_tpicker_hour_'+ dp_id).slider({ + orientation: "horizontal", + value: this.hour, + min: o.hourMin, + max: hourMax, + step: o.stepHour, + slide: function(event, ui) { + tp_inst.hour_slider.slider( "option", "value", ui.value); + tp_inst._onTimeChange(); + } + }); + + + // Updated by Peter Medeiros: + // - Pass in Event and UI instance into slide function + this.minute_slider = $tp.find('#ui_tpicker_minute_'+ dp_id).slider({ + orientation: "horizontal", + value: this.minute, + min: o.minuteMin, + max: minMax, + step: o.stepMinute, + slide: function(event, ui) { + tp_inst.minute_slider.slider( "option", "value", ui.value); + tp_inst._onTimeChange(); + } + }); + + this.second_slider = $tp.find('#ui_tpicker_second_'+ dp_id).slider({ + orientation: "horizontal", + value: this.second, + min: o.secondMin, + max: secMax, + step: o.stepSecond, + slide: function(event, ui) { + tp_inst.second_slider.slider( "option", "value", ui.value); + tp_inst._onTimeChange(); + } + }); + + this.millisec_slider = $tp.find('#ui_tpicker_millisec_'+ dp_id).slider({ + orientation: "horizontal", + value: this.millisec, + min: o.millisecMin, + max: millisecMax, + step: o.stepMillisec, + slide: function(event, ui) { + tp_inst.millisec_slider.slider( "option", "value", ui.value); + tp_inst._onTimeChange(); + } + }); + + this.timezone_select = $tp.find('#ui_tpicker_timezone_'+ dp_id).append('').find("select"); + $.fn.append.apply(this.timezone_select, + $.map(o.timezoneList, function(val, idx) { + return $("