Changeset 2435596
- Timestamp:
- 12/09/2020 03:04:20 PM (5 years ago)
- Location:
- upstream/trunk
- Files:
-
- 12 edited
-
includes.php (modified) (1 diff)
-
includes/admin/class-up-admin.php (modified) (1 diff)
-
includes/admin/metaboxes/class-up-metaboxes-clients.php (modified) (2 diffs)
-
includes/class-up-report.php (modified) (5 diffs)
-
includes/frontend/up-template-functions.php (modified) (1 diff)
-
includes/model/UpStream_Model_File.php (modified) (5 diffs)
-
includes/model/UpStream_Model_Project.php (modified) (4 diffs)
-
includes/up-general-functions.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
templates/assets/css/upstream.css (modified) (1 diff)
-
templates/report-parameters/section.php (modified) (2 diffs)
-
upstream.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
upstream/trunk/includes.php
r2418972 r2435596 1 1 <?php 2 define('UPSTREAM_VERSION', '1.3 8.4');2 define('UPSTREAM_VERSION', '1.39.0'); 3 3 4 4 global $upstream_addon_requirements; -
upstream/trunk/includes/admin/class-up-admin.php
r2417454 r2435596 767 767 return "$classes upstream"; 768 768 } 769 770 return $classes; 769 771 } 770 772 -
upstream/trunk/includes/admin/metaboxes/class-up-metaboxes-clients.php
r2417454 r2435596 243 243 <tr data-id="<?php echo $user->id; ?>"> 244 244 <td> 245 <?php echo esc_html($user->name); ?> 245 <a title="<?php echo sprintf(__("Managing %s's Permissions"), $user->name); ?>" 246 href="#TB_inline?width=600&height=425&inlineId=modal-user-permissions" 247 class="thickbox"><?php echo esc_html($user->name); ?></a> 246 248 </td> 247 249 <td><?php echo esc_html($user->email); ?></td> … … 814 816 public static function updateUserPermissions() 815 817 { 818 header('Content-Type: application/json'); 819 820 $response = [ 821 'success' => false, 822 'err' => null, 823 ]; 824 825 try { 826 if ( ! upstream_admin_permissions('edit_clients')) { 827 throw new \Exception(__("You're not allowed to do this.", 'upstream')); 828 } 829 830 if (empty($_POST) || ! isset($_POST['client'])) { 831 throw new \Exception(__('Invalid request.', 'upstream')); 832 } 833 834 $client_id = (int)$_POST['client']; 835 if ($client_id <= 0) { 836 throw new \Exception(__('Invalid Client ID.', 'upstream')); 837 } 838 839 $client_user_id = isset($_POST['user']) ? (int)$_POST['user'] : 0; 840 if ($client_user_id <= 0) { 841 throw new \Exception(__('Invalid User ID.', 'upstream')); 842 } 843 844 if ( ! upstream_do_client_user_belongs_to_client($client_user_id, $client_id)) { 845 throw new \Exception(__("This Client User is not associated with this Client.", 'upstream')); 846 } 847 848 $clientUser = new \WP_User($client_user_id); 849 if (array_search('upstream_client_user', $clientUser->roles) === false) { 850 throw new \Exception(__("This user doesn't seem to be a valid Client User.", 'upstream')); 851 } 852 853 if (isset($_POST['permissions']) && ! empty($_POST['permissions'])) { 854 855 if (is_array($_POST['permissions'])) { 856 $newPermissions = \array_map( 'sanitize_text_field', $_POST['permissions'] ); 857 } else { 858 $newPermissions = [sanitize_text_field($_POST['permissions'])]; 859 } 860 861 $permissions = upstream_get_client_users_permissions(); 862 863 $deniedPermissions = (array)array_diff(array_keys($permissions), $newPermissions); 864 foreach ($deniedPermissions as $permissionKey) { 865 /* Make sure this is a valid permission. */ 866 if (isset($permissions[$permissionKey])) { 867 $clientUser->add_cap($permissionKey, false); 868 } 869 } 870 871 foreach ($newPermissions as $permissionKey) { 872 /* Make sure this is a valid permission. */ 873 if (isset($permissions[$permissionKey])) { 874 $clientUser->add_cap($permissionKey, true); 875 } 876 } 877 } 878 879 $response['success'] = true; 880 } catch (\Exception $e) { 881 $response['err'] = $e->getMessage(); 882 } 883 884 echo wp_json_encode($response); 885 816 886 wp_die(); 817 887 } 888 818 889 } -
upstream/trunk/includes/class-up-report.php
r2410501 r2435596 100 100 return false; 101 101 102 return ( count($ids) == 0 ||in_array($item->id, $ids));102 return (in_array($item->id, $ids)); 103 103 }; 104 104 … … 124 124 return false; 125 125 126 return ( count($ids) == 0 ||in_array($item->id, $ids));126 return (in_array($item->id, $ids)); 127 127 128 128 }; … … 149 149 return false; 150 150 151 return ( count($ids) == 0 ||in_array($item->id, $ids));151 return (in_array($item->id, $ids)); 152 152 153 153 }; … … 175 175 return false; 176 176 177 return ( count($ids) == 0 ||in_array($item->id, $ids));177 return (in_array($item->id, $ids)); 178 178 179 179 }; … … 200 200 return false; 201 201 202 return ( count($ids) == 0 ||in_array($item->id, $ids));202 return (in_array($item->id, $ids)); 203 203 204 204 }; -
upstream/trunk/includes/frontend/up-template-functions.php
r2417454 r2435596 53 53 if (upstream_show_users_name()) { 54 54 if ($isAfterFirstItem) { 55 echo ', ';55 echo ', '; 56 56 } 57 57 -
upstream/trunk/includes/model/UpStream_Model_File.php
r2385265 r2435596 12 12 13 13 protected $upfsFileId = null; 14 15 protected $createdAt = 0; 14 16 15 17 protected $reminders = []; … … 33 35 { 34 36 parent::loadFromArray($item_metadata); 37 38 $this->createdAt = !empty($item_metadata['created_at']) ? $item_metadata['created_at'] : null; 35 39 36 40 if (upstream_filesytem_enabled() && isset($item_metadata['file']) && upstream_upfs_info($item_metadata['file'])) { … … 82 86 } 83 87 88 if ($this->createdAt >= 0) $item_metadata['created_at'] = $this->createdAt; 84 89 $item_metadata['reminders'] = []; 85 90 … … 130 135 return ''; 131 136 137 case 'createdAt': 138 if ($this->createdAt > 0) 139 return self::timestampToYMD($this->createdAt); 140 else 141 return ''; 142 132 143 default: 133 144 return parent::__get($property); … … 163 174 164 175 $fields['fileId'] = [ 'type' => 'file', 'title' => __('File'), 'search' => false, 'display' => true ]; 176 $fields['createdAt'] = [ 'type' => 'date', 'title' => __('Upload Date'), 'search' => true, 'display' => true ]; 165 177 166 178 $fields = self::customFields($fields, UPSTREAM_ITEM_TYPE_FILE); -
upstream/trunk/includes/model/UpStream_Model_Project.php
r2354305 r2435596 21 21 protected $clientUserIds = []; 22 22 23 protected $memberUserIds = []; 24 23 25 protected $clientId = 0; 24 26 … … 40 42 'clientUserIds' => function ($m) { 41 43 $arr = isset($m['_upstream_project_client_users'][0]) ? unserialize($m['_upstream_project_client_users'][0]) : null; 44 $arr = is_array($arr) ? $arr : []; 45 $arr = array_filter($arr); 46 return $arr; 47 }, 48 'memberUserIds' => function ($m) { 49 $arr = isset($m['_upstream_project_members'][0]) ? unserialize($m['_upstream_project_members'][0]) : null; 42 50 $arr = is_array($arr) ? $arr : []; 43 51 $arr = array_filter($arr); … … 319 327 case 'clientId': 320 328 case 'clientUserIds': 329 case 'memberUserIds': 321 330 case 'startDate': 322 331 case 'endDate': … … 456 465 $fields['statusCode'] = [ 'type' => 'select', 'title' => __('Status'), 'search' => true, 'display' => true, 'options_cb' => 'UpStream_Model_Project::getStatuses' ]; 457 466 $fields['categoryIds'] = [ 'type' => 'select', 'title' => __('Categories'), 'search' => true, 'display' => true, 'options_cb' => 'UpStream_Model_Project::getCategories', 'is_array' => 'true' ]; 467 $fields['clientUserIds'] = [ 'type' => 'user_id', 'is_array' => true, 'title' => __('Selected Client Users'), 'search' => true, 'display' => true ]; 468 $fields['memberUserIds'] = [ 'type' => 'user_id', 'is_array' => true, 'title' => __('Members'), 'search' => true, 'display' => true ]; 458 469 $fields['startDate'] = [ 'type' => 'date', 'title' => __('Start Date'), 'search' => true, 'display' => true ]; 459 470 $fields['endDate'] = [ 'type' => 'date', 'title' => __('End Date'), 'search' => true, 'display' => true ]; -
upstream/trunk/includes/up-general-functions.php
r2417454 r2435596 95 95 function upstream_filesystem_max_size() 96 96 { 97 return 10000000 ;97 return 100000000; 98 98 } 99 99 -
upstream/trunk/readme.txt
r2418972 r2435596 3 3 Tags: project, manage, management, project management, project manager, wordpress project management, crm, client, client manager, tasks, issue tracker, bug tracker, task manager 4 4 Requires at least: 5.2 5 Tested up to: 5. 55 Tested up to: 5.6 6 6 Requires PHP: 5.6.20 7 Stable tag: 1.3 8.47 Stable tag: 1.39.0 8 8 License: GPL-3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 142 142 The format is based on [Keep a Changelog](http://keepachangelog.com) 143 143 and this project adheres to [Semantic Versioning](http://semver.org). 144 145 = [1.39.0] - 2020-12-07 = 146 * Made report changes 147 * Fixed LTR display bug 148 * Added back permissions edit box removed in previous release 144 149 145 150 = [1.38.4] - 2020-11-15 = -
upstream/trunk/templates/assets/css/upstream.css
r2315471 r2435596 512 512 margin-bottom: 50px; 513 513 } 514 515 .rtl.nav-md .container.body .right_col { 516 margin-left: 0 !important; 517 margin-right: 230px !important; 518 } 519 520 .rtl .main_container .top_nav { 521 display:none; 522 } 523 524 .rtl .panel-body div:first-child { 525 margin-right:20px; 526 } 527 528 .rtl .menu_section > ul.side-menu { 529 padding:0; 530 } 531 532 rtl.nav-sm .container.body .right_col { 533 margin-left:0; 534 } 535 536 .rtl.nav-sm ul.nav.child_menu { 537 left: 0; 538 position: relative; 539 width: auto; 540 z-index: 4000; 541 background: inherit; 542 padding: 0; 543 margin: 0; 544 } -
upstream/trunk/templates/report-parameters/section.php
r2417454 r2435596 14 14 $typeInfo = ""; 15 15 16 $show = true; 17 16 18 switch ($type) { 17 19 case 'project': … … 22 24 $typeInfo = upstream_milestone_label(); 23 25 $fields = UpStream_Model_Milestone::fields(); 26 $show = !upstream_disable_milestones(); 24 27 break; 25 28 case 'task': 26 29 $typeInfo = upstream_task_label(); 27 30 $fields = UpStream_Model_Task::fields(); 31 $show = !upstream_disable_tasks(); 28 32 break; 29 33 case 'bug': 30 34 $typeInfo = upstream_bug_label(); 31 35 $fields = UpStream_Model_Bug::fields(); 36 $show = !upstream_disable_bugs(); 32 37 break; 33 38 case 'file': 34 39 $typeInfo = upstream_file_label(); 35 40 $fields = UpStream_Model_File::fields(); 41 $show = !upstream_disable_files(); 36 42 break; 37 43 } 38 44 39 ?> 40 <div class="col-md-12 col-sm-12 col-xs-12"> 41 <div class="x_panel" data-section="report-parameters-<?php echo $sectionId; ?>"> 42 <div class="x_title"> 43 <h2> 44 <?php echo esc_html($typeInfo . __(' Filters')); ?> 45 </h2> 46 <div class="clearfix"></div> 47 </div> 48 <div class="x_content"> 45 if ($show) { 46 ?> 47 <div class="col-md-12 col-sm-12 col-xs-12"> 48 <div class="x_panel" data-section="report-parameters-<?php echo $sectionId; ?>"> 49 <div class="x_title"> 50 <h2> 51 <?php echo esc_html($typeInfo . __(' Filters')); ?> 52 </h2> 53 <div class="clearfix"></div> 54 </div> 55 <div class="x_content"> 49 56 50 <div class="row">57 <div class="row"> 51 58 52 <div class="col-lg-12 col-xs-12"> 53 <div class="form-group"> 54 <label><?php esc_html_e('Name') ?></label> 55 <select class="form-control" multiple name="upstream_report__<?php echo $sectionId ?>_id[]"> 56 <?php 57 foreach ($projects as $project): 58 $user = upstream_user_data(); 59 if (upstream_user_can_access_project(isset($user['id']) ? $user['id'] : 0, $project->id)): 59 <div class="col-lg-12 col-xs-12"> 60 <div class="form-group"> 61 <label><?php esc_html_e('Name') ?></label> 62 <select class="form-control" multiple name="upstream_report__<?php echo $sectionId ?>_id[]"> 63 <?php 64 foreach ($projects as $project): 65 $user = upstream_user_data(); 66 if (upstream_user_can_access_project(isset($user['id']) ? $user['id'] : 0, $project->id)): 67 ?> 68 <?php if ($type == 'project'): ?> 69 <option selected value="<?php echo $project->id ?>"><?php esc_html_e($project->title); ?></option> 70 <?php else: ?> 71 <option disabled 72 style="color:#DDDDDD;font-style: italic"><?php esc_html_e($project->title); ?></option> 73 <?php endif; ?> 74 75 <?php 76 if ($type == 'milestone' || $type == 'bug' || $type == 'file' || $type == 'task') { 77 78 $children = []; 79 if ($type == 'bug') $children = &$project->bugs(); 80 elseif ($type == 'file') $children = &$project->files(); 81 elseif ($type == 'task') $children = &$project->tasks(); 82 elseif ($type == 'milestone') $children = $project->findMilestones(); 83 84 foreach ($children as $child) { 85 if (upstream_override_access_object(true, $type, $child->id, UPSTREAM_ITEM_TYPE_PROJECT, $project->id, UPSTREAM_PERMISSIONS_ACTION_VIEW)) { 86 ?> 87 <option selected value="<?php echo esc_attr($child->id) ?>"> 88  <?php esc_html_e($child->title); ?></option> 89 <?php 90 } 91 } 92 93 } 94 ?> 95 <?php 96 endif; 97 endforeach; 60 98 ?> 61 <?php if ($type == 'project'): ?> 62 <option value="<?php echo $project->id ?>"><?php esc_html_e($project->title); ?></option> 63 <?php else: ?> 64 <option disabled style="color:#DDDDDD;font-style: italic"><?php esc_html_e($project->title); ?></option> 65 <?php endif; ?> 99 </select> 100 <a onclick="jQuery('[name=\'upstream_report__<?php print $sectionId; ?>_id[]\'] option').prop('selected', true)">Select 101 all</a> | <a 102 onclick="jQuery('[name=\'upstream_report__<?php print $sectionId; ?>_id[]\'] option').prop('selected', false)">Select 103 none</a> 104 </div> 66 105 67 <?php 68 if ($type == 'milestone' || $type == 'bug' || $type == 'file' || $type == 'task') { 69 70 $children = []; 71 if ($type == 'bug') $children = &$project->bugs(); 72 elseif ($type == 'file') $children = &$project->files(); 73 elseif ($type == 'task') $children = &$project->tasks(); 74 elseif ($type == 'milestone') $children = $project->findMilestones(); 75 76 foreach ($children as $child) { 77 if (upstream_override_access_object(true, $type, $child->id, UPSTREAM_ITEM_TYPE_PROJECT, $project->id, UPSTREAM_PERMISSIONS_ACTION_VIEW)) { 78 ?> 79 <option value="<?php echo esc_attr($child->id) ?>"> 80  <?php esc_html_e($child->title); ?></option> 81 <?php 82 } 83 } 84 85 } 86 ?> 87 <?php 88 endif; 89 endforeach; 90 ?> 91 </select> 92 <a onclick="jQuery('[name=\'upstream_report__<?php print $sectionId; ?>_id[]\'] option').prop('selected', true)">Select all</a> | <a onclick="jQuery('[name=\'upstream_report__<?php print $sectionId; ?>_id[]\'] option').prop('selected', false)">Select none</a> 106 <?php include('search-fields.php'); ?> 93 107 </div> 94 95 <?php include('search-fields.php'); ?>96 108 </div> 97 109 </div> 98 110 </div> 99 111 </div> 100 </div> 112 <?php 113 } 114 ?> -
upstream/trunk/upstream.php
r2418972 r2435596 5 5 * Author: UpStream 6 6 * Author URI: https://upstreamplugin.com 7 * Version: 1.3 8.47 * Version: 1.39.0 8 8 * Text Domain: upstream 9 9 * Domain Path: /languages
Note: See TracChangeset
for help on using the changeset viewer.