Skip to content

Commit

Permalink
Merge branch 'release/1.6.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
asaquzzaman committed Feb 26, 2018
2 parents e271ab6 + f5584bd commit de3717a
Show file tree
Hide file tree
Showing 13 changed files with 3,535 additions and 1,231 deletions.
14 changes: 9 additions & 5 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,12 +659,16 @@
e.preventDefault();
$( '#cpm-new-message-form-content' ).html( '' );
$( '#cpm-signle-message' ).slideUp();
$( '.cpm-new-message-form' ).slideDown();
$( '.cpm-new-message-form' ).slideDown(400, function(){
uploadernd.uploader.refresh();
});
$( '#cpm-new-message-form-content' ).hide();
},
showasblank: function( e ) {
e.preventDefault();
$( '.cpm-new-message-form' ).slideDown();
$( '.cpm-new-message-form' ).slideDown(400, function(){
uploadernd.uploader.refresh();
});
},
hide: function( e ) {
e.preventDefault();
Expand Down Expand Up @@ -1019,9 +1023,9 @@
$( this ).closest( 'tr' ).remove();
} );
} );
new CPM_Uploader_Old( 'cpm-upload-pickfiles-nd', 'cpm-upload-container-nd' );
new CPM_Uploader_Old( 'cpm-upload-pickfiles-cm', 'cpm-upload-container-cm' );
new CPM_Uploader_Old( 'cpm-upload-pickfiles-cd', 'cpm-upload-container-cd' );
window.uploadernd = new CPM_Uploader_Old( 'cpm-upload-pickfiles-nd', 'cpm-upload-container-nd' );
window.uploadercm = new CPM_Uploader_Old( 'cpm-upload-pickfiles-cm', 'cpm-upload-container-cm' );
window.uploadercd = new CPM_Uploader_Old( 'cpm-upload-pickfiles-cd', 'cpm-upload-container-cd' );

function showderror() {

Expand Down
14 changes: 9 additions & 5 deletions assets/js/cpm-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,12 +659,16 @@
e.preventDefault();
$( '#cpm-new-message-form-content' ).html( '' );
$( '#cpm-signle-message' ).slideUp();
$( '.cpm-new-message-form' ).slideDown();
$( '.cpm-new-message-form' ).slideDown(400, function(){
uploadernd.uploader.refresh();
});
$( '#cpm-new-message-form-content' ).hide();
},
showasblank: function( e ) {
e.preventDefault();
$( '.cpm-new-message-form' ).slideDown();
$( '.cpm-new-message-form' ).slideDown(400, function(){
uploadernd.uploader.refresh();
});
},
hide: function( e ) {
e.preventDefault();
Expand Down Expand Up @@ -1019,9 +1023,9 @@
$( this ).closest( 'tr' ).remove();
} );
} );
new CPM_Uploader_Old( 'cpm-upload-pickfiles-nd', 'cpm-upload-container-nd' );
new CPM_Uploader_Old( 'cpm-upload-pickfiles-cm', 'cpm-upload-container-cm' );
new CPM_Uploader_Old( 'cpm-upload-pickfiles-cd', 'cpm-upload-container-cd' );
window.uploadernd = new CPM_Uploader_Old( 'cpm-upload-pickfiles-nd', 'cpm-upload-container-nd' );
window.uploadercm = new CPM_Uploader_Old( 'cpm-upload-pickfiles-cm', 'cpm-upload-container-cm' );
window.uploadercd = new CPM_Uploader_Old( 'cpm-upload-pickfiles-cd', 'cpm-upload-container-cd' );

