Plugin Directory

Changeset 2147379


Ignore:
Timestamp:
08/28/2019 09:50:10 PM (7 years ago)
Author:
Will Brownsberger
Message:

version 4.5 work in progress

Location:
wp-issues-crm/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wp-issues-crm/trunk/js/email-inbox.js

    r2146005 r2147379  
    121121        if ( $( event.target ).hasClass ( "wic-inbox-page-label") ) {
    122122            $target = $(event.target).parent();
     123        } else if ( $( event.target ).hasClass ( "wic-inbox-tab-count") ) {
     124            $target = $(event.target).parent().parent();
    123125        } else {
    124126            $target = $(event.target);
     
    482484    wpIssuesCRM.doFilterAssignmentPopup = function() {
    483485        var popupWidth = 480;
    484         var popupContent = '<div title="Select Assigned Staff for Message Display"><div id = "staff_filter_assignment_popup">' +
     486        var popupContent = '<div title="Filter Assigned/Ready messages"><div id = "staff_filter_assignment_popup">' +
    485487            $( "#hidden-staff-assignment-control" ).html() +
    486             '<p class="staff_assignment_popup-legend">Selection applies only when viewing Assigned or Ready tab.</p>' +
     488            '<p>Selection of staff filters messages in the Assigned and Ready tabs, limiting them to messages assigned to the selected staff.</p>' +
     489            '<p><em>The messages assigned to other staff and filtered out of the Assigned and Ready tabs will appear in the tabs where they would appear if unassigned.</em></p>' + 
    487490            '</div></div>';
    488491        dialog              = $.parseHTML( popupContent );
     
    499502            position: { my: "right top", at: "right top", of: "#wic-filter-assigned-button" }, 
    500503            show: { effect: "fadeIn", duration: 200 },
    501             buttons: [],
     504            buttons: [
     505                {
     506                    width: 80,
     507                    text: "Cancel",
     508                    click: function() {
     509                        wpIssuesCRM.filterAssignedPopupObject.dialog( "close" );
     510                    }
     511                },
     512                {
     513                    width: 80,
     514                    text: "Filter",
     515                    autofocus: true,
     516                    click: function() {
     517                        selectedStaff = selectStaffButton.val();
     518                        nextPage[selectedPage] = 0;
     519                        wpIssuesCRM.loadSelectedPage();
     520                        wpIssuesCRM.filterAssignedPopupObject.fadeOut( 300, 'swing', function(){ wpIssuesCRM.filterAssignedPopupObject.dialog( "close" );  })   
     521
     522                    }
     523                }
     524            ],             
    502525            modal: true,
    503526        });
    504527        selectStaffButton = $( "#staff_filter_assignment_popup #case_assigned" );
    505528        wpIssuesCRM.setVal( selectStaffButton[0],selectedStaff, '' ); // empty string is ignored provided staff # exists
    506        
    507         selectStaffButton.on( "change", function( event, ui ) {
    508             selectedStaff = selectStaffButton.val();
    509             nextPage[selectedPage] = 0;
    510             wpIssuesCRM.loadSelectedPage();
    511             wpIssuesCRM.filterAssignedPopupObject.fadeOut( 200, 'swing', function(){ wpIssuesCRM.filterAssignedPopupObject.remove(); })     
    512         });
     529
    513530    };
    514531
  • wp-issues-crm/trunk/js/email-message.js

    r2146005 r2147379  
    9898        })
    9999        //  info request handlers
    100         .on( "click", "#assigned-case-popup-button", wpIssuesCRM.handleAssignmentPopupClick )   
    101100        .on( "click", "#parse-popup-button", wpIssuesCRM.doParseDetailsPopup )
    102101        .on( "click", "#view-issue-button", wpIssuesCRM.doIssuePeekPopup )
     
    106105        .on ( "change", "#wic-inbox-work-area #pro_con", handleProConChange )
    107106        // initialize action request handlers
     107        .on( "click", "#assigned-case-popup-button", wpIssuesCRM.handleAssignmentPopupClick )   
    108108        // processEmail distinguishes the trigger buttons
    109109        .on( "click", ".trigger-email-process-button", wpIssuesCRM.processEmail )
     
    111111        // display message review area
    112112        .css( "visibility", "visible" );
    113        
    114         // enable or disable approval/unapproval button
    115         if ( !( ['CATEGORY_ASSIGNED', 'CATEGORY_READY'].indexOf(wpIssuesCRM.inboxSelectedTab) > -1 ) ){
    116             $( '#wic-email-approve-button' ).prop( 'disabled',true ).addClass('ui-state-disabled');
    117         } else {
    118             $( '#wic-email-approve-button' ).prop( 'disabled',false ).removeClass('ui-state-disabled');
    119         }
    120         // enable/disable staff reassignment button
    121         if ( ! wpIssuesCRMSettings.canSendEmail ){
    122             $( '#assigned-case-popup-button' ).prop( 'disabled',true ).addClass('ui-state-disabled');
    123         } else {
    124             $( '#assigned-case-popup-button' ).prop( 'disabled',false ).removeClass('ui-state-disabled');
    125         }       
    126                
     113           
    127114        // remove any extant tinymce instances
    128115        tinymce.remove();
     
    193180    /*
    194181    *  ScrollMessage retrieves message info based on activeMessage pointer.
    195     *  It only show/hides loaders and areas to be filled -- no other display decisions change in it
    196     *
     182    *  It only show/hides loaders and areas to be filled, enables/disables approve/assign buttons -- no other display decisions change in it
     183    *
     184    *  Note that this is scrolling within a subject line ( or loading the first message of a subject line); jumpToSubjectLine scrolls across lines
    197185    */
    198186    wpIssuesCRM.scrollMessage = function( switchingSubjects ) {
     
    261249            // save assigned staff -- setting to 0 if unassigned
    262250            wpIssuesCRM.assignedStaff = response.assigned_staff;
    263             chooseStaffButtonColor();
     251            // set button values attributes and properties
     252            manageApproveAssignButtons();
    264253            // save final draft status
    265254            wpIssuesCRM.replyFinal = response.reply_is_final;
     
    320309            // cache transition line
    321310            wpIssuesCRM.replyTransitionLine  = response.reply_transition_line;
     311
     312
    322313        });     
    323314    }
     
    340331    // informational popup
    341332    wpIssuesCRM.doAssignmentPopup = function() {
     333
    342334        var popupWidth = 480;
    343335        var popupContent = '<div title="Assign Staff to Handle Message"><div id = "staff_assignment_popup">' +
    344336            $( "#hidden-staff-assignment-control" ).html() +
    345             '<p class="staff_assignment_popup-legend">Email will be assigned for drafting of reply to selected staff.</p>' +
    346             '</div></div>';
     337            '<p>Email will be assigned to selected staff and will show in the Assigned tab.</p>' +
     338            '<p>Other emails with the exact same subject line will automatically follow the assigned email into the Assigned tab until ' +
     339            'the assigned email is disposed of; you will still need to sweep them or individually reply to them.  They are not yet recorded or assigned or grouped ' +
     340             'with the assigned email.  They are just following it to reduce clutter in other inbox tabs, while assigned staff drafts a reply. ' +
     341             'You can act on them individually at any time just as if they were in any other tab.</p>';
    347342        dialog              = $.parseHTML( popupContent );
    348343        wpIssuesCRM.assignedCasePopupObject = $( dialog );
     
    358353            position: { my: "left top", at: "left bottom", of: "#wic-message-sender-constituent  .wic-selectmenu-wrapper" },   
    359354            show: { effect: "fadeIn", duration: 200 },
    360             buttons: [],
    361             modal: true,
     355            buttons: [
     356                {
     357                    width: 80,
     358                    text: "Cancel",
     359                    click: function() {
     360                        wpIssuesCRM.assignedCasePopupObject.dialog( "close" );
     361                    }
     362                },
     363                {
     364                    width: 80,
     365                    text: "Assign",
     366                    autofocus: true,
     367                    click: function() {
     368                        wpIssuesCRM.assignedStaff = selectStaffButton.val();
     369                        wpIssuesCRM.saveValueToInboxImage( 'staff', wpIssuesCRM.assignedStaff );
     370                        manageApproveAssignButtons();
     371                        wpIssuesCRM.assignedCasePopupObject.dialog( "close" );
     372                    }
     373                }
     374            ],             
     375            modal: true,
    362376        });
    363377        selectStaffButton = $( "#staff_assignment_popup #case_assigned" );
    364378        wpIssuesCRM.setVal( selectStaffButton[0], wpIssuesCRM.assignedStaff, '' ); // empty string is ignored provided staff # exists
    365        
    366         selectStaffButton.on( "change", function( event, ui ) {
    367             wpIssuesCRM.assignedStaff = selectStaffButton.val();
    368             wpIssuesCRM.saveValueToInboxImage( 'staff', wpIssuesCRM.assignedStaff );
    369             wpIssuesCRM.assignedCasePopupObject.fadeOut( 500, 'swing', function(){ wpIssuesCRM.assignedCasePopupObject.remove(); })     
    370             chooseStaffButtonColor();
    371         });
     379
    372380    };
    373381
     
    713721                $toTile.children( ".constituent-email-item-text" ).text ( response.constituent_name );
    714722            }
    715             chooseStaffButtonColor();
    716723            // enable processing buttons
    717724            processingButtons.prop("disabled", false ).removeClass('ui-state-disabled');
    718725        });
    719     }
    720 
    721     function chooseStaffButtonColor() {
    722         var color;
    723         if( wpIssuesCRM.currentMessageVars.countMessages > 1 ) {
    724             color = '#ddd'
    725         } else if ( wpIssuesCRM.assignedStaff > 0 ) {
    726             color = 'green'
    727         } else {
    728             color = '#999';
    729         }
    730         $( "#assigned-case-popup-button" ).css( "color", color );
    731726    }
    732727
     
    793788    /*
    794789    *
    795     * handle approval button
     790    * handle approval button appearance
    796791    *
    797792    *
     
    903898    *
    904899    */
     900    function manageApproveAssignButtons() {
     901        /*
     902        * enable/disable assign/approve buttons -- could do at jumpToSubjectLine, but doing it here makes
     903        * possibility of adding message specific legends in enabled cases
     904        *
     905        */
     906        // enable or disable approval/unapproval button based on tab selection and message line count; is enabled for all users
     907        if ( !( ['CATEGORY_ASSIGNED', 'CATEGORY_READY'].indexOf(wpIssuesCRM.inboxSelectedTab) > -1 ||
     908            wpIssuesCRM.currentMessageVars.countMessages > 1  ) ){
     909            $( '#wic-email-approve-button' ).prop( 'disabled',true ).addClass('ui-state-disabled');
     910        } else {
     911            $( '#wic-email-approve-button' ).prop( 'disabled',false ).removeClass('ui-state-disabled');
     912        }
     913        // enable/disable staff reassignment button based on user capability and message count; is enabled in all tabs
     914        if ( ! wpIssuesCRMSettings.canSendEmail || wpIssuesCRM.currentMessageVars.countMessages > 1 ){
     915            $( '#assigned-case-popup-button' ).prop( 'disabled',true ).addClass('ui-state-disabled').attr("title","Cannot assign/reassign.");
     916        } else {
     917            $( '#assigned-case-popup-button' ).prop( 'disabled',false ).removeClass('ui-state-disabled');
     918            console.log ( )
     919            $( '#assigned-case-popup-button' ).prop("title", wpIssuesCRM.assignedStaff > 0 ? "Assigned -- click to reassign." : "Unassigned -- click to assign.");
     920        }
     921
     922        /*
     923        *
     924        * choose staff button color
     925        */
     926        var color;
     927        if( wpIssuesCRM.currentMessageVars.countMessages > 1 ) {
     928            color = '#ddd'
     929        } else if ( wpIssuesCRM.assignedStaff > 0 ) {
     930            color = 'green'
     931        } else {
     932            color = '#999';
     933        }
     934        $( "#assigned-case-popup-button" ).css( "color", color );
     935    }
     936       
    905937    function currentUID() {
    906938        return wpIssuesCRM.currentMessageVars.uidArray[wpIssuesCRM.currentMessageVars.activeMessage];
  • wp-issues-crm/trunk/js/email-process.js

    r2146005 r2147379  
    609609    }
    610610
    611 
    612 
    613 
    614611}( window.wpIssuesCRM = window.wpIssuesCRM || {}, jQuery )); // end  namespace enclosure   
  • wp-issues-crm/trunk/php/form/class-wic-form-email-inbox.php

    r2146005 r2147379  
    365365            '<div id = "wic-email-subject-header"> '.
    366366                '<div id = "wic-message-subject"></div>' .
    367                 '<button class="wic-form-button email-action-button trigger-email-process-button" id="wic-email-approve-button" type="button" value="approve" title="Reply ready" ><span class="dashicons dashicons-thumbs-down"></span></button>' .
    368                 '<button class="wic-form-button email-action-button trigger-email-process-button" id="wic-email-delete-button" type="button" value="delete" title="Archive" ><span class="dashicons dashicons-archive"></span></button>' .
    369                 '<button class="wic-form-button email-action-button trigger-email-process-button" id="wic-email-block-button" type="button" value="block" title = "Archive and block sender" ><span class="dashicons dashicons-warning"></span></button>' .
    370                 '<button class="wic-form-button email-action-button subject-line-move-button" type="button" value="left" title="Previous Line"><span class="dashicons dashicons-arrow-left" ></span></button>' .
    371                 '<button class="wic-form-button email-action-button subject-line-move-button" type="button" value="right" title="Next Line"><span class="dashicons dashicons-arrow-right" ></span></button>' .
    372                 '<button class="wic-form-button email-action-button trigger-email-process-button" id="wic-email-record-reply-button" type="button" value="reply" title="Record incoming and send outgoing" >Send</button>' .
    373                 '<button class="wic-form-button email-action-button trigger-email-process-button" id="wic-email-record-button" type="button" value="record" title="Record incoming" ><span class="dashicons dashicons-yes" ></span></button>' .
    374                 '<button class="wic-form-button email-action-button" id="wic-email-close-button" type="button" title="Close"><span class="dashicons dashicons-no"></span></button>' .
    375             '</div>' .
     367                    '<button class="wic-form-button email-action-button trigger-email-process-button" id="wic-email-approve-button" type="button" value="approve" title="Reply ready" ><span class="dashicons dashicons-thumbs-down"></span></button>' .
     368                    '<button class="wic-form-button email-action-button trigger-email-process-button" id="wic-email-delete-button" type="button" value="delete" title="Archive" ><span class="dashicons dashicons-archive"></span></button>' .
     369                    '<button class="wic-form-button email-action-button trigger-email-process-button" id="wic-email-block-button" type="button" value="block" title = "Archive and block sender" ><span class="dashicons dashicons-warning"></span></button>' .
     370                    '<button class="wic-form-button email-action-button subject-line-move-button" type="button" value="left" title="Previous Line"><span class="dashicons dashicons-arrow-left" ></span></button>' .
     371                    '<button class="wic-form-button email-action-button subject-line-move-button" type="button" value="right" title="Next Line"><span class="dashicons dashicons-arrow-right" ></span></button>' .
     372                    '<button class="wic-form-button email-action-button trigger-email-process-button" id="wic-email-record-reply-button" type="button" value="reply" title="Record incoming and send outgoing" >Send</button>' .
     373                    '<button class="wic-form-button email-action-button trigger-email-process-button" id="wic-email-record-button" type="button" value="record" title="Record incoming" ><span class="dashicons dashicons-yes" ></span></button>' .
     374                    '<button class="wic-form-button email-action-button" id="wic-email-close-button" type="button" title="Close"><span class="dashicons dashicons-no"></span></button>' .
     375                '</div>' .
    376376            '<div id = "wic-inbox-detail-wrapper" >' .
    377377                '<div class="wic-dashboard-title inbox-legend"  id = "wic-message-sender-header">' .
     
    431431            '<div id="reply-help-sidebar" class="wic-mce-sidebar">
    432432                <div class="wic-mce-sidebar-section" >
     433                    <p><span class="dashicons dashicons-thumbs-up"></span><p>
     434                    <p><em>Approve this email draft -- move from Assigned tab to Ready tab.</em></p>
     435                </div>
     436                <div class="wic-mce-sidebar-section" >
    433437                    <p><span class="dashicons dashicons-archive"></span><p>
    434438                    <p><em>Delete the emails with this subject line (one time).</em></p>
  • wp-issues-crm/trunk/sql/wic_structures.sql

    r2145245 r2147379  
    255255KEY extended_message_id_key (extended_message_id(100)),
    256256KEY from_domain_key (from_domain(100)),
     257KEY staff_subject (inbox_defined_staff,subject(100)),
    257258KEY staff_final_subject (inbox_defined_staff,inbox_defined_reply_is_final,subject(100))
    258259) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
  • wp-issues-crm/trunk/wp-issues-crm.php

    r2145245 r2147379  
    44 * Plugin URI: http://wp-issues-crm.com
    55 * Description: Constituent Relationship Management for organizations that respond to constituents.  Organizes constituent contacts ( calls, etc. ) around Wordpress posts and categories.
    6  * Version: 4.4.1.4
     6 * Version: 4.5.0.1
    77 * Author: Will Brownsberger
    88 * Author URI: http://willbrownsberger.com
     
    1212 *  Text Domain: wp-issues-crm
    1313 *
    14  *  Copyright 2015, 2016, 2017, 2018, 2019  WILL BROWNSBERGER  (email : willbrownsberger@gmail.com)
     14 *  Copyright 2015, 2016, 2017, 2018, 2019  WILL BROWNSBERGER  (email : will@brownsberger.net)
    1515
    1616    This program is free software; you can redistribute it and/or modify
     
    3939// set database version global;
    4040global $wp_issues_crm_db_version;
    41 $wp_issues_crm_db_version = '4.5.0.0.0.1';
     41$wp_issues_crm_db_version = '4.5.0.1';
    4242/*
    4343* set js_css version global -- three possibilities:
Note: See TracChangeset for help on using the changeset viewer.