Skip to content

Commit

Permalink
Merge branch 'release/1.6.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
asaquzzaman committed Aug 1, 2017
2 parents fb39bed + 0eb7a33 commit 7badd39
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 25 deletions.
16 changes: 11 additions & 5 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -3941,6 +3941,7 @@ ul.cpm-files li .cpm-file-action .comment-number {
margin-top: 0px;
margin-left: 5%;
display: inline-block;
width: 80%;
}
.cpm .half-modal .cpm-modal-conetnt .cpm-task-meta .cpm-task-date-wrap {
cursor: pointer;
Expand Down Expand Up @@ -3970,29 +3971,34 @@ ul.cpm-files li .cpm-file-action .comment-number {
.cpm .half-modal .cpm-modal-conetnt .task-details:hover .cpm-desc-content {
background: #eee;
}
.cpm .half-modal .cpm-modal-conetnt .task-details {
.cpm .half-modal .cpm-modal-conetnt .task-details,
.cpm .half-modal .cpm-modal-conetnt .cpm-empty-task-details {
margin-bottom: 15px;
margin-top: 15px;
margin-left: 5%;
width: 62%;
text-align: justify;
}
.cpm .half-modal .cpm-modal-conetnt .task-details .cpm-help-text {
.cpm .half-modal .cpm-modal-conetnt .task-details .cpm-help-text,
.cpm .half-modal .cpm-modal-conetnt .cpm-empty-task-details .cpm-help-text {
font-size: 10px;
background: #f5f5f5;
width: 30%;
padding: 0 7px;
}
.cpm .half-modal .cpm-modal-conetnt .task-details .cpm-desc-field {
.cpm .half-modal .cpm-modal-conetnt .task-details .cpm-desc-field,
.cpm .half-modal .cpm-modal-conetnt .cpm-empty-task-details .cpm-desc-field {
height: 100px;
width: 100%;
}
.cpm .half-modal .cpm-modal-conetnt .task-details .cpm-desc-content {
.cpm .half-modal .cpm-modal-conetnt .task-details .cpm-desc-content,
.cpm .half-modal .cpm-modal-conetnt .cpm-empty-task-details .cpm-desc-content {
margin: 0;
padding: 6px;
min-height: 100px;
}
.cpm .half-modal .cpm-modal-conetnt .task-details .cpm-task-des-edit-btn {
.cpm .half-modal .cpm-modal-conetnt .task-details .cpm-task-des-edit-btn,
.cpm .half-modal .cpm-modal-conetnt .cpm-empty-task-details .cpm-task-des-edit-btn {
display: none;
}
.cpm .half-modal .cpm-modal-conetnt .task-details:hover .cpm-task-des-edit-btn {
Expand Down
5 changes: 3 additions & 2 deletions assets/css/new-admin.less
Original file line number Diff line number Diff line change
Expand Up @@ -4661,6 +4661,7 @@ ul.cpm-files {
margin-top: 0px;
margin-left: 5%;
display: inline-block;
width: 80%;

.cpm-task-date-wrap {
cursor: pointer;
Expand Down Expand Up @@ -4696,7 +4697,7 @@ ul.cpm-files {



.task-details {
.task-details, .cpm-empty-task-details {
margin-bottom: 15px;
margin-top: 15px;
margin-left: 5%;
Expand All @@ -4706,7 +4707,7 @@ ul.cpm-files {
.cpm-help-text {
font-size: 10px;
background: #f5f5f5;
width: 30%;
width: 100%;
padding: 0 7px;
}

Expand Down
12 changes: 10 additions & 2 deletions assets/js/task-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -1343,11 +1343,14 @@ var CPM_Task_Single = {

if ( date.field == 'datepicker_to' ) {
var task = this.task;

var start = new Date( task.start_date ),
due = new Date( date.date );

if ( start <= due ) {
if ( !this.$store.state.permissions.task_start_field ) {
task.due_date = date.date;
this.updateTaskElement(task);
} else if ( start <= due ) {
task.due_date = date.date;
this.updateTaskElement(task);
}
Expand All @@ -1359,6 +1362,10 @@ var CPM_Task_Single = {
},
isTaskDetailsEditMode: function() {
this.is_task_details_edit_mode = true;

Vue.nextTick(function() {
jQuery('.cpm-desc-field').focus();
});
},

updateDescription: function(task, event) {
Expand Down Expand Up @@ -1421,6 +1428,7 @@ var CPM_Task_Single = {
task_start: task.start_date,
task_due: task.due_date,
task_privacy: task.task_privacy,
single: true,
_wpnonce: CPM_Vars.nonce,
},
self = this;
Expand Down
5 changes: 3 additions & 2 deletions class/notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,12 @@ function new_task( $list_id, $task_id, $data ) {
if ( cpm_strlen( $subject ) > 78 ) {
$subject = substr( $subject, 0, 78 ) . '...';
}
$assign_user = (!is_array ($_POST['task_assign']) ) ? explode( ',', $_POST['task_assign'] ) : $_POST['task_assign'] ;
$assign_user = (!is_array ($_POST['task_assign']) ) ? explode( ',', $_POST['task_assign'] ) : $_POST['task_assign'];

foreach ( $assign_user as $key => $user_id ) {
$user = get_user_by( 'id', intval( $user_id ) );

if ( ! $this->filter_email( $user_id ) ) {
if ( ! $user || ! $this->filter_email( $user_id ) ) {
continue;
}

Expand Down
6 changes: 4 additions & 2 deletions class/task.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ function tasks_scripts() {
wp_enqueue_media();

$scripts = array(
'cpm-tiptip',
'cpm-uploader',
'cpm-toastr',
'cpm-tiny-mce',
Expand Down Expand Up @@ -197,6 +198,7 @@ function tasks_scripts() {
do_action( 'after-'. $script );
}

wp_enqueue_style( 'cpm-tiptip' );
wp_enqueue_style( 'cpm-vue-multiselect' );
wp_enqueue_style( 'cpm-toastr' );
wp_enqueue_style( 'cpm-trix' );
Expand Down Expand Up @@ -284,7 +286,7 @@ function add_task( $list_id, $postdata, $task_id = 0 ) {
$is_update = $task_id ? true : false;

$task_title = trim( $postdata[ 'task_title' ] );
$content = trim( $postdata[ 'task_text' ] );
$content = empty( $postdata[ 'task_text' ] ) ? '' : trim( $postdata[ 'task_text' ] );
//print_r($postdata[ 'task_assign' ]) ; exit() ;
$assigned = isset( $postdata[ 'task_assign' ] ) ? $postdata[ 'task_assign' ] : array ( '-1' );
// $due = empty( $postdata['task_due'] ) ? '' : cpm_date2mysql( $postdata['task_due'] );
Expand Down Expand Up @@ -334,7 +336,7 @@ function add_task( $list_id, $postdata, $task_id = 0 ) {
}
}

$data['assigned_users'] = $postdata[ 'task_assign' ];
$data['assigned_users'] = empty( $postdata[ 'task_assign' ] ) ? array ( '-1' ) : $postdata[ 'task_assign' ];

if ( $is_update ) {
$this->new_task_project_item( $list_id, $task_id, $assigned, $task_privacy, $is_update );
Expand Down
2 changes: 1 addition & 1 deletion cpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function __construct() {

//Execute only plugin install time
register_activation_hook( __FILE__, array( $this, 'install' ) );

//Do some thing after load this plugin
do_action( 'cpm_loaded' );
}
Expand Down
50 changes: 39 additions & 11 deletions views/js-templates/task-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,21 @@ class="cpm-task-title-activity cpm-task-title-field"
<div class="clearfix cpm-clear"></div>
</h3>

<div class="cpm-task-meta">
<span class="cpm-assigned-user-wrap">
<span class='cpm-assigned-user'
<div class="cpm-task-meta">
<span class="cpm-assigned-user-wrap">
<span v-if="task_assign.length" class='cpm-assigned-user'
@click.prevent="isEnableMultiSelect()"
v-for="user in getUsers( task.assigned_to )"
v-html="user.user_url">

</span>
<span v-if="!task_assign.length" class='cpm-assigned-user'
@click.prevent="isEnableMultiSelect()"
>
<i style="font-size: 20px;" class="fa fa-user" aria-hidden="true"></i>
</span>

<div @click.prevent="afterSelect" class="cpm-multiselect cpm-multiselect-single-task" v-if="is_enable_multi_select">
<div v-if="task_assign.length" @click.prevent="afterSelect" class="cpm-multiselect cpm-multiselect-single-task" v-if="is_enable_multi_select">

<multiselect
v-model="task_assign"
Expand Down Expand Up @@ -113,7 +118,7 @@ class="cpm-task-title-activity cpm-task-title-field"
</span>


<span class="cpm-task-date-wrap cpm-date-window">
<span v-if="(task.start_date != '' || task.due_date != '')" class="cpm-task-date-wrap cpm-date-window">
<span
@click.prevent="isTaskDateEditMode()"
v-bind:class="task.completed ? completedTaskWrap(task.start_date, task.due_date) : taskDateWrap( task.start_date, task.due_date)">
Expand All @@ -131,7 +136,29 @@ class="cpm-task-title-activity cpm-task-title-field"
</span>

<div class="cpm-date-update-wrap" v-if="is_task_date_edit_mode">
<div v-cpm-datepicker class="cpm-date-picker-from cpm-inline-date-picker-from"></div>
<div v-if="task_start_field" v-cpm-datepicker class="cpm-date-picker-from cpm-inline-date-picker-from"></div>
<div v-cpm-datepicker class="cpm-date-picker-to cpm-inline-date-picker-to"></div>
<div class="clearfix cpm-clear"></div>
</div>


</span>

<span v-if="(task.start_date == '' && task.due_date == '')" class="cpm-task-date-wrap cpm-date-window">
<span
@click.prevent="isTaskDateEditMode()"
v-bind:class="task.completed ? completedTaskWrap(task.start_date, task.due_date) : taskDateWrap( task.start_date, task.due_date)">
<span>
<!-- <span class="dashicons cpm-date-edit-btn dashicons-edit" title="<?php _e( 'Edit Task Description', 'cpm' ); ?>"></span> -->
<i style="font-size: 20px;" class="fa fa-calendar" aria-hidden="true"></i>
</span>



</span>

<div class="cpm-date-update-wrap" v-if="is_task_date_edit_mode">
<div v-if="task_start_field" v-cpm-datepicker class="cpm-date-picker-from cpm-inline-date-picker-from"></div>
<div v-cpm-datepicker class="cpm-date-picker-to cpm-inline-date-picker-to"></div>
<div class="clearfix cpm-clear"></div>
</div>
Expand All @@ -144,15 +171,16 @@ class="cpm-task-title-activity cpm-task-title-field"
</div>


<div class="task-details">
<div class="task-details">

<!--v-if-->

<p class="cpm-des-area cpm-desc-content" v-if="!is_task_details_edit_mode" @click.prevent="isTaskDetailsEditMode()">
{{ task.post_content }}
<!-- <span class="dashicons dashicons-edit cpm-task-des-edit-btn cpm-des-area" title="<?php _e( 'Edit Task Description', 'cpm' ); ?>"></span> -->
<span v-if="!task.post_content == ''">{{ task.post_content }}</span>
<span style="margin-left: -3px;" v-if="task.post_content == ''"><i style="font-size: 16px;" class="fa fa-pencil" aria-hidden="true"></i>&nbsp;&nbsp<?php _e( 'Update Description', 'cpm' ); ?></span>

</p>
<!-- @keyup.enter="updateTaskElement(task)" -->
<!-- @keyup.enter="updateTaskElement(task)" -->
<textarea
v-prevent-line-break
@blur="updateDescription(task, $event)"
Expand All @@ -162,7 +190,7 @@ class="cpm-des-area cpm-desc-field"
v-model="task.post_content">

</textarea>
<div v-if="is_task_details_edit_mode" class="cpm-help-text"><?php _e('Shift+Enter for line break', 'cpm'); ?></div>
<div v-if="is_task_details_edit_mode" class="cpm-help-text"><span><?php _e('Shift+Enter for line break', 'cpm'); ?></span></div>

<div class="clearfix cpm-clear"></div>
</div>
Expand Down

0 comments on commit 7badd39

Please sign in to comment.