Changeset 2157599
- Timestamp:
- 09/17/2019 03:17:12 AM (6 years ago)
- Location:
- wp-issues-crm
- Files:
-
- 10 edited
- 3 copied
-
tags/4.5.3 (copied) (copied from wp-issues-crm/trunk)
-
tags/4.5.3/css/dashboard.css (modified) (1 diff)
-
tags/4.5.3/js/ajax.js (modified) (1 diff)
-
tags/4.5.3/js/dashboard.js (modified) (6 diffs)
-
tags/4.5.3/php/entity/class-wic-entity-dashboard.php (modified) (17 diffs)
-
tags/4.5.3/readme.txt (copied) (copied from wp-issues-crm/trunk/readme.txt) (2 diffs)
-
tags/4.5.3/wp-issues-crm.php (copied) (copied from wp-issues-crm/trunk/wp-issues-crm.php) (3 diffs)
-
trunk/css/dashboard.css (modified) (1 diff)
-
trunk/js/ajax.js (modified) (1 diff)
-
trunk/js/dashboard.js (modified) (6 diffs)
-
trunk/php/entity/class-wic-entity-dashboard.php (modified) (17 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-issues-crm.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-issues-crm/tags/4.5.3/css/dashboard.css
r2152005 r2157599 164 164 } 165 165 166 /* maintain always open flexible height for dashboard summary */167 .wic-dashboard-flex .wic-inner-dashboard,168 .wic-dashboard-flex.wic-dashboard-tall .wic-inner-dashboard {169 height: auto;170 margin-bottom: 30px;171 max-height: calc( 100vh - 540px) ;172 }173 .wic-dashboard-flex .wic-inner-dashboard ul.wic-post-list,174 .wic-dashboard-flex.wic-dashboard-tall .wic-inner-dashboard ul.wic-post-list {175 height: auto ;176 max-height: calc( 100vh - 540px) ;177 }178 179 180 166 .dashboard-not-found { 181 167 margin: 20px; -
wp-issues-crm/tags/4.5.3/js/ajax.js
r2069459 r2157599 87 87 } 88 88 89 // note: this function invoked directly on loadDashboardPanel in dashboard.js 89 90 wpIssuesCRM.saveState = function ( currentEntity, currentAction ) { 90 91 var valuesObject = {}; -
wp-issues-crm/tags/4.5.3/js/dashboard.js
r2145245 r2157599 44 44 defaultDate: +0 45 45 }); 46 $( "#dashboard\\[end\\]\\[date_range\\]" ). datepicker( "setDate", "+0" )47 $( "#dashboard\\[start\\]\\[date_range\\]" ). datepicker( "setDate", "-30" )48 $( "#dashboard\\[end_t\\]\\[date_range\\]" ). datepicker( "setDate", "+0" )49 $( "#dashboard\\[start_t\\]\\[date_range\\]" ). datepicker( "setDate", "-30" )46 $( "#dashboard\\[end\\]\\[date_range\\]" ).attr( "placeholder", "Before?" ) 47 $( "#dashboard\\[start\\]\\[date_range\\]" ).attr( "placeholder", "After?" ) 48 $( "#dashboard\\[end_t\\]\\[date_range\\]" ).attr( "placeholder", "Before?" ) 49 $( "#dashboard\\[start_t\\]\\[date_range\\]" ).attr( "placeholder", "After?" ) 50 50 $( "#dashboard\\[case_review_date\\]\\[date_range\\]" ).attr( "placeholder", "Due before?" ) 51 51 $( "#dashboard\\[review_date\\]\\[date_range\\]" ).attr( "placeholder", "Due before?" ) 52 52 53 54 $( ".wic-dashboard " ).each( function () {53 // only open what has been set as tall 54 $( ".wic-dashboard.wic-dashboard-tall" ).each( function () { 55 55 wpIssuesCRM.loadDashboardPanel ( $( this ).attr("id") ); 56 56 }); … … 61 61 if ( currentTile.hasClass("wic-dashboard-tall") ) { 62 62 currentTile.removeClass( "wic-dashboard-tall" ); 63 wpIssuesCRM.saveDashboardLayout(); 63 64 } else { 64 65 $( ".wic-dashboard").removeClass ( "wic-dashboard-tall" ); 65 66 currentTile.addClass ( "wic-dashboard-tall" ); 67 wpIssuesCRM.loadDashboardPanel ( currentTile.attr("id") ); 66 68 } 67 wpIssuesCRM.saveDashboardLayout();68 69 }); 69 70 … … 74 75 $( ".wic-dashboard").removeClass ( "wic-dashboard-tall" ); 75 76 currentTile.addClass ( "wic-dashboard-tall" ); 76 wpIssuesCRM.saveDashboardLayout(); 77 wpIssuesCRM.loadDashboardPanel ( currentTile.attr("id") ); 78 // dashboard layout will be saved on load 77 79 } 78 80 }); … … 84 86 $( ".wic-dashboard").removeClass ( "wic-dashboard-tall" ); 85 87 currentTile.addClass ( "wic-dashboard-tall" ); 86 wpIssuesCRM.saveDashboardLayout(); 88 wpIssuesCRM.loadDashboardPanel ( currentTile.attr("id") ); 89 // dashboard layout will be saved on load 87 90 } 88 91 }); … … 106 109 } 107 110 111 // includes same action as saveDashboardLayout on server side 108 112 wpIssuesCRM.loadDashboardPanel = function ( panel ) { 109 var varPreID; 110 var submittedData = ''; 111 if ( 'dashboard_activity' == panel ) { 112 var includedTypes=[]; 113 $( "#filter-activities-menu .wic-input-checked" ).each ( function () { 114 if ( $( this ).prop("checked") ) { 115 varPreID = $(this).attr("id").substr(14); 116 includedTypes.push ( varPreID.substr(0, varPreID.length -1 ) ); 117 } 118 }); 119 submittedData = { 120 start: $( "#dashboard\\[start\\]\\[date_range\\]" ).val(), 121 end: $( "#dashboard\\[end\\]\\[date_range\\]" ).val(), 122 included: includedTypes 123 } 124 } else if ( 'dashboard_activity_type' == panel ) { 125 submittedData = { 126 start: $( "#dashboard\\[start_t\\]\\[date_range\\]" ).val(), 127 end: $( "#dashboard\\[end_t\\]\\[date_range\\]" ).val(), 128 } 129 } else if ( 'dashboard_cases' == panel ) { 130 submittedData = { 131 case_assigned: $( "#dashboard\\[case_assigned\\]\\[case_assigned\\]" ).val(), 132 case_review_date: $( "#dashboard\\[case_review_date\\]\\[date_range\\]" ).val(), 133 case_status: $( "#dashboard\\[case_status\\]\\[case_status\\]" ).val(), 134 } 135 } else if ( 'dashboard_issues' == panel ) { 136 submittedData = { 137 issue_staff: $( "#dashboard\\[issue_staff\\]\\[issue_staff\\]" ).val(), 138 review_date: $( "#dashboard\\[review_date\\]\\[date_range\\]" ).val(), 139 follow_up_status: $( "#dashboard\\[follow_up_status\\]\\[follow_up_status\\]" ).val(), 140 } 141 } 113 wpIssuesCRM.ajaxPost( 'dashboard', panel, '', assembleDashboardStatus(), function( response ) { 114 $( "#" + panel ).children( ".wic-inner-dashboard").html( response ); 142 115 143 wpIssuesCRM.ajaxPost( 'dashboard', panel, '', submittedData, function( response ) {144 $( "#" + panel ).children( ".wic-inner-dashboard").html( response );145 116 // special initialization terms for particular panels 146 117 if ( 'dashboard_searches' == panel ) { 147 118 wpIssuesCRM.initializeSearchLogTooltips(); 148 119 } 120 121 // save state to allow return to same panel 122 wpIssuesCRM.saveState ( 'dashboard', 'dashboard' ); 149 123 150 124 }); … … 152 126 153 127 wpIssuesCRM.saveDashboardLayout = function () { 154 var varWide = []; 128 wpIssuesCRM.ajaxPost( 'dashboard', 'save_dashboard_preferences', '', assembleDashboardStatus() , function( response ) { 129 }); 130 } 131 132 assembleDashboardStatus = function() { 133 134 // set open item 155 135 var varTall = []; 156 136 $( '.wic-dashboard-tall' ).each ( function () { 157 137 varTall.push ( $( this ).attr("id") ); 158 138 }); 139 140 // set sort order 141 var varSort = $( "#dashboard-sortables" ).sortable( "toArray"); 142 143 // set activity vars 144 var varPreID; 145 var includedTypes=[]; 146 $( "#filter-activities-menu .wic-input-checked" ).each ( function () { 147 if ( $( this ).prop("checked") ) { 148 varPreID = $(this).attr("id").substr(14); 149 includedTypes.push ( varPreID.substr(0, varPreID.length -1 ) ); 150 } 151 }); 152 var activityVars = { 153 start: $( "#dashboard\\[start\\]\\[date_range\\]" ).val(), 154 end: $( "#dashboard\\[end\\]\\[date_range\\]" ).val(), 155 included: includedTypes 156 } 157 158 // set activity_type vars 159 var activityTypeVars = { 160 start: $( "#dashboard\\[start_t\\]\\[date_range\\]" ).val(), 161 end: $( "#dashboard\\[end_t\\]\\[date_range\\]" ).val(), 162 } 163 164 // set cases vars 165 var casesVars = { 166 case_assigned: $( "#dashboard\\[case_assigned\\]\\[case_assigned\\]" ).val(), 167 case_review_date: $( "#dashboard\\[case_review_date\\]\\[date_range\\]" ).val(), 168 case_status: $( "#dashboard\\[case_status\\]\\[case_status\\]" ).val(), 169 } 170 171 // set issues vars 172 var issuesVars = { 173 issue_staff: $( "#dashboard\\[issue_staff\\]\\[issue_staff\\]" ).val(), 174 review_date: $( "#dashboard\\[review_date\\]\\[date_range\\]" ).val(), 175 follow_up_status: $( "#dashboard\\[follow_up_status\\]\\[follow_up_status\\]" ).val(), 176 } 177 159 178 var dashboardConfig = { 160 sort: $( "#dashboard-sortables" ).sortable( "toArray"), 161 wide: varWide, 162 tall: varTall 163 } 164 wpIssuesCRM.ajaxPost( 'dashboard', 'save_dashboard_preferences', '', dashboardConfig , function( response ) { 165 }); 179 sort: varSort, 180 tall: varTall, 181 dashboard_activity: activityVars, 182 dashboard_activity_type: activityTypeVars, 183 dashboard_cases: casesVars, 184 dashboard_issues: issuesVars 185 } 186 187 return dashboardConfig; 188 166 189 } 167 190 191 168 192 }( window.wpIssuesCRM = window.wpIssuesCRM || {}, jQuery )); // end anonymous namespace enclosure -
wp-issues-crm/tags/4.5.3/php/entity/class-wic-entity-dashboard.php
r2152005 r2157599 19 19 protected function dashboard () { 20 20 21 // get sort order and w ide display list21 // get sort order and what is open 22 22 $config = WIC_Entity_User::get_wic_user_preference ( 'wic_dashboard_config' ); 23 23 if ( $config ) { … … 60 60 } 61 61 ksort ( $sorted_dashboard_divs ); 62 // identify which entity to start as open 63 $open_div = isset ( $config->tall ) ? $config->tall[0] : 'dashboard_overview'; 62 64 echo '<ul id="dashboard-sortables" >'; 63 65 foreach ( $sorted_dashboard_divs as $key => $dashboard_div ) { 64 $wide_class = ' wic-dashboard-full '; 65 $tall_class = in_array( $dashboard_div[0], array ( 'dashboard_overview' ) ) ? ' wic-dashboard-flex ' : ''; // no longer controlled by user 66 $tall_class = $open_div == $dashboard_div[0] ? ' wic-dashboard-tall ' : ''; // no longer controlled by user 66 67 echo 67 '<li id = "' . $dashboard_div[0] . '" class = "ui-state-default wic-dashboard ' . $wide_class. $tall_class . '">' .68 '<li id = "' . $dashboard_div[0] . '" class = "ui-state-default wic-dashboard wic-dashboard-full ' . $tall_class . '">' . 68 69 '<div class="wic-dashboard-title wic-dashboard-drag-handle" title="Drag to reorder dashboard widgets"><span class="dashicons dashicons-move"></span>' . $dashboard_div[1] . '</div>' . 69 $this->special_buttons ( $dashboard_div[0] ) .70 $this->special_buttons ( $dashboard_div[0], $config ) . 70 71 '<button class="wic-dashboard-title wic-dashboard-refresh-button" type="button" title="Refresh"><span class="dashicons dashicons-update"></span></button>' . 71 72 '<div class = "wic-inner-dashboard" id="wic-inner-dashboard-' . $dashboard_div[0] . '">' . … … 79 80 80 81 81 public static function save_dashboard_preferences ( $dummy_id, $data ) { 82 public static function save_dashboard_preferences ( $dummy_id, $data ) { 82 83 return WIC_Entity_User::set_wic_user_preference ( 'wic_dashboard_config', $data ); 83 84 } 84 85 85 public static function dashboard_overview ( $dummy_id, $dummy_data ) { 86 public static function dashboard_overview ( $dummy_id, $data ) { 87 88 self::save_dashboard_preferences ( $dummy_id, $data ); 86 89 87 90 global $wpdb; … … 213 216 214 217 // display a list of CASES assigned to user -- (SEE ONLY OWN, NO OPTIONS) 215 public static function dashboard_mycases( ) { 216 218 public static function dashboard_mycases( $dummy_id, $data ) { 219 220 self::save_dashboard_preferences ( $dummy_id, $data ); 221 217 222 $user_ID = get_current_user_id(); 218 223 … … 256 261 257 262 // display a list of issues assigned to user -- (SEE ONLY OWN, NO OPTIONS) 258 public static function dashboard_myissues() { 263 public static function dashboard_myissues( $dummy_id, $data ) { 264 265 self::save_dashboard_preferences ( $dummy_id, $data ); 259 266 260 267 $user_ID = get_current_user_id(); … … 299 306 300 307 // display a list of assigned cases -- default is to current user 301 public static function dashboard_cases( $dummy, $data) { 302 303 extract ( (array) $data ); // case_assigned/case_review_date/case_status 308 public static function dashboard_cases( $dummy_id, $data) { 309 310 self::save_dashboard_preferences ( $dummy_id, $data ); 311 312 extract ( (array) $data->dashboard_cases ); // case_assigned/case_review_date/case_status 304 313 305 314 $wic_query = WIC_DB_Access_Factory::make_a_db_access_object( 'constituent' ); … … 369 378 370 379 // display a list of assigned issues -- default is to current user 371 public static function dashboard_issues( $dummy, $data ) { 372 373 extract ( (array) $data ); // issue_staff/review_date/follow_up_status: 380 public static function dashboard_issues( $dummy_id, $data ) { 381 382 self::save_dashboard_preferences ( $dummy_id, $data ); 383 384 extract ( (array) $data->dashboard_issues ); // issue_staff/review_date/follow_up_status: 374 385 $wic_query = WIC_DB_Access_Factory::make_a_db_access_object( 'issue' ); 375 386 … … 485 496 486 497 487 public static function dashboard_recent() { 498 public static function dashboard_recent( $dummy_id, $data ) { 499 500 self::save_dashboard_preferences ( $dummy_id, $data ); 488 501 489 502 $user_ID = get_current_user_id(); … … 508 521 509 522 // display user's search log ( which includes form searches, items selected from lists and also items saved ) 510 public static function dashboard_searches() { 523 public static function dashboard_searches( $dummy_id, $data ) { 524 525 self::save_dashboard_preferences ( $dummy_id, $data ); 511 526 512 527 $wic_query = WIC_DB_Access_Factory::make_a_db_access_object( 'search_log' ); … … 523 538 } 524 539 525 public static function dashboard_uploads () { 540 public static function dashboard_uploads ( $dummy_id, $data ) { 541 542 self::save_dashboard_preferences ( $dummy_id, $data ); 543 526 544 // table entry in the access factory will make this a standard WIC DB object 527 545 $wic_query = WIC_DB_Access_Factory::make_a_db_access_object( 'upload' ); … … 549 567 } 550 568 551 private function special_buttons ( $dashboard_div ) { 569 570 571 private function special_buttons ( $dashboard_div, $config ) { 572 552 573 if ( 'dashboard_activity' == $dashboard_div ) { 553 574 $start_control = WIC_Control_Factory::make_a_control ( 'date' ); … … 555 576 $end_control = WIC_Control_Factory::make_a_control ( 'date' ); 556 577 $end_control->initialize_default_values( 'dashboard', 'date_range', 'end' ); 578 if ( isset ( $config->dashboard_activity ) ) { 579 $start_control->set_value( $config->dashboard_activity->start ); 580 $end_control->set_value( $config->dashboard_activity->end ); 581 } 557 582 return $start_control->form_control() . $end_control->form_control() . WIC_Entity_Activity::make_activity_type_filter_button(); 558 583 } elseif ( 'dashboard_activity_type' == $dashboard_div ) { … … 561 586 $end_control = WIC_Control_Factory::make_a_control ( 'date' ); 562 587 $end_control->initialize_default_values( 'dashboard', 'date_range', 'end_t' ); 588 if ( isset ( $config->dashboard_activity_type ) ) { 589 $start_control->set_value( $config->dashboard_activity_type->start ); 590 $end_control->set_value( $config->dashboard_activity_type->end ); 591 } 563 592 return $start_control->form_control() . $end_control->form_control(); 564 593 } elseif ( 'dashboard_cases' == $dashboard_div ) { … … 571 600 $status_control->initialize_default_values( 'dashboard', 'case_status', 'case_status' ); 572 601 $status_control->set_value ( '1' ); 602 if ( isset ( $config->dashboard_cases ) ) { 603 $due_control->set_value( $config->dashboard_cases->case_review_date ); 604 $assigned_control->set_value( $config->dashboard_cases->case_assigned ); 605 $status_control->set_value( $config->dashboard_cases->case_status ); 606 } 573 607 return $assigned_control->form_control() . $status_control->form_control() . $due_control->form_control(); 574 608 } elseif ( 'dashboard_issues' == $dashboard_div ) { … … 581 615 $status_control->initialize_default_values( 'dashboard', 'follow_up_status', 'follow_up_status' ); 582 616 $status_control->set_value ( 'open' ); 617 if ( isset ( $config->dashboard_issues ) ) { 618 $due_control->set_value( $config->dashboard_issues->review_date ); 619 $assigned_control->set_value( $config->dashboard_issues->issue_staff ); 620 $status_control->set_value( $config->dashboard_issues->follow_up_status ); 621 } 583 622 return $assigned_control->form_control() . $status_control->form_control() . $due_control->form_control(); 584 623 } else { … … 591 630 public static function dashboard_activity ( $dummy_id, $data ) { 592 631 593 extract ( (array) $data ); 632 self::save_dashboard_preferences ( $dummy_id, $data ); 633 634 extract ( (array) $data->dashboard_activity ); 594 635 $start = $start ? $start : '1900-01-01'; 595 636 $end = $end ? $end : '2100-01-01'; … … 642 683 public static function dashboard_activity_type ( $dummy_id, $data ) { 643 684 644 extract ( (array) $data ); 685 self::save_dashboard_preferences ( $dummy_id, $data ); 686 687 extract ( (array) $data->dashboard_activity_type ); 645 688 $start = $start ? $start : '1900-01-01'; 646 689 $end = $end ? $end : '2100-01-01'; -
wp-issues-crm/tags/4.5.3/readme.txt
r2152009 r2157599 5 5 Requires at least: 5 6 6 Tested up to: 5.2.1 7 Stable tag: 4.5. 27 Stable tag: 4.5.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 108 108 109 109 == Changelog == 110 = 4.5.3 = 111 * Save state of dashboard to facilitate iterative select from dashboard and return to dashboard 110 112 = 4.5.2 = 111 113 * Revise security rules for template and issue creation from email -- allow to those with view_edit_unassigned -
wp-issues-crm/tags/4.5.3/wp-issues-crm.php
r2152009 r2157599 4 4 * Plugin URI: http://wp-issues-crm.com 5 5 * Description: Constituent Relationship Management for organizations that respond to constituents. Organizes constituent contacts ( calls, etc. ) around Wordpress posts and categories. 6 * Version: 4.5. 26 * Version: 4.5.3 7 7 * Author: Will Brownsberger 8 8 * Author URI: http://willbrownsberger.com … … 39 39 // set database version global; 40 40 global $wp_issues_crm_db_version; 41 $wp_issues_crm_db_version = '4.5. 2';41 $wp_issues_crm_db_version = '4.5.3'; 42 42 /* 43 43 * set js_css version global -- three possibilities: … … 48 48 */ 49 49 global $wp_issues_crm_js_css_version; 50 $wp_issues_crm_js_css_version = '4.5. 2'; // may or not be set at release time50 $wp_issues_crm_js_css_version = '4.5.3'; // may or not be set at release time 51 51 if ( '' == $wp_issues_crm_js_css_version ) { 52 52 if ( strpos ( site_url(), 'localhost' ) > 0 ) { -
wp-issues-crm/trunk/css/dashboard.css
r2152005 r2157599 164 164 } 165 165 166 /* maintain always open flexible height for dashboard summary */167 .wic-dashboard-flex .wic-inner-dashboard,168 .wic-dashboard-flex.wic-dashboard-tall .wic-inner-dashboard {169 height: auto;170 margin-bottom: 30px;171 max-height: calc( 100vh - 540px) ;172 }173 .wic-dashboard-flex .wic-inner-dashboard ul.wic-post-list,174 .wic-dashboard-flex.wic-dashboard-tall .wic-inner-dashboard ul.wic-post-list {175 height: auto ;176 max-height: calc( 100vh - 540px) ;177 }178 179 180 166 .dashboard-not-found { 181 167 margin: 20px; -
wp-issues-crm/trunk/js/ajax.js
r2069459 r2157599 87 87 } 88 88 89 // note: this function invoked directly on loadDashboardPanel in dashboard.js 89 90 wpIssuesCRM.saveState = function ( currentEntity, currentAction ) { 90 91 var valuesObject = {}; -
wp-issues-crm/trunk/js/dashboard.js
r2145245 r2157599 44 44 defaultDate: +0 45 45 }); 46 $( "#dashboard\\[end\\]\\[date_range\\]" ). datepicker( "setDate", "+0" )47 $( "#dashboard\\[start\\]\\[date_range\\]" ). datepicker( "setDate", "-30" )48 $( "#dashboard\\[end_t\\]\\[date_range\\]" ). datepicker( "setDate", "+0" )49 $( "#dashboard\\[start_t\\]\\[date_range\\]" ). datepicker( "setDate", "-30" )46 $( "#dashboard\\[end\\]\\[date_range\\]" ).attr( "placeholder", "Before?" ) 47 $( "#dashboard\\[start\\]\\[date_range\\]" ).attr( "placeholder", "After?" ) 48 $( "#dashboard\\[end_t\\]\\[date_range\\]" ).attr( "placeholder", "Before?" ) 49 $( "#dashboard\\[start_t\\]\\[date_range\\]" ).attr( "placeholder", "After?" ) 50 50 $( "#dashboard\\[case_review_date\\]\\[date_range\\]" ).attr( "placeholder", "Due before?" ) 51 51 $( "#dashboard\\[review_date\\]\\[date_range\\]" ).attr( "placeholder", "Due before?" ) 52 52 53 54 $( ".wic-dashboard " ).each( function () {53 // only open what has been set as tall 54 $( ".wic-dashboard.wic-dashboard-tall" ).each( function () { 55 55 wpIssuesCRM.loadDashboardPanel ( $( this ).attr("id") ); 56 56 }); … … 61 61 if ( currentTile.hasClass("wic-dashboard-tall") ) { 62 62 currentTile.removeClass( "wic-dashboard-tall" ); 63 wpIssuesCRM.saveDashboardLayout(); 63 64 } else { 64 65 $( ".wic-dashboard").removeClass ( "wic-dashboard-tall" ); 65 66 currentTile.addClass ( "wic-dashboard-tall" ); 67 wpIssuesCRM.loadDashboardPanel ( currentTile.attr("id") ); 66 68 } 67 wpIssuesCRM.saveDashboardLayout();68 69 }); 69 70 … … 74 75 $( ".wic-dashboard").removeClass ( "wic-dashboard-tall" ); 75 76 currentTile.addClass ( "wic-dashboard-tall" ); 76 wpIssuesCRM.saveDashboardLayout(); 77 wpIssuesCRM.loadDashboardPanel ( currentTile.attr("id") ); 78 // dashboard layout will be saved on load 77 79 } 78 80 }); … … 84 86 $( ".wic-dashboard").removeClass ( "wic-dashboard-tall" ); 85 87 currentTile.addClass ( "wic-dashboard-tall" ); 86 wpIssuesCRM.saveDashboardLayout(); 88 wpIssuesCRM.loadDashboardPanel ( currentTile.attr("id") ); 89 // dashboard layout will be saved on load 87 90 } 88 91 }); … … 106 109 } 107 110 111 // includes same action as saveDashboardLayout on server side 108 112 wpIssuesCRM.loadDashboardPanel = function ( panel ) { 109 var varPreID; 110 var submittedData = ''; 111 if ( 'dashboard_activity' == panel ) { 112 var includedTypes=[]; 113 $( "#filter-activities-menu .wic-input-checked" ).each ( function () { 114 if ( $( this ).prop("checked") ) { 115 varPreID = $(this).attr("id").substr(14); 116 includedTypes.push ( varPreID.substr(0, varPreID.length -1 ) ); 117 } 118 }); 119 submittedData = { 120 start: $( "#dashboard\\[start\\]\\[date_range\\]" ).val(), 121 end: $( "#dashboard\\[end\\]\\[date_range\\]" ).val(), 122 included: includedTypes 123 } 124 } else if ( 'dashboard_activity_type' == panel ) { 125 submittedData = { 126 start: $( "#dashboard\\[start_t\\]\\[date_range\\]" ).val(), 127 end: $( "#dashboard\\[end_t\\]\\[date_range\\]" ).val(), 128 } 129 } else if ( 'dashboard_cases' == panel ) { 130 submittedData = { 131 case_assigned: $( "#dashboard\\[case_assigned\\]\\[case_assigned\\]" ).val(), 132 case_review_date: $( "#dashboard\\[case_review_date\\]\\[date_range\\]" ).val(), 133 case_status: $( "#dashboard\\[case_status\\]\\[case_status\\]" ).val(), 134 } 135 } else if ( 'dashboard_issues' == panel ) { 136 submittedData = { 137 issue_staff: $( "#dashboard\\[issue_staff\\]\\[issue_staff\\]" ).val(), 138 review_date: $( "#dashboard\\[review_date\\]\\[date_range\\]" ).val(), 139 follow_up_status: $( "#dashboard\\[follow_up_status\\]\\[follow_up_status\\]" ).val(), 140 } 141 } 113 wpIssuesCRM.ajaxPost( 'dashboard', panel, '', assembleDashboardStatus(), function( response ) { 114 $( "#" + panel ).children( ".wic-inner-dashboard").html( response ); 142 115 143 wpIssuesCRM.ajaxPost( 'dashboard', panel, '', submittedData, function( response ) {144 $( "#" + panel ).children( ".wic-inner-dashboard").html( response );145 116 // special initialization terms for particular panels 146 117 if ( 'dashboard_searches' == panel ) { 147 118 wpIssuesCRM.initializeSearchLogTooltips(); 148 119 } 120 121 // save state to allow return to same panel 122 wpIssuesCRM.saveState ( 'dashboard', 'dashboard' ); 149 123 150 124 }); … … 152 126 153 127 wpIssuesCRM.saveDashboardLayout = function () { 154 var varWide = []; 128 wpIssuesCRM.ajaxPost( 'dashboard', 'save_dashboard_preferences', '', assembleDashboardStatus() , function( response ) { 129 }); 130 } 131 132 assembleDashboardStatus = function() { 133 134 // set open item 155 135 var varTall = []; 156 136 $( '.wic-dashboard-tall' ).each ( function () { 157 137 varTall.push ( $( this ).attr("id") ); 158 138 }); 139 140 // set sort order 141 var varSort = $( "#dashboard-sortables" ).sortable( "toArray"); 142 143 // set activity vars 144 var varPreID; 145 var includedTypes=[]; 146 $( "#filter-activities-menu .wic-input-checked" ).each ( function () { 147 if ( $( this ).prop("checked") ) { 148 varPreID = $(this).attr("id").substr(14); 149 includedTypes.push ( varPreID.substr(0, varPreID.length -1 ) ); 150 } 151 }); 152 var activityVars = { 153 start: $( "#dashboard\\[start\\]\\[date_range\\]" ).val(), 154 end: $( "#dashboard\\[end\\]\\[date_range\\]" ).val(), 155 included: includedTypes 156 } 157 158 // set activity_type vars 159 var activityTypeVars = { 160 start: $( "#dashboard\\[start_t\\]\\[date_range\\]" ).val(), 161 end: $( "#dashboard\\[end_t\\]\\[date_range\\]" ).val(), 162 } 163 164 // set cases vars 165 var casesVars = { 166 case_assigned: $( "#dashboard\\[case_assigned\\]\\[case_assigned\\]" ).val(), 167 case_review_date: $( "#dashboard\\[case_review_date\\]\\[date_range\\]" ).val(), 168 case_status: $( "#dashboard\\[case_status\\]\\[case_status\\]" ).val(), 169 } 170 171 // set issues vars 172 var issuesVars = { 173 issue_staff: $( "#dashboard\\[issue_staff\\]\\[issue_staff\\]" ).val(), 174 review_date: $( "#dashboard\\[review_date\\]\\[date_range\\]" ).val(), 175 follow_up_status: $( "#dashboard\\[follow_up_status\\]\\[follow_up_status\\]" ).val(), 176 } 177 159 178 var dashboardConfig = { 160 sort: $( "#dashboard-sortables" ).sortable( "toArray"), 161 wide: varWide, 162 tall: varTall 163 } 164 wpIssuesCRM.ajaxPost( 'dashboard', 'save_dashboard_preferences', '', dashboardConfig , function( response ) { 165 }); 179 sort: varSort, 180 tall: varTall, 181 dashboard_activity: activityVars, 182 dashboard_activity_type: activityTypeVars, 183 dashboard_cases: casesVars, 184 dashboard_issues: issuesVars 185 } 186 187 return dashboardConfig; 188 166 189 } 167 190 191 168 192 }( window.wpIssuesCRM = window.wpIssuesCRM || {}, jQuery )); // end anonymous namespace enclosure -
wp-issues-crm/trunk/php/entity/class-wic-entity-dashboard.php
r2152005 r2157599 19 19 protected function dashboard () { 20 20 21 // get sort order and w ide display list21 // get sort order and what is open 22 22 $config = WIC_Entity_User::get_wic_user_preference ( 'wic_dashboard_config' ); 23 23 if ( $config ) { … … 60 60 } 61 61 ksort ( $sorted_dashboard_divs ); 62 // identify which entity to start as open 63 $open_div = isset ( $config->tall ) ? $config->tall[0] : 'dashboard_overview'; 62 64 echo '<ul id="dashboard-sortables" >'; 63 65 foreach ( $sorted_dashboard_divs as $key => $dashboard_div ) { 64 $wide_class = ' wic-dashboard-full '; 65 $tall_class = in_array( $dashboard_div[0], array ( 'dashboard_overview' ) ) ? ' wic-dashboard-flex ' : ''; // no longer controlled by user 66 $tall_class = $open_div == $dashboard_div[0] ? ' wic-dashboard-tall ' : ''; // no longer controlled by user 66 67 echo 67 '<li id = "' . $dashboard_div[0] . '" class = "ui-state-default wic-dashboard ' . $wide_class. $tall_class . '">' .68 '<li id = "' . $dashboard_div[0] . '" class = "ui-state-default wic-dashboard wic-dashboard-full ' . $tall_class . '">' . 68 69 '<div class="wic-dashboard-title wic-dashboard-drag-handle" title="Drag to reorder dashboard widgets"><span class="dashicons dashicons-move"></span>' . $dashboard_div[1] . '</div>' . 69 $this->special_buttons ( $dashboard_div[0] ) .70 $this->special_buttons ( $dashboard_div[0], $config ) . 70 71 '<button class="wic-dashboard-title wic-dashboard-refresh-button" type="button" title="Refresh"><span class="dashicons dashicons-update"></span></button>' . 71 72 '<div class = "wic-inner-dashboard" id="wic-inner-dashboard-' . $dashboard_div[0] . '">' . … … 79 80 80 81 81 public static function save_dashboard_preferences ( $dummy_id, $data ) { 82 public static function save_dashboard_preferences ( $dummy_id, $data ) { 82 83 return WIC_Entity_User::set_wic_user_preference ( 'wic_dashboard_config', $data ); 83 84 } 84 85 85 public static function dashboard_overview ( $dummy_id, $dummy_data ) { 86 public static function dashboard_overview ( $dummy_id, $data ) { 87 88 self::save_dashboard_preferences ( $dummy_id, $data ); 86 89 87 90 global $wpdb; … … 213 216 214 217 // display a list of CASES assigned to user -- (SEE ONLY OWN, NO OPTIONS) 215 public static function dashboard_mycases( ) { 216 218 public static function dashboard_mycases( $dummy_id, $data ) { 219 220 self::save_dashboard_preferences ( $dummy_id, $data ); 221 217 222 $user_ID = get_current_user_id(); 218 223 … … 256 261 257 262 // display a list of issues assigned to user -- (SEE ONLY OWN, NO OPTIONS) 258 public static function dashboard_myissues() { 263 public static function dashboard_myissues( $dummy_id, $data ) { 264 265 self::save_dashboard_preferences ( $dummy_id, $data ); 259 266 260 267 $user_ID = get_current_user_id(); … … 299 306 300 307 // display a list of assigned cases -- default is to current user 301 public static function dashboard_cases( $dummy, $data) { 302 303 extract ( (array) $data ); // case_assigned/case_review_date/case_status 308 public static function dashboard_cases( $dummy_id, $data) { 309 310 self::save_dashboard_preferences ( $dummy_id, $data ); 311 312 extract ( (array) $data->dashboard_cases ); // case_assigned/case_review_date/case_status 304 313 305 314 $wic_query = WIC_DB_Access_Factory::make_a_db_access_object( 'constituent' ); … … 369 378 370 379 // display a list of assigned issues -- default is to current user 371 public static function dashboard_issues( $dummy, $data ) { 372 373 extract ( (array) $data ); // issue_staff/review_date/follow_up_status: 380 public static function dashboard_issues( $dummy_id, $data ) { 381 382 self::save_dashboard_preferences ( $dummy_id, $data ); 383 384 extract ( (array) $data->dashboard_issues ); // issue_staff/review_date/follow_up_status: 374 385 $wic_query = WIC_DB_Access_Factory::make_a_db_access_object( 'issue' ); 375 386 … … 485 496 486 497 487 public static function dashboard_recent() { 498 public static function dashboard_recent( $dummy_id, $data ) { 499 500 self::save_dashboard_preferences ( $dummy_id, $data ); 488 501 489 502 $user_ID = get_current_user_id(); … … 508 521 509 522 // display user's search log ( which includes form searches, items selected from lists and also items saved ) 510 public static function dashboard_searches() { 523 public static function dashboard_searches( $dummy_id, $data ) { 524 525 self::save_dashboard_preferences ( $dummy_id, $data ); 511 526 512 527 $wic_query = WIC_DB_Access_Factory::make_a_db_access_object( 'search_log' ); … … 523 538 } 524 539 525 public static function dashboard_uploads () { 540 public static function dashboard_uploads ( $dummy_id, $data ) { 541 542 self::save_dashboard_preferences ( $dummy_id, $data ); 543 526 544 // table entry in the access factory will make this a standard WIC DB object 527 545 $wic_query = WIC_DB_Access_Factory::make_a_db_access_object( 'upload' ); … … 549 567 } 550 568 551 private function special_buttons ( $dashboard_div ) { 569 570 571 private function special_buttons ( $dashboard_div, $config ) { 572 552 573 if ( 'dashboard_activity' == $dashboard_div ) { 553 574 $start_control = WIC_Control_Factory::make_a_control ( 'date' ); … … 555 576 $end_control = WIC_Control_Factory::make_a_control ( 'date' ); 556 577 $end_control->initialize_default_values( 'dashboard', 'date_range', 'end' ); 578 if ( isset ( $config->dashboard_activity ) ) { 579 $start_control->set_value( $config->dashboard_activity->start ); 580 $end_control->set_value( $config->dashboard_activity->end ); 581 } 557 582 return $start_control->form_control() . $end_control->form_control() . WIC_Entity_Activity::make_activity_type_filter_button(); 558 583 } elseif ( 'dashboard_activity_type' == $dashboard_div ) { … … 561 586 $end_control = WIC_Control_Factory::make_a_control ( 'date' ); 562 587 $end_control->initialize_default_values( 'dashboard', 'date_range', 'end_t' ); 588 if ( isset ( $config->dashboard_activity_type ) ) { 589 $start_control->set_value( $config->dashboard_activity_type->start ); 590 $end_control->set_value( $config->dashboard_activity_type->end ); 591 } 563 592 return $start_control->form_control() . $end_control->form_control(); 564 593 } elseif ( 'dashboard_cases' == $dashboard_div ) { … … 571 600 $status_control->initialize_default_values( 'dashboard', 'case_status', 'case_status' ); 572 601 $status_control->set_value ( '1' ); 602 if ( isset ( $config->dashboard_cases ) ) { 603 $due_control->set_value( $config->dashboard_cases->case_review_date ); 604 $assigned_control->set_value( $config->dashboard_cases->case_assigned ); 605 $status_control->set_value( $config->dashboard_cases->case_status ); 606 } 573 607 return $assigned_control->form_control() . $status_control->form_control() . $due_control->form_control(); 574 608 } elseif ( 'dashboard_issues' == $dashboard_div ) { … … 581 615 $status_control->initialize_default_values( 'dashboard', 'follow_up_status', 'follow_up_status' ); 582 616 $status_control->set_value ( 'open' ); 617 if ( isset ( $config->dashboard_issues ) ) { 618 $due_control->set_value( $config->dashboard_issues->review_date ); 619 $assigned_control->set_value( $config->dashboard_issues->issue_staff ); 620 $status_control->set_value( $config->dashboard_issues->follow_up_status ); 621 } 583 622 return $assigned_control->form_control() . $status_control->form_control() . $due_control->form_control(); 584 623 } else { … … 591 630 public static function dashboard_activity ( $dummy_id, $data ) { 592 631 593 extract ( (array) $data ); 632 self::save_dashboard_preferences ( $dummy_id, $data ); 633 634 extract ( (array) $data->dashboard_activity ); 594 635 $start = $start ? $start : '1900-01-01'; 595 636 $end = $end ? $end : '2100-01-01'; … … 642 683 public static function dashboard_activity_type ( $dummy_id, $data ) { 643 684 644 extract ( (array) $data ); 685 self::save_dashboard_preferences ( $dummy_id, $data ); 686 687 extract ( (array) $data->dashboard_activity_type ); 645 688 $start = $start ? $start : '1900-01-01'; 646 689 $end = $end ? $end : '2100-01-01'; -
wp-issues-crm/trunk/readme.txt
r2152009 r2157599 5 5 Requires at least: 5 6 6 Tested up to: 5.2.1 7 Stable tag: 4.5. 27 Stable tag: 4.5.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 108 108 109 109 == Changelog == 110 = 4.5.3 = 111 * Save state of dashboard to facilitate iterative select from dashboard and return to dashboard 110 112 = 4.5.2 = 111 113 * Revise security rules for template and issue creation from email -- allow to those with view_edit_unassigned -
wp-issues-crm/trunk/wp-issues-crm.php
r2152009 r2157599 4 4 * Plugin URI: http://wp-issues-crm.com 5 5 * Description: Constituent Relationship Management for organizations that respond to constituents. Organizes constituent contacts ( calls, etc. ) around Wordpress posts and categories. 6 * Version: 4.5. 26 * Version: 4.5.3 7 7 * Author: Will Brownsberger 8 8 * Author URI: http://willbrownsberger.com … … 39 39 // set database version global; 40 40 global $wp_issues_crm_db_version; 41 $wp_issues_crm_db_version = '4.5. 2';41 $wp_issues_crm_db_version = '4.5.3'; 42 42 /* 43 43 * set js_css version global -- three possibilities: … … 48 48 */ 49 49 global $wp_issues_crm_js_css_version; 50 $wp_issues_crm_js_css_version = '4.5. 2'; // may or not be set at release time50 $wp_issues_crm_js_css_version = '4.5.3'; // may or not be set at release time 51 51 if ( '' == $wp_issues_crm_js_css_version ) { 52 52 if ( strpos ( site_url(), 'localhost' ) > 0 ) {
Note: See TracChangeset
for help on using the changeset viewer.