Skip to content

Commit

Permalink
Merge branch 'release/1.6.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
asaquzzaman committed Aug 17, 2017
2 parents 7badd39 + 10a1a03 commit 1a6da71
Show file tree
Hide file tree
Showing 18 changed files with 216 additions and 91 deletions.
2 changes: 1 addition & 1 deletion assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -3983,7 +3983,7 @@ ul.cpm-files li .cpm-file-action .comment-number {
.cpm .half-modal .cpm-modal-conetnt .cpm-empty-task-details .cpm-help-text {
font-size: 10px;
background: #f5f5f5;
width: 30%;
width: 100%;
padding: 0 7px;
}
.cpm .half-modal .cpm-modal-conetnt .task-details .cpm-desc-field,
Expand Down
41 changes: 38 additions & 3 deletions assets/js/task-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,15 +969,26 @@ Vue.component('new-task-form', {
submit_disabled: false,
before_edit: jQuery.extend( true, {}, this.task ),
show_spinner: false,
date_from: '',
date_to: '',
}
},

// Initial action for this component
created: function() {
this.$root.$on( 'cpm_date_picker', this.getDatePicker );
this.$on( 'cpm_date_picker', this.getDatePicker );
},

watch: {
date_from: function(new_date) {
this.task.start_date = new_date;
},

date_to: function(new_date) {
this.task.due_date = new_date;
console.log( this.task.due_date );

},
/**
* Live check is the task private or not
*
Expand Down Expand Up @@ -1062,11 +1073,11 @@ Vue.component('new-task-form', {
getDatePicker: function( data ) {

if ( data.field == 'datepicker_from' ) {
this.task.start_date = data.date;
//this.task.start_date = data.date;
}

if ( data.field == 'datepicker_to' ) {
this.task.due_date = data.date;
//this.task.due_date = data.date;
}
},

Expand Down Expand Up @@ -2453,5 +2464,29 @@ Vue.component( 'cpm-todo-lists-drop-down', {
}
});

Vue.component('cpm-datepickter', {
template: '<input type="text" :value="value">',
props: ['value', 'dependency'],
mounted: function() {
var self = this,
limit_date = ( self.dependency == 'cpm-datepickter-from' ) ? "maxDate" : "minDate";

jQuery( self.$el ).datepicker({
dateFormat: 'yy-mm-dd',
changeYear: true,
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
jQuery( "."+ self.dependency ).datepicker( "option", limit_date, selectedDate );
},
onSelect: function(dateText) {
self.$emit('input', dateText);
}
});
},

});




11 changes: 5 additions & 6 deletions assets/js/task-vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@
// send data to the server
$.post( CPM_Vars.ajaxurl, data, function( response ) {
if (response.success) {
console.log(response.data);
}
} );
}
});
},

datepicker: function() {
datepicker: function(el, binding, vnode) {
$( '.cpm-date-field').datepicker({
dateFormat: 'yy-mm-dd',
changeMonth: true,
Expand Down Expand Up @@ -135,11 +134,11 @@
var CPM_Task_Router = new VueRouter(CPM_Task_Routes);


// Register a global custom directive called v-cpm-datepicker
//Register a global custom directive called v-cpm-datepicker
Vue.directive('cpm-datepicker', {
inserted: function (el) {
CPM_Task.datepicker( el );
}
inserted: function (el, binding, vnode) {
CPM_Task.datepicker( el, binding, vnode );
},
});

// Register a global custom directive called v-cpm-sortable
Expand Down
30 changes: 30 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
= 1.6.8 - August 17, 2017 =

* [Fix] Prevent the loading trix-editor for all WP page.
* [Fix] Text formating retained got from others editor.
* [Fix] Creating second task does change the date of first task.
* [new] Add new component cpm-datepicker

= 1.6.7 - August 01, 2017 =

* [new] Js Tiptip library has been added.
* [update] Condition applied when showing calender on setting tast start date.
* [update] Date icon has been shown if no date was set.
* [update] Description icon has been shown if no description was set.
* [update] Co-Worker icon has been shown if no Co-Worker was set in the task.
* [fix] Double date picker shown at task date update time.
* [fix] Undefined index errors.

= 1.6.6 - July 31, 2017 =

* [new] Task title update from single task page.
* [new] Task privacy update from single task page.
* [new] Task description update from single task page.
* [new] Task start and end date update from single task page.
* [new] Add user/co-worker/client from single task page.
* [fix] Unable to complete task.
* [fix] When complete a task then this completed task shown double in the to-do list.
* [fix] Double "New To-Do" button shown.
* [update] 'Get porject id' function always return false.
* [update] Design change for single task page.

= 1.6.5 - July 6, 2017 =

* [fix] Co-worker can not show the list corner menu.
Expand Down
9 changes: 3 additions & 6 deletions class/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ function update_task() {
$project_id = isset( $posted[ 'project_id' ] ) ? intval( $posted[ 'project_id' ] ) : 0;
$task_id = isset( $posted[ 'task_id' ] ) ? intval( $posted[ 'task_id' ] ) : 0;
$type = isset( $posted[ 'type' ] ) ? $posted[ 'type' ] : 'html';
$single = ( int ) $posted[ 'single' ];
$single = empty( $posted[ 'single' ] ) ? false : $posted[ 'single' ];
$response = array ( 'success' => false );

if ( cpm_user_can_delete_edit( $project_id, $task_id, true ) ) {
Expand Down Expand Up @@ -1779,12 +1779,9 @@ function get_todo_single() {
$task_id = sanitize_text_field( $_POST[ 'task_id' ] );
$project_id = sanitize_text_field( $_POST[ 'project_id' ] );
$task = $task_obj->get_task( $task_id);
//$task = $task_obj->set_todo_extra_data( $project_id, $task->post_parent, $task);

$task->post_content = cpm_get_content( $task->post_content );
$task->post_content = wp_strip_all_tags( $task->post_content );

$task->can_del_edit = cpm_user_can_delete_edit( $project_id, $task );

wp_send_json_success( array( 'task' => $task ) );
}

Expand Down
5 changes: 4 additions & 1 deletion class/loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ function project_nav_links( $link ) {

}

new CPM_Free_Loader();
if ( ! cpm_is_pro() ) {
new CPM_Free_Loader();
}

23 changes: 23 additions & 0 deletions class/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class CPM_Message {

public function __construct() {
add_filter( 'init', array( $this, 'register_post_type' ) );
add_action( 'cpm_admin_scripts', array ( $this, 'message_scripts' ) );
}

public static function getInstance() {
Expand Down Expand Up @@ -87,6 +88,28 @@ function get_all( $project_id, $privacy = false ) {
return $messages;
}

function message_scripts() {
if ( isset( $_GET[ 'tab' ] ) AND $_GET[ 'tab' ] == 'message' ) {

$scripts = array(
'cpm-trix-editor'
);

$scripts = apply_filters( 'cpm_message_scripts', $scripts );

do_action( 'cpm_before_message_scripts' );

foreach( $scripts as $script ) {
do_action( 'before-'. $script );
wp_enqueue_script( $script );
wp_enqueue_style( $script );
do_action( 'after-'. $script );
}

do_action( 'cpm_after_message_scripts' );
}
}

/**
* Get All message created User as Authore.
* @since 1.5.1
Expand Down
23 changes: 23 additions & 0 deletions class/milestone.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class CPM_Milestone {

public function __construct() {
add_filter( 'init', array( $this, 'register_post_type' ) );
add_action( 'cpm_admin_scripts', array ( $this, 'milestone_scripts' ) );
}

public static function getInstance() {
Expand Down Expand Up @@ -52,6 +53,28 @@ function register_post_type() {
) );
}

function milestone_scripts() {
if ( isset( $_GET[ 'tab' ] ) AND $_GET[ 'tab' ] == 'milestone' ) {

$scripts = array(
'cpm-trix-editor'
);

$scripts = apply_filters( 'cpm_milestone_scripts', $scripts );

do_action( 'cpm_before_milestone_scripts' );

foreach( $scripts as $script ) {
do_action( 'before-'. $script );
wp_enqueue_script( $script );
wp_enqueue_style( $script );
do_action( 'after-'. $script );
}

do_action( 'cpm_after_milestone_scripts' );
}
}

function create( $project_id, $milestone_id = 0 ) {
$posted = $_POST;
$is_update = $milestone_id ? true : false;
Expand Down
3 changes: 1 addition & 2 deletions class/task.php
Original file line number Diff line number Diff line change
Expand Up @@ -831,11 +831,10 @@ function set_task_meta( &$task ) {
$task->start_date = get_post_meta( $task->ID, '_start', true );
$task->task_privacy = get_post_meta( $task->ID, '_task_privacy', true );
$task->comments = $this->get_task_comments( $task->ID );
$task->post_content = wp_strip_all_tags( $task->post_content );
$task->post_content = cpm_get_content( $task->post_content );
$task->edit_mode = false;

$task = apply_filters( 'cpm_set_task_meta', $task );
// var_dump( $task ); die();
}

/**
Expand Down
9 changes: 4 additions & 5 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.7
* Version: 1.6.8
* License: GPL2
*/
/**
Expand Down Expand Up @@ -49,7 +49,7 @@ class WeDevs_CPM {
*
* @var string
*/
public $version = '1.6.7';
public $version = '1.6.8';

/**
* Plugin Database version
Expand Down Expand Up @@ -384,7 +384,7 @@ static function admin_scripts() {
wp_enqueue_script( 'jquery-prettyPhoto', plugins_url( 'assets/js/jquery.prettyPhoto.js', __FILE__ ), array( 'jquery' ), false, true );
wp_enqueue_script( 'jquery-chosen', plugins_url( 'assets/js/chosen.jquery.min.js', __FILE__ ), array( 'jquery' ), false, true );
wp_enqueue_script( 'cpm_chart', plugins_url( 'assets/js/chart.js', __FILE__ ), array( 'jquery' ), false, true );
wp_enqueue_script( 'trix_editor', plugins_url( 'assets/js/trix.js', __FILE__ ), array( 'jquery' ), false, true );
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_vue-multiselect', plugins_url( 'assets/js/multiselect.js', __FILE__ ), array ( 'jquery', 'plupload-handlers' ), false, true );
Expand Down Expand Up @@ -447,14 +447,13 @@ static function admin_scripts() {
wp_register_style( 'cpm-tiptip', CPM_URL . '/assets/js/tiptip/tipTip.css' );
wp_register_style( 'cpm-vue-multiselect', CPM_URL . '/assets/css/vue-multiselect/vue-multiselect.min.css' );

wp_register_style( 'cpm-trix', CPM_URL . '/assets/css/trix/trix.css' );
wp_register_style( 'cpm-trix-editor', CPM_URL . '/assets/css/trix/trix.css' );
wp_register_style( 'cpm-tiny-mce', site_url( '/wp-includes/css/editor.css' ) );
wp_register_style( 'cpm-toastr', CPM_URL . '/assets/css/toastr/toastr.min.css' );
wp_enqueue_style( 'atwhocss', plugins_url( 'assets/css/jquery.atwho.css', __FILE__ ) );
wp_enqueue_style( 'cpm_prettyPhoto', plugins_url( 'assets/css/prettyPhoto.css', __FILE__ ) );
wp_enqueue_style( 'jquery-ui', plugins_url( 'assets/css/jquery-ui-1.9.1.custom.css', __FILE__ ) );
wp_enqueue_style( 'jquery-chosen', plugins_url( 'assets/css/chosen.css', __FILE__ ) );
wp_enqueue_style( 'trix_editor_style', plugins_url( 'assets/css/trix.css', __FILE__ ) );
wp_enqueue_style( 'cpm_admin', plugins_url( 'assets/css/admin.css', __FILE__ ) );
wp_enqueue_style( 'fontawesome', CPM_URL . '/assets/css/fontawesome/font-awesome.min.css' );
wp_enqueue_style( 'dashicons' );
Expand Down
Loading

0 comments on commit 1a6da71

Please sign in to comment.