Plugin Directory

Changeset 3079882


Ignore:
Timestamp:
05/01/2024 01:10:10 PM (2 years ago)
Author:
taskbuilder
Message:

version change

Location:
taskbuilder
Files:
320 added
99 edited

Legend:

Unmodified
Added
Removed
  • taskbuilder/trunk/asset/css/admin.css

    r2981294 r3079882  
    154154  border: none !important;
    155155}
    156 .wppm_thread{
     156.wppm_thread,.wppm_proj_thread{
    157157  background-color: #FFFFFF;
    158158  color: #000000;
     
    218218}
    219219.wppm_widget{
     220  display: flex;
     221  flex-direction: column;
     222  width: 100%;
     223  min-width: 100%;
     224  max-width: 100%;
     225  box-sizing: border-box;
     226  margin-bottom: 15px;
    220227  border: 1px solid #eee !important;
     228}
     229.wppm-widget-header {
     230  display: flex;
     231  align-items: center;
     232  padding: 10px;
     233}
     234.wppm-widget-header span {
     235  display: flex;
     236  align-items: center;
     237  margin-left: 5px;
     238  cursor: pointer;
     239}
     240.wppm-widget-header h4 {
     241    flex-grow: 1;
     242    margin: 0px !important;
     243}
     244.wppm-widget-body {
     245    display: flex;
     246    flex-direction: column;
     247    padding: 10px 10px 0;
    221248}
    222249.wppm-btn{
     
    521548  }
    522549}
    523 .wppm_task_name_grid_view, .wppm_task_due_date_grid_view, .wppm_empty_container{
     550.wppm_task_name_grid_view, .wppm_task_due_date_grid_view, .wppm_empty_container, .wppm_proj_name_grid_view{
    524551  font-family: "OpenSans-Semibold","Helvetica Neue",Arial,Helvetica,sans-serif;
    525552  font-size: 14px;
     
    672699  border: 1px solid #eee !important;
    673700}
     701.wppm_proj_thread{
     702  background-color: #FFFFFF;
     703  border: 1px solid #eee !important;
     704}
     705
    674706.wppm_progress_bar_container{
    675707  margin-bottom: 6px;
     
    793825  padding: 10px;
    794826}
     827#wppm_proj_comment_btn{
     828  display:none;
     829  padding: 10px;
     830}
    795831#wppm_activity_container{
    796832  background-color:#ffffff;
     
    799835}
    800836.wppm_task_discussion{
     837  font: 18px "Helvetica Neue",Helvetica,Arial,sans-serif;
     838}
     839.wppm_proj_discussion{
    801840  font: 18px "Helvetica Neue",Helvetica,Arial,sans-serif;
    802841}
     
    839878  font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif;
    840879}
     880#wppm_proj_comment{
     881  width: 80%;
     882  height: 30px;
     883  padding: 5px;
     884  margin-bottom: 15px;
     885  overflow: hidden;
     886  border: 1px solid #eee;
     887  color:#eee;
     888  margin-top: 10px;
     889  font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif;
     890}
    841891.wppm_attachment_title{
    842892  font: 15px "Helvetica Neue",Helvetica,Arial,sans-serif;
     
    870920  font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif;
    871921}
     922#wppm_proj_attach_file{
     923  color:#301db7;
     924  cursor:pointer;
     925  font-weight: normal;
     926  text-decoration-line: underline;
     927  text-decoration-style: dotted;
     928  font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif;
     929}
     930#wppm_individual_cancel_proj_comment_btn{
     931  float:right;
     932  background-color:#ffffff;
     933  margin-left: 5px;
     934  margin-top:5px;
     935  font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif;
     936}
     937#wppm_individual_submit_proj_comment_btn{
     938  float:right;
     939  margin-left: 5px;
     940  margin-top:5px;
     941  font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif;
     942}
    872943.wppm_thread_messege{
    873944  font-size: 14px;
     
    888959}
    889960.widget_divider{
    890   margin-top: 4px !important;
    891   margin-bottom: 6px !important;
     961  margin:4px 0 6px 0px !important;
    892962}
    893963.wppm_individual_task_widget{
     
    11541224}
    11551225
    1156 #wppm_task_filter{
     1226#wppm_task_filter, #wppm_task_list_proj_filter
     1227{
    11571228  border: 1px solid #ccc !important;
    11581229  background-color:#FFFFFF;
     
    11651236  margin-right: 5px;
    11661237  margin-bottom: 10px;
     1238  margin: 0 5px 10px 10px;
    11671239}
    11681240.wppm-filter-item select {
     
    12171289  font: 15px "Helvetica Neue",Arial,Helvetica,sans-serif !important;
    12181290}
     1291
     1292#wppm_proj_discussion_container{
     1293  background-color: #ffffff;
     1294  border: 1px solid #eee !important;
     1295}
     1296.wppm-setting-tab-container {
     1297    display: flex;
     1298    flex-wrap: wrap;
     1299    width: 100%;
     1300    align-items: center;
     1301    margin-bottom: 10px;
     1302  background-color:#F0F0F1;
     1303}
     1304.wppm-setting-tab-container button {
     1305    padding: 7px 15px;
     1306    font-size: 16px;
     1307    font-weight: normal;
     1308    border: none !important;
     1309    color: #6A6A6A;
     1310    background-color: transparent;
     1311    cursor: pointer;
     1312    border-radius: 16px;
     1313    margin: 10 0 5px 5px;
     1314}
     1315.wppm-setting-tab-container button.active,
     1316.wppm-setting-tab-container button:hover {
     1317    color: #fff;
     1318    background-color: #FFA04A;
     1319}
     1320.wppm-input-group {
     1321    width: 100%;
     1322    display: flex;
     1323    flex-direction: column;
     1324    padding-bottom: 15px;
     1325    box-sizing: border-box;
     1326}
     1327.wppm-input-group .label-container {
     1328    display: flex;
     1329    align-items: center;
     1330    color: #000;
     1331    margin-bottom: 2px;
     1332}
     1333.wppm-input-group label {
     1334    font-size: 12px;
     1335    font-weight: 600;
     1336    margin-right: 5px;
     1337}
     1338.wppm-input-group .label-container svg {
     1339    width: 12px;
     1340    margin-left: 5px;
     1341}
     1342.wppm-input-group input[type="text"],
     1343.wppm-input-group select {
     1344    width: 100%;
     1345    max-width: 100%;
     1346}
     1347.wppm-input-group .checkbox-group,
     1348.wppm-input-group .radio-group {
     1349    width: 100%;
     1350    display: flex;
     1351    flex-wrap: wrap;
     1352    align-items: center;
     1353}
     1354.wppm-input-group .checkbox-group div,
     1355.wppm-input-group .radio-group div {
     1356    width: 250px;
     1357    display: flex;
     1358    flex-wrap: wrap;
     1359    align-items: center;
     1360    margin: 0 10px 5px 0;
     1361}
     1362.wppm-input-group .checkbox-group div input,
     1363.wppm-input-group .radio-group div input {
     1364    margin: 0 5px 0 0 !important;
     1365}
     1366.wppm-input-group .checkbox-group div span,
     1367.wppm-input-group .radio-group div span {
     1368    font-size: 12px;
     1369    font-weight: 300;
     1370}
     1371.wppm-input-group .required-char {
     1372    font-size: 12px;
     1373    color: #ff0000;
     1374}
     1375.wppm-input-group .divide-bar {
     1376    width: 100%;
     1377    display: flex;
     1378    flex-wrap: grid;
     1379    align-items: center;
     1380}
  • taskbuilder/trunk/asset/css/public.css

    r2611331 r3079882  
    5757    word-break: break-word;
    5858}
     59
     60.wppm_bootstrap .wppm_proj_thread{
     61    word-break: break-word;
     62}
  • taskbuilder/trunk/asset/js/admin.js

    r2981294 r3079882  
    6363  if (!flag) return;
    6464
    65   var data = { action: 'wppm_delete_category', cat_id };
     65  var data = { action: 'wppm_delete_category',
     66    cat_id,
     67    _ajax_nonce:jQuery('#wppm_delete_cat_ajax_nonce').val()
     68  };
    6669  jQuery.post(wppm_admin.ajax_url, data, function (res) {
    6770    wppm_get_category_settings();
     
    98101  if (!flag) return;
    99102
    100   var data = { action: 'wppm_delete_status', status_id };
     103  var data = { action: 'wppm_delete_status', status_id,
     104    _ajax_nonce:jQuery('#wppm_delete_pstatus_ajax_nonce').val()
     105  };
    101106  jQuery.post(wppm_admin.ajax_url, data, function (res) {
    102107    wppm_get_proj_status_settings();
     
    214219  if (!flag) return;
    215220
    216   var data = { action: 'wppm_delete_task_priority', priority_id };
     221  var data = { action: 'wppm_delete_task_priority', priority_id,
     222    _ajax_nonce:jQuery('#wppm_delete_tprio_ajax_nonce').val()
     223  };
    217224  jQuery.post(wppm_admin.ajax_url, data, function (res) {
    218225    wppm_get_task_prioriy_settings();
     
    249256  if (!flag) return;
    250257
    251   var data = { action: 'wppm_delete_task_status', status_id };
     258  var data = { action: 'wppm_delete_task_status', status_id,
     259    _ajax_nonce: jQuery('#wppm_delete_tstatus_ajax_nonce').val()};
    252260  jQuery.post(wppm_admin.ajax_url, data, function (res) {
    253261    wppm_get_task_status_settings();
     
    319327    task_id: task_id,
    320328    proj_id: proj_id,
    321     checklist_name: jQuery('#wppm_checklist_label').val()
     329    checklist_name: jQuery('#wppm_checklist_label').val(),
     330    _ajax_nonce:jQuery('#wppm_checklist_ajax_nonce').val()
    322331  };
    323332  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     
    341350    checklist_id: checklist_id,
    342351    proj_id:proj_id,
    343     label: jQuery('#wppm_checklist_item_label_'+checklist_id).val()
     352    label: jQuery('#wppm_checklist_item_label_'+checklist_id).val(),
     353    _ajax_nonce:jQuery('#wppm_checklist_item_ajax_nonce').val()
    344354  };
    345355  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     
    357367  var data = {
    358368    action: 'wppm_delete_checklist',
    359     checklist_id: checklist_id
     369    checklist_id: checklist_id,
     370    _ajax_nonce:jQuery('#wppm_delete_checklist_ajax_nonce').val()
    360371  };
    361372  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     
    374385    action: 'wppm_remove_checklist_item',
    375386    item_id:item_id,
    376     checklist_id: checklist_id
     387    checklist_id: checklist_id,
     388    _ajax_nonce:jQuery('#wppm_delete_checklist_item_ajax_nonce').val()
    377389  };
    378390  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     
    403415    checklist_id: checklist_id,
    404416    item_id:item_id,
    405     checked_item: checked_item
     417    checked_item: checked_item,
     418    _ajax_nonce:jQuery('#wppm_checklist_progress_ajax_nonce').val()
    406419  };
    407420  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     
    451464  tinymce.remove('#wppm_task_comment');
    452465  jQuery('#wppm_comment_btn').hide();
     466}
     467
     468function wppm_cancel_proj_comment(){
     469  tinyMCE. activeEditor. setContent('');
     470  tinymce.remove('#wppm_proj_comment');
     471  jQuery('#wppm_proj_comment_btn').hide();
    453472}
    454473
     
    473492      wppm_open_task(id);
    474493    }
     494  });
     495}
     496
     497function wppm_submit_proj_comment(proj_id){
     498  var dataform = new FormData(jQuery('#wppm_open_project')[0]);
     499  jQuery('#wppm_load_individual_project_container').html(wppm_admin.loading_html);
     500  dataform.append('action','wppm_submit_proj_comment');
     501  var comment_body = tinyMCE.get('wppm_proj_comment').getContent().trim();
     502  dataform.append('comment_body',comment_body);
     503  dataform.append('proj_id',proj_id);
     504  jQuery.ajax({
     505    url: wppm_admin.ajax_url,
     506    type: 'POST',
     507    data: dataform,
     508    processData: false,
     509    contentType: false
     510  })
     511  .done(function (response_str) {
     512      wppm_open_project(proj_id);
    475513  });
    476514}
     
    664702}
    665703
     704function wppm_edit_proj_thread(comment_id,proj_id){
     705  wppm_modal_open('Edit Thread');
     706  var data = {
     707    action: 'wppm_edit_proj_thread',
     708    comment_id:comment_id,
     709    proj_id: proj_id
     710  }
     711  jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     712    var response = JSON.parse(response_str);
     713    jQuery('#wppm_popup_body').html(response.body);
     714    jQuery('#wppm_popup_footer').html(response.footer);
     715  });
     716}
     717
    666718function wppm_set_edit_task_thread(task_id,proj_id){
    667719  var dataform = new FormData(jQuery('#frm_edit_task_thread')[0]);
     
    686738}
    687739
     740function wppm_set_edit_proj_thread(proj_id,){
     741  var dataform = new FormData(jQuery('#frm_edit_proj_thread')[0]);
     742  var comment_body = tinyMCE.get('wppm_edit_proj_thread_editor').getContent().trim();
     743  dataform.append('wppm_edit_proj_thread', comment_body);
     744  wppm_modal_close();
     745  jQuery('#wppm_task_container').html(wppm_admin.loading_html);
     746  jQuery.ajax({
     747    url: wppm_admin.ajax_url,
     748    type: 'POST',
     749    data: dataform,
     750    processData: false,
     751    contentType: false
     752  })
     753  .done(function (response_str) {
     754      wppm_open_project(proj_id);
     755  });
     756}
     757
    688758function wppm_delete_thread(comment_id,task_id,proj_id){
    689759  wppm_modal_open('Delete Thread');
     
    692762    comment_id:comment_id,
    693763    task_id: task_id,
     764    proj_id:proj_id
     765  }
     766  jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     767    var response = JSON.parse(response_str);
     768    jQuery('#wppm_popup_body').html(response.body);
     769    jQuery('#wppm_popup_footer').html(response.footer);
     770  });
     771}
     772
     773function wppm_delete_proj_thread(comment_id,proj_id){
     774  wppm_modal_open('Delete Thread');
     775  var data = {
     776    action: 'wppm_delete_proj_thread',
     777    comment_id:comment_id,
    694778    proj_id:proj_id
    695779  }
     
    718802      wppm_open_task(task_id);
    719803    }
     804  });
     805}
     806
     807function wppm_set_delete_proj_thread(proj_id){
     808  var dataform = new FormData(jQuery('#frm_delete_proj_thread')[0]);
     809  wppm_modal_close();
     810  jQuery('#wppm_task_container').html(wppm_admin.loading_html);
     811  jQuery.ajax({
     812    url: wppm_admin.ajax_url,
     813    type: 'POST',
     814    data: dataform,
     815    processData: false,
     816    contentType: false
     817  })
     818  .done(function (response_str) {
     819    wppm_open_project(proj_id);
    720820  });
    721821}
     
    10521152     attachment : attachment,
    10531153     comment_id : comment_id,
    1054      task_id:task_id
     1154     task_id:task_id,
     1155     _ajax_nonce : jQuery('#wppm_ajax_nonce').val()
    10551156   };
    10561157   jQuery.post(wppm_admin.ajax_url, data, function(response) {
     
    10651166}
    10661167
     1168function wppm_proj_thread_attachment_remove(obj,attachment,comment_id,id){
     1169  if( confirm(wppm_admin.confirm) ){
     1170   var data = {
     1171     action: 'wppm_remove_proj_thread_attachment',
     1172     attachment : attachment,
     1173     comment_id : comment_id,
     1174     proj_id:id,
     1175     _ajax_nonce:jQuery('#wppm_proj_thread_attachment_remove').val()
     1176   };
     1177   jQuery.post(wppm_admin.ajax_url, data, function(response) {
     1178      jQuery(obj).parent('td').parent('tr').remove();
     1179      wppm_open_project(id);
     1180    });
     1181  }
     1182}
     1183
    10671184function wppm_open_project(id){
    10681185  jQuery('#wppm_project_list').hide();
     
    11051222
    11061223function wppm_set_clone_task(){
    1107   var data = {
    1108     action: 'wppm_set_clone_task',
    1109     task_id: jQuery("input[name=task_id]").val(),
    1110     task_name:jQuery("input[name=task_name]").val()
    1111   }
    1112   jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     1224  var dataform = new FormData(jQuery('#frm_edit_clone_task_name')[0]);
     1225  jQuery.ajax({
     1226    url: wppm_admin.ajax_url,
     1227    type: 'POST',
     1228    data: dataform,
     1229    processData: false,
     1230    contentType: false
     1231  })
     1232  .done(function (response_str) {
    11131233    wppm_modal_close();
    11141234    wppm_get_task_list();
     
    11521272    jQuery('.wppm_setting_col2').html(response);
    11531273  });
     1274}
     1275
     1276function wppm_get_appearance_settings(){
     1277  jQuery('.wppm_setting_pills li').removeClass('active');
     1278  jQuery('#wppm_settings_appearance').addClass('active');
     1279  var data = {
     1280    action: 'wppm_get_appearance_settings'
     1281  };
     1282  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     1283    jQuery('.wppm_setting_col2').html(response);
     1284  });
     1285}
     1286
     1287function wppm_get_ap_proj_list(current_tab_class) {
     1288    jQuery( '.wppm-setting-tab-container button' ).removeClass( 'active' );
     1289    jQuery( '.wppm-setting-tab-container button.' + current_tab_class ).addClass( 'active' );
     1290    jQuery('.wppm-setting-section-body').html(wppm_admin.loading_html);
     1291  var data = { action: 'wppm_get_ap_proj_list' ,
     1292      current_tab:current_tab_class
     1293  };
     1294    jQuery.post(
     1295        wppm_admin.ajax_url,
     1296        data,
     1297        function (response) {
     1298            jQuery( '.wppm-setting-section-body' ).html( response );
     1299        }
     1300    );
     1301}
     1302
     1303function wppm_get_ap_modal_popup(current_tab_class){
     1304  jQuery( '.wppm-setting-tab-container button' ).removeClass( 'active' );
     1305    jQuery( '.wppm-setting-tab-container button.' + current_tab_class ).addClass( 'active' );
     1306    jQuery('.wppm-setting-section-body').html(wppm_admin.loading_html);
     1307  var data = { action: 'wppm_get_ap_modal_popup' ,
     1308      current_tab:current_tab_class };
     1309    jQuery.post(
     1310        wppm_admin.ajax_url,
     1311        data,
     1312        function (response) {
     1313            jQuery( '.wppm-setting-section-body' ).html( response );
     1314        }
     1315    );
     1316}
     1317
     1318function wppm_get_ap_task_list(current_tab_class){
     1319  jQuery( '.wppm-setting-tab-container button' ).removeClass( 'active' );
     1320    jQuery( '.wppm-setting-tab-container button.' + current_tab_class ).addClass( 'active' );
     1321    jQuery( '.wppm-setting-section-body').html(wppm_admin.loading_html);
     1322    var data = { action: 'wppm_get_ap_task_list' ,
     1323      current_tab:current_tab_class
     1324  };
     1325    jQuery.post(
     1326        wppm_admin.ajax_url,
     1327        data,
     1328        function (response) {
     1329            jQuery( '.wppm-setting-section-body' ).html( response );
     1330        }
     1331    );
     1332}
     1333
     1334function wppm_get_ap_individual_proj(current_tab_class){
     1335  jQuery( '.wppm-setting-tab-container button' ).removeClass( 'active' );
     1336    jQuery( '.wppm-setting-tab-container button.' + current_tab_class ).addClass( 'active' );
     1337    jQuery( '.wppm-setting-section-body').html(wppm_admin.loading_html);
     1338    var data = { action: 'wppm_get_ap_individual_proj' ,
     1339      current_tab:current_tab_class
     1340  };
     1341    jQuery.post(
     1342        wppm_admin.ajax_url,
     1343        data,
     1344        function (response) {
     1345            jQuery( '.wppm-setting-section-body' ).html( response );
     1346        }
     1347    );
     1348}
     1349
     1350function wppm_get_ap_individual_task(current_tab_class){
     1351  jQuery( '.wppm-setting-tab-container button' ).removeClass( 'active' );
     1352    jQuery( '.wppm-setting-tab-container button.' + current_tab_class ).addClass( 'active' );
     1353    jQuery( '.wppm-setting-section-body').html(wppm_admin.loading_html);
     1354    var data = { action: 'wppm_get_ap_individual_task' ,
     1355      current_tab:current_tab_class
     1356  };
     1357    jQuery.post(
     1358        wppm_admin.ajax_url,
     1359        data,
     1360        function (response) {
     1361            jQuery( '.wppm-setting-section-body' ).html( response );
     1362        }
     1363    );
     1364}
     1365
     1366function wppm_get_ap_grid_view(current_tab_class){
     1367  jQuery( '.wppm-setting-tab-container button' ).removeClass( 'active' );
     1368    jQuery( '.wppm-setting-tab-container button.' + current_tab_class ).addClass( 'active' );
     1369    jQuery( '.wppm-setting-section-body').html(wppm_admin.loading_html);
     1370    var data = { action: 'wppm_get_ap_grid_view' ,
     1371      current_tab:current_tab_class
     1372  };
     1373    jQuery.post(
     1374        wppm_admin.ajax_url,
     1375        data,
     1376        function (response) {
     1377            jQuery( '.wppm-setting-section-body' ).html( response );
     1378        }
     1379    );
     1380}
     1381
     1382function wppm_get_ap_settings(current_tab_class){
     1383  jQuery( '.wppm-setting-tab-container button' ).removeClass( 'active' );
     1384    jQuery( '.wppm-setting-tab-container button.' + current_tab_class ).addClass( 'active' );
     1385    jQuery( '.wppm-setting-section-body').html(wppm_admin.loading_html);
     1386    var data = { action: 'wppm_get_ap_settings' ,
     1387      current_tab:current_tab_class
     1388  };
     1389    jQuery.post(
     1390        wppm_admin.ajax_url,
     1391        data,
     1392        function (response) {
     1393            jQuery( '.wppm-setting-section-body' ).html( response );
     1394        }
     1395    );
     1396}
     1397
     1398function wppm_set_ap_settings(){
     1399  var form     = jQuery( '.wppm-frm-ap-settings' )[0];
     1400    var dataform = new FormData( form );
     1401    jQuery('.wppm_submit_wait').show();
     1402    jQuery.ajax(
     1403        {
     1404            url: wppm_admin.ajax_url,
     1405            type: 'POST',
     1406            data: dataform,
     1407            processData: false,
     1408            contentType: false
     1409        }
     1410    ).done(
     1411        function (response_str) {
     1412      var response = JSON.parse(response_str);
     1413      jQuery('.wppm_submit_wait').hide();
     1414      if (response.sucess_status=='1') {
     1415        jQuery('#wppm_alert_success .wppm_alert_text').text(response.messege);
     1416      }
     1417      jQuery('#wppm_alert_success').slideDown('fast',function(){});
     1418      setTimeout(function(){ jQuery('#wppm_alert_success').slideUp('fast',function(){}); }, 3000); 
     1419        }
     1420    );
     1421}
     1422
     1423function wppm_set_ap_proj_list() {
     1424    var form     = jQuery( '.wppm-frm-ap-pl' )[0];
     1425    var dataform = new FormData( form );
     1426    jQuery('.wppm_submit_wait').show();
     1427    jQuery.ajax(
     1428        {
     1429            url: wppm_admin.ajax_url,
     1430            type: 'POST',
     1431            data: dataform,
     1432            processData: false,
     1433            contentType: false
     1434        }
     1435    ).done(
     1436        function (response_str) {
     1437      var response = JSON.parse(response_str);
     1438      jQuery('.wppm_submit_wait').hide();
     1439      if (response.sucess_status=='1') {
     1440        jQuery('#wppm_alert_success .wppm_alert_text').text(response.messege);
     1441      }
     1442      jQuery('#wppm_alert_success').slideDown('fast',function(){});
     1443      setTimeout(function(){ jQuery('#wppm_alert_success').slideUp('fast',function(){}); }, 3000); 
     1444        }
     1445    );
     1446}
     1447
     1448function wppm_set_ap_task_list(){
     1449  var form     = jQuery( '.wppm-frm-ap-tl' )[0];
     1450    var dataform = new FormData( form );
     1451    jQuery('.wppm_submit_wait').show();
     1452    jQuery.ajax(
     1453        {
     1454            url: wppm_admin.ajax_url,
     1455            type: 'POST',
     1456            data: dataform,
     1457            processData: false,
     1458            contentType: false
     1459        }
     1460    ).done(
     1461        function (response_str) {
     1462      var response = JSON.parse(response_str);
     1463      jQuery('.wppm_submit_wait').hide();
     1464      if (response.sucess_status=='1') {
     1465        jQuery('#wppm_alert_success .wppm_alert_text').text(response.messege);
     1466      }
     1467      jQuery('#wppm_alert_success').slideDown('fast',function(){});
     1468      setTimeout(function(){ jQuery('#wppm_alert_success').slideUp('fast',function(){}); }, 3000); 
     1469        }
     1470    );
     1471}
     1472
     1473function wppm_set_ap_individual_proj(){
     1474  var form     = jQuery( '.wppm-frm-ap-individual_pl' )[0];
     1475    var dataform = new FormData( form );
     1476    jQuery('.wppm_submit_wait').show();
     1477    jQuery.ajax(
     1478        {
     1479            url: wppm_admin.ajax_url,
     1480            type: 'POST',
     1481            data: dataform,
     1482            processData: false,
     1483            contentType: false
     1484        }
     1485    ).done(
     1486        function (response_str) {
     1487      var response = JSON.parse(response_str);
     1488      jQuery('.wppm_submit_wait').hide();
     1489      if (response.sucess_status=='1') {
     1490        jQuery('#wppm_alert_success .wppm_alert_text').text(response.messege);
     1491      }
     1492      jQuery('#wppm_alert_success').slideDown('fast',function(){});
     1493      setTimeout(function(){ jQuery('#wppm_alert_success').slideUp('fast',function(){}); }, 3000); 
     1494        }
     1495    );
     1496}
     1497
     1498function wppm_set_ap_individual_task(){
     1499  var form     = jQuery( '.wppm-frm-ap-individual_tl' )[0];
     1500    var dataform = new FormData( form );
     1501    jQuery('.wppm_submit_wait').show();
     1502    jQuery.ajax(
     1503        {
     1504            url: wppm_admin.ajax_url,
     1505            type: 'POST',
     1506            data: dataform,
     1507            processData: false,
     1508            contentType: false
     1509        }
     1510    ).done(
     1511        function (response_str) {
     1512      var response = JSON.parse(response_str);
     1513      jQuery('.wppm_submit_wait').hide();
     1514      if (response.sucess_status=='1') {
     1515        jQuery('#wppm_alert_success .wppm_alert_text').text(response.messege);
     1516      }
     1517      jQuery('#wppm_alert_success').slideDown('fast',function(){});
     1518      setTimeout(function(){ jQuery('#wppm_alert_success').slideUp('fast',function(){}); }, 3000); 
     1519        }
     1520    );
     1521}
     1522
     1523function wppm_set_ap_modal_popup(){
     1524  var form     = jQuery( '.wppm-frm-ap-modal_popup' )[0];
     1525    var dataform = new FormData( form );
     1526    jQuery('.wppm_submit_wait').show();
     1527    jQuery.ajax(
     1528        {
     1529            url: wppm_admin.ajax_url,
     1530            type: 'POST',
     1531            data: dataform,
     1532            processData: false,
     1533            contentType: false
     1534        }
     1535    ).done(
     1536        function (response_str) {
     1537      var response = JSON.parse(response_str);
     1538      jQuery('.wppm_submit_wait').hide();
     1539      if (response.sucess_status=='1') {
     1540        jQuery('#wppm_alert_success .wppm_alert_text').text(response.messege);
     1541      }
     1542      jQuery('#wppm_alert_success').slideDown('fast',function(){});
     1543      setTimeout(function(){ jQuery('#wppm_alert_success').slideUp('fast',function(){}); }, 3000); 
     1544        }
     1545    );
     1546}
     1547
     1548function wppm_set_ap_grid_view(){
     1549  var form     = jQuery( '.wppm-frm-ap-grid_view' )[0];
     1550    var dataform = new FormData( form );
     1551    jQuery('.wppm_submit_wait').show();
     1552    jQuery.ajax(
     1553        {
     1554            url: wppm_admin.ajax_url,
     1555            type: 'POST',
     1556            data: dataform,
     1557            processData: false,
     1558            contentType: false
     1559        }
     1560    ).done(
     1561        function (response_str) {
     1562      var response = JSON.parse(response_str);
     1563      jQuery('.wppm_submit_wait').hide();
     1564      if (response.sucess_status=='1') {
     1565        jQuery('#wppm_alert_success .wppm_alert_text').text(response.messege);
     1566      }
     1567      jQuery('#wppm_alert_success').slideDown('fast',function(){});
     1568      setTimeout(function(){ jQuery('#wppm_alert_success').slideUp('fast',function(){}); }, 3000); 
     1569        }
     1570    );
    11541571}
    11551572
     
    11971614    action: 'wppm_change_project_visibility',
    11981615    project_id:proj_id,
    1199     project_visibility:project_visibility
     1616    project_visibility:project_visibility,
     1617    _ajax_nonce:jQuery('#wppm_proj_visibility_ajax_nonce').val()
    12001618  };
    12011619  jQuery.post(wppm_admin.ajax_url, data, function() {
     
    12341652    task_search:"",
    12351653    sort_by:"task_name",
    1236     order:"ASC"
     1654    order:"ASC",
     1655    wppm_proj_filter:0
    12371656  };
    12381657  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     
    12601679    task_search:"",
    12611680    sort_by:"task_name",
    1262     order:"ASC"
     1681    order:"ASC",
     1682    wppm_proj_filter:"0"
    12631683  };
    12641684  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     
    12801700  });
    12811701}
     1702
     1703function wppm_tasks_by_select_project(){
     1704  wppm_proj_filter = jQuery('#wppm_task_list_proj_filter').find(":selected").val();
     1705  jQuery('#wppm_task_container').html(wppm_admin.loading_html);
     1706  var data = {
     1707    action: 'wppm_get_task_list',
     1708    wppm_proj_filter:wppm_proj_filter
     1709  };
     1710  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     1711    jQuery('#wppm_task_container').html(response);
     1712  }); 
     1713}
     1714
     1715function wppm_tasks_by_select_project_grid_view(){
     1716  wppm_proj_filter = jQuery('#wppm_task_list_proj_filter').find(":selected").val();
     1717  jQuery('#wppm_task_container').html(wppm_admin.loading_html);
     1718  var data = {
     1719    action: 'wppm_view_project_tasks',
     1720    wppm_proj_filter:wppm_proj_filter
     1721  };
     1722  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     1723    jQuery('#wppm_task_container').html(response);
     1724  }); 
     1725}
     1726
     1727function wppm_reset_ap_proj_list(){
     1728  jQuery( "#wppm_reset_ap_proj_list_btn" ).text( wppm_admin.please_wait );
     1729  var _ajax_nonce = jQuery("#wppm_reset_ap_proj_list_nonce").val();
     1730    var data = { action: 'wppm_reset_ap_proj_list',_ajax_nonce };
     1731    jQuery.post(
     1732        wppm_admin.ajax_url,
     1733        data,
     1734        function () {
     1735            wppm_get_ap_proj_list('project-list');
     1736        }
     1737    );
     1738}
     1739
     1740function wppm_reset_ap_task_list(){
     1741  jQuery( "#wppm_reset_ap_task_list_btn" ).text( wppm_admin.please_wait );
     1742  var _ajax_nonce = jQuery("#wppm_reset_ap_task_list_ajax_nonce").val();
     1743    var data = { action: 'wppm_reset_ap_task_list',_ajax_nonce };
     1744    jQuery.post(
     1745        wppm_admin.ajax_url,
     1746        data,
     1747        function () {
     1748            wppm_get_ap_task_list('task-list');
     1749        }
     1750    );
     1751}
     1752
     1753function wppm_reset_ap_individual_proj(){
     1754  jQuery( "#wppm_reset_ap_individual_proj_btn" ).text( wppm_admin.please_wait );
     1755  var _ajax_nonce =  jQuery( "#wppm_reset_ap_individual_proj_ajax_nonce").val();
     1756    var data = { action: 'wppm_reset_ap_individual_proj',
     1757          _ajax_nonce, };
     1758    jQuery.post(
     1759        wppm_admin.ajax_url,
     1760        data,
     1761        function () {
     1762            wppm_get_ap_individual_proj('individual-project');
     1763        }
     1764    );
     1765}
     1766
     1767function wppm_reset_ap_individual_task(){
     1768  jQuery( "#wppm_reset_ap_individual_task_btn" ).text( wppm_admin.please_wait );
     1769  var _ajax_nonce = jQuery( "#wppm_reset_ap_individual_task_ajax_nonce" ).val();
     1770    var data = { action: 'wppm_reset_ap_individual_task',_ajax_nonce };
     1771    jQuery.post(
     1772        wppm_admin.ajax_url,
     1773        data,
     1774        function () {
     1775            wppm_get_ap_individual_task('individual-task');
     1776        }
     1777    );
     1778}
     1779
     1780function wppm_reset_ap_modal_popup(){
     1781  jQuery( "#wppm_reset_ap_modal_popup_btn" ).text( wppm_admin.please_wait );
     1782  var _ajax_nonce = jQuery( "#wppm_reset_ap_modal_popup_nonce" ).val();
     1783    var data = { action: 'wppm_reset_ap_modal_popup',_ajax_nonce };
     1784    jQuery.post(
     1785        wppm_admin.ajax_url,
     1786        data,
     1787        function () {
     1788            wppm_get_ap_modal_popup('modal-popup');
     1789        }
     1790    );
     1791}
     1792
     1793function wppm_reset_ap_grid_view(){
     1794  jQuery( "#wppm_reset_ap_grid_view_btn" ).text( wppm_admin.please_wait );
     1795  var wppm_reset_grid_ajax_nonce = jQuery( "#wppm_reset_ap_grid_view_ajax_nonce" ).val();
     1796  var data = {
     1797    action: 'wppm_reset_ap_grid_view',
     1798    wppm_reset_grid_ajax_nonce:wppm_reset_grid_ajax_nonce
     1799  };
     1800  jQuery.post(wppm_admin.ajax_url, data, function(response) {
     1801    wppm_get_ap_grid_view('grid-view');
     1802  });
     1803}
     1804
     1805function wppm_reset_ap_settings(){
     1806  jQuery( "#wppm_reset_ap_settings_btn" ).text( wppm_admin.please_wait );
     1807  var _ajax_nonce = jQuery("#wppm_reset_ap_settings_nonce").val();
     1808    var data = { action: 'wppm_reset_ap_settings',_ajax_nonce };
     1809    jQuery.post(
     1810        wppm_admin.ajax_url,
     1811        data,
     1812        function () {
     1813            wppm_get_ap_settings('settings');
     1814        }
     1815    );
     1816}
  • taskbuilder/trunk/includes/admin/email_notifications/wppm_email_notifications.php

    r2611331 r3079882  
    44
    55global $wpdb,$wppmfunction;
     6$settings = get_option("wppm-ap-modal");
     7$wppm_ap_settings = get_option("wppm-ap-settings");
    68?>
    79<div class="wppm_bootstrap">
     
    4345  </div>
    4446</div>
     47<style>
     48  #wppm_popup_title{
     49  background-color: <?php echo esc_attr($settings['header-bg-color'])?>;
     50  }
     51  #wppm_popup_title h3{
     52    color:<?php echo esc_attr( $settings['header-text-color'])?>;
     53  }
     54  #wppm_popup_body{
     55    background-color: <?php echo esc_attr($settings['body-bg-color'])?>!important;
     56  }
     57  #wppm_popup_body label{
     58    color:<?php echo esc_attr( $settings['body-label-color'])?>;
     59  }
     60  #wppm_popup_body input{
     61    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     62  }
     63  #wppm_popup_body select{
     64    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     65  }
     66  #wppm_popup_body span {
     67    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     68  }
     69  #wppm_popup_body .select2-results__options {
     70    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     71  }
     72  #wppm_popup_footer{
     73    background-color: <?php echo esc_attr($settings['footer-bg-color'])?>!important;
     74  }
     75  .wppm_popup_action{
     76    background-color: <?php echo esc_attr($settings['action-btn-bg-color'])?>!important;
     77    color:<?php echo esc_attr( $settings['action-btn-text-color'])?>!important;
     78  }
     79  .wppm_bootstrap .nav-pills > li.active > a,
     80  .wppm_bootstrap .nav-pills > li.active > a:hover,
     81  .wppm_bootstrap .nav-pills > li.active > a:focus {
     82    color: <?php echo esc_attr( $wppm_ap_settings['tab-text-color'])?>!important;
     83    background-color:<?php echo esc_attr($wppm_ap_settings['tab-background-color'])?>!important;
     84  }
     85</style>
    4586<!-- Pop-up snippet end -->
    4687<script>
  • taskbuilder/trunk/includes/admin/email_notifications/wppm_get_edit_email_notification.php

    r2663532 r3079882  
    8181  <img class="wppm_submit_wait" style="display:none;" src="<?php echo WPPM_PLUGIN_URL.'asset/images/[email protected]';?>">
    8282  <input type="hidden" name="action" value="wppm_set_edit_email_notification" />
     83  <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_edit_email_notification' ) ); ?>">
    8384    <input type="hidden" name="id" value="<?php echo htmlentities(esc_attr($id)) ?>" />
    8485</form>
  • taskbuilder/trunk/includes/admin/email_notifications/wppm_get_en_general_setting.php

    r2611331 r3079882  
    3333  <span class="wppm_submit_wait" style="display:none;"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/loading_buffer.svg'); ?>" alt="loading_icon"></span> 
    3434  <input type="hidden" name="action" value="wppm_set_en_general_settings" />
     35  <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_en_general_settings' ) ); ?>">
    3536</form>
  • taskbuilder/trunk/includes/admin/email_notifications/wppm_set_edit_email_notification.php

    r2663532 r3079882  
    66if (!($current_user->ID && $current_user->has_cap('manage_options'))) {
    77    exit;
     8}
     9if ( check_ajax_referer( 'wppm_set_edit_email_notification', '_ajax_nonce', false ) != 1 ) {
     10    wp_send_json_error( 'Unauthorised request!', 401 );
    811}
    912$wppm_email_notificatins = get_option('wppm_email_notification');
  • taskbuilder/trunk/includes/admin/email_notifications/wppm_set_en_general_setting.php

    r2611331 r3079882  
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {
    88    exit;
     9}
     10if ( check_ajax_referer( 'wppm_set_en_general_settings', '_ajax_nonce', false ) != 1 ) {
     11    wp_send_json_error( 'Unauthorised request!', 401 );
    912}
    1013
  • taskbuilder/trunk/includes/admin/licenses.php

    r2611331 r3079882  
    33  exit; // Exit if accessed directly
    44}
    5 
    65$is_addons = apply_filters( 'wppm_is_add_on_installed', false );
    76if($is_addons) {
  • taskbuilder/trunk/includes/admin/projects/get_users.php

    r2611331 r3079882  
    1111    $users = explode(",",$project->users);
    1212}
     13$settings = get_option("wppm-ap-modal");
    1314ob_start();
    1415?>
     
    5859        </div>
    5960        <input type="hidden" name="action" value="wppm_set_project_users" />
     61        <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_project_users' ) ); ?>">
    6062        <input type="hidden" id="wppm_proj_id" name="proj_id" value="<?php echo esc_attr($proj_id) ?>" />
    6163    </div>
    6264</form>
     65<style>
     66    li {
     67        color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
     68    }
     69</style>
    6370<script>
    6471    jQuery(document).ready(function(){
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_change_project_visibility.php

    r2951988 r3079882  
    44}
    55global $current_user,$wpdb,$wppmfunction;
     6if ( check_ajax_referer( 'wppm_change_project_visibility', '_ajax_nonce', false ) != 1 ) {
     7    wp_send_json_error( 'Unauthorised request!', 401 );
     8}
    69$project_id  = isset($_POST['project_id']) ? sanitize_text_field($_POST['project_id']) : '' ;
    710if (!(($current_user->ID && $current_user->has_cap('manage_options')))) {exit;}
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_drag_and_drop_card.php

    r2611331 r3079882  
    44}
    55global $wpdb,$current_user, $wppmfunction;
    6 
     6if ( check_ajax_referer( 'wppm_drag_and_drop_card', '_ajax_nonce', false ) != 1 ) {
     7    wp_send_json_error( 'Unauthorised request!', 401 );
     8}
    79$wppm_card = isset($_POST) && isset($_POST['el']) ? sanitize_text_field($_POST['el']) : '';
    810if (!$wppm_card) {exit;}
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_edit_project_creator.php

    r2611331 r3079882  
    88$project_data = $wppmfunction->get_project($project_id);
    99$project_creator = get_userdata($project_data['created_by']);
     10$settings = get_option("wppm-ap-modal");
    1011ob_start();
    1112?>
     
    1819    </div>
    1920    <input type="hidden" name="action" value="wppm_set_change_project_raised_by" />
     21    <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_change_project_raised_by' ) ); ?>">
    2022    <input type="hidden" name="wppm_user_id" id="wppm_user_id" value="<?php echo esc_attr($project_creator->ID) ?>">
    2123    <input type="hidden" name="project_id" value="<?php echo htmlentities(esc_attr($project_id)) ?>" />
    2224</form>
     25<style>
     26    li {
     27        color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
     28    }
     29</style>
    2330<script type="text/javascript">
    2431    jQuery(document).ready(function(){
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_edit_project_details.php

    r2663532 r3079882  
    1212$categories = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wppm_project_categories");
    1313$wppm_project_time = get_option('wppm_project_time');
     14$settings = get_option("wppm-ap-modal");
    1415ob_start();
    1516?>
     
    8182   
    8283    <input type="hidden" name="action" value="wppm_set_change_project_details" />
     84    <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_change_project_details' ) ); ?>">
    8385    <input type="hidden" name="project_id" value="<?php echo htmlentities(esc_attr($id)) ?>" />
    8486</form>
     
    116118        convert_urls : true,
    117119        paste_as_text: true,
     120        content_style:
     121        `body {
     122              color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
     123          }`,
    118124        setup: function (editor) {
    119125        }
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_edit_project_status.php

    r2611331 r3079882  
    2727    <?php do_action('wppm_after_edit_change_project_status',$project_id);?>
    2828  <input type="hidden" name="action" value="wppm_set_change_project_status" />
     29  <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_change_project_status' ) ); ?>">
    2930  <input type="hidden" id="wppm_project_id" name="project_id" value="<?php echo htmlentities(esc_attr($project_id)); ?>" />
    3031   
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_get_project_tasks.php

    r3042496 r3079882  
    55global $current_user,$wpdb,$wppmfunction;
    66$project_id = isset($_POST['id']) ? intval(sanitize_text_field($_POST['id'])) : 0 ;
     7$appearance_settings = get_option("wppm-ap-task-list");
    78$wppm_task_time = get_option('wppm_task_time');
    89if($current_user->has_cap('manage_options')){
     
    2526                <thead>
    2627                <tr>
    27                     <th class="wppm_table_header"><?php echo esc_html_e('Task id','taskbuilder');?> </th>
    28             <th class="wppm_table_header"><?php echo esc_html_e('Task Name','taskbuilder');?> </th>
    29                         <th class="wppm_table_header"><?php echo esc_html_e('Task Status','taskbuilder');?> </th>
    30             <th class="wppm_table_header"><?php echo esc_html_e('Task Priority','taskbuilder');?> </th>
    31             <th class="wppm_table_header"><?php echo esc_html_e('Assign To','taskbuilder');?> </th>
    32             <th class="wppm_table_header"><?php echo esc_html_e('Start Date','taskbuilder');?> </th>
    33                   <th class="wppm_table_header"><?php echo esc_html_e('End Date','taskbuilder');?> </th>
     28                    <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>;color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Task id','taskbuilder');?> </th>
     29            <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>;color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>" <?php echo esc_attr($appearance_settings['list-header-text-color'])?>><?php echo esc_html_e('Task Name','taskbuilder');?> </th>
     30                        <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>;color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Task Status','taskbuilder');?> </th>
     31            <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>;color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Task Priority','taskbuilder');?> </th>
     32            <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>;color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Assign To','taskbuilder');?> </th>
     33            <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>;color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Start Date','taskbuilder');?> </th>
     34                  <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>;color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('End Date','taskbuilder');?> </th>
    3435          </tr>
    3536        </thead>
     
    109110    </div>
    110111</form>
     112<style>
     113  #tbl_project_tasks tr:nth-child(even){
     114    background-color:<?php echo esc_attr($appearance_settings['list-item-even-background-color'])?>;
     115    color:<?php echo esc_attr($appearance_settings['list-item-even-text-color'])?>;
     116  }
     117  #tbl_project_tasks tr:nth-child(odd){
     118    background-color:<?php echo esc_attr($appearance_settings['list-item-odd-background-color'])?>;
     119    color:<?php echo esc_attr($appearance_settings['list-item-odd-text-color'])?>;
     120  }
     121  #tbl_project_tasks tr:hover{
     122    background-color:<?php echo esc_attr($appearance_settings['list-item-hover-background-color'])?>;
     123  }
     124  #tbl_project_tasks tr:hover td{
     125    color: <?php echo esc_attr($appearance_settings['list-item-hover-text-color'])?>;
     126  }
     127</style>
    111128<script type="text/javascript">
    112129  jQuery(document).ready(function() {
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_get_project_visibility.php

    r2951988 r3079882  
    2121    </div>
    2222</div>
     23<input type="hidden" name="wppm_proj_visibility_ajax_nonce" id="wppm_proj_visibility_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_change_project_visibility' ) ); ?>">
    2324<script>
    2425jQuery(document).ready(function(){
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_set_change_project_details.php

    r2663532 r3079882  
    44}
    55global $wpdb,$wppmfunction,$current_user;
     6if ( check_ajax_referer( 'wppm_set_change_project_details', '_ajax_nonce', false ) != 1 ) {
     7    wp_send_json_error( 'Unauthorised request!', 401 );
     8}
    69$project_id  = isset($_POST['project_id']) ? sanitize_text_field($_POST['project_id']) : '' ;
    710if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_project_permission('change_project_details',$project_id))) {exit;}
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_set_change_project_raised_by.php

    r2611331 r3079882  
    44}
    55global $current_user,$wppmfunction,$wpdb;
     6
     7if ( check_ajax_referer( 'wppm_set_change_project_raised_by', '_ajax_nonce', false ) != 1 ) {
     8    wp_send_json_error( 'Unauthorised request!', 401 );
     9}
    610$project_id = isset($_POST['project_id'])  ? intval(sanitize_text_field($_POST['project_id'])) : '';
    711
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_set_change_project_status.php

    r2611331 r3079882  
    44}
    55global $current_user,$wppmfunction,$wpdb;
    6 
     6if ( check_ajax_referer( 'wppm_set_change_project_status', '_ajax_nonce', false ) != 1 ) {
     7    wp_send_json_error( 'Unauthorised request!', 401 );
     8}
    79$project_id    = isset($_POST['project_id'])  ? sanitize_text_field($_POST['project_id']) : '';
    810if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_project_permission('change_project_status',$project_id))) {exit;}
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_set_project_users.php

    r2611331 r3079882  
    44}
    55global $wpdb,$wppmfunction,$current_user;
     6if ( check_ajax_referer( 'wppm_set_project_users', '_ajax_nonce', false ) != 1 ) {
     7  wp_send_json_error( 'Unauthorised request!', 401 );
     8}
    69$proj_id  = isset($_POST['proj_id']) ? sanitize_text_field($_POST['proj_id']) : '' ;
    710if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_project_permission('assign_project_users',$proj_id))) {exit;}
  • taskbuilder/trunk/includes/admin/projects/open_project/wppm_view_project_tasks.php

    r3042496 r3079882  
    77$total_no_of_rows = 0;
    88$totalrows_tasks = 0;
     9$appearance_settings = get_option("wppm-ap-grid-view");
    910$page_no = isset($_POST['page_no']) ? intval(sanitize_text_field($_POST['page_no'])) : '0';
    1011$task_status = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}wppm_task_statuses ORDER BY load_order ASC" );
     
    1213$search_tag = isset($_POST['task_search']) ? sanitize_text_field($_POST['task_search']) : '';
    1314$filter_by = isset($_POST['wppm_task_filter']) ? sanitize_text_field($_POST['wppm_task_filter']) : "all";
     15$proj_filter = isset($_POST['wppm_proj_filter']) ? sanitize_text_field($_POST['wppm_proj_filter']) : "0";
    1416$filters = array(
    1517    'search' => $search_tag,
    16     'filter'=>$filter_by
     18    'filter'=>$filter_by,
     19    'proj_filter'=>$proj_filter
    1720);
    1821$grid_view_filter = $filters ;
    1922$tl_filters = isset( $_COOKIE['wppm_grid_view_filters'] ) ? sanitize_text_field( wp_unslash( $_COOKIE['wppm_grid_view_filters'] ) ) : $grid_view_filter;
    2023$current_date = date('Y-m-d');
     24if($current_user->has_cap('manage_options')){
     25    $query = ( "SELECT * FROM {$wpdb->prefix}wppm_project ORDER BY project_name" );
     26    $where = "";
     27}else{
     28    $query = ("SELECT Proj.*
     29              FROM {$wpdb->prefix}wppm_project AS Proj
     30              Left join {$wpdb->prefix}wppm_project_meta proj_meta ON Proj.id = proj_meta.project_id");
     31    $where =  " where (FIND_IN_SET($current_user->ID,Proj.users)) OR (Proj.id = proj_meta.project_id AND proj_meta.meta_key='public_project' AND proj_meta.meta_value=1) Group by Proj.id ORDER BY project_name";
     32}
     33$query.= $where;
     34$projects = $wpdb->get_results($query);
    2135$wppm_tl_filter = "1=1";
    2236if(!is_array($tl_filters)){
     
    2842$search_tag = isset($_POST['task_search']) ? sanitize_text_field($_POST['task_search']) : $tl_filters_arr['search'];
    2943$filter_by = isset($_POST['wppm_task_filter']) ? sanitize_text_field($_POST['wppm_task_filter']) : $tl_filters_arr['filter'];
     44$proj_filter = isset($_POST['wppm_proj_filter']) ? sanitize_text_field($_POST['wppm_proj_filter']) : $tl_filters_arr['proj_filter'];
    3045$filters = array(
    3146    'search'=>$search_tag,
    32     'filter'=>$filter_by
     47    'filter'=>$filter_by,
     48    'proj_filter' =>$proj_filter
    3349);
    3450setcookie('wppm_grid_view_filters',wp_json_encode( $filters ),time() + 3600);
     
    4965    $wppm_tl_filter = "(FIND_IN_SET('$current_user->ID',Task.users)>0)";
    5066}
     67if($proj_filter!=0){
     68    $wppm_task_by_proj_filter = "Task.project = '$proj_filter'";
     69}else{
     70    $wppm_task_by_proj_filter ="1=1";
     71}
    5172if(!empty($task_status)){
    5273    foreach($task_status as $status) {
     
    6384                        ");
    6485                $no_of_rows = ( "SELECT count(*) FROM ($query");
    65                 $where = " where $wppm_tl_filter AND (Task.task_name LIKE '$search_tag_text' OR proj.project_name LIKE '$search_tag_text' OR task_statuses.name LIKE '$search_tag_text' OR task_priorities.name LIKE '$search_tag_text' OR user.display_name LIKE '$search_tag_text') AND Task.status= $status->id";
     86                $where = " where $wppm_tl_filter AND $wppm_task_by_proj_filter AND (Task.task_name LIKE '$search_tag_text' OR proj.project_name LIKE '$search_tag_text' OR task_statuses.name LIKE '$search_tag_text' OR task_priorities.name LIKE '$search_tag_text' OR user.display_name LIKE '$search_tag_text') AND Task.status= $status->id";
    6687            } else{
    6788                $query = ("SELECT Task.*
     
    7596                    ");
    7697                $no_of_rows = ( "SELECT count(*) FROM ($query");
    77                 $where = " where $wppm_tl_filter AND (((FIND_IN_SET('$current_user->ID',Task.users)>0) OR (Task.created_by= '$current_user->ID') OR (proj_users.user_id = '$current_user->ID' AND proj_users.role_id = 1 AND (FIND_IN_SET('$current_user->ID',proj.users)>0)) OR (Task.project = proj_meta.project_id AND proj_meta.meta_key='public_project' AND proj_meta.meta_value=1)) AND (Task.task_name LIKE '$search_tag_text' OR proj.project_name LIKE '$search_tag_text' OR task_statuses.name LIKE '$search_tag_text' OR task_priorities.name LIKE '$search_tag_text' OR user.display_name LIKE '$search_tag_text')) AND Task.status= $status->id";
     98                $where = " where $wppm_tl_filter AND $wppm_task_by_proj_filter AND (((FIND_IN_SET('$current_user->ID',Task.users)>0) OR (Task.created_by= '$current_user->ID') OR (proj_users.user_id = '$current_user->ID' AND proj_users.role_id = 1 AND (FIND_IN_SET('$current_user->ID',proj.users)>0)) OR (Task.project = proj_meta.project_id AND proj_meta.meta_key='public_project' AND proj_meta.meta_value=1)) AND (Task.task_name LIKE '$search_tag_text' OR proj.project_name LIKE '$search_tag_text' OR task_statuses.name LIKE '$search_tag_text' OR task_priorities.name LIKE '$search_tag_text' OR user.display_name LIKE '$search_tag_text')) AND Task.status= $status->id";
    7899            }
    79100        }else{
     
    83104                ");
    84105                $no_of_rows = ( "SELECT count(*) FROM ($query");
    85                 $where = " where $wppm_tl_filter AND Task.status= $status->id";
     106                $where = " where $wppm_tl_filter AND $wppm_task_by_proj_filter AND Task.status= $status->id";
    86107            }else{
    87108                $query = ( "SELECT Task.*
     
    92113                    ");
    93114                $no_of_rows = ( "SELECT count(*) FROM ($query");
    94                 $where = " where $wppm_tl_filter AND ((FIND_IN_SET('$current_user->ID',Task.users)>0) OR (Task.created_by= '$current_user->ID') OR (proj_users.user_id = '$current_user->ID' AND proj_users.role_id = 1 AND (FIND_IN_SET('$current_user->ID',proj.users)>0)) OR (Task.project = proj_meta.project_id AND proj_meta.meta_key='public_project' AND proj_meta.meta_value=1)) AND Task.status= $status->id";
     115                $where = " where $wppm_tl_filter AND $wppm_task_by_proj_filter AND ((FIND_IN_SET('$current_user->ID',Task.users)>0) OR (Task.created_by= '$current_user->ID') OR (proj_users.user_id = '$current_user->ID' AND proj_users.role_id = 1 AND (FIND_IN_SET('$current_user->ID',proj.users)>0)) OR (Task.project = proj_meta.project_id AND proj_meta.meta_key='public_project' AND proj_meta.meta_value=1)) AND Task.status= $status->id";
    95116            }
    96117        }
     
    129150        <div class="col-sm-6">
    130151            <span class="wppm-heading-inline"> <?php echo esc_html_e('Tasks','taskbuilder');?> </span>
    131             <span class="wppm-add-new-btn btn-primary" onclick="wppm_add_new_task()"><img class="wppm_add_new_task_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/plus_icon.svg'); ?>" alt="add"><?php echo esc_html_e('Add New','taskbuilder');?></span>
    132             <span class="wppm-add-new-btn btn-primary" id="wppm_task_list" onclick="wppm_get_task_list()" ><span><img class="wppm_task_list_image" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/list-symbol.svg'); ?>" alt="list"></span><span><?php echo esc_html_e('Task List','taskbuilder');?></span></span>
     152            <span class="wppm-add-new-btn btn-primary" onclick="wppm_add_new_task()" style="background-color:<?php echo esc_attr($appearance_settings['menu-button-bg-color'])?>;color:<?php echo esc_attr($appearance_settings['menu-button-text-color'])?>"><img class="wppm_add_new_task_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/plus_icon.svg'); ?>" alt="add"><?php echo esc_html_e('Add New','taskbuilder');?></span>
     153            <span class="wppm-add-new-btn btn-primary" style="background-color:<?php echo esc_attr($appearance_settings['menu-button-bg-color'])?>; id="wppm_task_list" onclick="wppm_get_task_list()" ><span><img class="wppm_task_list_image" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/list-symbol.svg'); ?>" alt="list"></span><span style="color:<?php echo esc_attr($appearance_settings['menu-button-text-color'])?>"><?php echo esc_html_e('Task List','taskbuilder');?></span></span>
    133154        </div>
    134155        <div id="wppm_task_search" class="col-sm-6">
     
    137158        </div>
    138159    </div>
    139     <div class="row">
    140       <div class="col-sm-6" id="wppm_task_filter_container">
    141         <div class="wppm-filter-item">
    142           <label for="wppm_task_filter"> <?php echo esc_html_e('Filter','taskbuilder');?></label>
    143           <select id="wppm_task_filter" name="wppm_task_filter" onchange="wppm_apply_task_filter_grid_view()">
    144             <option value="all"<?php echo ($filter_by == "all")? 'selected':""?>><?php echo esc_html_e('All','taskbuilder');?></option>
    145             <option value="todo" <?php echo ($filter_by == "todo")? 'selected':""?>><?php echo  esc_html_e('Todo','taskbuilder');?></option>
    146             <option value="inprogress" <?php echo ($filter_by == "inprogress")? 'selected':""?>><?php echo  esc_html_e('In Progress','taskbuilder');?></option>
    147             <option value="hold" <?php echo ($filter_by == "hold")? 'selected':""?>><?php echo  esc_html_e('Hold','taskbuilder');?></option>
     160    <div id="wppm_task_filter_container">
     161        <div class="wppm-filter-item">
     162            <label for="wppm_task_filter"> <?php echo esc_html_e('Filter','taskbuilder');?></label>
     163            <select id="wppm_task_filter" name="wppm_task_filter" onchange="wppm_apply_task_filter_grid_view()">
     164            <option value="all"<?php echo ($filter_by == "all")? 'selected':""?>><?php echo esc_html_e('All','taskbuilder');?></option>
     165            <option value="todo" <?php echo ($filter_by == "todo")? 'selected':""?>><?php echo  esc_html_e('Todo','taskbuilder');?></option>
     166            <option value="inprogress" <?php echo ($filter_by == "inprogress")? 'selected':""?>><?php echo  esc_html_e('In Progress','taskbuilder');?></option>
     167            <option value="hold" <?php echo ($filter_by == "hold")? 'selected':""?>><?php echo  esc_html_e('Hold','taskbuilder');?></option>
    148168            <option value="completed" <?php echo ($filter_by == "completed")? 'selected':""?>><?php echo  esc_html_e('Completed','taskbuilder');?></option>
    149169            <option value="mine" <?php echo ($filter_by == "mine")? 'selected':""?>><?php echo  esc_html_e('Mine','taskbuilder');?></option>
    150170            <option value="unassigned" <?php echo ($filter_by == "unassigned")? 'selected':""?>><?php echo  esc_html_e('Unassigned','taskbuilder');?></option>
    151             <option value="overdue" <?php echo ($filter_by == "overdue")? 'selected':""?>><?php echo  esc_html_e('Overdue','taskbuilder');?></option>
    152           </select>
    153         </div>
    154         <div class="wppm_display_submit">
    155           <div class="wppm-filter-actions">
    156               <span class="wppm-link" onclick="wppm_tl_reset_grid_view_filter()"> <?php echo esc_html_e('Reset','taskbuilder');?></span>
    157           </div>
    158         </div>
    159       </div>
    160       <div class="col-sm-6">
    161         <span id="wppm_list_view_btn" onclick="wppm_get_task_list()"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/listv.svg'); ?>" alt="list"><span style="margin-left:5px;"><?php echo esc_html_e('List view','taskbuilder');?></span></span>
    162       </div>
    163     </div>
     171            <option value="overdue" <?php echo ($filter_by == "overdue")? 'selected':""?>><?php echo  esc_html_e('Overdue','taskbuilder');?></option>
     172            </select>
     173        </div>
     174        <div class="wppm-filter-item wppm_project_autocomplete_container">
     175            <label for="wppm_task_list_proj_filter">
     176                <?php echo esc_html_e('Project','taskbuilder');?>
     177            </label><br>
     178            <select searchable="search here" onchange="wppm_tasks_by_select_project_grid_view()" class="form-control" size="40" name="wppm_task_list_proj_filter" id="wppm_task_list_proj_filter">
     179                <option value="0" <?php echo ($proj_filter == 0)? 'selected':""?>><?php echo esc_html_e('All','taskbuilder');?></option>
     180                <?php
     181                    if(!empty($projects)){
     182                        foreach($projects as $proj) {
     183                            ?>
     184                            <option value="<?php echo esc_attr($proj->id)?>" <?php echo ($proj_filter == $proj->id)? 'selected':""?>><?php echo esc_html_e($proj->project_name,'taskbuilder');?></option>
     185                    <?php }
     186                    } ?>
     187            </select>
     188        </div>
     189        <div class="wppm_display_submit">
     190            <div class="wppm-filter-actions">
     191                <span class="wppm-link" onclick="wppm_tl_reset_grid_view_filter()"> <?php echo esc_html_e('Reset','taskbuilder');?></span>
     192            </div>
     193        </div>
     194    </div>
     195    <div class="row">
     196        <div class="col-sm-12">
     197            <span id="wppm_list_view_btn" onclick="wppm_get_task_list()"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/listv.svg'); ?>" alt="list"><span style="margin-left:5px;"><?php echo esc_html_e('List view','taskbuilder');?></span></span>
     198        </div>
     199    </div>
    164200    <div class="wppm_task_container" id="wppm_task_container">
    165201        <?php
     
    205241                                            Left join {$wpdb->prefix}wppm_checklist checklist ON Items.checklist_id = checklist.id
    206242                                            WHERE checklist.task_id = $task->id AND Items.checked=1");
     243                                        $project_data = $wppmfunction->get_project($task->project);
    207244                                        ?>
    208                                         <div class="wppm_card_body" onclick="wppm_open_task(<?php echo esc_attr($task->id)?>)" id="wppm_draggable_card_<?php echo esc_attr($task->id)?>">
     245                                        <div class="wppm_card_body" style="background-color:<?php echo esc_attr($appearance_settings['grid-background-color'])?>!important;color:<?php echo esc_attr($appearance_settings['grid-header-text-color'])?>!important;" onclick="wppm_open_task(<?php echo esc_attr($task->id)?>)" id="wppm_draggable_card_<?php echo esc_attr($task->id)?>">
    209246                                            <div class="row">
    210247                                                <div class="col-sm-6">
     
    223260                                                <div class="col-sm-12">
    224261                                                    <span class="wppm_task_name_grid_view"><?php echo esc_html_e($task->task_name,'taskbuilder');?></span>
     262                                                    <span class="wppm_proj_name_grid_view">(<?php echo esc_html_e($project_data['project_name'],'taskbuilder');?>)</span>
    225263                                                </div>
    226264                                            </div>
     
    234272                                                    $task_users = explode(',',$task->users);
    235273                                                    $i=0;
    236                                                     $project_data = $wppmfunction->get_project($task->project);
    237274                                                    if(!empty($project_data['users'])){
    238275                                                        $proj_users = explode(',',$project_data['users']);
     
    285322        ?>
    286323        <input type="hidden" action="wppm_drag_and_drop_card">
     324        <input type="hidden" name="wppm_drag_and_drop_card_ajax_nonce" id="wppm_drag_and_drop_card_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_drag_and_drop_card' ) ); ?>">
    287325    </div>
    288326    <div class="row wppm_task_pagination_container">
     
    305343    </div>
    306344</form>
     345<style>
     346    .select2-selection--single {
     347        height: 30px!important;
     348    }
     349    .select2-dropdown:hover {
     350        color: #23527c!important;;
     351    }
     352    .select2-results__options{
     353        font:15px "Helvetica Neue",Arial,Helvetica,sans-serif !important;
     354        margin: 0!important;
     355        line-height: inherit!important;
     356    }
     357    .select2-selection__rendered{
     358        font:15px "Helvetica Neue",Arial,Helvetica,sans-serif !important;
     359        margin-top: 5px!important;
     360    }
     361    .select2-selection__rendered:hover{
     362        color: #2271b1 !important;
     363    }
     364    .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable{
     365        background-color: #e85f08!important;
     366        color: white !important;
     367    }
     368    .select2-container {
     369        max-width: 150px !important;
     370        min-width: 150px !important;
     371    }
     372    #wppm_task_filter{
     373        min-height: 30px !important;
     374        max-height: 35px !important;
     375    }
     376    #wppm_view_project_task .wppm-add-new-btn:hover{
     377        background-color: <?php echo esc_attr($appearance_settings['menu-button-hover-color'])?>!important;
     378    }
     379</style>
    307380<script type="text/javascript">
    308381    jQuery( document ).ready( function( jQuery ) {
     
    333406            el:el.id,
    334407            target: target.id,
    335             source:source.id
     408            source:source.id,
     409            _ajax_nonce:jQuery("#wppm_drag_and_drop_card_ajax_nonce").val()
    336410        };
    337411        jQuery.post(wppm_admin.ajax_url, data, function(response) {
     
    339413        });
    340414    }
     415    jQuery('#wppm_task_list_proj_filter').select2({ dropdownAutoWidth: true, width: 'auto' });
     416    jQuery('#wppm_task_list_proj_filter').val(<?php echo esc_attr($proj_filter) ?>);
     417
    341418</script>
  • taskbuilder/trunk/includes/admin/projects/projects.php

    r2611331 r3079882  
    33  exit; // Exit if accessed directly
    44}
     5$settings = get_option("wppm-ap-modal");
    56?>
    67<div class="wppm_bootstrap">
     
    2526<!-- Pop-up snippet end -->
    2627</div>
     28<style>
     29  #wppm_popup_title{
     30  background-color: <?php echo esc_attr($settings['header-bg-color'])?>;
     31  }
     32  #wppm_popup_title h3{
     33    color:<?php echo esc_attr( $settings['header-text-color'])?>;
     34  }
     35  #wppm_popup_body{
     36    background-color: <?php echo esc_attr($settings['body-bg-color'])?>!important;
     37  }
     38  #wppm_popup_body label{
     39    color:<?php echo esc_attr( $settings['body-label-color'])?>;
     40  }
     41  #wppm_popup_body input{
     42    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     43  }
     44  #wppm_popup_body select{
     45    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     46  }
     47  #wppm_popup_body span {
     48    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     49  }
     50  #wppm_popup_body .select2-results__options {
     51    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     52  }
     53  #wppm_popup_footer{
     54    background-color: <?php echo esc_attr($settings['footer-bg-color'])?>!important;
     55  }
     56  .wppm_popup_action{
     57    background-color: <?php echo esc_attr($settings['action-btn-bg-color'])?>!important;
     58    color:<?php echo esc_attr( $settings['action-btn-text-color'])?>!important;
     59  }
     60</style>
    2761<script type="text/javascript">
    2862  jQuery( document ).ready( function( jQuery ) {
  • taskbuilder/trunk/includes/admin/projects/projects_list.php

    r3035644 r3079882  
    66$status = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}wppm_project_statuses" );
    77$categories = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}wppm_project_categories" );
     8$appearance_settings = get_option("wppm-ap-project-list");
    89$proj_per_page = 20;
    910$page_no = (isset($_POST['page_no'])) ? intval(sanitize_text_field($_POST['page_no'])): '0';
     
    161162      <table id="wppm_project_table" class="wppm_table table">
    162163        <tr>
    163           <th class="wppm_table_header">
    164             <span id="wppm_proj_name_th"><?php echo esc_html_e('Project','taskbuilder'); ?></span>
     164          <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     165            <span id="wppm_proj_name_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Project','taskbuilder'); ?></span>
    165166            <img width="16" height="16" onclick="wppm_sort_up_project_list('project_name','ASC')" style = "<?php echo ($sort_by == 'project_name' && $order == 'DESC') ? 'display:inline': 'display:none;'?>" class="wppm_chevron_img" id="wppm_chevron_sort_up_project_name_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    166167            <img width="16" height="16" onclick="wppm_sort_up_project_list('project_name','DESC')" style = "<?php echo ($sort_by == 'project_name' && $order == 'ASC') ? 'display:inline': 'display:none;'?>" class="wppm_chevron_img" id="wppm_chevron_sort_down_project_name_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    167168          </th>
    168           <th class="wppm_table_header">
    169             <span id="wppm_project_status_th"><?php echo esc_html_e('Status','taskbuilder'); ?></span>
     169          <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     170            <span id="wppm_project_status_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Status','taskbuilder'); ?></span>
    170171            <img width="16" height="16" onclick="wppm_sort_up_project_list('status','ASC')" style = "<?php echo ($sort_by == 'proj_statuses.name' && $order == 'DESC') ? 'display:inline': 'display:none;'?>" class="wppm_chevron_img" id="wppm_chevron_sort_up_project_status_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    171172            <img width="16" height="16" onclick="wppm_sort_up_project_list('status','DESC')" style = "<?php echo ($sort_by == 'proj_statuses.name' && $order == 'ASC') ? 'display:inline': 'display:none;'?>" class="wppm_chevron_img" id="wppm_chevron_sort_down_project_status_img" class="wppm_chevron_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    172173          </th>
    173           <th class="wppm_table_header"><?php echo esc_html_e('Users','taskbuilder'); ?></th>
    174           <th class="wppm_table_header">
    175             <span id="wppm_project_category_th"><?php echo esc_html_e('Category','taskbuilder'); ?></span>
     174          <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     175            <span id="wppm_proj_list_users_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Users','taskbuilder'); ?></span></th>
     176          <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     177            <span id="wppm_project_category_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Category','taskbuilder'); ?></span>
    176178            <img width="16" height="16" onclick="wppm_sort_up_project_list('category','ASC')" style = "<?php echo ($sort_by == 'proj_categories.name' && $order == 'DESC') ? 'display:inline': 'display:none;'?>" class="wppm_chevron_img" id="wppm_chevron_sort_up_project_cat_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    177179            <img width="16" height="16" onclick="wppm_sort_up_project_list('category','DESC')" style = "<?php echo ($sort_by == 'proj_categories.name' && $order == 'ASC') ? 'display:inline': 'display:none;'?>" class="wppm_chevron_img" id="wppm_chevron_sort_down_project_cat_img" class="wppm_chevron_img"  src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    178180          </th>
    179181          <?php if($wppm_default_project_date==1){ ?>
    180                   <th class="wppm_table_header">
    181                     <span id="wppm_project_start_date_th"><?php echo esc_html_e('Start Date','taskbuilder'); ?></span>
     182                  <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     183                    <span id="wppm_project_start_date_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Start Date','taskbuilder'); ?></span>
    182184                    <img width="16" height="16" onclick="wppm_sort_up_project_list('start_date','ASC')" style = "<?php echo ($sort_by == 'start_date' && $order == 'DESC') ? 'display:inline': 'display:none;'?>" class="wppm_chevron_img" id="wppm_chevron_sort_up_project_start_date_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    183185                    <img width="16" height="16" onclick="wppm_sort_up_project_list('start_date','DESC')" style = "<?php echo ($sort_by == 'start_date' && $order == 'ASC') ? 'display:inline': 'display:none;'?>" class="wppm_chevron_img" id="wppm_chevron_sort_down_project_start_date_img" class="wppm_chevron_img"  src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    184186                  </th>
    185                   <th class="wppm_table_header">
    186                     <span id="wppm_project_end_date_th"><?php echo esc_html_e('End Date','taskbuilder'); ?></span>
     187                  <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     188                    <span id="wppm_project_end_date_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('End Date','taskbuilder'); ?></span>
    187189                    <img width="16" height="16" onclick="wppm_sort_up_project_list('end_date','ASC')" style = "<?php echo ($sort_by == 'end_date' && $order == 'DESC') ? 'display:inline': 'display:none;'?>" class="wppm_chevron_img" id="wppm_chevron_sort_up_project_end_date_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    188190                    <img width="16" height="16" onclick="wppm_sort_up_project_list('end_date','DESC')" style = "<?php echo ($sort_by == 'end_date' && $order == 'ASC') ? 'display:inline': 'display:none;'?>" class="wppm_chevron_img" id="wppm_chevron_sort_down_project_end_date_img" class="wppm_chevron_img"  src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    189191                  </th>
    190192          <?php } ?>
    191           <th class="wppm_table_header"><?php echo esc_html_e('No. of tasks','taskbuilder'); ?></th>
    192           <th class="wppm_table_header"></th>
     193          <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>"><span style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('No. of tasks','taskbuilder'); ?></span></th>
     194          <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>"></th>
    193195        </tr>
    194196        <tbody>
     
    311313  </div>
    312314</form>
     315<style>
     316  #wppm_project_table tr:nth-child(even) td{
     317    background-color:<?php echo esc_attr($appearance_settings['list-item-even-background-color'])?>!important;
     318    color:<?php echo esc_attr($appearance_settings['list-item-even-text-color'])?>!important;
     319  }
     320  #wppm_project_table tr:nth-child(odd) td{
     321    background-color:<?php echo esc_attr($appearance_settings['list-item-odd-background-color'])?>!important;
     322    color:<?php echo esc_attr($appearance_settings['list-item-odd-text-color'])?>!important;
     323  }
     324  #wppm_project_table tr:hover td{
     325    background-color:<?php echo esc_attr($appearance_settings['list-item-hover-background-color'])?>!important;
     326  }
     327  #wppm_project_table tr:hover td{
     328    color: <?php echo esc_attr($appearance_settings['list-item-hover-text-color'])?>!important;
     329  }
     330</style>
    313331<script type="text/javascript">
    314332  jQuery( document ).ready( function( jQuery ) {
  • taskbuilder/trunk/includes/admin/projects/wppm_add_new_project.php

    r3019975 r3079882  
    110110                <button type="button" class="wppm_reset_btn" id="wppm_submit_proj_reset_btn" onclick="wppm_add_new_project()"><?php echo esc_html_e('Reset Form','taskbuilder') ?></button>
    111111                <input type="hidden" name="action" value="wppm_create_project" />
     112                <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_create_project' ) ); ?>">
    112113            </div>
    113114        </div>
  • taskbuilder/trunk/includes/admin/projects/wppm_create_project.php

    r2951988 r3079882  
    33    exit; // Exit if accessed directly
    44}
    5 global $wpdb, $wppmfunction;
     5global $wpdb, $wppmfunction, $current_user;
     6
     7if (!($current_user->ID && $current_user->has_cap('manage_options'))) {
     8    exit;
     9}
     10
     11if ( check_ajax_referer( 'wppm_create_project', '_ajax_nonce', false ) != 1 ) {
     12    wp_send_json_error( 'Unauthorised request!', 401 );
     13}
    614// project name
    715$name = isset($_POST['name']) ? sanitize_text_field($_POST['name']) : '';
     
    3543
    3644$project_id = WPPM_Functions::create_project($args);
     45$auth_code = $wppmfunction->getRandomString(10);
    3746$wppmfunction->add_project_meta($project_id,'public_project',$public_proj);
     47$wppmfunction->add_project_meta($project_id,'project_auth_code',$auth_code);
     48
    3849
    3950do_action('wppm_after_project_created',$project_id);
  • taskbuilder/trunk/includes/admin/projects/wppm_get_delete_project.php

    r2611331 r3079882  
    1313    </div>
    1414    <input type="hidden" name="action" value="wppm_set_delete_project" />
     15    <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_delete_project' ) ); ?>">
    1516    <input type="hidden" name="project_id" value="<?php echo htmlentities(esc_attr($id))?>" />
    1617</form>
  • taskbuilder/trunk/includes/admin/projects/wppm_open_project.php

    r3035644 r3079882  
    77$wppm_default_project_date = get_option('wppm_default_project_date');
    88$wppm_public_projects_permission = get_option('wppm_public_projects_permission');
     9$appearance_settings = get_option("wppm-ap-individual-project");
     10$settings = get_option("wppm-ap-modal");
    911$current_date = date('Y-m-d');
    1012$id = isset($_POST) && isset($_POST['id']) ? intval(sanitize_text_field($_POST['id'])) : 0;
    11 if (!$id) {exit;}
     13if (!isset($id)) {exit;}
     14$auth_id = $wppmfunction->get_project_meta($id,'project_auth_code',true);
     15$auth_id = sanitize_text_field($auth_id);
    1216$project = $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}wppm_project where id = $id" );
    13 $users = explode(",",$project->users);
     17$project_comment = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}wppm_project_comment where proj_id=".$id." ORDER BY create_time DESC");
     18if(isset($project->users)){
     19  $users = explode(",",$project->users);
     20}else{
     21  $users = "";
     22}
    1423$wppm_users_role = get_option('wppm_user_role');
    1524if(isset($project->status)){
     
    2332}
    2433if($wppm_project_time == 1){
    25  $proj_start_date = $project->start_date;
    26  $proj_end_date = $project->end_date;
     34 $proj_start_date = isset($project->start_date)? $project->start_date:"";
     35 $proj_end_date = isset($project->end_date) ? $project->end_date: "" ;
    2736} elseif($wppm_project_time == 0){
    28   $psDate = new DateTime($project->start_date);
    29   $peDate = new DateTime($project->end_date);
    30   $proj_start_date = $psDate->format('Y-m-d');
    31   $proj_end_date = $peDate->format('Y-m-d');
     37  $psDate = isset($project->start_date) ? new DateTime($project->start_date): "";
     38  $peDate = isset($project->end_date) ? new DateTime($project->end_date):"";
     39  $proj_start_date = !empty($psDate) ? $psDate->format('Y-m-d'):"";
     40  $proj_end_date =  !empty($peDate) ? $peDate->format('Y-m-d'):"";
    3241}
    3342
     
    3847      <span class="wppm-heading-inline"><?php echo esc_html_e('Project','taskbuilder');?></span>
    3948      <?php if($current_user->has_cap('manage_options')){ ?>
    40               <span class="wppm-add-new-btn btn-primary" id="wppm_add_new_project_btn" onclick="wppm_add_new_project()"><span style="margin-right:5px;"><img id="wppm_add_new_project_icon" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/plus_icon.svg'); ?>" alt="plus_icon"></span><span><?php echo esc_html_e('Add New','taskbuilder');?></span></span>
     49              <span class="wppm-add-new-btn btn-primary" style="background-color:<?php echo esc_attr($appearance_settings['menu-button-bg-color'])?>;color:<?php echo esc_attr($appearance_settings['menu-button-text-color'])?>" id="wppm_add_new_project_btn" onclick="wppm_add_new_project()"><span style="margin-right:5px;"><img id="wppm_add_new_project_icon" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/plus_icon.svg'); ?>" alt="plus_icon"></span><span><?php echo esc_html_e('Add New','taskbuilder');?></span></span>
    4150      <?php } ?>
    42       <span class="wppm-add-new-btn btn-primary" id="wppm_project_list" onclick="wppm_get_project_list()" ><span style="margin-right:5px;"><img id ="wppm_project_list_icon" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/list-symbol.svg'); ?>" alt="list-symbol"></span><span><?php echo esc_html_e('Project List','taskbuilder');?></span></span>
    43       <span class="wppm-add-new-btn btn-primary" id="wppm_project_tasks" onclick="wppm_get_project_tasks(<?php echo esc_attr($id) ?>)"><span style="margin-right:5px;"><img id ="wppm_task_list_icon" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/task_list.svg'); ?>" alt="task_list"></span><span><?php echo esc_html_e('Tasks','taskbuilder');?></span></span>
     51      <span class="wppm-add-new-btn btn-primary" id="wppm_project_list" style="background-color:<?php echo esc_attr($appearance_settings['menu-button-bg-color'])?>;color:<?php echo esc_attr($appearance_settings['menu-button-text-color'])?>" onclick="wppm_get_project_list()" ><span style="margin-right:5px;"><img id ="wppm_project_list_icon" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/list-symbol.svg'); ?>" alt="list-symbol"></span><span><?php echo esc_html_e('Project List','taskbuilder');?></span></span>
     52      <span class="wppm-add-new-btn btn-primary" id="wppm_project_tasks" style="background-color:<?php echo esc_attr($appearance_settings['menu-button-bg-color'])?>;color:<?php echo esc_attr($appearance_settings['menu-button-text-color'])?>" onclick="wppm_get_project_tasks(<?php echo esc_attr($id) ?>)"><span style="margin-right:5px;"><img id ="wppm_task_list_icon" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/task_list.svg'); ?>" alt="task_list"></span><span><?php echo esc_html_e('Tasks','taskbuilder');?></span></span>
    4453      <?php $style = (($current_user->ID && $current_user->has_cap('manage_options')) || ($wppmfunction->has_project_permission('delete_project',$project->id)))? "display:inline":"display:none"; ?>
    45       <span class="wppm-add-new-btn btn-primary" id="wppm_delete_project_btn" onclick="wppm_delete_project(<?php echo esc_attr($id) ?>)" style="<?php echo esc_attr($style) ?>"><span style="margin-right:5px;"><img id="wppm_delete_project_icon" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/delete2.svg'); ?>" alt="delete"></span><span><?php echo esc_html_e('Delete','taskbuilder');?></span></span>
     54      <span class="wppm-add-new-btn btn-primary" id="wppm_delete_project_btn" style="background-color:<?php echo esc_attr($appearance_settings['menu-button-bg-color'])?>;color:<?php echo esc_attr($appearance_settings['menu-button-text-color'])?>;<?php echo esc_attr($style) ?>" onclick="wppm_delete_project(<?php echo esc_attr($id) ?>)"><span style="margin-right:5px;"><img id="wppm_delete_project_icon" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/delete2.svg'); ?>" alt="delete"></span><span><?php echo esc_html_e('Delete','taskbuilder');?></span></span>
    4655      <?php $visibility_style = (($current_user->ID && $current_user->has_cap('manage_options')) && ($wppm_public_projects_permission==1))? "display:inline":"display:none"; ?>
    47       <span class="wppm-add-new-btn btn-primary" id="wppm_project_visibility" onclick="wppm_get_project_visibility(<?php echo esc_attr($id) ?>)" style="<?php echo esc_attr($visibility_style) ?>"><span style="margin-right:5px;"><img id ="wppm_task_list_icon" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/wppm_visibility.svg'); ?>" alt="project_visibility"></span><span><?php echo esc_html_e('Project Visibility','taskbuilder');?></span></span>
     56      <span class="wppm-add-new-btn btn-primary" id="wppm_project_visibility" style="background-color:<?php echo esc_attr($appearance_settings['menu-button-bg-color'])?>;color:<?php echo esc_attr($appearance_settings['menu-button-text-color'])?>;<?php echo esc_attr($visibility_style) ?>" onclick="wppm_get_project_visibility(<?php echo esc_attr($id) ?>)"><span style="margin-right:5px;"><img id ="wppm_task_list_icon" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/wppm_visibility.svg'); ?>" alt="project_visibility"></span><span><?php echo esc_html_e('Project Visibility','taskbuilder');?></span></span>
    4857      <?php echo do_action('wppm_after_open_project_buttons',$project->id);?>
    4958    </div>
     
    5564            <div class="row">
    5665              <div class="col-sm-12">
    57                 <span class="wppm_project_label"> <?php echo esc_html($project->project_name);
     66                <span class="wppm_project_label"> <?php echo isset($project->project_name) ? esc_html($project->project_name):"";
    5867                      if (($wppmfunction->has_project_permission('change_project_details',$id)) || ($current_user->has_cap('manage_options'))) { ?>
    5968                        <span id="wppm_individual_edit_project_subject" onclick="wppm_edit_proj_details(<?php echo esc_attr($id) ?>)" class="btn btn-sm wppm_action_btn" style="background-color:#FFFFFF !important;color:#000000 !important;"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span>
     
    6776              </div>
    6877              <div class="col-sm-9">
    69                 <span class="wppm_project_details"><?php echo esc_html($project->date_created) ?></span>
     78                <span class="wppm_project_details"><?php echo isset($project->date_created) ? esc_html($project->date_created):"" ?></span>
    7079              </div>
    7180            </div>
     
    7685                      </div>
    7786                      <div class="col-sm-9">
    78                         <span class="wppm_project_details"><?php echo (isset($proj_start_date))? esc_html($proj_start_date): "" ?></span>
     87                        <span class="wppm_project_details"  id="wppm_edit_pstart_date"><?php echo (isset($proj_start_date))? esc_html($proj_start_date): "" ?></span>
    7988                      </div>
     89                      <input type="hidden" name="wppm_edit_pstart_date_ajax_nonce" id="wppm_edit_pstart_date_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_change_proj_start_date' ) ); ?>">
    8090                    </div>
    8191                    <div class="row">
     
    8494                      </div>
    8595                      <div class="col-sm-9">
    86                       <?php $style = ($project->status!=4 && $proj_end_date < $current_date) ? "color:#FF0000":"color:#2C3E50"; ?>
    87                         <span class="wppm_project_details" style="<?php echo esc_attr($style); ?>"><?php echo (isset($proj_end_date))? esc_html($proj_end_date):"" ?></span>
     96                      <?php
     97                        $pstatus = isset($project->status) ? $project->status :"";
     98                        $style = ($pstatus!=4 && $proj_end_date < $current_date) ? "color:#FF0000":"color:#2C3E50"; ?>
     99                        <span class="wppm_project_details" id="wppm_edit_pend_date" style="<?php echo esc_attr($style); ?>"><?php echo (isset($proj_end_date))? esc_html($proj_end_date):"" ?></span>
    88100                      </div>
     101                      <input type="hidden" name="wppm_edit_pend_date_ajax_nonce" id="wppm_edit_pend_date_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_change_proj_end_date' ) ); ?>">
    89102                    </div>
    90103            <?php } ?>
     
    110123          </div>
    111124        </div>
    112       </div>
     125        <div id="wppm_proj_discussion_container">
     126            <div class="row">
     127              <div class="col-sm-12" style="margin-top:5px;">
     128                <span class="wppm_proj_discussion"><?php echo esc_html_e('Comment','taskbuilder')?></span><br>
     129              </div>
     130            </div>
     131            <div class="row">
     132              <div class="col-sm-12">
     133                <textarea id="wppm_proj_comment" placeholder="<?php echo esc_attr__('Write a comment...','taskbuilder');?>" onclick="wppm_add_proj_comment()" name="wppm_proj_comment"></textarea>
     134              </div>
     135            </div>
     136            <div class="row" id="wppm_proj_comment_btn">
     137              <div class="col-sm-6">
     138                <span id="wppm_proj_attach_file" onclick="wppm_upload_proj_comment_file()"><?php echo esc_html_e('Attach Files','taskbuilder')?></span>
     139              </div>
     140              <div class="col-sm-6">
     141                <button type="button" id="wppm_individual_cancel_proj_comment_btn" onclick="wppm_cancel_proj_comment();" class="wppm-btn-cancel">
     142                  <?php echo esc_html_e('Cancel','taskbuilder')?>
     143                </button>
     144                <button type="button" id="wppm_individual_submit_proj_comment_btn" style="background-color:<?php echo esc_attr($appearance_settings['comment-send-btn-bg-color'])?>;color:<?php echo esc_attr($appearance_settings['comment-send-btn-color'])?>!important;" onclick="wppm_submit_proj_comment(<?php echo esc_attr($id); ?>);" class="wppm-btn">
     145                  <?php echo esc_html_e('SEND','taskbuilder')?>
     146                </button>
     147              </div>
     148              <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_submit_proj_comment' ) ); ?>">
     149            </div>
     150            <div class="row">
     151              <div class="wppm_proj_attachment_container col-sm-12" style="display:none;">
     152              </div>
     153            </div>
     154          </div>
     155          <div class="wppm_thread_container">
     156          <?php
     157            if(!empty($project_comment)){
     158              foreach($project_comment as $comment){
     159                $user = get_userdata( $comment->created_by );
     160                $comment_body = stripslashes((htmlspecialchars_decode($comment->body, ENT_QUOTES)));
     161                $comment_body = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $comment_body);
     162                $date = date("Y-m-d H:i:s" ,strtotime($comment->create_time));
     163                $thread_date = date("d F Y, h:i:s A" ,strtotime($date));
     164                $attachment_ids = isset($comment->attachment_ids)? $comment->attachment_ids : '';
     165                if($attachment_ids!=""){
     166                  $attachments = explode(",",$attachment_ids);
     167                } else {
     168                  $attachments = array();
     169                }
     170                ?>
     171                <div class="wppm_proj_thread">
     172                  <div class="wppm_thread_avatar">
     173                    <?php echo (get_avatar($comment->created_by, 40));?>
     174                  </div>
     175                  <div class="wppm_thread_body">
     176                    <div class="wppm_thread_user_name">
     177                      <strong style="color:<?php echo esc_attr($appearance_settings['comment-primary-color']);?>"><?php echo esc_html($user->display_name) ?></strong> <small class="wppm_comment_date" style="color:<?php echo esc_attr($appearance_settings['comment-date-color']);?>"><i><?php echo esc_html($thread_date) ?></i></small>
     178                      <div class="wppm_thread_action">
     179                        <?php if(( ($current_user->has_cap('manage_options')) || ($wppmfunction->has_proj_comment_permission('edit_proj_comment',$id,$comment->id)))){ ?>
     180                          <span title="Edit this thread" onclick="wppm_edit_proj_thread(<?php echo esc_attr($comment->id)?>,<?php echo esc_attr($id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit1.svg'); ?>" alt="edit"></span>
     181                          <span title="Delete this thread" onclick="wppm_delete_proj_thread(<?php echo esc_attr($comment->id) ?>,<?php echo esc_attr($id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/trash.svg'); ?>" alt="delete"></span>
     182                        <?php } ?>
     183                      </div>
     184                    </div>
     185                    <div class="wppm_thread_messege" style="color:<?php echo esc_attr($appearance_settings['comment-secondary-color']);?>">
     186                      <?php
     187                      $allowedtags = array( 'br' => array(), 'abbr' => array('title' => array(),), 'p' => array(), 'strong' => array(), 'a' => array('href' => array(), 'title' => array(), 'target'=> array(), 'rel'=>array()),'em' =>array(),'span' =>array(), 'blockquote'=>array('cite'  => array(),),'div' => array('class' => array(),'title' => array(),'style' => array(),),'ul'=>array(),'li'=>array(),'ol'=>array(),'img' => array( 'alt'=> array(),'class' => array(),'height' => array(),'src'=> array(),'width'=> array(),));
     188                      if(!empty($comment_body)){
     189                        echo wp_kses(wpautop($comment_body),$allowedtags) ;
     190                      } ?>
     191                    </div>
     192                    <?php
     193                    if(!empty($attachments)):?> <br>
     194                      <strong class="wppm_attachment_title"><?php echo esc_html_e('Attachments','taskbuilder');?>:</strong><br>
     195                      <table class="wppm_attachment_tbl">
     196                        <tbody>
     197                        <?php
     198                        if(!empty($attachments)){
     199                          foreach( $attachments as $attachment ):
     200                            $attach = $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}wppm_attachments where id=".$attachment);
     201                            $download_url = site_url('/').'?wppm_attachment='.$attachment.'&pid='.$id.'&pac='.$auth_id;
     202                            $findStr = ".txt";
     203                            if(!empty( $attach)){
     204                              $attachment_name = preg_replace('/' . $findStr . '/', "", $attach->name, 1);
     205                              $attachment_name = sanitize_file_name($attachment_name);
     206                            }
     207                            if((!empty($attachment_name))){
     208                              ?>
     209                              <tr class="wppm_attachment_tr">
     210                                <td>
     211                                  <a class="wppm_attachment_link" href="<?php echo esc_url($download_url) ?>" target="_blank">
     212                                  <span class="wppm_attachment_file_name" style="padding: 7px;"><?php echo isset($attach->file_name) ? esc_html($attach->file_name):"";?></span></a>
     213                                  <?php if((($comment->created_by == $current_user->ID) || ($current_user->has_cap('manage_options')) || ($wppmfunction->has_proj_comment_permission('edit_proj_comment',$id,$comment->id)))){ ?>
     214                                    <span class="wppm_thread_action_btn" onclick="wppm_proj_thread_attachment_remove(this,<?php echo isset($attach->id)? esc_attr($attach->id):''; ?>,<?php echo isset($comment->id)? esc_attr($comment->id):''; ?>,<?php echo isset($comment->proj_id) ? esc_attr($comment->proj_id):'';?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/cancel.svg'); ?>" alt="cancel"></span>
     215                                  <?php } ?>
     216                                </td>
     217                              </tr>
     218                            <?php }
     219                          endforeach;
     220                        } ?>
     221                        </tbody>
     222                      </table>
     223                      <input type="hidden" name="wppm_proj_thread_attachment_remove_ajax_nonce" id="wppm_proj_thread_attachment_remove" value="<?php echo esc_attr( wp_create_nonce( 'wppm_remove_proj_thread_attachment' ) ); ?>">
     224                    <?php do_action('wppm_after_project_comment_attachment',$id,$comment->id);?>
     225                    <?php endif;?>
     226                  </div>
     227                </div>
     228            <?php }
     229            } ?>
     230          </div>
     231        </div>
    113232      <div class="wppm_individual_project_widget col-sm-4 wppm_sidebar col-md-3">
    114233        <div class="row wppm_widget" id="wppm_project_status_widget">
    115             <h4 class="widget_header"><?php echo esc_html_e('Status','taskbuilder')?>
    116             <?php $style = ($wppmfunction->has_project_permission('change_project_status',$id) || $current_user->has_cap('manage_options'))? "display:inline":"display:none"; ?>
    117             <span class="wppm_edit_project_details_widget" style="<?php echo esc_attr($style) ?>" onclick="wppm_edit_project_status(<?php echo esc_attr($id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span></h4>
     234            <div class="wppm-widget-header" style="background-color:<?php echo esc_attr($appearance_settings['widget-header-bg-color'])?>">
     235              <h4 class="widget_header" style="color:<?php echo esc_attr($appearance_settings['widget-header-text-color'])?>"><?php echo esc_html_e('Status','taskbuilder')?></h4>
     236                <?php $style = ($wppmfunction->has_project_permission('change_project_status',$id) || $current_user->has_cap('manage_options'))? "display:flex":"display:none"; ?>
     237                <span class="wppm_edit_project_details_widget" style="<?php echo $style ?>" onclick="wppm_edit_project_status(<?php echo esc_attr($id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span>
     238            </div>
    118239            <hr class="widget_divider">
    119             <div class="wppm_sidebar_labels"><span class="wppm_label_info"><?php echo esc_html_e('Status','taskbuilder')?>:</span> <span class="wppm_admin_label" style="background-color:<?php echo esc_attr($project_status->bg_color) ?>;color:<?php echo esc_attr($project_status->color)?>;"><?php echo esc_attr($project_status->name) ?> </span></div>
    120         </div>
     240            <div class="wppm-widget-body" style="background-color:<?php echo esc_attr($appearance_settings['widget-body-bg-color'])?>">
     241              <div class="wppm_sidebar_labels"><span class="wppm_label_info" style="color:<?php echo esc_attr($appearance_settings['widget-body-label-color'])?>"><?php echo esc_html_e('Status','taskbuilder')?>: <span class="wppm_admin_label" style="background-color:<?php echo isset($project_status->bg_color) ? esc_attr($project_status->bg_color):""; ?>;color:<?php echo isset($project_status->color) ? esc_attr($project_status->color): "" ?>;"><?php echo isset($project_status->name) ? esc_attr($project_status->name) : "" ?> </span></div>
     242            </div>
     243          </div>
    121244        <div class="row wppm_widget" id="wppm_project_raisedby_widget">
    122           <h4 class="widget_header">
     245          <div class="wppm-widget-header" style="background-color:<?php echo esc_attr($appearance_settings['widget-header-bg-color'])?>">
     246            <h4 class="widget_header" style="color:<?php echo esc_attr($appearance_settings['widget-header-text-color'])?>"><?php echo esc_html_e('Project Creator','taskbuilder')?></span></h4>
    123247            <?php if ($current_user->has_cap('manage_options')) { ?>
    124248                    <span class="wppm_edit_project_details_widget" onclick="wppm_edit_project_creator(<?php echo esc_attr($id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span>
    125249            <?php } ?>
    126             <span><?php echo esc_html_e('Project Creator','taskbuilder')?></span></h4>
    127             <hr class="widget_divider"> <?php
     250          </div>
     251          <hr class="widget_divider"> <?php
     252          if(isset($project->created_by)){
    128253            $user_info = get_userdata($project->created_by);
    129             ?>
     254          }else{
     255            $user_info = "";
     256          }
     257          ?>
     258          <div class="wppm-widget-body" style="background-color:<?php echo esc_attr($appearance_settings['widget-body-bg-color'])?>">
    130259            <div id="wppm_project_creator">
    131260              <div style="padding:2px 0;">
    132                   <span class="wppm_project_user_avatar"><?php echo (get_avatar($project->created_by, 25, "mysteryman")); ?></span>
    133                   <span class="wppm_project_user_names"><?php echo (!empty($user_info)) ? esc_html_e($user_info->display_name,'taskbuilder') : "";?></span>
    134               </div>
    135             </div>
     261                  <span class="wppm_project_user_avatar"><?php echo isset($project->created_by)? (get_avatar($project->created_by, 25, "mysteryman")):""; ?></span>
     262                  <span class="wppm_project_user_names" style="color:<?php echo esc_attr($appearance_settings['widget-body-text-color'])?>"><?php echo (!empty($user_info)) ? esc_html_e($user_info->display_name,'taskbuilder') : "";?></span>
     263              </div>
     264            </div>
     265          </div>
    136266        </div>
    137267        <div class="row wppm_widget" id="wppm_project_users_widget_container">
    138           <h4 class="widget_header">
    139           <?php if ($wppmfunction->has_project_permission('assign_project_users',$id ) || $current_user->has_cap('manage_options')) { ?>
    140                     <span class="wppm_edit_project_details_widget" onclick="wppm_get_users(<?php echo esc_attr($id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span>
    141           <?php } ?>
    142           <span><?php echo esc_html_e('Users','taskbuilder')?></span></h4>
     268          <div class="wppm-widget-header" style="background-color:<?php echo esc_attr($appearance_settings['widget-header-bg-color'])?>">
     269            <h4 class="widget_header" style="color:<?php echo esc_attr($appearance_settings['widget-header-text-color'])?>"><?php echo esc_html_e('Users','taskbuilder')?></h4>
     270            <?php if ($wppmfunction->has_project_permission('assign_project_users',$id ) || $current_user->has_cap('manage_options')) { ?>
     271                      <span class="wppm_edit_project_details_widget" onclick="wppm_get_users(<?php echo esc_attr($id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span>
     272            <?php } ?>
     273          </div>
    143274          <hr class="widget_divider">
    144           <div id="wppm_project_users">
    145             <?php
    146             if(!(empty(array_filter($users)))){
    147               foreach($users as $user) {
    148                 $user_data = get_userdata($user);
    149                 $project_user = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}wppm_project_users WHERE proj_id = $id AND user_id = $user");
    150                 ?>
    151                 <div style="padding:2px 0;">
    152                   <span class="wppm_project_user_avatar"><?php echo (get_avatar($user, 25, "mysteryman")); ?></span>
    153                   <span class="wppm_project_user_names"><?php echo esc_html_e($user_data->display_name,'taskbuilder'); ?></span>
    154                   <?php
    155                   if(!empty($wppm_users_role)){
    156                     foreach($wppm_users_role as $key=>$role){
    157                       if(!empty($role)){
    158                         foreach($role as $k=>$val){
    159                           if( !empty($project_user) && $key == $project_user->role_id){ ?>
    160                             <span class="wppm_project_user_role">(<?php echo esc_html_e($role['label'],'taskbuilder'); ?>)</span><?php
     275          <div class="wppm-widget-body" style="background-color:<?php echo esc_attr($appearance_settings['widget-body-bg-color'])?>">
     276            <div id="wppm_project_users">
     277              <?php
     278              if(!(empty(array_filter($users)))){
     279                foreach($users as $user) {
     280                  $user_data = get_userdata($user);
     281                  $project_user = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}wppm_project_users WHERE proj_id = $id AND user_id = $user");
     282                  ?>
     283                  <div style="padding:2px 0;">
     284                    <span class="wppm_project_user_avatar"><?php echo (get_avatar($user, 25, "mysteryman")); ?></span>
     285                    <span class="wppm_project_user_names" style="color:<?php echo esc_attr($appearance_settings['widget-header-text-color'])?>"><?php echo esc_html_e($user_data->display_name,'taskbuilder'); ?></span>
     286                    <?php
     287                    if(!empty($wppm_users_role)){
     288                      foreach($wppm_users_role as $key=>$role){
     289                        if(!empty($role)){
     290                          foreach($role as $k=>$val){
     291                            if( !empty($project_user) && $key == $project_user->role_id){ ?>
     292                              <span class="wppm_project_user_role" style="color:<?php echo esc_attr($appearance_settings['widget-body-text-color'])?>">(<?php echo esc_html_e($role['label'],'taskbuilder'); ?>)</span><?php
     293                            }
    161294                          }
    162295                        }
    163296                      }
    164297                    }
    165                   }
    166                   ?>
    167                 </div>
    168               <?php
     298                    ?>
     299                  </div>
     300                <?php
     301                }
     302              } else {
     303                ?><span class="wppm_project_users_not_assign_label" style="color:<?php echo esc_attr($appearance_settings['widget-body-text-color'])?>"> <?php echo esc_html_e('None','taskbuilder'); ?></span><?php
    169304              }
    170             } else {
    171               ?><span class="wppm_project_users_not_assign_label"> <?php echo esc_html_e('None','taskbuilder'); ?></span><?php
    172             }
    173             ?>
     305              ?>
     306            </div>
    174307          </div>
    175308        </div>
    176309      </div>
     310      <input type="hidden" id="wppm_proj_nonce" value="<?php echo wp_create_nonce('wppm_upload_proj_attach_file')?>">
     311      <input type="file" id="wppm_proj_attachment_upload" class="hidden" onchange="">
    177312  </div>
    178313</form>
     314<style>
     315  .wppm_comment_date i:hover{
     316    color: <?php echo esc_attr($appearance_settings['comment-date-hover-color'])?>;
     317  }
     318  #wppm_open_project .wppm-add-new-btn:hover{
     319    background-color: <?php echo esc_attr($appearance_settings['menu-button-hover-color'])?>!important;
     320  }
     321</style>
    179322<script>
    180 jQuery( document ).ready( function( jQuery ) {
     323  jQuery( document ).ready( function( jQuery ) { <?php
     324    if ((($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_project_permission('change_project_details',$id))) { ?>
     325      jQuery("#wppm_edit_pstart_date").flatpickr({
     326        enableTime: true,
     327        dateFormat: "Y-m-d H:i",
     328        onChange: function(selectedDates, dateStr, instance) {
     329          var data = {
     330            action: 'wppm_set_change_proj_start_date',
     331            proj_id:<?php echo esc_attr($project->id);?>,
     332            date:dateStr,
     333            _ajax_nonce:jQuery('#wppm_edit_pstart_date_ajax_nonce').val()
     334          };
     335          jQuery.post(wppm_admin.ajax_url, data, function(response) {
     336            instance.close();
     337            wppm_open_project(<?php echo esc_attr($project->id);?>);
     338          });
     339        },
     340      });
     341      jQuery("#wppm_edit_pend_date").flatpickr({
     342        enableTime: true,
     343        dateFormat: "Y-m-d H:i",
     344        onChange: function(selectedDates, dateStr, instance) {
     345          var data = {
     346            action: 'wppm_set_change_proj_end_date',
     347            proj_id:<?php echo esc_attr($project->id);?>,
     348            date:dateStr,
     349            _ajax_nonce:jQuery('#wppm_edit_pend_date_ajax_nonce').val()
     350          };
     351          jQuery.post(wppm_admin.ajax_url, data, function(response) {
     352            instance.close();
     353            wppm_open_project(<?php echo esc_attr($project->id);?>);
     354          });
     355        },
     356      });
     357    <?php } ?>
     358    tinymce.remove();
     359    tinymce.init({
     360      selector:'#wppm_proj_description',
     361      body_id: 'wppm_proj_description',
     362      directionality : '<?php //echo 'rtl'; ?>',
     363      menubar: false,
     364      statusbar: false,
     365      height : '200',
     366      plugins: [
     367          'lists link image directionality'
     368      ],
     369      image_advtab: true,
     370      toolbar: 'bold italic underline blockquote | alignleft aligncenter alignright | bullist numlist | rtl | link image',
     371      branding: false,
     372      autoresize_bottom_margin: 20,
     373      browser_spellcheck : true,
     374      relative_urls : false,
     375      remove_script_host : false,
     376      convert_urls : true,
     377      setup: function (editor) {
     378      }
     379    });
     380  });
     381
     382function wppm_add_proj_comment(){
    181383  tinymce.remove();
    182384  tinymce.init({
    183     selector:'#wppm_proj_description',
    184     body_id: 'wppm_proj_description',
     385    selector:'#wppm_proj_comment',
     386    body_id: 'wppm_proj_comment',
    185387    directionality : '<?php //echo 'rtl'; ?>',
    186388    menubar: false,
    187389    statusbar: false,
    188390    height : '200',
     391    width  : '100%',
    189392    plugins: [
    190         'lists link image directionality'
     393        'lists link image directionality paste'
    191394    ],
    192395    image_advtab: true,
     
    198401    remove_script_host : false,
    199402    convert_urls : true,
     403    paste_as_text: true,
    200404    setup: function (editor) {
    201405    }
    202406  });
    203 });
     407  jQuery('#wppm_proj_comment_btn').show();
     408}
     409
     410function wppm_upload_proj_comment_file(){
     411    jQuery('#wppm_proj_attachment_upload').unbind('change');
     412    jQuery('#wppm_proj_attachment_upload').on('change', function() {
     413      var flag = false;
     414      var file = this.files[0];
     415      jQuery('#wppm_proj_attachment_upload').val('');
     416      var allowedExtension = ['exe', 'php','js'];
     417        var file_name_split = file.name.split('.');
     418        var file_extension = file_name_split[file_name_split.length-1];
     419      file_extension = file_extension.toLowerCase();   
     420      if( (jQuery.inArray(file_extension,allowedExtension)  > -1)){
     421        flag = true;
     422        alert("<?php _e('Attached file type not allowed!','taskbuilder')?>");
     423      };
     424      <?php
     425      $max_upload = (int)(ini_get('upload_max_filesize')); ?>
     426      var current_filesize=file.size/1000000;
     427      if(current_filesize > <?php echo esc_attr($max_upload); ?>){
     428                flag = true;
     429                alert("<?php _e('File size exceed allowed limit!','taskbuilder')?>");
     430            }
     431      if (!flag){
     432        var html_str = '<div class="wppm_attachment">'+
     433                          '<div class="progress" style="float: none !important; width: unset !important;">'+
     434                              '<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">'+
     435                                file.name+
     436                              '</div>'+
     437                              '<span class="wppm_attachment_cancel" onclick="wppm_attachment_cancel(this);" style="display:none;"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/cross_icon.svg'); ?>" alt="delete_icon"></span>'+
     438                          '</div>'+
     439                        '</div>';
     440          jQuery('.wppm_proj_attachment_container').show();
     441          jQuery('.wppm_proj_attachment_container').append(html_str);
     442          var attachment = jQuery('.wppm_proj_attachment_container').find('.wppm_attachment').last();
     443          var data = new FormData();
     444            data.append('file', file);
     445            data.append('arr_name', file.name);
     446            data.append('action', 'wppm_upload_proj_attach_file');
     447            data.append('nonce', jQuery('#wppm_proj_nonce').val().trim());
     448            jQuery.ajax({
     449              type: 'post',
     450              url: wppm_admin.ajax_url,
     451              data: data,
     452              xhr: function(){
     453                var xhr = new window.XMLHttpRequest();
     454                xhr.upload.addEventListener("progress", function(evt){
     455                  if (evt.lengthComputable) {
     456                    var percentComplete = Math.floor((evt.loaded / evt.total) * 100);
     457                    jQuery(attachment).find('.progress-bar').css('width',percentComplete+'%');
     458                  }
     459                }, false);
     460                return xhr;
     461              },
     462              processData: false,
     463              contentType: false,
     464              success: function(response) {
     465                var return_obj=JSON.parse(response);
     466                jQuery(attachment).find('.wppm_attachment_cancel').show();
     467                if( parseInt(return_obj.id) != 0 ){
     468                  jQuery(attachment).append('<input type="hidden" class="wppm_proj_comment_attachment" name="wppm_proj_comment_attachment[]" value="'+return_obj.id+'">');
     469                  jQuery(attachment).find('.progress-bar').addClass('progress-bar-success');
     470                }else {
     471                  jQuery(attachment).find('.progress-bar').addClass('progress-bar-danger');
     472                }
     473              }
     474            });   
     475      }
     476    });
     477    jQuery('#wppm_proj_attachment_upload').trigger('click');
     478}
    204479</script>
  • taskbuilder/trunk/includes/admin/projects/wppm_set_delete_project.php

    r2772108 r3079882  
    77$project_id  = isset($_POST['project_id']) ? sanitize_text_field($_POST['project_id']) : 0 ;
    88if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_project_permission('delete_project',$project_id))) {exit;}
     9
     10if ( check_ajax_referer( 'wppm_set_delete_project', '_ajax_nonce', false ) != 1 ) {
     11    wp_send_json_error( 'Unauthorised request!', 401 );
     12}
     13
    914$tasks = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wppm_task where project = $project_id");
    1015/*************delete project********/
  • taskbuilder/trunk/includes/admin/settings.php

    r2951988 r3079882  
    44}
    55global $wpdb, $wppmfunction;
     6$popup_settings = get_option("wppm-ap-modal");
     7$wppm_ap_settings = get_option("wppm-ap-settings");
    68?>
    79<div class="wppm_bootstrap">
     
    1921        <li id="wppm_settings_task_status" role="presentation"><a href="javascript:wppm_get_task_status_settings();"><?php echo esc_html_e('Task Statuses','taskbuilder');?></a></li>
    2022        <li id="wppm_settings_miscellaneous" role="presentation"><a href="javascript:wppm_get_miscellaneous_settings();"><?php echo esc_html_e('Miscellaneous','taskbuilder');?></a></li>
     23        <li id="wppm_settings_appearance" role="presentation"><a href="javascript:wppm_get_appearance_settings();"><?php echo esc_html_e('Appearance','taskbuilder');?></a></li>
    2124        <?php do_action('wppm_after_setting_pills');?>
    2225      </ul>
     
    4952  </div>
    5053</div>
     54<style>
     55  #wppm_popup_title{
     56  background-color: <?php echo esc_attr($popup_settings['header-bg-color'])?>;
     57  }
     58  #wppm_popup_title h3{
     59    color:<?php echo esc_attr( $popup_settings['header-text-color'])?>;
     60  }
     61  #wppm_popup_body{
     62    background-color: <?php echo esc_attr($popup_settings['body-bg-color'])?>!important;
     63  }
     64  #wppm_popup_body label{
     65    color:<?php echo esc_attr( $popup_settings['body-label-color'])?>;
     66  }
     67  #wppm_popup_body input{
     68    color:<?php echo esc_attr( $popup_settings['body-text-color'])?>;
     69  }
     70  #wppm_popup_body select{
     71    color:<?php echo esc_attr( $popup_settings['body-text-color'])?>;
     72  }
     73  #wppm_popup_body span {
     74    color:<?php echo esc_attr( $popup_settings['body-text-color'])?>;
     75  }
     76  #wppm_popup_body .select2-results__options {
     77    color:<?php echo esc_attr( $popup_settings['body-text-color'])?>;
     78  }
     79  #wppm_popup_footer{
     80    background-color: <?php echo esc_attr($popup_settings['footer-bg-color'])?>!important;
     81  }
     82  .wppm_popup_action{
     83    background-color: <?php echo esc_attr($popup_settings['action-btn-bg-color'])?>!important;
     84    color:<?php echo esc_attr( $popup_settings['action-btn-text-color'])?>!important;
     85  }
     86  .wppm_bootstrap .nav-pills > li.active > a,
     87  .wppm_bootstrap .nav-pills > li.active > a:hover,
     88  .wppm_bootstrap .nav-pills > li.active > a:focus {
     89    color: <?php echo esc_attr( $wppm_ap_settings['tab-text-color'])?>!important;
     90    background-color:<?php echo esc_attr($wppm_ap_settings['tab-background-color'])?>!important;
     91  }
     92</style>
    5193<!-- Pop-up snippet end -->
    5294<script>
  • taskbuilder/trunk/includes/admin/settings/wppm_add_task_priority.php

    r2611331 r3079882  
    2323  <input id="wppm_priority_bg_color" class="wppm_color_picker" name="wppm_priority_bg_color" value="#1E90FF" />
    2424</div>
     25<input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_add_priority' ) ); ?>">
    2526<script>
    2627  jQuery(document).ready(function(){
  • taskbuilder/trunk/includes/admin/settings/wppm_delete_category.php

    r2611331 r3079882  
    66global $current_user,$wpdb;
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
    8 
     8if ( check_ajax_referer( 'wppm_delete_category', '_ajax_nonce', false ) != 1 ) {
     9    wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    911$cat_id = isset($_POST) && isset($_POST['cat_id']) ? intval(sanitize_text_field($_POST['cat_id'])) : 0;
    1012if (!$cat_id) {exit;}
  • taskbuilder/trunk/includes/admin/settings/wppm_delete_status.php

    r2611331 r3079882  
    66global $current_user,$wpdb;
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
    8 
     8if ( check_ajax_referer( 'wppm_delete_status', '_ajax_nonce', false ) != 1 ) {
     9    wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    911$status_id = isset($_POST) && isset($_POST['status_id']) ? intval(sanitize_text_field($_POST['status_id'])) : 0;
    1012if (!$status_id) {exit;}
  • taskbuilder/trunk/includes/admin/settings/wppm_delete_task_priority.php

    r2611331 r3079882  
    66global $current_user,$wpdb;
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     8if ( check_ajax_referer( 'wppm_delete_task_priority', '_ajax_nonce', false ) != 1 ) {
     9    wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    811
    912$priority_id = isset($_POST) && isset($_POST['priority_id']) ? intval(sanitize_text_field($_POST['priority_id'])) : 0;
  • taskbuilder/trunk/includes/admin/settings/wppm_delete_task_status.php

    r2611331 r3079882  
    66global $current_user,$wpdb;
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     8if ( check_ajax_referer( 'wppm_delete_task_status', '_ajax_nonce', false ) != 1 ) {
     9    wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    811
    912$status_id = isset($_POST) && isset($_POST['status_id']) ? intval(sanitize_text_field($_POST['status_id'])) : 0;
  • taskbuilder/trunk/includes/admin/settings/wppm_get_add_category.php

    r2611331 r3079882  
    1313  <input id="wppm_cat_name" class="form-control" name="wppm_cat_name" value="" />
    1414</div>
     15<input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_add_category' ) ); ?>">
    1516<?php
    1617$body = ob_get_clean();
  • taskbuilder/trunk/includes/admin/settings/wppm_get_add_proj_status.php

    r2611331 r3079882  
    2323  <input id="wppm_proj_status_bg_color" class="wppm_color_picker" name="wppm_status_bg_color" value="#1E90FF" />
    2424</div>
     25<input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_add_status' ) ); ?>">
    2526<script>
    2627  jQuery(document).ready(function(){
  • taskbuilder/trunk/includes/admin/settings/wppm_get_add_task_status.php

    r2611331 r3079882  
    2323  <input id="wppm_task_status_bg_color" class="wppm_color_picker" name="wppm_task_status_bg_color" value="#1E90FF" />
    2424</div>
     25<input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_add_task_status' ) ); ?>">
    2526<script>
    2627  jQuery(document).ready(function(){
  • taskbuilder/trunk/includes/admin/settings/wppm_get_advanced_settings.php

    r2951988 r3079882  
    66global $current_user,$wpdb,$wppmfunction;
    77$wppm_public_projects_permission = get_option('wppm_public_projects_permission');
     8$wppm_ap_settings = get_option("wppm-ap-settings");
    89?>
    910<form id="wppm_frm_advanced_settings" method="post" action="javascript:wppm_set_advanced_settings();">
     
    2425    </select>
    2526    <hr>
    26     <button type="submit" class="wppm-submit-btn"><?php echo esc_html_e('Save Changes','taskbuilder');?></button>
     27    <button type="submit" class="wppm-submit-btn" style="background-color:<?php echo esc_attr($wppm_ap_settings['save-changes-button-bg-color'])?>!important;color:<?php echo esc_attr($wppm_ap_settings['save-changes-button-text-color'])?>!important;"><?php echo esc_html_e('Save Changes','taskbuilder');?></button>
    2728    <span class="wppm_submit_wait" style="display:none;"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/loading_buffer.svg'); ?>" alt="edit"></span> 
    2829    <input type="hidden" name="action" value="wppm_set_advanced_settings" />
     30    <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_advanced_settings' ) ); ?>">
    2931</form>
  • taskbuilder/trunk/includes/admin/settings/wppm_get_category_settings.php

    r2951988 r3079882  
    88    exit;
    99}
     10$wppm_ap_settings = get_option("wppm-ap-settings");
    1011$categories = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}wppm_project_categories ORDER BY load_order ASC" );
    1112$cat_arr = array();
     
    2526    <span class="wppm-title">
    2627        <?php echo esc_html_e('Project Categories','taskbuilder');?>
    27         <span style="margin-left:10px;" class="wppm-add-new-btn wppm_btn btn-primary" onclick="wppm_get_add_category()"><?php echo esc_html_e('+Add New','taskbuilder');?></span>
    2828    </span>
     29    <span class="wppm-add-new-btn wppm_btn btn-primary" onclick="wppm_get_add_category()" style="margin-left:10px;background-color:<?php echo esc_attr($wppm_ap_settings['add-new-button-bg-color'])?>;color:<?php echo esc_attr($wppm_ap_settings['add-new-button-text-color'])?>;"><?php echo esc_html_e('+Add New','taskbuilder');?></span>
    2930    <div class="wppm_padding_space"></div>
    3031    <ul class="wppm-sortable">
     
    4344        ?>
    4445    </ul>
     46    <input type="hidden" name="wppm_cat_order_ajax_nonce" id="wppm_cat_order_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_category_order' ) ); ?>">
     47    <input type="hidden" name="wppm_delete_cat_ajax_nonce" id="wppm_delete_cat_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_delete_category' ) ); ?>">
    4548<div>
     49<style>
     50    #wppm_category_container .wppm-add-new-btn:hover{
     51    background-color: <?php echo esc_attr($wppm_ap_settings['add-new-button-hover-color'])?>!important;
     52}
     53</style>
    4654<script>
    4755    jQuery(function(){
     
    5664            var data = {
    5765                action: 'wppm_set_category_order',
    58                 load_orders : result
     66                load_orders : result,
     67                _ajax_nonce:jQuery('#wppm_cat_order_ajax_nonce').val()
    5968            };
    6069            jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     
    93102        var data = {
    94103            action: 'wppm_set_add_category',
    95             cat_name : cat_name
     104            cat_name : cat_name,
     105            _ajax_nonce:jQuery('[name="_ajax_nonce"]').val()
    96106        };
    97107        jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     
    137147            action : 'wppm_set_edit_category',
    138148            cat_id:cat_id,
    139             cat_name:cat_name
     149            cat_name:cat_name,
     150            _ajax_nonce:jQuery('[name="_ajax_nonce"]').val()
    140151        };
    141152        jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
  • taskbuilder/trunk/includes/admin/settings/wppm_get_edit_category.php

    r2611331 r3079882  
    1818  <input id="wppm_edit_cat_name" class="form-control" name="wppm_edit_cat_name" value="<?php echo esc_html_e($category->name,'taskbuilder');?>" />
    1919</div>
     20<input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_edit_category' ) ); ?>">
    2021<?php
    2122$body = ob_get_clean();
  • taskbuilder/trunk/includes/admin/settings/wppm_get_edit_priority.php

    r2611331 r3079882  
    3939<button type="button" class="btn wppm_popup_close" onclick="wppm_modal_close();"><?php echo esc_html_e('Close','taskbuilder');?></button>
    4040<button type="button" class="btn wppm_popup_action" onclick="wppm_set_edit_priority(<?php echo htmlentities(esc_attr($priority_id))?>);"><?php echo esc_html_e('Submit','taskbuilder');?></button>
     41<input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_edit_priority' ) ); ?>">
    4142<?php
    4243$footer = ob_get_clean();
  • taskbuilder/trunk/includes/admin/settings/wppm_get_edit_proj_status.php

    r2611331 r3079882  
    2828  <input id="wppm_edit_status_bg_color" class="wppm_edit_color_picker" name="wppm_edit_status_bg_color" value="<?php echo esc_attr($status->bg_color)?>" />
    2929</div>
     30<input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_edit_status' ) ); ?>">
    3031<script>
    3132  jQuery(document).ready(function(){
  • taskbuilder/trunk/includes/admin/settings/wppm_get_edit_task_status.php

    r2611331 r3079882  
    2828  <input id="wppm_edit_task_status_bg_color" class="wppm_edit_color_picker" name="wppm_edit_task_status_bg_color" value="<?php echo esc_attr($status->bg_color)?>" />
    2929</div>
     30<input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_edit_task_status' ) ); ?>">
    3031<script>
    3132  jQuery(document).ready(function(){
  • taskbuilder/trunk/includes/admin/settings/wppm_get_general_settings.php

    r3035644 r3079882  
    1010$wppm_project_time = get_option('wppm_project_time');
    1111$wppm_task_time = get_option('wppm_task_time');
     12$wppm_ap_settings = get_option("wppm-ap-settings");
    1213$wppm_edit_tasks_permission = get_option('wppm_default_edit_tasks_permission');
    1314?>
     
    8788    </select>
    8889    <hr>
    89     <button type="submit" class="wppm-submit-btn"><?php echo esc_html_e('Save Changes','taskbuilder');?></button>
     90    <button type="submit" class="wppm-submit-btn" style="background-color:<?php echo esc_attr($wppm_ap_settings['save-changes-button-bg-color'])?>!important;color:<?php echo esc_attr($wppm_ap_settings['save-changes-button-text-color'])?>!important;"><?php echo esc_html_e('Save Changes','taskbuilder');?></button>
    9091    <span class="wppm_submit_wait" style="display:none;"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/loading_buffer.svg'); ?>" alt="edit"></span> 
    9192    <input type="hidden" name="action" value="wppm_set_general_settings" />
     93    <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_general_settings' ) ); ?>">
    9294</form>
  • taskbuilder/trunk/includes/admin/settings/wppm_get_priority_settings.php

    r2951988 r3079882  
    1818    $priority_ids = $wppmfunction->sanitize_array($priority_ids);
    1919}
     20$wppm_ap_settings = get_option("wppm-ap-settings");
    2021?>
    2122<div id="wppm_task_priorities_container">
     
    2526    <span class="wppm-title">
    2627        <?php echo esc_html_e('Task Priorities','taskbuilder');?>
    27         <span style="margin-left:10px;" class="wppm-add-new-btn wppm_btn btn-primary" onclick="wppm_add_task_priority();"><?php echo esc_html_e('+Add New','taskbuilder');?></span>
    2828    </span>
     29    <span style="margin-left:10px;background-color:<?php echo esc_attr($wppm_ap_settings['add-new-button-bg-color'])?>;color:<?php echo esc_attr($wppm_ap_settings['add-new-button-text-color'])?>;" class="wppm-add-new-btn wppm_btn btn-primary" onclick="wppm_add_task_priority();"><?php echo esc_html_e('+Add New','taskbuilder');?></span>
    2930    <div class="wppm_padding_space"></div>
    3031    <ul class="wppm-sortable">
     
    4849        ?>
    4950    </ul>
     51    <input type="hidden" name="wppm_prio_order_ajax_nonce" id="wppm_prio_order_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_priority_order' ) ); ?>">
     52    <input type="hidden" name="wppm_delete_tprio_ajax_nonce" id="wppm_delete_tprio_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_delete_task_priority' ) ); ?>">
    5053<div>
     54<style>
     55    #wppm_task_priorities_container .wppm-add-new-btn:hover{
     56        background-color: <?php echo esc_attr($wppm_ap_settings['add-new-button-hover-color'])?>!important;
     57    }
     58</style>
    5159<script>
    5260    jQuery(function(){
     
    6169            var data = {
    6270                action: 'wppm_set_priority_order',
    63                 load_orders : result
     71                load_orders : result,
     72                _ajax_nonce : jQuery('#wppm_prio_order_ajax_nonce').val()
    6473            };
    6574            jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     
    94103            priority_name : priority_name,
    95104            priority_color: priority_color,
    96             priority_bg_color: priority_bg_color
     105            priority_bg_color: priority_bg_color,
     106            _ajax_nonce:jQuery('[name="_ajax_nonce"]').val()
    97107        };
    98108        jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     
    148158            priority_name:priority_name,
    149159            priority_color: priority_color,
    150             priority_bg_color: priority_bg_color
     160            priority_bg_color: priority_bg_color,
     161            _ajax_nonce:jQuery('[name="_ajax_nonce"]').val()
    151162        };
    152163        jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
  • taskbuilder/trunk/includes/admin/settings/wppm_get_proj_status_settings.php

    r2951988 r3079882  
    1313    exit;
    1414}
     15$wppm_ap_settings = get_option("wppm-ap-settings");
    1516$statuses = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}wppm_project_statuses ORDER BY load_order ASC" );
    1617$status_arr = $wpdb->get_results( "SELECT id FROM {$wpdb->prefix}wppm_project_statuses" );
     
    3031    <span class="wppm-title">
    3132        <?php echo esc_html_e('Project Statuses','taskbuilder');?>
    32         <span style="margin-left:10px;" class="wppm-add-new-btn wppm_btn btn-primary" onclick="wppm_get_add_proj_status();"><?php echo esc_html_e('+Add New','taskbuilder');?></span>
    3333    </span>
     34    <span style="margin-left:10px;background-color:<?php echo esc_attr($wppm_ap_settings['add-new-button-bg-color'])?>;color:<?php echo esc_attr($wppm_ap_settings['add-new-button-text-color'])?>;" class="wppm-add-new-btn wppm_btn btn-primary" onclick="wppm_get_add_proj_status();"><?php echo esc_html_e('+Add New','taskbuilder');?></span>
    3435    <div class="wppm_padding_space"></div>
    3536
     
    5354        ?>
    5455    </ul>
     56    <input type="hidden" name="wppm_status_order_ajax_nonce" id="wppm_status_order_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_status_order' ) ); ?>">
     57    <input type="hidden" name="wppm_delete_pstatus_ajax_nonce" id="wppm_delete_pstatus_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_delete_status' ) ); ?>">
     58
    5559<div>
     60<style>
     61    #wppm_proj_statuses_container .wppm-add-new-btn:hover{
     62        background-color: <?php echo esc_attr($wppm_ap_settings['add-new-button-hover-color'])?>!important;
     63    }
     64</style>
    5665<script>
    5766    jQuery(function(){
     
    6675            var data = {
    6776                action: 'wppm_set_status_order',
    68                 load_orders : result
     77                load_orders : result,
     78                _ajax_nonce : jQuery('#wppm_status_order_ajax_nonce').val()
    6979            };
    7080            jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     
    99109            status_name : status_name,
    100110            status_color: status_color,
    101             status_bg_color: status_bg_color
     111            status_bg_color: status_bg_color,
     112            _ajax_nonce:jQuery('[name="_ajax_nonce"]').val()
    102113        };
    103114        jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     
    153164            status_name:status_name,
    154165            status_color: status_color,
    155             status_bg_color: status_bg_color
     166            status_bg_color: status_bg_color,
     167            _ajax_nonce:jQuery('[name="_ajax_nonce"]').val()
    156168        };
    157169        jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
  • taskbuilder/trunk/includes/admin/settings/wppm_get_task_status_settings.php

    r2951988 r3079882  
    2323    $status_ids = $wppmfunction->sanitize_array($status_ids);
    2424}
     25$wppm_ap_settings = get_option("wppm-ap-settings");
    2526?>
    2627<div id="wppm_task_statuses_container">
     
    3031    <span class="wppm-title">
    3132        <?php echo esc_html_e('Task Statuses','taskbuilder');?>
    32         <span style="margin-left:10px;" class="wppm_btn btn-primary wppm-add-new-btn" onclick="wppm_get_add_task_status();"><?php echo esc_html_e('+Add New','taskbuilder');?></span>
    3333    </span>
     34    <span style="margin-left:10px;background-color:<?php echo esc_attr($wppm_ap_settings['add-new-button-bg-color'])?>;color:<?php echo esc_attr($wppm_ap_settings['add-new-button-text-color'])?>;" class="wppm_btn btn-primary wppm-add-new-btn" onclick="wppm_get_add_task_status();"><?php echo esc_html_e('+Add New','taskbuilder');?></span>
    3435    <div class="wppm_padding_space"></div>
    3536    <ul class="wppm-sortable">
     
    5354    ?>
    5455    </ul>
     56    <input type="hidden" name="wppm_tstatus_order_ajax_nonce" id="wppm_tstatus_order_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_task_status_order' ) ); ?>">
     57    <input type="hidden" name="wppm_delete_tstatus_ajax_nonce" id="wppm_delete_tstatus_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_delete_task_status' ) ); ?>">
    5558<div>
     59<style>
     60    #wppm_task_statuses_container .wppm-add-new-btn:hover{
     61        background-color: <?php echo esc_attr($wppm_ap_settings['add-new-button-hover-color'])?>!important;
     62    }
     63</style>
    5664<script>
    5765    jQuery(function(){
     
    6674            var data = {
    6775                action: 'wppm_set_task_status_order',
    68                 load_orders : result
     76                load_orders : result,
     77                _ajax_nonce : jQuery('#wppm_tstatus_order_ajax_nonce').val()
    6978            };
    7079            jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     
    99108            status_name : status_name,
    100109            status_color: status_color,
    101             status_bg_color: status_bg_color
     110            status_bg_color: status_bg_color,
     111            _ajax_nonce:jQuery('[name="_ajax_nonce"]').val()
    102112        };
    103113        jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
     
    153163            status_name:status_name,
    154164            status_color: status_color,
    155             status_bg_color: status_bg_color
     165            status_bg_color: status_bg_color,
     166            _ajax_nonce:jQuery('[name="_ajax_nonce"]').val()
    156167        };
    157168        jQuery.post(wppm_admin.ajax_url, data, function(response_str) {
  • taskbuilder/trunk/includes/admin/settings/wppm_set_add_category.php

    r2611331 r3079882  
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
    88
     9if ( check_ajax_referer( 'wppm_set_add_category', '_ajax_nonce', false ) != 1 ) {
     10    wp_send_json_error( 'Unauthorised request!', 401 );
     11}
    912$cat_name = isset($_POST) && isset($_POST['cat_name']) ? sanitize_text_field($_POST['cat_name']) : '';
    1013if (!$cat_name) {exit;}
  • taskbuilder/trunk/includes/admin/settings/wppm_set_add_priority.php

    r2611331 r3079882  
    66global $current_user, $wpdb;
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     8
     9if ( check_ajax_referer( 'wppm_set_add_priority', '_ajax_nonce', false ) != 1 ) {
     10  wp_send_json_error( 'Unauthorised request!', 401 );
     11}
     12
    813$priority_name = isset($_POST) && isset($_POST['priority_name']) ? sanitize_text_field($_POST['priority_name']) : '';
    914if (!$priority_name) {exit;}
  • taskbuilder/trunk/includes/admin/settings/wppm_set_add_status.php

    r2611331 r3079882  
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
    88
     9if ( check_ajax_referer( 'wppm_set_add_status', '_ajax_nonce', false ) != 1 ) {
     10  wp_send_json_error( 'Unauthorised request!', 401 );
     11}
    912$status_name = isset($_POST) && isset($_POST['status_name']) ? sanitize_text_field($_POST['status_name']) : '';
    1013if (!$status_name) {exit;}
  • taskbuilder/trunk/includes/admin/settings/wppm_set_add_task_status.php

    r2611331 r3079882  
    66global $current_user, $wpdb;
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     8
     9if ( check_ajax_referer( 'wppm_set_add_task_status', '_ajax_nonce', false ) != 1 ) {
     10  wp_send_json_error( 'Unauthorised request!', 401 );
     11}
    812
    913$status_name = isset($_POST) && isset($_POST['status_name']) ? sanitize_text_field($_POST['status_name']) : '';
  • taskbuilder/trunk/includes/admin/settings/wppm_set_advanced_settings.php

    r2951988 r3079882  
    88    exit;
    99}
     10
     11if ( check_ajax_referer( 'wppm_set_advanced_settings', '_ajax_nonce', false ) != 1 ) {
     12    wp_send_json_error( 'Unauthorised request!', 401 );
     13}
     14
    1015$wppm_public_projects_permission = isset($_POST) && isset(($_POST['wppm_public_projects_permission'])) ? sanitize_text_field($_POST['wppm_public_projects_permission']) : '0';
    1116update_option('wppm_public_projects_permission',$wppm_public_projects_permission);
  • taskbuilder/trunk/includes/admin/settings/wppm_set_category_order.php

    r2611331 r3079882  
    55global $current_user, $wpdb,$wppmfunction;
    66if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
    7 
     7if ( check_ajax_referer( 'wppm_set_category_order', '_ajax_nonce', false ) != 1 ) {
     8  wp_send_json_error( 'Unauthorised request!', 401 );
     9}
    810$load_orders = isset($_POST) && isset($_POST['load_orders']) ? ($_POST['load_orders']) : array();
    911if(!empty($load_orders)){
  • taskbuilder/trunk/includes/admin/settings/wppm_set_edit_category.php

    r2611331 r3079882  
    55global $current_user,$wpdb;
    66if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     7
     8if ( check_ajax_referer( 'wppm_set_edit_category', '_ajax_nonce', false ) != 1 ) {
     9    wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    711
    812$cat_id = isset($_POST) && isset($_POST['cat_id']) ? intval(sanitize_text_field($_POST['cat_id'])) : 0;
  • taskbuilder/trunk/includes/admin/settings/wppm_set_edit_priority.php

    r2611331 r3079882  
    77
    88if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     9
     10if ( check_ajax_referer( 'wppm_set_edit_priority', '_ajax_nonce', false ) != 1 ) {
     11  wp_send_json_error( 'Unauthorised request!', 401 );
     12}
    913
    1014$priority_id = isset($_POST) && isset($_POST['priority_id']) ? intval(sanitize_text_field($_POST['priority_id'])) : '';
  • taskbuilder/trunk/includes/admin/settings/wppm_set_edit_status.php

    r2611331 r3079882  
    77
    88if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     9
     10if ( check_ajax_referer( 'wppm_set_edit_status', '_ajax_nonce', false ) != 1 ) {
     11  wp_send_json_error( 'Unauthorised request!', 401 );
     12}
    913$status_id = isset($_POST) && isset($_POST['status_id']) ? intval(sanitize_text_field($_POST['status_id'])) : '';
    1014if (!$status_id) {exit;}
  • taskbuilder/trunk/includes/admin/settings/wppm_set_edit_task_status.php

    r2611331 r3079882  
    66
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     8
     9if ( check_ajax_referer( 'wppm_set_edit_task_status', '_ajax_nonce', false ) != 1 ) {
     10  wp_send_json_error( 'Unauthorised request!', 401 );
     11}
    812
    913$status_id = isset($_POST) && isset($_POST['status_id']) ? intval(sanitize_text_field($_POST['status_id'])) : '';
  • taskbuilder/trunk/includes/admin/settings/wppm_set_general_settings.php

    r3035644 r3079882  
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {
    88    exit;
     9}
     10if ( check_ajax_referer( 'wppm_set_general_settings', '_ajax_nonce', false ) != 1 ) {
     11    wp_send_json_error( 'Unauthorised request!', 401 );
    912}
    1013$wppm_task_list_view = isset($_POST) && isset(($_POST['wppm_task_list_view'])) ? sanitize_text_field($_POST['wppm_task_list_view']) : '';
  • taskbuilder/trunk/includes/admin/settings/wppm_set_priority_order.php

    r2611331 r3079882  
    66global $current_user, $wpdb, $wppmfunction;
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     8if ( check_ajax_referer( 'wppm_set_priority_order', '_ajax_nonce', false ) != 1 ) {
     9  wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    811
    912$load_orders = isset($_POST) && isset($_POST['load_orders']) ? $wppmfunction->sanitize_array($_POST['load_orders']) : array();
  • taskbuilder/trunk/includes/admin/settings/wppm_set_status_order.php

    r2712671 r3079882  
    66global $current_user, $wpdb, $wppmfunction;
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     8if ( check_ajax_referer( 'wppm_set_status_order', '_ajax_nonce', false ) != 1 ) {
     9  wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    811$load_orders = isset($_POST) && isset($_POST['load_orders']) ? $wppmfunction->sanitize_array($_POST['load_orders']) : array();
    912$statuses = $wpdb->get_results( "SELECT id FROM {$wpdb->prefix}wppm_project_statuses");
  • taskbuilder/trunk/includes/admin/settings/wppm_set_task_status_order.php

    r2611331 r3079882  
    66global $current_user, $wpdb,$wppmfunction;
    77if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
     8if ( check_ajax_referer( 'wppm_set_task_status_order', '_ajax_nonce', false ) != 1 ) {
     9  wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    811$load_orders = isset($_POST) && isset($_POST['load_orders']) ? $wppmfunction->sanitize_array($_POST['load_orders']) : array();
    912$priorities = $wpdb->get_results( "SELECT id FROM {$wpdb->prefix}wppm_task_statuses");
  • taskbuilder/trunk/includes/admin/tasks/open_task/checklist/wppm_add_new_checklist.php

    r2611331 r3079882  
    44}
    55global $current_user,$wpdb,$wppmfunction;
     6if ( check_ajax_referer( 'wppm_add_new_checklist', '_ajax_nonce', false ) != 1 ) {
     7    wp_send_json_error( 'Unauthorised request!', 401 );
     8}
    69$task_id = isset($_POST) && isset($_POST['task_id']) ? intval(sanitize_text_field($_POST['task_id'])) : '';
    710if (!$task_id) {exit;}
  • taskbuilder/trunk/includes/admin/tasks/open_task/checklist/wppm_add_new_checklist_item.php

    r2611331 r3079882  
    44}
    55global $current_user,$wpdb,$wppmfunction;
     6if ( check_ajax_referer( 'wppm_add_new_checklist_item', '_ajax_nonce', false ) != 1 ) {
     7    wp_send_json_error( 'Unauthorised request!', 401 );
     8}
    69$checklist_id = isset($_POST) && isset($_POST['checklist_id']) ? intval(sanitize_text_field($_POST['checklist_id'])) : '';
    710if (!$checklist_id) {exit;}
  • taskbuilder/trunk/includes/admin/tasks/open_task/checklist/wppm_delete_checklist.php

    r2611331 r3079882  
    55global $current_user,$wpdb,$wppmfunction;
    66
     7if ( check_ajax_referer( 'wppm_delete_checklist', '_ajax_nonce', false ) != 1 ) {
     8    wp_send_json_error( 'Unauthorised request!', 401 );
     9}
    710$checklist_id = isset($_POST) && isset($_POST['checklist_id']) ? intval(sanitize_text_field($_POST['checklist_id'])) : '';
    811if (!$checklist_id) {exit;}
  • taskbuilder/trunk/includes/admin/tasks/open_task/checklist/wppm_remove_checklist_item.php

    r2611331 r3079882  
    44}
    55global $current_user,$wpdb,$wppmfunction;
    6 
     6if ( check_ajax_referer( 'wppm_remove_checklist_item', '_ajax_nonce', false ) != 1 ) {
     7    wp_send_json_error( 'Unauthorised request!', 401 );
     8}
    79$checklist_id = isset($_POST) && isset($_POST['checklist_id']) ? intval(sanitize_text_field($_POST['checklist_id'])) : '';
    810$item_id = isset($_POST) && isset($_POST['item_id']) ? intval(sanitize_text_field($_POST['item_id'])) : '';
  • taskbuilder/trunk/includes/admin/tasks/open_task/checklist/wppm_set_checklist_progress.php

    r2611331 r3079882  
    44}
    55global $current_user,$wpdb,$wppmfunction;
    6 
     6if ( check_ajax_referer( 'wppm_set_checklist_progress', '_ajax_nonce', false ) != 1 ) {
     7    wp_send_json_error( 'Unauthorised request!', 401 );
     8}
    79$checklist_id = isset($_POST) && isset($_POST['checklist_id']) ? intval(sanitize_text_field($_POST['checklist_id'])) : '';
    810if (!$checklist_id) {exit;}
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_clone_task.php

    r2734438 r3079882  
    1919    <input type="hidden" name="action" value="wppm_set_clone_task" />
    2020    <input type="hidden" name="task_id" value="<?php echo esc_attr($task_id) ?>" />
    21     <input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('set_clone_task')?>">
     21    <input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('wppm_set_clone_task')?>">
    2222</form>
    2323
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_delete_task_thread.php

    r2611331 r3079882  
    1414    <p><?php echo esc_html_e('Are you sure to delete this thread?','taskbuilder');?></p>
    1515    <input type="hidden" name="action" value="wppm_set_delete_thread" />
     16    <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_delete_thread' ) ); ?>">
    1617    <input type="hidden" name="task_id" value="<?php echo htmlentities(esc_attr($task_id))?>" />
    1718    <input type="hidden" name="comment_id" value="<?php echo htmlentities(esc_attr($comment_id))?>" /> 
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_edit_task_creator.php

    r2611331 r3079882  
    99$task_data = $wppmfunction->get_task($task_id);
    1010$task_creator = get_userdata($task_data['created_by']);
     11$settings = get_option("wppm-ap-modal");
    1112ob_start();
    1213?>
     
    1920    </div>
    2021    <input type="hidden" name="action" value="wppm_set_change_raised_by" />
     22    <input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('wppm_set_change_raised_by')?>">
    2123    <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($task_creator->ID) ?>">
    2224    <input type="hidden" name="task_id" value="<?php echo htmlentities(esc_attr($task_id)) ?>" />
    2325</form>
     26<style>
     27li {
     28    color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
     29  }
     30</style>
    2431<script>
    2532    jQuery(document).ready(function(){
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_edit_task_details.php

    r2951988 r3079882  
    99if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_permission('change_task_details',$task_id))) {exit;}
    1010$task_data = $wppmfunction->get_task($task_id);
     11$settings = get_option("wppm-ap-modal");
    1112$project_data = $wppmfunction->get_project(intval(sanitize_text_field($task_data['project'])));
    1213if($current_user->has_cap('manage_options')){
     
    110111    <?php do_action('wppm_edit_task_details',$task_id,$project_id);?>
    111112    <input type="hidden" name="action" value="wppm_set_change_task_details" />
     113    <input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('wppm_set_change_task_details')?>">
    112114    <input type="hidden" name="user_id" id="user_id" value="">
    113115    <input type="hidden" name="task_id" value="<?php echo esc_attr($task_id) ?>" />
    114116</form>
     117<style>
     118.select2-results__options {
     119    color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
     120  }
     121</style>
    115122<script>
    116123jQuery( document ).ready( function( jQuery ) {
     
    146153        convert_urls : true,
    147154        paste_as_text: true,
     155        content_style:
     156        `body {
     157              color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
     158            }`,
    148159        setup: function (editor) {
    149160        }
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_edit_task_status.php

    r2611331 r3079882  
    2929    <?php do_action('wppm_after_edit_change_task_status',$task_id);?>
    3030  <input type="hidden" name="action" value="wppm_set_change_task_status" />
     31  <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_change_task_status' ) ); ?>">
    3132  <input type="hidden" id="wppm_task_id" name="task_id" value="<?php echo htmlentities(esc_attr($task_id)) ?>" />
    3233   
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_edit_task_thread.php

    r2611331 r3079882  
    1010$task_data = $wppmfunction->get_task($task_id);
    1111$task_comment = $wppmfunction->get_task_comment($comment_id);
     12$settings = get_option("wppm-ap-modal");
    1213if (!(($current_user->ID && $current_user->has_cap('manage_options')) || ($wppmfunction->has_permission('change_task_details',$task_id)) || ($current_user->ID == $task_comment['created_by']))) {exit;}
    1314ob_start();
     
    2021    </div>
    2122  <input type="hidden" name="action" value="wppm_set_edit_task_thread" />
     23  <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_edit_task_thread' ) ); ?>">
    2224  <input type="hidden" id="wppm_task_id" name="task_id" value="<?php echo htmlentities(esc_attr($task_id)) ?>" />
    2325  <input type="hidden" id="wppm_comment_id" name="comment_id" value="<?php echo htmlentities(esc_attr($comment_id)) ?>" />
     
    4547        remove_script_host : false,
    4648        convert_urls : true,
     49        content_style:
     50        `body {
     51              color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
     52          }`,
    4753        setup: function (editor) {
    4854        }
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_open_task.php

    r3035644 r3079882  
    99$wppm_default_task_date = get_option('wppm_default_task_date');
    1010$wppm_task_time = get_option('wppm_task_time');
     11$appearance_settings = get_option("wppm-ap-individual-task");
     12$settings = get_option("wppm-ap-modal");
    1113if (!(($current_user->ID && $current_user->has_cap('manage_options')) || ($wppmfunction->has_permission('view_task',$id)))) {exit;}
    1214$proj_id = isset($_POST) && isset($_POST['proj_id']) ? intval(sanitize_text_field($_POST['proj_id'])) : 0;
     
    110112                  </div>
    111113                  <div class="col-sm-9">
    112                     <span class="wppm_task_details"><?php echo (isset($task_start_date))? esc_html($task_start_date):"" ?></span>
     114                    <span class="wppm_task_details" id="wppm_edit_tstart_date"><?php echo (isset($task_start_date))? esc_html($task_start_date):"" ?></span>
    113115                  </div>
     116                  <input type="hidden" name="wppm_edit_tstart_date_ajax_nonce" id="wppm_edit_tstart_date_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_change_task_start_date' ) ); ?>">
    114117                </div>
    115118                <div class="row">
     
    119122                  <div class="col-sm-9">
    120123                    <?php $style = ($task->status!=4 && $task->end_date < $current_date) ? "color:#FF0000":"color:#2C3E50"; ?>
    121                     <span class="wppm_task_details" style="<?php echo esc_attr($style); ?>"><?php echo (isset($task_end_date))? esc_html($task_end_date):"" ?></span>
     124                    <span class="wppm_task_details" id="wppm_edit_tend_date" style="<?php echo esc_attr($style); ?>"><?php echo (isset($task_end_date))? esc_html($task_end_date):"" ?></span>
    122125                  </div>
     126                  <input type="hidden" name="wppm_edit_tend_date_ajax_nonce" id="wppm_edit_tend_date_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_change_task_end_date' ) ); ?>">
    123127                </div>
    124128        <?php } ?>
     
    157161                <div class="col-sm-4" style="text-align:right;<?php echo esc_attr($check_style) ?>">
    158162                  <a class="wppm_delete_checklist" onclick="wppm_delete_checklist(<?php echo esc_attr($list->id);?>,<?php echo esc_attr($task->id);?>,<?php echo esc_attr($proj_id);?>)"><?php echo esc_html_e('Delete Checklist','taskbuilder');?></a>
     163                  <input type="hidden" name="wppm_delete_checklist_ajax_nonce" id="wppm_delete_checklist_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_delete_checklist' ) ); ?>">
    159164                </div>
    160165              </div>
     
    175180                    $checked = $val->checked == 1 ? 'checked="checked"' : '';
    176181                    ?>
    177                     <div id="wppm_checklist_<?php echo esc_attr($val->id) ?>" class="row" style="margin-bottom:10px;font: 15px 'Helvetica Neue',Helvetica,Arial,sans-serif;">
     182                    <div id="wppm_checklist_<?php echo esc_attr($val->id) ?>" class="row wppm_checklist_item" style="margin-bottom:10px;font: 15px 'Helvetica Neue',Helvetica,Arial,sans-serif;">
    178183                      <div class="col-sm-8" id="wppm_checklist_item_container_<?php echo esc_attr($val->id) ?>">
    179184                        <input id="wppm_checklist_item_<?php echo esc_attr($val->id) ?>" class="wppm_checklist_item_<?php echo esc_attr($val->checklist_id) ?>" onchange="wppm_checklist_progress(<?php echo esc_attr($val->checklist_id) ?>,<?php echo esc_attr($val->id) ?>,<?php echo esc_attr($task->id) ?>)" type="checkbox" name="wppm_checklist" <?php echo esc_attr($checked) ?> value="<?php echo esc_attr($val->id) ?>" <?php echo esc_attr($disabled) ?> style="margin:5px;"><label style="padding-top: 5px;font-weight: normal;font: 13px 'Helvetica Neue',Helvetica,Arial,sans-serif;"><?php  echo esc_html_e($val->item_name,'taskbuilder') ?></label>
     185                        <input type="hidden" name="wppm_checklist_progress_ajax_nonce" id="wppm_checklist_progress_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_checklist_progress' ) ); ?>">
    180186                      </div>
    181187                      <?php if ($list->created_by == $current_user->ID || $current_user->has_cap('manage_options') || $user_role == 1) { ?>
    182188                      <div class="col-sm-4" id="wppm_checklist_action_<?php echo esc_attr($val->id) ?>" style="text-align:right; display:none;cursor:pointer;">
    183189                          <span onclick=wppm_delete_checklist_item(<?php echo esc_attr($val->id) ?>,<?php echo esc_attr($val->checklist_id) ?>,<?php echo esc_attr($proj_id);?>,<?php echo esc_attr($id) ?>)><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/trash.svg'); ?>" alt="delete"></span>
     190                          <input type="hidden" name="wppm_delete_checklist_item_ajax_nonce" id="wppm_delete_checklist_item_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_remove_checklist_item' ) ); ?>">
    184191                      </div>
    185192                      <?php } ?>
     
    199206                      <input type="text" id="wppm_checklist_item_label_<?php echo esc_attr($list->id) ?>" class="wppm_checklist_item_label_<?php echo esc_attr($list->id) ?>" placeholder="<?php echo esc_attr__('Add an item','taskbuilder') ?>" name="wppm_checklist_item_label" style="font: 13px 'Helvetica Neue',Helvetica,Arial,sans-serif;">
    200207                      <input type="button" value="Add" class="btn btn-success btn-sm wppm_add_new_item_btn_<?php echo esc_attr($list->id); ?>" onclick="wppm_add_new_checklist_item(<?php echo esc_attr($list->id)?>,<?php echo esc_attr($task->id)?>,<?php echo esc_attr($proj_id) ?>)">
     208                      <input type="hidden" name="wppm_checklist_item_ajax_nonce" id="wppm_checklist_item_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_add_new_checklist_item' ) ); ?>">
    201209                      <span onclick="wppm_remove_add_checklist_container(<?php echo esc_attr($list->id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/cancel.svg'); ?>" alt="delete"></span>
    202210                    </div>
     
    220228              <input type="text" class="wppm_checklist_label" placeholder="<?php echo esc_attr__('Please insert checklist title','taskbuilder');?>" id="wppm_checklist_label" name="wppm_checklist_label">
    221229              <input type="button" value="Add" id="wppm_checklist_btn" class="btn btn-success btn-sm" onclick="wppm_add_new_checklist(<?php echo esc_attr($id)?>,<?php echo esc_attr($proj_id) ?>)">
     230              <input type="hidden" name="wppm_checklist_ajax_nonce" id="wppm_checklist_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_add_new_checklist' ) ); ?>">
    222231              <span onclick="wppm_remove_add_checklist()"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/cross1.svg'); ?>"></span>
    223232            </div>
     
    245254              <?php echo esc_html_e('Cancel','taskbuilder')?>
    246255            </button>
    247             <button type="button" id="wppm_individual_submit_task_comment_btn" onclick="wppm_submit_task_comment(<?php echo esc_attr($id); ?>,<?php echo esc_attr($proj_id); ?>);" class="wppm-btn">
     256            <button type="button" id="wppm_individual_submit_task_comment_btn" style="background-color:<?php echo esc_attr($appearance_settings['comment-send-btn-bg-color'])?>;color:<?php echo esc_attr($appearance_settings['comment-send-btn-color'])?>!important;" onclick="wppm_submit_task_comment(<?php echo esc_attr($id); ?>,<?php echo esc_attr($proj_id); ?>);" class="wppm-btn">
    248257              <?php echo esc_html_e('SEND','taskbuilder')?>
    249258            </button>
     259            <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_submit_task_comment' ) ); ?>">
    250260          </div>
    251261        </div>
     
    277287                  <div class="wppm_thread_body">
    278288                    <div class="wppm_thread_user_name">
    279                       <strong><?php echo esc_html($user->display_name) ?></strong> <small class="wppm_comment_date"><i><?php echo esc_html($thread_date) ?></i></small>
     289                      <strong style="color:<?php echo esc_attr($appearance_settings['comment-primary-color']);?>"><?php echo esc_html($user->display_name) ?></strong> <small class="wppm_comment_date" style="color:<?php echo esc_attr($appearance_settings['comment-date-color']);?>"><i><?php echo esc_html($thread_date) ?></i></small>
    280290                      <div class="wppm_thread_action">
    281291                        <?php if(( ($current_user->has_cap('manage_options')) || ($wppmfunction->has_comment_permission('edit_task_comment',$id,$comment->id)))){ ?>
     
    285295                      </div>
    286296                    </div>
    287                     <div class="wppm_thread_messege">
     297                    <div class="wppm_thread_messege" style="color:<?php echo esc_attr($appearance_settings['comment-secondary-color']);?>">
    288298                      <?php
    289299                      $allowedtags = array( 'br' => array(), 'abbr' => array('title' => array(),), 'p' => array(), 'strong' => array(), 'a' => array('href' => array(), 'title' => array(), 'target'=> array(), 'rel'=>array()),'em' =>array(),'span' =>array(), 'blockquote'=>array('cite'  => array(),),'div' => array('class' => array(),'title' => array(),'style' => array(),),'ul'=>array(),'li'=>array(),'ol'=>array(),'img' => array( 'alt'=> array(),'class' => array(),'height' => array(),'src'=> array(),'width'=> array(),));
     
    318328                                </td>
    319329                              </tr>
     330                              <input type="hidden" name="wppm_ajax_nonce" id="wppm_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_remove_thread_attachment' ) ); ?>">
    320331                            <?php }
    321332                          endforeach;
     
    333344    <div class="wppm_individual_task_widget col-sm-4 wppm_sidebar col-md-3">
    334345      <div class="row wppm_widget" id="wppm_status_widget">
    335         <h4 class="widget_header"><?php echo esc_html_e('Status','taskbuilder')?>
    336         <?php if ($wppmfunction->has_permission('change_status',$id) || $current_user->has_cap('manage_options')) { ?>
    337                 <span class="wppm_edit_task_details_widget" onclick="wppm_edit_task_status(<?php echo esc_attr($id) ?>,<?php echo esc_attr($proj_id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span></h4>
    338         <?php } ?>
     346        <div class="wppm-widget-header" style="background-color:<?php echo esc_attr($appearance_settings['widget-header-bg-color'])?>">
     347          <h4 class="widget_header" style="color:<?php echo esc_attr($appearance_settings['widget-header-text-color'])?>"><?php echo esc_html_e('Status','taskbuilder')?></h4>
     348          <?php if ($wppmfunction->has_permission('change_status',$id) || $current_user->has_cap('manage_options')) { ?>
     349                  <span class="wppm_edit_task_details_widget" onclick="wppm_edit_task_status(<?php echo esc_attr($id) ?>,<?php echo esc_attr($proj_id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span>
     350          <?php } ?>
     351        </div>
    339352        <hr class="widget_divider">
    340         <div class="wppm_sidebar_labels"><span class="wppm_label_info"><?php echo esc_html_e('Status','taskbuilder')?>:</span> <span class="wppm_admin_label" style="background-color:<?php echo (isset($task_status->bg_color))? esc_attr($task_status->bg_color):""?>;color:<?php echo (isset($task_status->color))? esc_attr($task_status->color):""?>;"><?php echo (isset($task_status->name))? esc_attr($task_status->name):"" ?> </span></div>
     353        <div class="wppm-widget-body" style="background-color:<?php echo esc_attr($appearance_settings['widget-body-bg-color'])?>">
     354          <div class="wppm_sidebar_labels"><span class="wppm_label_info" style="color:<?php echo esc_attr($appearance_settings['widget-body-label-color'])?>"><?php echo esc_html_e('Status','taskbuilder')?>:</span> <span class="wppm_admin_label" style="background-color:<?php echo (isset($task_status->bg_color))? esc_attr($task_status->bg_color):""?>;color:<?php echo (isset($task_status->color))? esc_attr($task_status->color):""?>;"><?php echo (isset($task_status->name))? esc_attr($task_status->name):"" ?> </span></div>
     355        </div>
    341356      </div>
    342357      <div class="row wppm_widget" id="wppm_raisedby_widget">
    343         <h4 class="widget_header">
    344         <?php echo esc_html_e('Task Creator','taskbuilder')?>
    345         <?php if ($wppmfunction->has_permission('change_raised_by',$id ) || $current_user->has_cap('manage_options')) { ?>
    346                 <span class="wppm_edit_task_details_widget" onclick="wppm_edit_task_creator(<?php echo esc_attr($id) ?>,<?php echo esc_attr($proj_id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span></h4>
    347         <?php } ?>
     358        <div class="wppm-widget-header" style="background-color:<?php echo esc_attr($appearance_settings['widget-header-bg-color'])?>">
     359          <h4 class="widget_header" style="color:<?php echo esc_attr($appearance_settings['widget-header-text-color'])?>">
     360          <?php echo esc_html_e('Task Creator','taskbuilder')?></h4>
     361          <?php if ($wppmfunction->has_permission('change_raised_by',$id ) || $current_user->has_cap('manage_options')) { ?>
     362                  <span class="wppm_edit_task_details_widget" onclick="wppm_edit_task_creator(<?php echo esc_attr($id) ?>,<?php echo esc_attr($proj_id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span>
     363          <?php } ?>
     364        </div>
    348365        <hr class="widget_divider"> <?php
    349366        $user_info = get_userdata($task->created_by);
    350367        ?>
    351         <div style="padding:2px 0;">
    352             <span class="wppm_task_user_avatar"><?php echo (get_avatar($task->created_by, 25, "mysteryman")); ?></span>
    353             <span class="wppm_task_user_names"><?php echo esc_html($user_info->display_name); ?></span>
     368        <div class="wppm-widget-body" style="background-color:<?php echo esc_attr($appearance_settings['widget-body-bg-color'])?>">
     369          <div style="padding:2px 0;">
     370              <span class="wppm_task_user_avatar"><?php echo (get_avatar($task->created_by, 25, "mysteryman")); ?></span>
     371              <span class="wppm_task_user_names" style="color:<?php echo esc_attr($appearance_settings['widget-body-text-color'])?>;"><?php echo esc_html($user_info->display_name); ?></span>
     372          </div>
    354373        </div>
    355374      </div>
    356375      <div class="row wppm_widget" id="wppm_task_users_widget_container">
    357         <h4 class="widget_header">
    358         <?php if ($wppmfunction->has_permission('assign_task_users',$id ) || $current_user->has_cap('manage_options')) { ?>
    359                   <span class="wppm_edit_task_details_widget" onclick="wppm_edit_task_users(<?php echo esc_attr($id) ?>,<?php echo esc_attr($proj_id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span>
    360         <?php } ?>
    361         <span><?php echo esc_html_e('Users','taskbuilder')?></span></h4>
     376        <div class="wppm-widget-header" style="background-color:<?php echo esc_attr($appearance_settings['widget-header-bg-color'])?>">
     377          <h4 class="widget_header" style="color:<?php echo esc_attr($appearance_settings['widget-header-text-color'])?>;"><?php echo esc_html_e('Users','taskbuilder')?></h4>
     378          <?php if ($wppmfunction->has_permission('assign_task_users',$id ) || $current_user->has_cap('manage_options')) { ?>
     379                    <span class="wppm_edit_task_details_widget" onclick="wppm_edit_task_users(<?php echo esc_attr($id) ?>,<?php echo esc_attr($proj_id) ?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/edit_01.svg'); ?>" alt="edit"></span>
     380            <?php } ?>
     381        </div>
    362382        <hr class="widget_divider">
    363         <div id="wppm_task_users">
    364           <?php
    365           $i=0;
    366           if(!empty($users)){
    367             foreach($users as $user) {
    368               $user_data = get_userdata($user);
    369               if(!empty($project_data['users'])){
    370                 $proj_users = explode(',',$project_data['users']);
    371                 if(in_array($user,$proj_users)){
    372                   $i++;
    373                   ?>
    374                   <div style="padding:2px 0;">
    375                       <span class="wppm_task_user_avatar"><?php echo (get_avatar($user, 25, "mysteryman")); ?></span>
    376                       <span class="wppm_task_user_names"><?php echo ((!empty($user_data))? esc_html($user_data->display_name) :"") ?></span>
    377                   </div>
    378                   <?php
     383        <div class="wppm-widget-body" style="background-color:<?php echo esc_attr($appearance_settings['widget-body-bg-color'])?>">
     384          <div id="wppm_task_users">
     385            <?php
     386            $i=0;
     387            if(!empty($users)){
     388              foreach($users as $user) {
     389                $user_data = get_userdata($user);
     390                if(!empty($project_data['users'])){
     391                  $proj_users = explode(',',$project_data['users']);
     392                  if(in_array($user,$proj_users)){
     393                    $i++;
     394                    ?>
     395                    <div style="padding:2px 0;">
     396                        <span class="wppm_task_user_avatar"><?php echo (get_avatar($user, 25, "mysteryman")); ?></span>
     397                        <span class="wppm_task_user_names" style="color:<?php echo esc_attr($appearance_settings['widget-body-text-color'])?>;"><?php echo ((!empty($user_data))? esc_html($user_data->display_name) :"") ?></span>
     398                    </div>
     399                    <?php
     400                  }
    379401                }
    380402              }
    381403            }
    382           }
    383           if($i==0){ ?>
    384             <span class="wppm_display_user_none"><?php echo esc_html_e('None','taskbuilder'); ?></span> <?php
    385           }
    386           ?>
     404            if($i==0){ ?>
     405              <span class="wppm_display_user_none" style="color:<?php echo esc_attr($appearance_settings['widget-body-text-color'])?>"><?php echo esc_html_e('None','taskbuilder'); ?></span> <?php
     406            }
     407            ?>
     408          </div>
    387409        </div>
    388410      </div>
    389411      <?php do_action('wppm_after_task_widgets',$id,$proj_id);?>
    390412    </div>
    391     <input type="hidden" id="wppm_nonce" value="<?php echo wp_create_nonce()?>">
     413    <input type="hidden" id="wppm_nonce" value="<?php echo wp_create_nonce('wppm_upload_file')?>">
    392414    <input type="file" id="wppm_attachment_upload" class="hidden" onchange="">
    393415  </div>
    394416</form>
     417<style>
     418  .wppm_comment_date i:hover{
     419    color: <?php echo esc_attr($appearance_settings['comment-date-hover-color'])?>;
     420  }
     421  #Layer_1{
     422    fill:red!important;
     423  }
     424</style>
    395425<script>
    396 jQuery( document ).ready( function( jQuery ) {
     426jQuery( document ).ready( function( jQuery ) {<?php
     427  if ((($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_permission('change_task_details',$task->id))){ ?>
     428    jQuery("#wppm_edit_tstart_date").flatpickr({
     429      enableTime: true,
     430      dateFormat: "Y-m-d H:i",
     431      onChange: function(selectedDates, dateStr, instance) {
     432        var data = {
     433          action: 'wppm_set_change_task_start_date',
     434          task_id:<?php echo esc_attr($task->id);?>,
     435          date:dateStr,
     436          _ajax_nonce:jQuery('#wppm_edit_tstart_date_ajax_nonce').val()
     437        };
     438        jQuery.post(wppm_admin.ajax_url, data, function(response) {
     439          instance.close();
     440          wppm_open_task(<?php echo esc_attr($task->id);?>);
     441        });
     442      },
     443    });
     444    jQuery("#wppm_edit_tend_date").flatpickr({
     445      enableTime: true,
     446      dateFormat: "Y-m-d H:i",
     447      onChange: function(selectedDates, dateStr, instance) {
     448        var data = {
     449          action: 'wppm_set_change_task_end_date',
     450          task_id:<?php echo esc_attr($task->id);?>,
     451          date:dateStr,
     452          _ajax_nonce:jQuery('#wppm_edit_tend_date_ajax_nonce').val()
     453        };
     454        jQuery.post(wppm_admin.ajax_url, data, function(response) {
     455          instance.close();
     456          wppm_open_task(<?php echo esc_attr($task->id);?>);
     457        });
     458      },
     459    });
     460  <?php } ?>
    397461  <?php foreach ($wppm_checklist as $chklist) { ?>
    398462          var $checkboxes = jQuery('.wppm_checklist_item_'+<?php echo esc_attr($chklist->id);?>);
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_set_change_raised_by.php

    r2611331 r3079882  
    77
    88if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_permission('change_raised_by',$task_id))) {exit;}
    9 
     9if ( check_ajax_referer( 'wppm_set_change_raised_by', '_ajax_nonce', false ) != 1 ) {
     10    wp_send_json_error( 'Unauthorised request!', 401 );
     11}
    1012$user_id = isset($_POST['user_id']) ? sanitize_text_field($_POST['user_id']) : 0 ;
    1113$task_data = $wppmfunction->get_task($task_id);
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_set_change_task_details.php

    r2951988 r3079882  
    77$proj_id =  isset($_POST['proj_id']) ? intval(sanitize_text_field($_POST['proj_id'])) : '' ;
    88if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_permission('change_task_details',$task_id))) {exit;}
     9if ( check_ajax_referer( 'wppm_set_change_task_details', '_ajax_nonce', false ) != 1 ) {
     10    wp_send_json_error( 'Unauthorised request!', 401 );
     11}
    912$task_data = $wppmfunction->get_task($task_id);
    1013$task_label = isset($_POST['wppm_edit_task_label']) ? sanitize_text_field($_POST['wppm_edit_task_label']) : "" ;
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_set_change_task_status.php

    r2611331 r3079882  
    77$task_id    = isset($_POST['task_id'])  ? sanitize_text_field($_POST['task_id']) : '';
    88if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_permission('change_status',$task_id))) {exit;}
    9 
     9if ( check_ajax_referer( 'wppm_set_change_task_status', '_ajax_nonce', false ) != 1 ) {
     10    wp_send_json_error( 'Unauthorised request!', 401 );
     11}
    1012$status_id   = isset($_POST['wppm_status']) ? intval(sanitize_text_field($_POST['wppm_status'])) : 0 ;
    1113if( !$status_id ){
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_set_clone_task.php

    r2772108 r3079882  
    44}
    55global $wpdb,$current_user,$wppmfunction;
    6 
     6$redirect_flag = false;
     7if ( !isset($ajax_nonce) && (check_ajax_referer( 'wppm_set_clone_task', '_ajax_nonce', false ) != 1) ) {
     8    $redirect_flag = true;
     9}elseif((isset($ajax_nonce) && !wp_verify_nonce($ajax_nonce,'wppm_set_clone_task'))){
     10    $redirect_flag = true;
     11}
     12if($redirect_flag == true){
     13    wp_send_json_error( 'Unauthorised request!', 401 );
     14}
    715$prev_task_id  = isset($_POST['task_id']) ? sanitize_text_field($_POST['task_id']) : $ptask_id ;
    816$task     = $wppmfunction->get_task($prev_task_id);
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_set_delete_thread.php

    r2772108 r3079882  
    99$task_comment = $wppmfunction->get_task_comment($thread_id);
    1010if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_comment_permission('delete_task_thread',$task_id,$thread_id))) {exit;}
     11if ( check_ajax_referer( 'wppm_set_delete_thread', '_ajax_nonce', false ) != 1 ) {
     12    wp_send_json_error( 'Unauthorised request!', 401 );
     13}
    1114$sql="SELECT attachment_ids FROM {$wpdb->prefix}wppm_task_comment WHERE id =".$thread_id;
    1215$thread_attachment_ids = $wpdb->get_results( $sql );
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_set_edit_task_thread.php

    r2663532 r3079882  
    88$task_comment = $wppmfunction->get_task_comment($comment_id);
    99if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_permission('change_task_details',$task_id) || $current_user->ID == $task_comment['created_by'])) {exit;}
     10if ( check_ajax_referer( 'wppm_set_edit_task_thread', '_ajax_nonce', false ) != 1 ) {
     11    wp_send_json_error( 'Unauthorised request!', 401 );
     12}
    1013$task_comment_data = $wppmfunction->get_task_comment($comment_id);
    1114$old_comment_body = $task_comment_data['body'];
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_set_task_users.php

    r2756281 r3079882  
    66$task_id  = isset($_POST['task_id']) ? intval(sanitize_text_field($_POST['task_id'])) : '' ;
    77if (!(($current_user->ID && $current_user->has_cap('manage_options')) || $wppmfunction->has_permission('assign_task_users',$task_id))) {exit;}
     8if ( check_ajax_referer( 'wppm_set_task_users', '_ajax_nonce', false ) != 1 ) {
     9    wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    811$task_data = $wppmfunction->get_task($task_id);
    912$users = "";
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_submit_task_comment.php

    r2663532 r3079882  
    44}
    55global $wpdb,$wppmfunction,$current_user;
     6if ( check_ajax_referer( 'wppm_submit_task_comment', '_ajax_nonce', false ) != 1 ) {
     7    wp_send_json_error( 'Unauthorised request!', 401 );
     8}
    69$task_id  = isset($_POST['task_id']) ? sanitize_text_field($_POST['task_id']) : '' ;
    710$comment  = isset($_POST['comment_body']) ? ($_POST['comment_body']) : '' ;
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_thread_attachment_remove.php

    r2772108 r3079882  
    55
    66global $current_user, $wppmfunction, $wpdb;
     7if ( check_ajax_referer( 'wppm_remove_thread_attachment', '_ajax_nonce', false ) != 1 ) {
     8    wp_send_json_error( 'Unauthorised request!', 401 );
     9}
    710$attachment     = isset($_POST['attachment']) ? intval(sanitize_text_field($_POST['attachment'])) : '0' ;
    811$comment_id = isset($_POST['comment_id']) ? intval(sanitize_text_field($_POST['comment_id'])) : '0' ;
  • taskbuilder/trunk/includes/admin/tasks/open_task/wppm_upload_file.php

    r2782740 r3079882  
    22// Exit if accessed directly
    33if ( ! defined( 'ABSPATH' ) ) exit;
    4 
     4if ( isset($_POST['wppm_upload_proj_attach_file']) && check_ajax_referer( 'wppm_upload_proj_attach_file', 'nonce', false ) != 1 ) {
     5    wp_send_json_error( 'Unauthorised request!', 401 );
     6}
     7elseif ( isset($_POST['wppm_upload_file']) && check_ajax_referer( 'wppm_upload_file', 'nonce', false ) != 1 ) {
     8    wp_send_json_error( 'Unauthorised request!', 401 );
     9}
    510global $wpdb;
    611$isError       = false;
  • taskbuilder/trunk/includes/admin/tasks/wppm_add_new_task.php

    r3042496 r3079882  
    142142                <?php } ?>
    143143                <input type="hidden" name="action" value="wppm_create_task" />
     144                <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_create_task' ) ); ?>">
    144145            </div>
    145146        </div>
  • taskbuilder/trunk/includes/admin/tasks/wppm_create_task.php

    r2663532 r3079882  
    55}
    66global $current_user,$wpdb,$wppmfunction;
     7
     8if ( check_ajax_referer( 'wppm_create_task', '_ajax_nonce', false ) != 1 ) {
     9    wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    711
    812// Task name
  • taskbuilder/trunk/includes/admin/tasks/wppm_get_delete_task.php

    r2611331 r3079882  
    1313    </div>
    1414    <input type="hidden" name="action" value="wppm_set_delete_task" />
     15    <input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('wppm_set_delete_task')?>">
    1516    <input type="hidden" name="task_id" value="<?php echo htmlentities(esc_attr($id))?>" />
    1617</form>
  • taskbuilder/trunk/includes/admin/tasks/wppm_get_task_users.php

    r2611331 r3079882  
    55global $wpdb,$wppmfunction,$current_user;
    66$wppm_users_role = get_option('wppm_user_role');
     7$settings = get_option("wppm-ap-modal");
    78$task_id  = isset($_POST['task_id']) ? intval(sanitize_text_field($_POST['task_id'])) : '' ;
    89$proj_id = isset($_POST['proj_id']) ? intval(sanitize_text_field($_POST['proj_id'])) : '' ;
     
    4748        </div>
    4849        <input type="hidden" name="action" value="wppm_set_task_users" />
     50        <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_task_users' ) ); ?>">
    4951        <input type="hidden" id="wppm_task_id" name="task_id" value="<?php echo esc_attr($task_id) ?>" />
    5052    </div>
    5153</form>
     54<style>
     55li {
     56    color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
     57  }
     58</style>
    5259<script>
    5360jQuery(document).ready(function(){
  • taskbuilder/trunk/includes/admin/tasks/wppm_set_delete_task.php

    r2844010 r3079882  
    66global $current_user, $wppmfunction ,$wpdb;
    77$task_id  = isset($_POST['task_id']) ? sanitize_text_field($_POST['task_id']) : 0 ;
    8 
     8if ( check_ajax_referer( 'wppm_set_delete_task', '_ajax_nonce', false ) != 1 ) {
     9    wp_send_json_error( 'Unauthorised request!', 401 );
     10}
    911$sql="SELECT attachment_ids FROM {$wpdb->prefix}wppm_task_comment WHERE task_id =".$task_id;
    1012$thread_attachment_ids= $wpdb->get_results( $sql );
  • taskbuilder/trunk/includes/admin/tasks/wppm_tasks.php

    r2611331 r3079882  
    44}
    55$wppm_default_task_list_view = get_option('wppm_default_task_list_view');
     6$settings = get_option("wppm-ap-modal");
    67?>
    78<div class="wppm_bootstrap">
     
    2627<!-- Pop-up snippet end -->
    2728</div>
     29<style>
     30  #wppm_popup_title{
     31  background-color: <?php echo esc_attr($settings['header-bg-color'])?>;
     32  }
     33  #wppm_popup_title h3{
     34    color:<?php echo esc_attr( $settings['header-text-color'])?>;
     35  }
     36  #wppm_popup_body{
     37    background-color: <?php echo esc_attr($settings['body-bg-color'])?>!important;
     38  }
     39  #wppm_popup_body label{
     40    color:<?php echo esc_attr( $settings['body-label-color'])?>;
     41  }
     42  #wppm_popup_body input{
     43    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     44  }
     45  #wppm_popup_body select{
     46    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     47  }
     48  #wppm_popup_body span {
     49    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     50  }
     51  #wppm_popup_body .select2-results__options {
     52    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     53  }
     54  #wppm_popup_footer{
     55    background-color: <?php echo esc_attr($settings['footer-bg-color'])?>!important;
     56  }
     57  .wppm_popup_action{
     58    background-color: <?php echo esc_attr($settings['action-btn-bg-color'])?>!important;
     59    color:<?php echo esc_attr( $settings['action-btn-text-color'])?>!important;
     60  }
     61</style>
    2862<script type="text/javascript">
    2963  jQuery( document ).ready( function( jQuery ) {
  • taskbuilder/trunk/includes/admin/tasks/wppm_tasks_list.php

    r3035644 r3079882  
    1010$sort_by = isset($_POST['sort_by']) ? sanitize_text_field($_POST['sort_by']):"task_name";
    1111$filter_by = isset($_POST['wppm_task_filter']) ? sanitize_text_field($_POST['wppm_task_filter']) : "all";
     12$proj_filter = isset($_POST['wppm_proj_filter']) ? sanitize_text_field($_POST['wppm_proj_filter']) : "0";
    1213$current_date = date('Y-m-d');
    1314$wppm_task_time = get_option('wppm_task_time');
     15if($current_user->has_cap('manage_options')){
     16  $query = ( "SELECT * FROM {$wpdb->prefix}wppm_project ORDER BY project_name" );
     17  $where = "";
     18}else{
     19  $query = ("SELECT Proj.*
     20            FROM {$wpdb->prefix}wppm_project AS Proj
     21            Left join {$wpdb->prefix}wppm_project_meta proj_meta ON Proj.id = proj_meta.project_id");
     22  $where =  " where (FIND_IN_SET($current_user->ID,Proj.users)) OR (Proj.id = proj_meta.project_id AND proj_meta.meta_key='public_project' AND proj_meta.meta_value=1) Group by Proj.id ORDER BY project_name";
     23}
     24$query.= $where;
     25$projects = $wpdb->get_results($query);
     26$appearance_settings = get_option("wppm-ap-task-list");
    1427$filters = array(
    1528  'sort_by' => $sort_by,
    1629  'order' => $order,
    1730  'search' => $search_tag,
    18   'filter'=>$filter_by
     31  'filter'=>$filter_by,
     32  'proj_filter' =>$proj_filter
    1933);
    2034$tl_filters = isset( $_COOKIE['wppm_filters'] ) ? sanitize_text_field( wp_unslash( $_COOKIE['wppm_filters'] ) ) : $filters;
     
    3044$search_tag = isset($_POST['task_search']) ? sanitize_text_field($_POST['task_search']) : $tl_filters_arr['search'];
    3145$filter_by = isset($_POST['wppm_task_filter']) ? sanitize_text_field($_POST['wppm_task_filter']) : $tl_filters_arr['filter'];
     46$proj_filter = isset($_POST['wppm_proj_filter']) ? sanitize_text_field($_POST['wppm_proj_filter']) : $tl_filters_arr['proj_filter'];
    3247if($sort_by == ""){
    3348  $sort_by = 'task_name';
     
    3752  'order' => $order,
    3853  'search'=>$search_tag,
    39   'filter'=>$filter_by
     54  'filter'=>$filter_by,
     55  'proj_filter'=>$proj_filter
    4056);
    4157setcookie('wppm_filters',wp_json_encode( $filters ),time() + 3600);
     
    7086}elseif($filter_by == 'mine'){
    7187  $wppm_tl_filter = "(FIND_IN_SET('$current_user->ID',Task.users)>0)";
     88}
     89if($proj_filter!=0){
     90  $wppm_task_by_proj_filter = "Task.project = '$proj_filter'";
     91}else{
     92  $wppm_task_by_proj_filter ="1=1";
    7293}
    7394$wppm_default_task_date = get_option('wppm_default_task_date');
     
    112133if(!empty($search_tag )){
    113134  if($current_user->has_cap('manage_options')){
    114     $where = " where $wppm_tl_filter AND (Task.task_name LIKE '$search_tag_text' OR proj.project_name LIKE '$search_tag_text' OR task_statuses.name LIKE '$search_tag_text' OR task_priorities.name LIKE '$search_tag_text' OR user.display_name LIKE '$search_tag_text')";
     135    $where = " where $wppm_tl_filter AND $wppm_task_by_proj_filter AND (Task.task_name LIKE '$search_tag_text' OR proj.project_name LIKE '$search_tag_text' OR task_statuses.name LIKE '$search_tag_text' OR task_priorities.name LIKE '$search_tag_text' OR user.display_name LIKE '$search_tag_text')";
    115136  } else{
    116     $where = " where $wppm_tl_filter AND (((FIND_IN_SET('$current_user->ID',Task.users)>0) OR (Task.created_by= '$current_user->ID') OR (proj_users.user_id = '$current_user->ID' AND proj_users.role_id = 1 AND (FIND_IN_SET('$current_user->ID',proj.users)>0)) OR (Task.project = proj_meta.project_id AND proj_meta.meta_key='public_project' AND proj_meta.meta_value=1)) AND (Task.task_name LIKE '$search_tag_text' OR proj.project_name LIKE '$search_tag_text' OR task_statuses.name LIKE '$search_tag_text' OR task_priorities.name LIKE '$search_tag_text' OR user.display_name LIKE '$search_tag_text'))";
     137    $where = " where $wppm_tl_filter AND $wppm_task_by_proj_filter AND (((FIND_IN_SET('$current_user->ID',Task.users)>0) OR (Task.created_by= '$current_user->ID') OR (proj_users.user_id = '$current_user->ID' AND proj_users.role_id = 1 AND (FIND_IN_SET('$current_user->ID',proj.users)>0)) OR (Task.project = proj_meta.project_id AND proj_meta.meta_key='public_project' AND proj_meta.meta_value=1)) AND (Task.task_name LIKE '$search_tag_text' OR proj.project_name LIKE '$search_tag_text' OR task_statuses.name LIKE '$search_tag_text' OR task_priorities.name LIKE '$search_tag_text' OR user.display_name LIKE '$search_tag_text'))";
    117138  }
    118139}else{
    119140  if($current_user->has_cap('manage_options')){
    120     $where = " where $wppm_tl_filter";
     141    $where = " where $wppm_tl_filter AND $wppm_task_by_proj_filter";
    121142  } else{
    122     $where = " where $wppm_tl_filter AND ((FIND_IN_SET('$current_user->ID',Task.users)>0) OR (Task.created_by= '$current_user->ID') OR (proj_users.user_id = '$current_user->ID' AND proj_users.role_id = 1 AND (FIND_IN_SET('$current_user->ID',proj.users)>0)) OR (Task.project = proj_meta.project_id AND proj_meta.meta_key='public_project' AND proj_meta.meta_value=1))";
     143    $where = " where $wppm_tl_filter AND $wppm_task_by_proj_filter AND ((FIND_IN_SET('$current_user->ID',Task.users)>0) OR (Task.created_by= '$current_user->ID') OR (proj_users.user_id = '$current_user->ID' AND proj_users.role_id = 1 AND (FIND_IN_SET('$current_user->ID',proj.users)>0)) OR (Task.project = proj_meta.project_id AND proj_meta.meta_key='public_project' AND proj_meta.meta_value=1))";
    123144  }
    124145}
     
    143164      <div class="col-sm-6">
    144165        <span class="wppm-heading-inline"> <?php echo esc_html_e('Tasks','taskbuilder');?> </span>
    145         <span class="wppm-add-new-btn btn-primary" onclick="wppm_add_new_task()"><img class="wppm_add_new_task_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/plus_icon.svg'); ?>" alt="add_icon"><?php echo esc_html_e('Add New','taskbuilder');?></span>
     166        <span class="wppm-add-new-btn btn-primary" id="wppm_add_new_task_btn_tl" style="background-color:<?php echo $appearance_settings['list-header-button-background-color']?>;color:<?php echo $appearance_settings['list-header-button-text-color']?>" onclick="wppm_add_new_task()"><img class="wppm_add_new_task_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/plus_icon.svg'); ?>" alt="add_icon"><?php echo esc_html_e('Add New','taskbuilder');?></span>
    146167      </div>
    147168      <div id="wppm_task_search" class="col-sm-6">
     
    150171      </div>
    151172    </div>
     173    <div id="wppm_task_filter_container">
     174      <div class="wppm-filter-item">
     175        <label for="wppm_task_filter"> <?php echo esc_html_e('Filter','taskbuilder');?></label>
     176        <select id="wppm_task_filter" name="wppm_task_filter" onchange="wppm_apply_task_filter()">
     177          <option value="all"<?php echo ($filter_by == "all")? 'selected':""?>><?php echo esc_html_e('All','taskbuilder');?></option>
     178          <option value="todo" <?php echo ($filter_by == "todo")? 'selected':""?>><?php echo  esc_html_e('Todo','taskbuilder');?></option>
     179          <option value="inprogress" <?php echo ($filter_by == "inprogress")? 'selected':""?>><?php echo  esc_html_e('In Progress','taskbuilder');?></option>
     180          <option value="hold" <?php echo ($filter_by == "hold")? 'selected':""?>><?php echo  esc_html_e('Hold','taskbuilder');?></option>
     181          <option value="completed" <?php echo ($filter_by == "completed")? 'selected':""?>><?php echo  esc_html_e('Completed','taskbuilder');?></option>
     182          <option value="mine" <?php echo ($filter_by == "mine")? 'selected':""?>><?php echo  esc_html_e('Mine','taskbuilder');?></option>
     183          <option value="unassigned" <?php echo ($filter_by == "unassigned")? 'selected':""?>><?php echo  esc_html_e('Unassigned','taskbuilder');?></option>
     184          <option value="overdue" <?php echo ($filter_by == "overdue")? 'selected':""?>><?php echo  esc_html_e('Overdue','taskbuilder');?></option>
     185        </select>
     186      </div>
     187      <div class="wppm-filter-item wppm_project_autocomplete_container">
     188            <label for="wppm_task_list_proj_filter">
     189                <?php echo esc_html_e('Project','taskbuilder');?>
     190            </label><br>
     191            <select searchable="search here" onchange="wppm_tasks_by_select_project()" class="form-control" size="40" name="wppm_task_list_proj_filter" id="wppm_task_list_proj_filter" data-width="100%" style="width: 100%!important;">
     192                <option value="0" <?php echo ($proj_filter == 0)? 'selected':""?>><?php echo esc_html_e('All','taskbuilder');?></option>
     193                <?php
     194                  if(!empty($projects)){
     195                      foreach($projects as $proj) {
     196                          ?>
     197                          <option value="<?php echo esc_attr($proj->id)?>" <?php echo ($proj_filter == $proj->id)? 'selected':""?>><?php echo esc_html_e($proj->project_name,'taskbuilder');?></option>
     198                  <?php }
     199                  } ?>
     200            </select>
     201      </div>
     202      <div class="wppm_display_submit">
     203        <div class="wppm-filter-actions">
     204            <span class="wppm-link" onclick="wppm_tl_reset_filter()"> <?php echo esc_html_e('Reset','taskbuilder');?></span>
     205        </div>
     206      </div>
     207    </div>
    152208    <div class="row">
    153         <div class="col-sm-6" id="wppm_task_filter_container">
    154           <div class="wppm-filter-item">
    155             <label for="wppm_task_filter"> <?php echo esc_html_e('Filter','taskbuilder');?></label>
    156             <select id="wppm_task_filter" name="wppm_task_filter" onchange="wppm_apply_task_filter()">
    157               <option value="all"<?php echo ($filter_by == "all")? 'selected':""?>><?php echo esc_html_e('All','taskbuilder');?></option>
    158               <option value="todo" <?php echo ($filter_by == "todo")? 'selected':""?>><?php echo  esc_html_e('Todo','taskbuilder');?></option>
    159               <option value="inprogress" <?php echo ($filter_by == "inprogress")? 'selected':""?>><?php echo  esc_html_e('In Progress','taskbuilder');?></option>
    160               <option value="hold" <?php echo ($filter_by == "hold")? 'selected':""?>><?php echo  esc_html_e('Hold','taskbuilder');?></option>
    161               <option value="completed" <?php echo ($filter_by == "completed")? 'selected':""?>><?php echo  esc_html_e('Completed','taskbuilder');?></option>
    162               <option value="mine" <?php echo ($filter_by == "mine")? 'selected':""?>><?php echo  esc_html_e('Mine','taskbuilder');?></option>
    163               <option value="unassigned" <?php echo ($filter_by == "unassigned")? 'selected':""?>><?php echo  esc_html_e('Unassigned','taskbuilder');?></option>
    164               <option value="overdue" <?php echo ($filter_by == "overdue")? 'selected':""?>><?php echo  esc_html_e('Overdue','taskbuilder');?></option>
    165             </select>
    166           </div>
    167           <div class="wppm_display_submit">
    168             <div class="wppm-filter-actions">
    169                 <span class="wppm-link" onclick="wppm_tl_reset_filter()"> <?php echo esc_html_e('Reset','taskbuilder');?></span>
    170             </div>
    171           </div>
    172         </div>
    173         <div class="col-sm-6">
     209      <div class="col-sm-12">
    174210          <span id="wppm_grid_view_btn" onclick="wppm_view_task_search_filter(<?php echo esc_attr($page_no)?>)"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/grid_view.svg'); ?>" alt="grid_view"><span><?php echo esc_html_e('Grid view','taskbuilder');?></span></span>
    175         </div>
     211      </div>
    176212    </div>
    177213    <div id="wppm_task_table_container" class="wppm_task_table_container table-responsive">
     
    179215        <thead>
    180216          <tr>
    181             <th class="wppm_table_header">
     217            <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
    182218              <div id="wppm_task_name_container">
    183                 <span id="wppm_task_name_th"><?php echo esc_html_e('Task name','taskbuilder'); ?></span>
     219                <span id="wppm_task_name_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Task name','taskbuilder'); ?></span>
    184220                <img width="16" height="16" style = "<?php echo ($sort_by == 'task_name' && $order == 'DESC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('task_name','ASC')" class="wppm_chevron_img" id="wppm_chevron_sort_up_task_name_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    185221                <img width="16" height="16" style = "<?php echo ($sort_by == 'task_name' && $order == 'ASC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('task_name','DESC')" class="wppm_chevron_img" id="wppm_chevron_sort_down_task_name_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    186222              </div>
    187223            </th>
    188             <th class="wppm_table_header">
    189               <span id="wppm_project_name_th"><?php echo esc_html_e('Project','taskbuilder'); ?></span>
     224            <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     225              <span id="wppm_project_name_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Project','taskbuilder'); ?></span>
    190226              <img width="16" height="16" style = "<?php echo ($sort_by == 'proj.project_name' && $order == 'DESC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('project','ASC')" class="wppm_chevron_img" id="wppm_chevron_sort_up_project_list_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    191227              <img width="16" height="16" style = "<?php echo ($sort_by == 'proj.project_name' && $order == 'ASC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('project','DESC')" class="wppm_chevron_img" id="wppm_chevron_sort_down_project_list_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    192228            </th>
    193             <th class="wppm_table_header">
    194               <span id="wppm_status_th"><?php echo esc_html_e('Status','taskbuilder'); ?></span>
     229            <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     230              <span id="wppm_status_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Status','taskbuilder'); ?></span>
    195231              <img width="16" height="16" style = "<?php echo ($sort_by == 'task_statuses.name' && $order == 'DESC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('status','ASC')" class="wppm_chevron_img" id="wppm_chevron_sort_up_status_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    196232              <img width="16" height="16" style = "<?php echo ($sort_by == 'task_statuses.name' && $order == 'ASC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('status','DESC')" class="wppm_chevron_img" id="wppm_chevron_sort_down_status_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    197233            </th>
    198             <th class="wppm_table_header">
    199               <span id="wppm_priority_th"><?php echo esc_html_e('Priority','taskbuilder'); ?></span>
     234            <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     235              <span id="wppm_priority_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Priority','taskbuilder'); ?></span>
    200236              <img width="16" height="16" style = "<?php echo ($sort_by == ('task_priorities.name') && $order == 'DESC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('priority','ASC')" class="wppm_chevron_img" id="wppm_chevron_sort_up_priority_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    201237              <img width="16" height="16" style = "<?php echo ($sort_by == ('task_priorities.name') && $order == 'ASC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('priority','DESC')" class="wppm_chevron_img" id="wppm_chevron_sort_down_priority_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    202238            </th>
    203239            <?php if($wppm_default_task_date == 1) { ?>
    204                     <th class="wppm_table_header">
    205                       <span id="wppm_start_date_th"><?php echo esc_html_e('Start date','taskbuilder'); ?></span>
     240                    <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     241                      <span id="wppm_start_date_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Start date','taskbuilder'); ?></span>
    206242                      <img width="16" height="16" style = "<?php echo ($sort_by == 'Task.start_date' && $order == 'DESC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('start_date','ASC')" class="wppm_chevron_img" id="wppm_chevron_sort_up_start_date_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    207243                      <img width="16" height="16" style = "<?php echo ($sort_by == 'Task.start_date' && $order == 'ASC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('start_date','DESC')" class="wppm_chevron_img" id="wppm_chevron_sort_down_start_date_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    208244                    </th>
    209                     <th class="wppm_table_header">
    210                       <span id="wppm_end_date_th"><?php echo esc_html_e('End date','taskbuilder'); ?></span>
     245                    <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     246                      <span id="wppm_end_date_th" style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('End date','taskbuilder'); ?></span>
    211247                      <img width="16" height="16" style = "<?php echo ($sort_by == 'Task.end_date' && $order == 'DESC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('end_date','ASC')" class="wppm_chevron_img" id="wppm_chevron_sort_up_end_date_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_up_icon.svg'); ?>" alt="chevron_sort_up_icon">
    212248                      <img width="16" height="16" style = "<?php echo ($sort_by == 'Task.end_date' && $order == 'ASC') ? 'display:inline': 'display:none;'?>" onclick="wppm_sort_up_task_list('end_date','DESC')" onclick="wppm_sort_up_task_list('end_date','DESC')" class="wppm_chevron_img" id="wppm_chevron_sort_down_end_date_img" src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/sort_down_icon.svg'); ?>" alt="chevron_sort_down_icon">
    213249                    </th>
    214250            <?php } ?>
    215             <th class="wppm_table_header">
    216               <?php echo esc_html_e('Assign To','taskbuilder'); ?>
     251            <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     252              <span style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Assign To','taskbuilder'); ?></span>
    217253            </th>
    218             <th class="wppm_table_header">
    219               <?php echo esc_html_e('Progress','taskbuilder'); ?>
     254            <th class="wppm_table_header" style="background-color:<?php echo esc_attr($appearance_settings['list-header-background-color'])?>">
     255              <span style="color:<?php echo esc_attr($appearance_settings['list-header-text-color'])?>"><?php echo esc_html_e('Progress','taskbuilder'); ?></span>
    220256            </th>
    221257            <?php do_action('wppm_table_header');?>
     
    380416  </div>
    381417</form>
     418<style>
     419    .select2-selection--single {
     420        height: 30px!important;
     421    }
     422  .select2-dropdown:hover {
     423        color: #23527c!important;;
     424    }
     425    .select2-results__options{
     426        font:15px "Helvetica Neue",Arial,Helvetica,sans-serif !important;
     427        margin: 0!important;
     428        line-height: inherit!important;
     429    }
     430    .select2-selection__rendered{
     431        font:15px "Helvetica Neue",Arial,Helvetica,sans-serif !important;
     432        margin-top: 5px!important;
     433    }
     434    .select2-selection__rendered:hover{
     435        color: #2271b1 !important;
     436    }
     437    .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable{
     438        background-color: #e85f08!important;
     439        color: white !important;
     440    }
     441  .select2-container {
     442    max-width: 150px !important;
     443    min-width: 150px !important;
     444  }
     445  #wppm_task_filter{
     446        min-height: 30px !important;
     447    max-height: 35px !important;
     448    }
     449  #wppm_task_table tr:nth-child(even) td{
     450    background-color:<?php echo esc_attr($appearance_settings['list-item-even-background-color'])?>;
     451    color:<?php echo esc_attr($appearance_settings['list-item-even-text-color'])?>;
     452  }
     453  #wppm_task_table tr:nth-child(odd) td{
     454    background-color:<?php echo esc_attr($appearance_settings['list-item-odd-background-color'])?>;
     455    color:<?php echo esc_attr($appearance_settings['list-item-odd-text-color'])?>;
     456  }
     457  #wppm_task_table tr:hover td{
     458    background-color:<?php echo esc_attr($appearance_settings['list-item-hover-background-color'])?>;
     459  }
     460  #wppm_task_table tr:hover td{
     461    color: <?php echo esc_attr($appearance_settings['list-item-hover-text-color'])?>;
     462  }
     463  #wppm_add_new_task_btn_tl:hover{
     464    background-color:<?php echo esc_attr($appearance_settings['list-header-button-hover-color'])?>!important;
     465  }
     466</style>
    382467<script type="text/javascript">
    383468  var link = true;
     
    415500   
    416501  })
     502  jQuery('#wppm_task_list_proj_filter').select2({ dropdownAutoWidth: true, width: 'auto' });
     503  jQuery('#wppm_task_list_proj_filter').val(<?php echo esc_attr($proj_filter) ?>);
     504
    417505</script>
    418506
  • taskbuilder/trunk/includes/class-wppm-admin.php

    r2951988 r3079882  
    1212      add_action( 'admin_enqueue_scripts', array( $this, 'loadScripts') );
    1313      add_action( 'admin_menu', array($this,'wppm_register_dashboard_menu') );
     14     // add_action( 'admin_init',array($this,'wppm_appearance_setting_tab') );
    1415      add_action( 'wp_ajax_wppm_add_new_project',array($this,'wppm_add_new_project'));
    1516      add_action( 'wp_ajax_wppm_open_project',array($this,'wppm_open_project'));
     
    6364      add_action('wp_ajax_wppm_submit_task_comment',array($this,'wppm_submit_task_comment'));
    6465      add_action('wp_ajax_wppm_upload_file',array($this,'wppm_upload_file'));
     66      add_action('wp_ajax_wppm_upload_proj_attach_file',array($this,'wppm_upload_file'));
    6567      add_action('wp_ajax_wppm_get_en_general_setting',array($this,'wppm_get_en_general_setting'));
    6668      add_action('wp_ajax_wppm_set_en_general_settings',array($this,'wppm_set_en_general_settings'));
     
    7375      add_action('wp_ajax_wppm_set_change_task_details',array($this,'wppm_set_change_task_details'));
    7476      add_action('wp_ajax_wppm_edit_task_thread',array($this,'wppm_edit_task_thread'));
     77      add_action('wp_ajax_wppm_edit_proj_thread',array($this,'wppm_edit_proj_thread'));
    7578      add_action('wp_ajax_wppm_set_edit_task_thread',array($this,'wppm_set_edit_task_thread'));
     79      add_action('wp_ajax_wppm_set_edit_proj_thread',array($this,'wppm_set_edit_proj_thread'));
    7680      add_action('wp_ajax_wppm_delete_task_thread',array($this,'wppm_delete_task_thread'));
     81      add_action('wp_ajax_wppm_delete_proj_thread',array($this,'wppm_delete_proj_thread'));
    7782      add_action('wp_ajax_wppm_set_delete_thread',array($this,'wppm_set_delete_thread'));
     83      add_action('wp_ajax_wppm_set_delete_proj_thread',array($this,'wppm_set_delete_proj_thread'));
    7884      add_action('wp_ajax_wppm_edit_project_details',array($this,'wppm_edit_project_details'));
    7985      add_action('wp_ajax_wppm_set_change_project_details',array($this,'wppm_set_change_project_details'));
     
    97103      add_action('wppm_after_project_created',array($this,'wppm_en_project_created'),100,1);
    98104      add_action('wppm_after_submit_task_comment',array($this,'wppm_en_submit_task_comment'),10,2);
     105      add_action('wppm_after_submit_proj_comment',array($this,'wppm_en_submit_proj_comment'),10,2);
    99106      add_action('wp_ajax_wppm_set_general_settings',array($this,'wppm_set_general_settings'));
    100107      add_action('wp_ajax_wppm_get_project_tasks',array($this,'wppm_get_project_tasks'));
    101       add_action('wp_ajax_wppm_remove_thread_attachment',array($this,'wppm_remove_thread_attachment'),10,3);
     108      add_action('wp_ajax_wppm_remove_thread_attachment',array($this,'wppm_remove_thread_attachment'),10,5);
     109      add_action('wp_ajax_wppm_remove_proj_thread_attachment',array($this,'wppm_remove_proj_thread_attachment'),10,4);
    102110      add_action('wp_ajax_wppm_remove_checklist_item',array($this,'wppm_remove_checklist_item'),10,4);
    103111      add_action('wp_ajax_wppm_clone_task',array($this,'wppm_clone_task'),10,1);
    104       add_action('wp_ajax_wppm_set_clone_task',array($this,'wppm_set_clone_task'),10,2);
     112      add_action('wp_ajax_wppm_set_clone_task',array($this,'wppm_set_clone_task'),10,4);
    105113      add_action('wp_ajax_wppm_get_advanced_settings',array($this,'wppm_get_advanced_settings'));
    106114      add_action('wp_ajax_wppm_set_advanced_settings',array($this,'wppm_set_advanced_settings'));
     115      add_action('wp_ajax_wppm_get_appearance_settings',array($this,'wppm_get_appearance_settings'));
    107116      add_action('wp_ajax_wppm_get_project_visibility',array($this,'wppm_get_project_visibility'),10,1);
    108117      add_action('wp_ajax_wppm_change_project_visibility',array($this,'wppm_change_project_visibility'),10,2);
     118      add_action('wp_ajax_wppm_submit_proj_comment',array($this,'wppm_submit_proj_comment'));
     119      add_action('wp_ajax_wppm_set_change_task_start_date',array($this,'wppm_set_change_task_start_date'));
     120      add_action('wp_ajax_wppm_set_change_task_end_date',array($this,'wppm_set_change_task_end_date'));
     121      add_action('wp_ajax_wppm_set_change_proj_start_date',array($this,'wppm_set_change_proj_start_date'));
     122      add_action('wp_ajax_wppm_set_change_proj_end_date',array($this,'wppm_set_change_proj_end_date'));
     123      add_action('wp_ajax_wppm_get_ap_proj_list',array($this,'wppm_get_ap_proj_list'));
     124      add_action('wp_ajax_wppm_set_ap_proj_list',array($this,'wppm_set_ap_proj_list'));
     125      add_action('wp_ajax_wppm_get_ap_task_list',array($this,'wppm_get_ap_task_list'));
     126      add_action('wp_ajax_wppm_set_ap_task_list',array($this,'wppm_set_ap_task_list'));
     127      add_action('wp_ajax_wppm_reset_ap_proj_list',array($this,'wppm_reset_ap_proj_list'));
     128      add_action('wp_ajax_wppm_reset_ap_task_list',array($this,'wppm_reset_ap_task_list'));
     129      add_action('wp_ajax_wppm_get_ap_individual_proj',array($this,'wppm_get_ap_individual_proj'));
     130      add_action('wp_ajax_wppm_set_ap_individual_proj',array($this,'wppm_set_ap_individual_proj'));
     131      add_action('wp_ajax_wppm_reset_ap_individual_proj',array($this,'wppm_reset_ap_individual_proj'));
     132      add_action('wp_ajax_wppm_get_ap_individual_task',array($this,'wppm_get_ap_individual_task'));
     133      add_action('wp_ajax_wppm_set_ap_individual_task',array($this,'wppm_set_ap_individual_task'));
     134      add_action('wp_ajax_wppm_reset_ap_individual_task',array($this,'wppm_reset_ap_individual_task'));
     135      add_action('wp_ajax_wppm_get_ap_modal_popup',array($this,'wppm_get_ap_modal_popup'));
     136      add_action('wp_ajax_wppm_set_ap_modal_popup',array($this,'wppm_set_ap_modal_popup'));
     137      add_action('wp_ajax_wppm_reset_ap_modal_popup',array($this,'wppm_reset_ap_modal_popup'));
     138      add_action('wp_ajax_wppm_get_ap_grid_view',array($this,'wppm_get_ap_grid_view'));
     139      add_action('wp_ajax_wppm_set_ap_grid_view',array($this,'wppm_set_ap_grid_view'));
     140      add_action('wp_ajax_wppm_reset_ap_grid_view',array($this,'wppm_reset_ap_grid_view'));
     141      add_action('wp_ajax_wppm_get_ap_settings',array($this,'wppm_get_ap_settings'));
     142      add_action('wp_ajax_wppm_set_ap_settings',array($this,'wppm_set_ap_settings'));
     143      add_action('wp_ajax_wppm_reset_ap_settings',array($this,'wppm_reset_ap_settings'));
    109144    }
    110145   
     
    237272   
    238273    }
    239    
     274
    240275    public function wppm_projects(){
    241276      include WPPM_ABSPATH.'includes/admin/projects/projects.php';
     
    567602    }
    568603
     604    public function wppm_edit_proj_thread(){
     605      include WPPM_ABSPATH.'includes/admin/projects/open_project/wppm_edit_project_thread.php';
     606      die();
     607    }
     608
    569609    public function wppm_set_edit_task_thread(){
    570610      include WPPM_ABSPATH.'includes/admin/tasks/open_task/wppm_set_edit_task_thread.php';
     
    572612    }
    573613
     614    public function wppm_set_edit_proj_thread(){
     615      include WPPM_ABSPATH.'includes/admin/projects/open_project/wppm_set_edit_proj_thread.php';
     616      die();
     617    }
     618
    574619    public function wppm_delete_task_thread(){
    575620      include WPPM_ABSPATH.'includes/admin/tasks/open_task/wppm_delete_task_thread.php';
     
    577622    }
    578623
     624    public function wppm_delete_proj_thread(){
     625      include WPPM_ABSPATH.'includes/admin/projects/open_project/wppm_delete_proj_thread.php';
     626      die();
     627    }
     628
    579629    public function wppm_set_delete_thread(){
    580630      include WPPM_ABSPATH.'includes/admin/tasks/open_task/wppm_set_delete_thread.php';
     631      die();
     632    }
     633
     634    public function wppm_set_delete_proj_thread(){
     635      include WPPM_ABSPATH.'includes/admin/projects/open_project/wppm_set_delete_proj_thread.php';
    581636      die();
    582637    }
     
    671726    }
    672727
     728    public function wppm_en_submit_proj_comment($proj_id,$comment_id){
     729      include WPPM_ABSPATH.'includes/admin/email_notifications/wppm_en_submit_proj_comment.php';
     730    }
     731
    673732    public function wppm_en_task_created($task_id){
    674733      include WPPM_ABSPATH.'includes/admin/email_notifications/wppm_en_task_created.php';
     
    690749    }
    691750
     751    public function wppm_remove_proj_thread_attachment(){
     752      include WPPM_ABSPATH.'includes/admin/projects/open_project/wppm_proj_thread_attachment_remove.php';
     753      die();
     754    }
     755
    692756    public function wppm_remove_checklist_item(){
    693757      include WPPM_ABSPATH.'includes/admin/tasks/open_task/checklist/wppm_remove_checklist_item.php';
     
    719783    }
    720784
     785    public function wppm_get_appearance_settings(){
     786      include WPPM_ABSPATH.'includes/admin/settings/wppm_get_appearance_settings.php';
     787      die();
     788    }
     789
     790    public function wppm_get_ap_proj_list(){
     791      include WPPM_ABSPATH.'includes/admin/settings/wppm_get_ap_proj_list.php';
     792      die();
     793    }
     794
     795    public function wppm_get_ap_individual_proj(){
     796      include WPPM_ABSPATH.'includes/admin/settings/wppm_get_ap_individual_proj.php';
     797      die();
     798    }
     799
     800    public function wppm_get_ap_individual_task(){
     801      include WPPM_ABSPATH.'includes/admin/settings/wppm_get_ap_individual_task.php';
     802      die();
     803    }
     804   
     805    public function wppm_set_ap_proj_list(){
     806      include WPPM_ABSPATH.'includes/admin/settings/wppm_set_ap_proj_list.php';
     807      die();
     808    }
     809
     810    public function wppm_reset_ap_proj_list(){
     811      include WPPM_ABSPATH.'includes/admin/settings/wppm_reset_ap_proj_list.php';
     812      die();
     813    }
     814
    721815    public function wppm_get_project_visibility(){
    722816      include WPPM_ABSPATH.'includes/admin/projects/open_project/wppm_get_project_visibility.php';
     
    728822      die();
    729823    }
     824
     825    public function wppm_submit_proj_comment(){
     826      include WPPM_ABSPATH.'includes/admin/projects/open_project/wppm_submit_project_comment.php';
     827      die();
     828    }
     829
     830    public function wppm_set_change_task_start_date(){
     831      include WPPM_ABSPATH.'includes/admin/tasks/open_task/wppm_set_change_task_start_date.php';
     832      die();
     833    }
     834
     835    public function wppm_set_change_task_end_date(){
     836      include WPPM_ABSPATH.'includes/admin/tasks/open_task/wppm_set_change_task_end_date.php';
     837      die();
     838    }
     839
     840    public function wppm_set_change_proj_start_date(){
     841      include WPPM_ABSPATH.'includes/admin/projects/open_project/wppm_set_change_proj_start_date.php';
     842      die();
     843    }
     844
     845    public function wppm_set_change_proj_end_date(){
     846      include WPPM_ABSPATH.'includes/admin/projects/open_project/wppm_set_change_proj_end_date.php';
     847      die();
     848    }
     849
     850    public function wppm_get_ap_task_list(){
     851      include WPPM_ABSPATH.'includes/admin/settings/wppm_get_ap_task_list.php';
     852      die();
     853    }
     854
     855    public function wppm_set_ap_task_list(){
     856      include WPPM_ABSPATH.'includes/admin/settings/wppm_set_ap_task_list.php';
     857      die();
     858    }
     859
     860    public function wppm_reset_ap_task_list(){
     861      include WPPM_ABSPATH.'includes/admin/settings/wppm_reset_ap_task_list.php';
     862      die();
     863    }
     864
     865    public function wppm_set_ap_individual_proj(){
     866      include WPPM_ABSPATH.'includes/admin/settings/wppm_set_ap_individual_proj.php';
     867      die();
     868    }
     869
     870    public function wppm_set_ap_individual_task(){
     871      include WPPM_ABSPATH.'includes/admin/settings/wppm_set_ap_individual_task.php';
     872      die();
     873    }
     874
     875    public function wppm_reset_ap_individual_proj(){
     876      include WPPM_ABSPATH.'includes/admin/settings/wppm_reset_ap_individual_proj.php';
     877      die();
     878    }
     879
     880    public function wppm_reset_ap_individual_task(){
     881      include WPPM_ABSPATH.'includes/admin/settings/wppm_reset_ap_individual_task.php';
     882      die();
     883    }
     884
     885    public function wppm_reset_ap_modal_popup(){
     886      include WPPM_ABSPATH.'includes/admin/settings/wppm_reset_ap_modal_popup.php';
     887      die();
     888    }
     889
     890    public function wppm_get_ap_modal_popup(){
     891      include WPPM_ABSPATH.'includes/admin/settings/wppm_get_ap_modal_popup.php';
     892      die();
     893    }
     894
     895    public function wppm_set_ap_modal_popup(){
     896      include WPPM_ABSPATH.'includes/admin/settings/wppm_set_ap_modal_popup.php';
     897      die();
     898    }
     899
     900    public function wppm_get_ap_grid_view(){
     901      include WPPM_ABSPATH.'includes/admin/settings/wppm_get_ap_grid_view.php';
     902      die();
     903    }
     904
     905    public function wppm_set_ap_grid_view(){
     906      include WPPM_ABSPATH.'includes/admin/settings/wppm_set_ap_grid_view.php';
     907      die();
     908    }
     909
     910    public function wppm_reset_ap_grid_view(){
     911      include WPPM_ABSPATH.'includes/admin/settings/wppm_reset_ap_grid_view.php';
     912      die();
     913    }
     914
     915    public function wppm_get_ap_settings(){
     916      include WPPM_ABSPATH.'includes/admin/settings/wppm_get_ap_settings.php';
     917      die();
     918    }
     919
     920    public function wppm_set_ap_settings(){
     921      include WPPM_ABSPATH.'includes/admin/settings/wppm_set_ap_settings.php';
     922      die();
     923    }
     924
     925    public function wppm_reset_ap_settings(){
     926      include WPPM_ABSPATH.'includes/admin/settings/wppm_reset_ap_settings.php';
     927      die();
     928    }
     929   
    730930  }
    731931 
  • taskbuilder/trunk/includes/class-wppm-functions.php

    r2951988 r3079882  
    9292        }
    9393
     94        public static function wppm_submit_proj_comment($args){
     95            global $wpdb;
     96            $wpdb->insert($wpdb->prefix.'wppm_project_comment',$args);
     97            $comment_id = $wpdb->insert_id;
     98            return $comment_id;
     99        }
     100
    94101        // Random string
    95102        public static function getRandomString($length = 8) {
     
    257264            }
    258265            return apply_filters( 'wppm_has_comment_permission', $response, $task_id, $comment_id, $permission );
     266        }
     267
     268        public function has_proj_comment_permission($permission, $proj_id,$comment_id){
     269            global $current_user,$wppmfunction,$wpdb;
     270            if(empty($comment_id)){
     271                $comment_id = 0;
     272            }
     273            $project_user = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}wppm_project_users WHERE proj_id = $proj_id AND user_id = $current_user->ID");
     274            $project_users = $wpdb->get_var("SELECT users FROM {$wpdb->prefix}wppm_project WHERE id = $proj_id");
     275            $project_users_arr = explode(',',(string)$project_users);
     276            $proj_comment = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}wppm_project_comment WHERE proj_id = $proj_id AND id = $comment_id");
     277            $response = false;
     278            $flag = false;
     279            if((!empty($project_user)) && ($project_user->role_id == 1) && in_array($current_user->ID,$project_users_arr)){
     280                $flag= true;
     281            }
     282            switch ($permission) {
     283                case 'delete_proj_thread':
     284                case 'edit_proj_comment':
     285                (($flag==true) || ($current_user->ID == $proj_comment->created_by)) ? $response = true: $response = false;
     286                break;
     287            }
     288            return apply_filters( 'wppm_has_proj_comment_permission', $response, $proj_id, $comment_id, $permission );
    259289        }
    260290
     
    415445        }
    416446
     447        public function get_proj_comment($comment_id){
     448            global $wpdb;
     449            $project_comment_data = array();
     450            $project_comment = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}wppm_project_comment WHERE id=$comment_id ");
     451            if( $project_comment ){
     452                $project_comment_data = json_decode(json_encode($project_comment), true);
     453            }
     454            return $project_comment_data;
     455        }
     456
    417457        public function change_task_comment($comment_id,$comment_body){
    418458            global $wpdb;
     
    422462            $wpdb->update($wpdb->prefix.'wppm_task_comment', $values, array('id'=>$comment_id));
    423463        }
     464
     465        public function change_proj_comment($comment_id,$comment_body){
     466            global $wpdb;
     467            $values=array(
     468                'body'=>$comment_body
     469            );
     470            $wpdb->update($wpdb->prefix.'wppm_project_comment', $values, array('id'=>$comment_id));
     471        }
     472
    424473        public function change_project_label($project_id,$project_label){
    425474            global $wpdb;
     
    496545            'change_task_assign_users'    => __('Change Task Assign Users','taskbuilder'),
    497546            'new_discussion'     => __('New Comment','taskbuilder'),
     547            'new_proj_discussion'  =>__('New Project Comment','taskbuilder')
    498548            );
    499549            return apply_filters('wppm_en_types',$notification_types);
     
    665715        public function get_project_category_name($cat_id){
    666716            global $wpdb;
    667             $cat_name = $wpdb->get_var("SELECT name FROM {$wpdb->prefix}wppm_project_categories WHERE id ='$cat_id'");
     717            if(!empty($cat_id)){
     718                $cat_name = $wpdb->get_var("SELECT name FROM {$wpdb->prefix}wppm_project_categories WHERE id ='$cat_id'");
     719            }else{
     720                $cat_name = "";
     721            }
    668722            return $cat_name;
    669723        }
     
    760814        }
    761815       
    762         public function create_duplicate_task($ptask_id, $project_id){
     816        public function create_duplicate_task($ptask_id, $project_id,$ajax_nonce){
    763817            include WPPM_ABSPATH . 'includes/admin/tasks/open_task/wppm_set_clone_task.php';
     818        }
     819
     820        public function get_last_comment_proj_user_name($project_id){
     821            global $wpdb;
     822            $proj_comment_creator = $wpdb->get_var("SELECT created_by FROM {$wpdb->prefix}wppm_project_comment WHERE (id=(select MAX(id) from {$wpdb->prefix}wppm_project_comment) AND proj_id = $project_id)");
     823            if(!empty($proj_comment_creator)){
     824                $user = get_userdata( $proj_comment_creator );
     825                return $user->display_name;
     826            }
     827        }
     828
     829        public function get_proj_comment_body($project_id){
     830            global $wpdb;
     831            $proj_comment = $wpdb->get_var("SELECT body FROM {$wpdb->prefix}wppm_project_comment WHERE (id=(select MAX(id) from {$wpdb->prefix}wppm_project_comment) AND proj_id = $project_id)");
     832            return $proj_comment;
    764833        }
    765834    }
  • taskbuilder/trunk/includes/frontend/shortcode.php

    r3042496 r3079882  
    2828wp_enqueue_script('wppm-datatable-js');
    2929wp_enqueue_script('wppm-datatable-css');
     30$settings = get_option("wppm-ap-modal");
    3031?>
    3132<div class="wppm_bootstrap">
     
    5455  </div>
    5556</div>
     57<style>
     58  #wppm_popup_title{
     59  background-color: <?php echo esc_attr($settings['header-bg-color'])?>;
     60  }
     61  #wppm_popup_title h3{
     62    color:<?php echo esc_attr( $settings['header-text-color'])?>;
     63  }
     64  #wppm_popup_body{
     65    background-color: <?php echo esc_attr($settings['body-bg-color'])?>!important;
     66  }
     67  #wppm_popup_body label{
     68    color:<?php echo esc_attr( $settings['body-label-color'])?>;
     69  }
     70  #wppm_popup_body input{
     71    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     72  }
     73  #wppm_popup_body select{
     74    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     75  }
     76  #wppm_popup_body span {
     77    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     78  }
     79  #wppm_popup_body .select2-results__options {
     80    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     81  }
     82  #wppm_popup_footer{
     83    background-color: <?php echo esc_attr($settings['footer-bg-color'])?>!important;
     84  }
     85  .wppm_popup_action{
     86    background-color: <?php echo esc_attr($settings['action-btn-bg-color'])?>!important;
     87    color:<?php echo esc_attr( $settings['action-btn-text-color'])?>!important;
     88  }
     89</style>
    5690<!-- Pop-up snippet end -->
    5791<?php
  • taskbuilder/trunk/includes/frontend/wppm_tasks_shortcode.php

    r3042496 r3079882  
    2424wp_enqueue_script('wppm-gpopover-js');
    2525wp_enqueue_script('wppm-dragula-js');
    26 $task_list_view = get_option('wppm_default_task_list_view');
     26$settings = get_option("wppm-ap-modal");
    2727?>
    2828<div class="wppm_bootstrap">
     
    5151  </div>
    5252</div>
     53<style>
     54  #wppm_popup_title{
     55    background-color: <?php echo esc_attr($settings['header-bg-color'])?>;
     56  }
     57  #wppm_popup_title h3{
     58    color:<?php echo esc_attr( $settings['header-text-color'])?>;
     59  }
     60  #wppm_popup_body{
     61    background-color: <?php echo esc_attr($settings['body-bg-color'])?>!important;
     62  }
     63  #wppm_popup_body label{
     64    color:<?php echo esc_attr( $settings['body-label-color'])?>;
     65  }
     66  #wppm_popup_body input{
     67    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     68  }
     69  #wppm_popup_body select{
     70    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     71  }
     72  #wppm_popup_body span {
     73    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     74  }
     75  #wppm_popup_body .select2-results__options {
     76    color:<?php echo esc_attr( $settings['body-text-color'])?>;
     77  }
     78</style>
    5379<!-- Pop-up snippet end -->
    5480<?php
     
    134160        dataform.append("sort_by", 'task_name');
    135161        dataform.append("order", 'ASC');
     162        dataform.append("wppm_proj_filter",0);
    136163        <?php echo do_action('wppm_tl_reset_filter_dataform');?>
    137164        jQuery.ajax( {
     
    261288        dataform.append("sort_by", "task_name");
    262289        dataform.append("order", "ASC");
     290        dataform.append("wppm_proj_filter","0");
    263291        jQuery.ajax( {
    264292          url: wppm_admin.ajax_url,
  • taskbuilder/trunk/includes/replace_macro.php

    r2611331 r3079882  
    88$project_id = intval(sanitize_text_field($project_id));
    99$wppm_project_data = $wppmfunction->get_project($project_id);
     10$wppm_proj_comment = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}wppm_project_comment where proj_id='".$project_id."' ORDER BY id DESC LIMIT 1;");
     11$attachments = array();
     12$auth_id  = $wppmfunction->get_project_meta($project_id,'project_auth_code',true);
     13if(!empty($wppm_proj_comment)){
     14    $attachments = explode(',',$wppm_proj_comment->attachment_ids);
     15}
    1016preg_match_all("/{[^}]*}/" ,$str,$matches);
    1117$matches = array_unique($matches[0]);
     18$flag =false;
    1219foreach($matches as $match){
    1320    switch($match){
     
    3441        // Project Category
    3542        case '{project_category}':
    36             $str = preg_replace('/{project_category}/', $this->get_project_category_name(sanitize_text_field($wppm_project_data['cat_id'])), $str);
     43            if(!empty($wppm_project_data['cat_id'])){
     44                $str = preg_replace('/{project_category}/', $this->get_project_category_name(sanitize_text_field($wppm_project_data['cat_id'])), $str);
     45            }else{
     46                $str = "";
     47            }
     48
    3749            break;
    3850        // Project Name
     
    6274            $str = preg_replace('/{date_created}/', get_date_from_gmt(sanitize_text_field($wppm_project_data['date_created'] )), $str);
    6375            break;
     76            //Last comment user name
     77        case '{last_proj_comment_user_name}':
     78            $str = preg_replace('/{last_proj_comment_user_name}/', $this->get_last_comment_proj_user_name($project_id), $str);
     79        break;
     80        //Last comment body
     81        case '{proj_comment_body}':
     82            $flag= true;
     83            $str = preg_replace('/{proj_comment_body}/', $this->get_proj_comment_body($project_id), $str);
     84        break;
     85
    6486        // Project Description
    6587        case '{project_description}':
    66         $str = preg_replace('/{project_description}/', sanitize_text_field($wppm_project_data['description']), $str);
    67 
    68        
     88        $str = preg_replace('/{project_description}/', sanitize_text_field($wppm_project_data['description']), $str);   
     89    }
     90}
     91if($flag == true){
     92    if(!empty($attachments)){
     93        foreach($attachments as $attach_id){
     94            $upload_dir   = wp_upload_dir();
     95            $attachment = $wpdb->get_row("select * from {$wpdb->prefix}wppm_attachments where id='".$attach_id."'");
     96            if(!empty($attachment)){
     97                $updated_time = sanitize_text_field($attachment->date_created);
     98                $time  = strtotime(sanitize_text_field($updated_time));
     99                $month = date("m",$time);
     100                $year  = date("Y",$time);
     101                $findStr = ".txt";
     102                $attachment_name = preg_replace('/' . $findStr . '/', "", sanitize_file_name($attachment->name), 1);
     103                $file_url = $upload_dir['basedir'] . '/wppm/'.'/'.$year.'/'.$month.'/'. $attachment_name;
     104                $download_url = home_url('/').'?wppm_attachment='.sanitize_text_field($attachment->id).'&pid='.sanitize_text_field($project_id).'&pac='.sanitize_text_field($auth_id);
     105                $attach_url[] = '<a style="text-decoration:none;" href="'.$download_url.'" target="_blank">'.sanitize_file_name($attachment->file_name).'</a>';
     106            }else{
     107                $attach_url= array();
     108            }
     109        }
     110        $str = $str.implode("<br>",$attach_url);
    69111    }
    70112}
  • taskbuilder/trunk/includes/wppm-install.php

    r3035644 r3079882  
    141141        );";
    142142        dbDelta( $sql );
     143        $sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_project_comment (
     144            id integer NOT NULL AUTO_INCREMENT,
     145            proj_id integer,
     146            body LONGTEXT NULL DEFAULT NULL,
     147            attachment_ids TINYTEXT NULL DEFAULT NULL,
     148            create_time datetime,
     149            created_by integer,
     150            PRIMARY KEY  (id)
     151        );";
     152        dbDelta( $sql );
    143153        $sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_attachments (
    144154            id BIGINT NOT NULL AUTO_INCREMENT,
     
    273283            update_option('wppm_task_time',1);
    274284        }
     285        if($installed_version < '3.0.0'){
     286            $wppm_email_notificatins = get_option('wppm_email_notification');
     287            if(!empty($wppm_email_notificatins) && !isset($wppm_email_notificatins[8])){
     288                $wppm_email_notificatins[8] = array(
     289                    'type'=>'new_proj_discussion',
     290                    'subject'=>__('[{project_name}] {last_proj_comment_user_name} started new discussion:','taskbuilder'),
     291                    'body'=>__('<p><strong>{last_proj_comment_user_name}</strong> wrote:</p> <p>{proj_comment_body}</p>','taskbuilder'),
     292                    'recipients'=>array(1,2)
     293                );
     294                update_option('wppm_email_notification',$wppm_email_notificatins);
     295            }
     296            update_option(
     297                'wppm-ap-project-list',
     298                array(
     299                    'list-header-background-color'     => '#304FFE',
     300                    'list-header-text-color'           => '#fff',
     301                    'list-item-odd-background-color'   => '#fff',
     302                    'list-item-odd-text-color'         => '#2C3E50',
     303                    'list-item-even-background-color'  => '#F2F2F2',
     304                    'list-item-even-text-color'        => '#2C3E50',
     305                    'list-item-hover-background-color' => '#F5F5F5',
     306                    'list-item-hover-text-color'       => '#2C3E50'
     307                )
     308            );
     309            update_option(
     310                'wppm-ap-task-list',
     311                array(
     312                    'list-header-button-background-color'=>'#0052CC',
     313                    'list-header-button-hover-color'    =>'#0065ff',
     314                    'list-header-button-text-color'     =>'#fff',
     315                    'list-header-background-color'     => '#304FFE',
     316                    'list-header-text-color'           => '#fff',
     317                    'list-item-odd-background-color'   => '#fff',
     318                    'list-item-odd-text-color'         => '#2C3E50',
     319                    'list-item-even-background-color'  => '#F2F2F2',
     320                    'list-item-even-text-color'        => '#2C3E50',
     321                    'list-item-hover-background-color' => '#F5F5F5',
     322                    'list-item-hover-text-color'       => '#2C3E50',
     323                )
     324            );
     325            update_option(
     326                'wppm-ap-individual-project',
     327                array(
     328                    'menu-button-bg-color'      =>'#0052CC',
     329                    'menu-button-hover-color'   =>'#0065ff',
     330                    'menu-button-text-color'    =>'#fff',
     331                    'comment-primary-color'      => '#000000',
     332                    'comment-secondary-color'    => '#4e4e4e',
     333                    'comment-date-color'         => '#a8aeb5',
     334                    'comment-date-hover-color'   => '#000000',
     335                    'comment-send-btn-bg-color'  => '#5067c5',
     336                    'comment-send-btn-color'  =>    '#ffffff',
     337                    'widget-header-bg-color'   => '#ffffff',
     338                    'widget-header-text-color' => '#2C3E50',
     339                    'widget-body-bg-color'     => '#ffffff',
     340                    'widget-body-label-color'  => '#9c9c9c',
     341                    'widget-body-text-color'   => '#2C3E50',
     342                )
     343            );
     344            update_option(
     345                'wppm-ap-individual-task',
     346                array(
     347                    'comment-primary-color'      => '#000000',
     348                    'comment-secondary-color'    => '#4e4e4e',
     349                    'comment-date-color'         => '#a8aeb5',
     350                    'comment-date-hover-color'   => '#000000',
     351                    'comment-send-btn-bg-color'  => '#5067c5',
     352                    'comment-send-btn-color'  =>    '#ffffff',
     353                    'widget-header-bg-color'   => '#ffffff',
     354                    'widget-header-text-color' => '#2C3E50',
     355                    'widget-body-bg-color'     => '#ffffff',
     356                    'widget-body-label-color'  => '#9c9c9c',
     357                    'widget-body-text-color'   => '#2C3E50',
     358                )
     359            );
     360            update_option(
     361                'wppm-ap-modal',
     362                array(
     363                    'header-bg-color'   => '#ffffff',
     364                    'header-text-color' => '#3c434a',
     365                    'body-bg-color'     => '#fff',
     366                    'body-label-color'  => '#3c434a',
     367                    'body-text-color'   => '#555',
     368                    'footer-bg-color'   => '#F6F6F6',
     369                    'action-btn-bg-color' =>'#306EFF',
     370                    'action-btn-text-color'=>'#fff',
     371                    'z-index'           => 900000000,
     372                )
     373            );
     374            update_option(
     375                'wppm-ap-grid-view',
     376                array(
     377                    'menu-button-bg-color'      =>'#0052CC',
     378                    'menu-button-hover-color'   =>'#0065ff',
     379                    'menu-button-text-color'    =>'#fff',
     380                    'grid-background-color'     => '#fff',
     381                    'grid-header-text-color'    => '#2C3E50'
     382                )
     383            );
     384            update_option(
     385                'wppm-ap-settings',
     386                array(
     387                    'tab-background-color'     => '#0052CC',
     388                    'tab-text-color'    => '#fff',
     389                    'add-new-button-bg-color'   =>'#0052CC',
     390                    'add-new-button-text-color' =>'#fff',
     391                    'add-new-button-hover-color'=>'#0065ff',
     392                    'save-changes-button-bg-color'=>'#306EFF',
     393                    'save-changes-button-text-color'=>'#fff'
     394                )
     395            );
     396        }
    275397        // update wppm_version option to plugin version
    276398        update_option( 'wppm_version', WPPM_VERSION );
  • taskbuilder/trunk/readme.txt

    r3042496 r3079882  
    44Tags: project,task,project management,task management,project manager,wordpress project management,task manager,CRM,Kanban board,management,bug tracker,issue tracker
    55Requires at least: 4.4
    6 Tested up to: 6.4.3
    7 Stable tag: 2.0.9
     6Tested up to: 6.5.2
     7Stable tag: 3.0.0
    88License: GPL v3
    99
     
    3838- **Custom Priorities**: You can create unlimited custom priorities for tasks.
    3939- **Custom Categories**: You can create unlimited custom categories for projects.
     40- **Appearance Setting**: Customizable Appearance to match up with your theme.
    4041 
    4142
     
    9899
    99100== Changelog ==
     101= V 3.0.0(May 1,2024) =
     102* Compatible with WordPress v6.5.2.
     103* New: Appearance Setting(Customizable Appearance to match up with your theme). You can set setting in (Projects > Settings > Appearance).
     104* New: Project Comment. You can add comment in project like task.
     105* New: Project filter in task list(Task by project).
     106* New: Project start & end date clickable in open project.
     107* New: Task start & end date clickable in open Task.
     108* New: Project name added on kanban board.
     109* Fix: Php warning & notices.
     110* Fix: Some security fixes.
     111* Fix(Pro feature): Warning in Gantt Chart add-on.
     112* Fix(Pro feature): Public project's task not showing on calendar for co-worker.
     113
    100114= V 2.0.9(Feb 28,2024) =
    101115* New: Hooks added.
  • taskbuilder/trunk/taskbuilder.php

    r3042496 r3079882  
    44 * Plugin URI: https://wordpress.org/plugins/taskbuilder/
    55 * Description: Wordpress Project & Task Management plugin. Easy to keep track of projects & tasks!
    6  * Version: 2.0.9
     6 * Version: 3.0.0
    77 * Author: Taskbuilder Team
    88 * Author URI: https://taskbuilder.net/
    99 * Requires at least: 4.4
    10  * Tested up to: 6.4.3
     10 * Tested up to: 6.5.2
    1111 * Text Domain: taskbuilder
    1212 * Domain Path: /lang
     
    2020 
    2121  final class WP_Taskbuilder {
    22     public $version    = '2.0.9';
     22    public $version    = '3.0.0';
    2323    public function __construct() {
    2424      // define global constants
     
    9090            }
    9191      }
     92      if( isset($_REQUEST['wppm_attachment']) && isset($_REQUEST['pid']) && isset($_REQUEST['pac'])){
     93        $attach_id = intval(sanitize_text_field($_REQUEST['wppm_attachment']));
     94        $auth_code = (sanitize_text_field($_REQUEST['pac']));
     95        $proj_id = intval(sanitize_text_field($_REQUEST['pid']));
     96        $proj_auth_code = $wppmfunction->get_project_meta($proj_id,'project_auth_code',true);
     97        $proj_auth_code = sanitize_text_field($proj_auth_code);
     98        if($proj_auth_code == $auth_code){
     99          $this->wppm_file_download($attach_id);
     100            }
     101      }
    92102    }
    93103
Note: See TracChangeset for help on using the changeset viewer.