function showderror() {

Expand Down
4 changes: 2 additions & 2 deletions assets/js/task-component-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ var CPM_Task_Mixin = {
return 'cpm-current-date';
},

completedTaskWrap( start_date, due_date ) {
completedTaskWrap: function ( start_date, due_date ) {
if ( start_date == '' && due_date == '' ) {
return false;
}
Expand Down Expand Up @@ -810,7 +810,7 @@ var CPM_Task_Mixin = {
return list.private == 'on' ? 'cpm-lock' : '';
},

updateActiveMode(mode) {
updateActiveMode: function (mode) {
var self = this,
form_data = {
project_id: CPM_Vars.project_id,
Expand Down
13 changes: 11 additions & 2 deletions assets/js/task-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,15 @@ Vue.component('cpm-task-comment-form', {
});
},

coworker_ids: function () {
var ids = [];
this.co_worker_lists().map(function(user) {
ids.push(user.id);
});

return ids;
},

/**
* Check select all check box enable or disabled. for notify users
*
Expand All @@ -793,7 +802,7 @@ Vue.component('cpm-task-comment-form', {
* @return void
*/
notify_coo_workers: function( user_id ) {
var co_worker_length = this.get_porject_users_id_by_role('co_worker').length,
var co_worker_length = this.coworker_ids().length,
notify_co_worker_length = this.notify_user.length;

if ( co_worker_length != notify_co_worker_length ) {
Expand All @@ -812,7 +821,7 @@ Vue.component('cpm-task-comment-form', {

if ( this.notify_all_user ) {
this.notify_user = [];
this.notify_user = this.get_porject_users_id_by_role('co_worker');
this.notify_user = this.coworker_ids();
} else {
this.notify_user = [];
}
Expand Down
10 changes: 8 additions & 2 deletions assets/js/task-vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
$( ".cpm-date-picker-to" ).datepicker( "option", "minDate", selectedDate );
},
onSelect: function(dateText) {
CPM_Task_Vue.$emit( 'cpm_date_picker', { field: 'datepicker_from', date: dateText, self: this } );
if ( !vnode.context.newSubTask ){
CPM_Task_Vue.$emit( 'cpm_date_picker', { field: 'datepicker_from', date: dateText, self: this } );
}
}
});

Expand All @@ -82,7 +84,11 @@
$( ".cpm-date-picker-from" ).datepicker( "option", "maxDate", selectedDate );
},
onSelect: function(dateText) {
CPM_Task_Vue.$emit( 'cpm_date_picker', { field: 'datepicker_to', date: dateText } );

if ( !vnode.context.newSubTask ){
CPM_Task_Vue.$emit( 'cpm_date_picker', { field: 'datepicker_to', date: dateText } );
}

}
});

Expand Down
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
= 1.6.11 - February 26, 2018 =

* [fix] Notify users while commenting in a task.
* [fix] Trix-editor intregration with the WP ERP.
* [fix] Compatible with the Microsoft Edge browser.
* [fix] Task re-ordering.
* [fix] Project list and grid view compatible with all browsers.

= 1.6.10 - November 27, 2017 =

* [new] Vuejs loading made compact.
Expand Down
14 changes: 10 additions & 4 deletions class/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,21 @@ function update_task_time() {
// cpm_user_can_delete_edit( $project_id, $list )
$start_date = sanitize_text_field( $_POST[ 'start_date' ] );
$end_date = sanitize_text_field( $_POST[ 'end_date' ] );

$start_date = !empty( $start_date ) ? date( 'Y-m-d H:i:s', strtotime( $start_date ) ) : '';
$end_date = !empty( $end_date ) ? date( 'Y-m-d H:i:s', strtotime( $end_date ) ) : '';
$project_id = sanitize_text_field( $_POST[ 'project_id' ] );
$task_id = sanitize_text_field( $_POST[ 'task_id' ] );

if ( empty( $end_date ) || empty( $task_id ) ) {
return ;
}
$end_date = date( 'Y-m-d H:i:s', strtotime( $end_date ) );

if( !empty( $start_date ) ){
$start_date = date( 'Y-m-d H:i:s', strtotime( $start_date ) );
}

if ( cpm_user_can_delete_edit( $project_id, $task_id, true ) ) {
$task_start_field = cpm_get_option( 'task_start_field', 'cpm_general', 'off' );
if ( $task_start_field == 'on' ) {
if ( $task_start_field == 'on' && !empty( $start_date ) ) {
update_post_meta( $_POST[ 'task_id' ], '_start', $start_date );
}

Expand Down
9 changes: 6 additions & 3 deletions cpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: WordPress Project Management plugin. Manage your projects and tasks, get things done.
* Author: Tareq Hasan
* Author URI: https://tareq.co
* Version: 1.6.10
* Version: 1.6.11
* License: GPL2
*/
/**
Expand Down Expand Up @@ -49,7 +49,7 @@ class WeDevs_CPM {
*
* @var string
*/
public $version = '1.6.10';
public $version = '1.6.11';

/**
* Plugin Database version
Expand Down Expand Up @@ -404,7 +404,10 @@ static function admin_scripts() {
wp_register_script( 'cpm-trix-editor', plugins_url( 'assets/js/trix.js', __FILE__ ), array( 'jquery' ), false, true );
wp_enqueue_script( 'validate', plugins_url( 'assets/js/jquery.validate.min.js', __FILE__ ), array( 'jquery' ), false, false );
wp_enqueue_script( 'plupload-handlers' );
wp_enqueue_script( 'cpm-trix-editor' );
if ( !wp_script_is( 'erp-trix-editor', 'enqueued' )){
wp_enqueue_script( 'cpm-trix-editor' );
}

//wp_enqueue_script( 'cpm_vue-multiselect', plugins_url( 'assets/js/multiselect.js', __FILE__ ), array ( 'jquery', 'plupload-handlers' ), false, true );

//swp_enqueue_script( 'cpm_common_js', plugins_url( 'assets/js/cpm_common_js.js', __FILE__ ), array('cpm-vue', 'cpm_vue-multiselect'), false, true );
Expand Down
7 changes: 6 additions & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,11 @@ function cpm_project_count() {
}

function cpm_project_actions( $project_id ) {
if (is_admin()){
$url = admin_url( "admin.php?page=cpm_projects" );
} else {
$url = add_query_arg( array( 'page' => 'cpm_projects' ), get_permalink() );
}
?>
<div class="cpm-project-action">
<span class="dashicons dashicons-admin-generic cpm-settings-bind"></span>
Expand Down Expand Up @@ -1094,7 +1099,7 @@ function cpm_project_actions( $project_id ) {
<?php if ( cpm_is_pro() ) { ?>
<li>
<span class="cpm-spinner"></span>
<a class="cpm-duplicate-project" href="<?php echo add_query_arg( array( 'page' => 'cpm_projects' ), get_permalink() ); ?>" data-project_id="<?php echo $project_id; ?>">
<a class="cpm-duplicate-project" href="<?php echo $url; ?>" data-project_id="<?php echo $project_id; ?>">
<span class="dashicons dashicons-admin-page"></span>
<span><?php _e( 'Duplicate', 'cpm' ); ?></span>
</a>
Expand Down
Loading

0 comments on commit de3717a

Please sign in to comment.