Plugin Directory

Changeset 1492501


Ignore:
Timestamp:
09/08/2016 12:50:26 PM (10 years ago)
Author:
d363f86b
Message:

Updated to version 1.16

Location:
crm-by-tpc/trunk
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • crm-by-tpc/trunk/TPC/CRM/Admin/Users.php

    r1267270 r1492501  
    7979        {
    8080            $userid = $user->ID;
    81             $post_counts = count_many_users_posts( array( $userid ) );
    82             $numposts = intval($post_counts[$userid]);
     81            $post_counts = count_user_posts( $userid );
     82            $numposts = intval($post_counts );
    8383            $meta_data = get_user_meta($user->ID);
    8484            $html = $wp_list_table->get_single_row( $user->ID, $user, $rows, $i );
     
    8888                                  'lastname' => (!empty($user->last_name)) ? strtolower($user->last_name) : "",
    8989                                  'date_registered' => date("m-d-Y", strtotime($user->user_registered)),
     90                                  'website' =>  (!empty($user->user_url)) ? strtolower($user->user_url) : "",
    9091                                  'posts' => $numposts,
    9192                                  'html' => $html);
     
    156157                'lastname' => (!empty($user->last_name)) ? strtolower($user->last_name) : "",
    157158                'date_registered' => date("m-d-Y", strtotime($user->user_registered)),
     159                'website' => (!empty($user->user_url) ? strtolower($user->user_url) : ""),
    158160                'posts' => $numposts,
    159161                'html' => $html);
     
    300302    public function getFilters( ) {
    301303        $filters                         = array( );
    302         $filters[ 'between_dates' ]      = __( "Between mm-dd-yyyy and mm-dd-yyyy", TPC_CRM_SLUG );
    303         $filters[ 'before_date' ]        = __( "Before mm-dd-yyyy"                , TPC_CRM_SLUG );
    304         $filters[ 'after_date' ]         = __( "After mm-dd-yyyy"                 , TPC_CRM_SLUG );
    305         $filters[ 'field_lesser_than' ]  = __( "Lesser than field"                , TPC_CRM_SLUG );
    306         $filters[ 'field_greater_than' ] = __( "Greater than field"               , TPC_CRM_SLUG );
    307         $filters[ 'field_equal' ]        = __( "Equal to field"                   , TPC_CRM_SLUG );
    308         $filters[ 'field_contains' ]     = __( "Field contains"                   , TPC_CRM_SLUG );
     304        $filters[ 'between_dates' ]            = __( "Between mm-dd-yyyy and mm-dd-yyyy"                    , TPC_CRM_SLUG );
     305        $filters[ 'before_date' ]              = __( "Before mm-dd-yyyy"                                    , TPC_CRM_SLUG );
     306        $filters[ 'after_date' ]               = __( "After mm-dd-yyyy"                                     , TPC_CRM_SLUG );
     307        $filters[ 'field_lesser_than' ]        = __( "Lesser than field"                                    , TPC_CRM_SLUG );
     308        $filters[ 'field_greater_than' ]       = __( "Greater than field"                                   , TPC_CRM_SLUG );
     309        $filters[ 'field_equal' ]              = __( "Equal to field"                                       , TPC_CRM_SLUG );
     310        $filters[ 'field_contains' ]           = __( "Field contains"                                       , TPC_CRM_SLUG );
     311        $filters[ 'field_not_equal' ]          = __( "Not equal to field"                                   , TPC_CRM_SLUG );
     312        $filters[ 'field_not_contains' ]       = __( "Field does not contain"                               , TPC_CRM_SLUG );
     313        $filters[ 'not_before_date' ]          = __( "Not before mm-dd-yyyy"                                , TPC_CRM_SLUG );
     314        $filters[ 'not_after_date' ]           = __( "Not after mm-dd-yyyy"                                 , TPC_CRM_SLUG );
     315        $filters[ 'not_between_dates' ]        = __( "Not between mm-dd-yyyy and mm-dd-yyyy"                , TPC_CRM_SLUG );
     316        $filters[ 'field_not_lesser_than' ]    = __( "Not lesser than field"                                , TPC_CRM_SLUG );
     317        $filters[ 'field_not_greater_than' ]   = __( "Not greater than field"                               , TPC_CRM_SLUG );
    309318
    310319        return apply_filters( 'tpc_crm_usrs_table_filters', $filters );
  • crm-by-tpc/trunk/assets/js/admin-users.js

    r1267270 r1492501  
    5858                }
    5959
    60 
     60                //Not between dates:
     61                var not_date_from = $('.filter-inputs input[name="not-between-dates[from]"]').val();
     62                var not_date_to = $('.filter-inputs input[name="not-between-dates[to]"]').val();
     63                if (((!!not_date_from) && (typeof not_date_from !== 'undefined')) && ((!!not_date_to) && (typeof not_date_to !== 'undefined')))
     64                {
     65                    checked = true;
     66                    filtered_fields++;
     67
     68                    var not_from_dt = not_date_from.split('/');
     69                    var not_from = new Date(not_from_dt[2], parseInt(not_from_dt[0])-1, not_from_dt[1]);
     70
     71                    var not_to_dt = not_date_to.split('/');
     72                    var not_to = new Date(not_to_dt[2], parseInt(not_to_dt[0])-1, not_to_dt[1]);
     73
     74                    if (registered_date <= not_from || registered_date >= not_to) fields_passed++;
     75                }
    6176                //Between dates:
    6277                var date_from = $('.filter-inputs input[name="between-dates[from]"]').val();
     
    7691                }
    7792
     93
     94                //Not before date:
     95                var not_before_date = $('.filter-inputs input[name="not-before-date[value]"]').val();
     96                if ((!!not_before_date) && (typeof not_before_date !== 'undefined'))
     97                {
     98                    checked = true;
     99                    filtered_fields++;
     100
     101                    var not_before_dt = not_before_date.split('/');
     102                    var not_before = new Date(not_before_dt[2], parseInt(not_before_dt[0])-1, not_before_dt[1]);
     103
     104                    if (registered_date >= not_before) fields_passed++;
     105                }
     106
    78107                //Before date:
    79108                var before_date = $('.filter-inputs input[name="before-date[value]"]').val();
     
    89118                }
    90119
     120                //Not after date:
     121                var not_after_date = $('.filter-inputs input[name="not-after-date[value]"]').val();
     122                if ((!!not_after_date) && (typeof not_after_date !== 'undefined'))
     123                {
     124                    checked = true;
     125                    filtered_fields++;
     126
     127                    var not_after_dt = not_after_date.split('/');
     128                    var not_after = new Date(not_after_dt[2], parseInt(not_after_dt[0])-1, not_after_dt[1]);
     129
     130                    if (registered_date <= not_after) fields_passed++;
     131                }
     132
    91133                //After date:
    92134                var after_date = $('.filter-inputs input[name="after-date[value]"]').val();
     
    104146
    105147                //Multiple filter fields:
     148                //Not lesser than:
     149                $('.filter-inputs input[name="not-lesser-than[value][]"]').each(function() {
     150                    var parent = $(this).closest( '.filter-inputs' );
     151                    var field_choosen = parent.find( '.chosen-container' ).first().find( '.chosen-single span' ).html();
     152
     153                    var value = $(this).val();
     154                    if ((!!value) && (typeof value !== 'undefined'))
     155                    {
     156                        checked = true;
     157                        filtered_fields++;
     158
     159                        switch (field_choosen)
     160                        {
     161                            case "Posts":
     162                                if (parseInt(user.posts) >= parseInt(value)) fields_passed++;
     163                                break;
     164                            case "Date Registered":
     165                                var dt = value.split('/');
     166                                if ((typeof dt[0] !== 'undefined') && (typeof dt[1] !== 'undefined') && (typeof dt[2] !== 'undefined'))
     167                                {
     168                                    var lesser_date = new Date(dt[2], parseInt(dt[0])-1, dt[1]);
     169                                    if (registered_date >= lesser_date) fields_passed++;
     170                                }else{
     171                                    //We exclude invalid values for filtering search results,
     172                                    //therefore, we decrement back the filtered_fields variable to its
     173                                    //previous count.
     174                                    filtered_fields--;
     175                                }
     176                                break;
     177                            default:
     178                                break;
     179                        }
     180                    }
     181                });
     182
    106183                //Lesser than:
    107184                $('.filter-inputs input[name="lesser-than[value][]"]').each(function() {
     
    139216                });
    140217
     218                //Not greater than:
     219                $('.filter-inputs input[name="not-greater-than[value][]"]').each(function() {
     220                    var parent = $(this).closest( '.filter-inputs' );
     221                    var field_choosen = parent.find( '.chosen-container' ).first().find( '.chosen-single span' ).html();
     222                    var default_field = parent.find( '.chosen-container' ).first().find( '.chosen-single span' ).html().toLowerCase();
     223                    var default_field_chosen = default_field.replace(/ /ig, "_");
     224                    var value = $(this).val();
     225                    if ((!!value) && (typeof value !== 'undefined'))
     226                    {
     227                        checked = true;
     228                        filtered_fields++;
     229
     230                        switch (field_choosen)
     231                        {
     232                            case "Posts":
     233                                if (parseInt(user.posts) <= parseInt(value)) fields_passed++;
     234                                break;
     235                            case "Date Registered":
     236                                var dt = value.split('/');
     237                                if ((typeof dt[0] !== 'undefined') && (typeof dt[1] !== 'undefined') && (typeof dt[2] !== 'undefined'))
     238                                {
     239                                    var greater_date = new Date(dt[2], parseInt(dt[0])-1, dt[1]);
     240                                    if (registered_date <= greater_date) fields_passed++;
     241                                }else{
     242                                    //We exclude invalid values for filtering search results,
     243                                    //therefore, we decrement back the filtered_fields variable to its
     244                                    //previous count.
     245                                    filtered_fields--;
     246                                }
     247                                break;
     248                            default:
     249                                if(typeof default_field_chosen !== 'undefined')
     250                                // console.log(typeof default_field_chosen);
     251                                    break;
     252                        }
     253                    }
     254                });
     255
    141256                //Greater than:
    142257                $('.filter-inputs input[name="greater-than[value][]"]').each(function() {
     
    172287                                if(typeof default_field_chosen !== 'undefined')
    173288                                 // console.log(typeof default_field_chosen);
     289                                break;
     290                        }
     291                    }
     292                });
     293
     294                //Not equal:
     295                $('.filter-inputs select[name="not-equals[value][]"]').each(function() {
     296                    var parent = $(this).closest( '.filter-inputs' );
     297                    var field_choosen = parent.find( '.chosen-container' ).first().find( '.chosen-single span' ).html();
     298                    var default_field = parent.find( '.chosen-container' ).first().find( '.chosen-single span' ).html().toLowerCase();
     299                    var default_field_chosen = default_field.replace(/ /ig, "_");
     300                    var value = $(this).val();
     301                    if( (!!value) && (typeof value !== 'undefined' ) ) {
     302
     303                        checked = true;
     304                        filtered_fields++;
     305                        switch (field_choosen) {
     306
     307                            case "Username":
     308                                if (user.login !== value.toLowerCase()) fields_passed++;
     309                                break;
     310                            case "Name":
     311                                if ((user.firstname !== value.toLowerCase()) || (user.lastname === value.toLowerCase())) fields_passed++;
     312                                break;
     313                            case "Email":
     314                                if (user.email !== value.toLowerCase()) fields_passed++;
     315                                break;
     316                            case "Role":
     317                                if (user.roles.indexOf(value.toLowerCase()) == -1) fields_passed++;
     318                                break;
     319                            case "Posts":
     320                                if (parseInt(user.posts) !== parseInt(value.toLowerCase())) fields_passed++;
     321                                break;
     322                            case "Date Registered":
     323                                var dt = value.split('/');
     324                                if ((typeof dt[0] !== 'undefined') && (typeof dt[1] !== 'undefined') && (typeof dt[2] !== 'undefined'))
     325                                {
     326                                    var entered_date = new Date(dt[2], parseInt(dt[0])-1, dt[1]);
     327                                    if (registered_date !== entered_date) fields_passed++;
     328                                }else{
     329                                    //We exclude invalid values for filtering search results,
     330                                    //therefore, we decrement back the filtered_fields variable to its
     331                                    //previous count.
     332                                    filtered_fields--;
     333                                }
     334                                break;
     335                            default:
     336                                if(user[default_field_chosen].indexOf(value) == -1) fields_passed++;
    174337                                break;
    175338                        }
     
    230393                });
    231394
     395                //Does not contain:
     396                $('.filter-inputs input[name="not-contains[value][]"]').each(function() {
     397                    var value = $(this).val();
     398                    if ((!!value) && (typeof value !== 'undefined'))
     399                    {
     400                        checked = true;
     401                        filtered_fields++;
     402                        if (user.index.indexOf(value.toLowerCase()) == -1) fields_passed++;
     403                    }
     404                });
     405
    232406                //Contains:
    233407                $('.filter-inputs input[name="contains[value][]"]').each(function() {
     
    8391013        } );
    8401014
    841         _getForm().on( 'keydown.input', '.filter-input', function(e){
     1015        _getForm().on( 'keyup.input', '.filter-input', function(e){
    8421016            fnApplyFilters( );
    8431017            $this.userDataTable.fnReloadAjax( );
     
    9041078                    _addBetweenDatesFilter( val.field, val.from, val.to );
    9051079                    break;
     1080                case "not-between-dates":
     1081                    _checkFilter( 'not_between_dates' );
     1082                    _addBetweenDatesFilter( val.field, val.form, val.to);
     1083                    break;
    9061084                case "before-date":
    9071085                    _checkFilter( 'before_date' );
    9081086                    _addBeforeDate( val.field, val.value );
     1087                    break;
     1088                case "not-before-date":
     1089                    _checkFilter( 'not_before_date' );
     1090                    _addNotBeforeDate( val.field, val.value );
    9091091                    break;
    9101092                case "after-date":
     
    9121094                    _addAfterDate( val.field, val.value );
    9131095                    break;
     1096                case "not-after-date":
     1097                    _checkFilter( 'not_after_date' );
     1098                    _addNotAfterDate( val.field, val.value );
    9141099                case "lesser-than":
    9151100                    _checkFilter( 'field_lesser_than' );
     
    9171102                        _addLesserThanField( opt.field, opt.value );
    9181103                    } );
     1104                    break;
     1105                case "not-lesser-than":
     1106                    _checkFilter( 'field_not_lesser_than' );
     1107                    $.each( val, function(j, opt) {
     1108                        _addNotLesserThanField( opt.field, opt.value );
     1109                    });
    9191110                    break;
    9201111                case "greater-than":
     
    9241115                    } );
    9251116                    break;
     1117                case "not-greater-than":
     1118                    _checkFilter( 'field_not_greater_than' );
     1119                    $.each( val, function(j, opt) {
     1120                        _addNotGreaterThanField( opt.field, opt.value)
     1121                    });
    9261122                case "equals":
    9271123                    _checkFilter( 'field_equal' );
     
    9301126                    } );
    9311127                    break;
     1128                case "not-equals":
     1129                    _checkFilter('field_not_equal');
     1130                    $.each(val, function(j, opt) {
     1131                        _addNotEqualsField(opt.field, opt.value);
     1132                    });
     1133                    break;
    9321134                case "contains":
    9331135                    _checkFilter( 'field_contains' );
    9341136                    $.each( val, function( j, opt ) {
    9351137                        _addContainsField( opt.field, opt.value );
     1138                    } );
     1139                    break;
     1140                case "not-contains":
     1141                    _checkFilter( 'field_not_contains' );
     1142                    $.each( val, function( j, opt ) {
     1143                        _addNotContainsField( opt.field, opt.value );
    9361144                    } );
    9371145                    break;
     
    11001308
    11011309        if( fixValue ) {
    1102             var fieldValue = $( '<select class="filter-input" name="greater-than[value][]" disabled></selct>' );
     1310            var fieldValue = $( '<select class="filter-input" name="greater-than[value][]" disabled></select>' );
    11031311        } else {
    11041312            var fieldValue = $( '<input class="filter-input" type="text" name="greater-than[value][]" disabled>' );
     
    11981406                    fieldValue.removeClass( 'ui-autocomplete-loading' );
    11991407                 } );
    1200 
     1408           
    12011409            return {
    12021410                input   : fieldInput,
     
    12341442     * ================================================================
    12351443     */
     1444
     1445    /**
     1446     * Adds a field for not between two dates
     1447     * @param {string|object} startDate     Starting Date
     1448     * @param {string|object} endDate       End Date
     1449     */
     1450    var _addNotBetweenDatesFilter = function( field, startDate, endDate ) {
     1451        /* Making the parameters optional */
     1452        field              = field || "date_registered";
     1453        startDate          = startDate || new Date( ),
     1454                endDate            = endDate || new Date( startDate.getTime( ) + ( 24 * 60 * 60 * 1000 ) );
     1455
     1456        /* reformats the string */
     1457        var startDateFormatted = _formatDate( startDate );
     1458        var endDateFormatted   = _formatDate( endDate );
     1459
     1460        startDate          = startDateFormatted.obj;
     1461        endDate            = endDateFormatted.obj;
     1462
     1463        var from         = $( '<input type="text" name="not-between-dates[from]" class="filter-input input-date-from input-datepicker">' ),
     1464                to           = $( '<input type="text" name="not-between-dates[to]" class="filter-input input-date-to input-datepicker">' ),
     1465                fromVal      = from.val( ),
     1466                toVal        = to.val ( ),
     1467                fields      = _createFilterableColumns( field, "date_registered", [ "date" ] );
     1468
     1469        if( fields === false ) {
     1470            _showNotification( "No available filters", true );
     1471            return false;
     1472        }
     1473
     1474        from.val( startDateFormatted.str );
     1475        from.datepicker()
     1476                .on( 'changeDate', function( ev ) {
     1477                    startDate   = ev.date;
     1478
     1479                    if( startDate.valueOf( ) > endDate.valueOf( ) ) {
     1480                        from.val( fromVal );
     1481                        _showNotification( 'The start date should be lesser than the end date', true );
     1482                    } else {
     1483                        from.datepicker('hide');
     1484                        fromVal = from.val( );
     1485                    }
     1486                }).data( 'datepicker' );
     1487
     1488        to.val( endDateFormatted.str );
     1489        to.datepicker()
     1490                .on( 'changeDate', function( ev ) {
     1491                    endDate     = ev.date;
     1492
     1493                    if( startDate.valueOf( ) > endDate.valueOf( ) ) {
     1494                        to.val( toVal );
     1495                        _showNotification( 'The start date should be lesser than the end date', true );
     1496                    } else {
     1497                        to.datepicker('hide');
     1498                        toVal = to.val( );
     1499                    }
     1500                }).data( 'datepicker' );
     1501
     1502        fields.input.attr( "name", "not-between-dates[field]" );
     1503        _createFilterField( 'not_between_dates', function( field ) {
     1504            field
     1505                    .append( "If " )
     1506                    .append( fields.input )
     1507                    .append( ' <br>is not between ' )
     1508                    .append( from )
     1509                    .append( 'and ' )
     1510                    .append( to );
     1511
     1512            fields.input.chosen( );
     1513            return field;
     1514        });
     1515    };
     1516
     1517
    12361518    /**
    12371519     * Adds a field for between two dates
    12381520     * @param {string|object} startDate     Starting Date
    1239      * @param {string|object} endDate       End Datek
     1521     * @param {string|object} endDate       End Date
    12401522     */
    12411523    var _addBetweenDatesFilter = function( field, startDate, endDate ) {
     
    13071589
    13081590    /**
     1591     * Adds a Not before date filter field
     1592     * @param {string|object} defaultDate   Default date
     1593     */
     1594    var _addNotBeforeDate = function( field, defaultDate ) {
     1595        /* make the parameter optional */
     1596        field               = field || "date_registered";
     1597        defaultDate         = defaultDate || new Date( );
     1598
     1599        /* reformat date */
     1600        var defaulDateFormatted = _formatDate( defaultDate );
     1601        defaultDate             = defaulDateFormatted.obj;
     1602        var fields              = _createFilterableColumns( field, "date_registered", [ "date" ] );
     1603
     1604        if( fields === false ) {
     1605            _showNotification( "No available filters", true );
     1606            return false;
     1607        }
     1608
     1609        var dateInput = $( '<input type="text" name="not-before-date[value]" class="filter-input input-date-before input-datepicker">' );
     1610        dateInput.val( defaulDateFormatted.str );
     1611        dateInput.datepicker( );
     1612
     1613        fields.input.attr( "name", "not-before-date[field]" );
     1614        _createFilterField( 'not_before_date', function( field ) {
     1615            field
     1616                    .append( "If ")
     1617                    .append( fields.input )
     1618                    .append( ' is not before ')
     1619                    .append( dateInput );
     1620
     1621            fields.input.chosen( );
     1622            return field;
     1623        } );
     1624    };
     1625
     1626    /**
    13091627     * Adds a before date filter field
    13101628     * @param {string|object} defaultDate   Default date
     
    13431661
    13441662    /**
     1663     * Adds a Not after date field
     1664     * @param {string|object} defaultDate   Default date
     1665     */
     1666    var _addAfterDate       = function( field, defaultDate ) {
     1667        /* make the parameter optional */
     1668        field               = field || "date_registered";
     1669        defaultDate         = defaultDate || new Date( );
     1670
     1671        /* reformat date */
     1672        var defaulDateFormatted = _formatDate( defaultDate );
     1673        defaultDate             = defaulDateFormatted.obj;
     1674        var fields              = _createFilterableColumns( field, "date_registered", [ "date" ] );
     1675
     1676        if( fields === false ) {
     1677            _showNotification( "No available filters", true );
     1678            return false;
     1679        }
     1680
     1681        var dateInput = $( '<input type="text" name="not-after-date[value]" class="filter-input input-date-after input-datepicker">' );
     1682        dateInput.val( defaulDateFormatted.str );
     1683        dateInput.datepicker( );
     1684
     1685        fields.input.attr( "name", "not-after-date[field]" );
     1686        _createFilterField( 'not_after_date', function( field ) {
     1687            field
     1688                    .append( "If " )
     1689                    .append( fields.input )
     1690                    .append( ' is not after ')
     1691                    .append( dateInput );
     1692
     1693            fields.input.chosen( );
     1694            return field;
     1695        } );
     1696    };
     1697
     1698    /**
    13451699     * Adds an after date field
    13461700     * @param {string|object} defaultDate   Default date
     
    13721726                .append( ' is after ')
    13731727                .append( dateInput );
     1728
     1729            fields.input.chosen( );
     1730            return field;
     1731        } );
     1732    };
     1733
     1734
     1735    /**
     1736     * Adds a Not lesser than field
     1737     * @param {string} defaultField     Default Field Name
     1738     * @param {string} defaultValue     Default Fiel Value
     1739     */
     1740    var _addNotLesserThanField  = function ( defaultField, defaultValue ) {
     1741        var fields = _createFilterableColumns( defaultField, defaultValue, [ "number", "date" ] );
     1742
     1743        if( fields === false ) {
     1744            _showNotification( "No available filters", true );
     1745            return false;
     1746        }
     1747
     1748        fields.input.attr( "name", "not-lesser-than[field][]" );
     1749        fields.value.attr( "name", "not-lesser-than[value][]" );
     1750        _createFilterField( 'field_not_lesser_than', function( field ) {
     1751            field
     1752                    .append( 'If ' )
     1753                    .append( fields.input )
     1754                    .append( 'is not lesser than ' )
     1755                    .append( fields.value );
    13741756
    13751757            fields.input.chosen( );
     
    14061788
    14071789    /**
     1790     * Adds a Not greater than field
     1791     * @param {string} defaultField     Default Field Name
     1792     * @param {string} defaultValue     Default Field Value
     1793     */
     1794    var _addNotGreaterThanField = function ( defaultField, defaultValue ) {
     1795        var fields = _createFilterableColumns( defaultField, defaultValue, [ "number", "date" ] );
     1796
     1797        if( fields === false ) {
     1798            _showNotification( "No available filters", true );
     1799            return false;
     1800        }
     1801
     1802        fields.input.attr( "name", "not-greater-than[field][]" );
     1803        fields.value.attr( "name", "not-greater-than[value][]" );
     1804        _createFilterField( 'field_not_greater_than', function( field ) {
     1805            field
     1806                    .append( 'If ' )
     1807                    .append( fields.input )
     1808                    .append( 'is not greater than ' )
     1809                    .append( fields.value );
     1810
     1811            fields.input.chosen( );
     1812            return field;
     1813        } );
     1814    };
     1815
     1816    /**
    14081817     * Adds a greater than field
    14091818     * @param {string} defaultField     Default Field Name
     
    14331842
    14341843    /**
     1844     * Adds an not equals field
     1845     * @param {string} defaultField     Default Field Name
     1846     * @param {string} defaultValue     Default Field Value
     1847     */
     1848    var _addNotEqualsField  = function ( defaultField, defaultValue ) {
     1849        var fields = _createFilterableColumns( defaultField, defaultValue, [ "number", "date", "string" ], true );
     1850        console.log(fields);
     1851        if( fields === false ) {
     1852            _showNotification( "No available filters", true );
     1853            return false;
     1854        }
     1855
     1856        fields.input.attr( "name", "not-equals[field][]" );
     1857        fields.value.attr( "name", "not-equals[value][]" );
     1858        _createFilterField( 'field_not_equal', function( field ) {
     1859            field
     1860                    .append( 'If ' )
     1861                    .append( fields.input )
     1862                    .append( 'not equals to ' )
     1863                    .append( fields.value );
     1864
     1865            fields.input.chosen( );
     1866            fields.value.chosen( );
     1867            // fields.input.change( function( ) {
     1868            //  fields.value.trigger( 'chosen:updated' );
     1869            // } );
     1870            return field;
     1871        } );
     1872    };
     1873
     1874
     1875    /**
    14351876     * Adds an equals field
    14361877     * @param {string} defaultField     Default Field Name
     
    14631904    };
    14641905
     1906
     1907    /**
     1908     * Adds a does not contain field
     1909     * @param {string} defaultField     Default Field Name
     1910     * @param {string} defaultValue     Default Field Value
     1911     */
     1912    var _addNotContainsField = function ( defaultField, defaultValue ) {
     1913        var fields = _createFilterableColumns( defaultField, defaultValue, [ "string" ] );
     1914
     1915        if( fields === false ) {
     1916            _showNotification( "No available filters", true );
     1917            return false;
     1918        }
     1919
     1920        fields.input.attr( "name", "not-contains[field][]" );
     1921        fields.value.attr( "name", "not-contains[value][]" );
     1922        _createFilterField( 'field_not_contains', function( field ) {
     1923            field
     1924                    .append( 'If ' )
     1925                    .append( fields.input )
     1926                    .append( 'does not contain ' )
     1927                    .append( fields.value );
     1928
     1929            fields.input.chosen( );
     1930            return field;
     1931        } );
     1932    }
     1933
    14651934    /**
    14661935     * Adds a contains field
     
    15061975        }
    15071976    }
    1508 
     1977    /**
     1978     * Hiding and Showing Columns and columns Data
     1979     */
     1980    var _hideColumns = function() {
     1981        $('.hide-column-tog').each(function(){
     1982
     1983            var thisValS = $(this).val();
     1984            var isChecked = $(this).prop('checked');
     1985            var table = $('.wp-list-table');
     1986            var th = table.find('thead th, thead td');
     1987            var counter = 0;
     1988            //var posFound = 0;
     1989            th.each(function() {
     1990                counter++;
     1991                if($(this).attr('id') == thisValS) return false;
     1992            });
     1993
     1994
     1995            var td = table.find('tbody tr td:nth-child(' + counter + ')');
     1996            td.each(function() {
     1997                if(isChecked === false)
     1998                    $(this).addClass('hidden');
     1999                else
     2000                    $(this).removeClass('hidden');
     2001            });
     2002        });
     2003    }
    15092004    /**
    15102005     * Create the Filters sidebar widget
     
    16532148                    .trigger( 'chosen:updated' )
    16542149                    .trigger( 'userFiltersChanged', [ val ] );
    1655 
     2150                //alert(val);
    16562151                val = _checkFilter( val );
    16572152
     
    16622157                        $('.filter-inputs input[name="between-dates[from]"]').trigger('change');
    16632158                        break;
     2159                    case "not_between_dates":
     2160                        _addNotBetweenDatesFilter( );
     2161                        $('.filter-inputs input[name="not-between-dates[from]"]').trigger('change');
     2162                        break;
    16642163                    case "before_date":
    16652164                        _addBeforeDate( );
    16662165                        $('.filter-inputs input[name="before-date[value]"]').trigger('change');
     2166                        break;
     2167                    case "not_before_date":
     2168                        _addNotBeforeDate( );
     2169                        $('.filter-inputs input[name="not-before-date[value]"]').trigger('change');
    16672170                        break;
    16682171                    case "after_date":
     
    16702173                        $('.filter-inputs input[name="after-date[value]"]').trigger('change');
    16712174                        break;
     2175                    case "not_after_date":
     2176                        _addNotAfterDate( );
     2177                        $('.filter-inputs input[name="not-after-date[value]"]').trigger('change');
     2178                        break;
    16722179                    case "field_lesser_than":
    16732180                        _addLesserThanField( );
     2181                        break;
     2182                    case "field_not_lesser_than":
     2183                        _addNotLesserThanField( );
    16742184                        break;
    16752185                    case "field_greater_than":
    16762186                        _addGreaterThanField( );
    16772187                        break;
     2188                    case "field_not_greater_than":
     2189                        _addNotGreaterThanField( );
     2190                        break;
    16782191                    case "field_equal":
    16792192                        _addEqualsField( );
     2193                        break;
     2194                    case "field_not_equal":
     2195                        _addNotEqualsField( );
    16802196                        break;
    16812197                    case "field_contains":
    16822198                        _addContainsField( );
    16832199                        break;
     2200                    case "field_not_contains":
     2201                        _addNotContainsField();
    16842202                    default: break;
    16852203                }
     
    17352253                        $this.userDataTable.fnReloadAjax( );
    17362254                    }
    1737                 );
     2255                ).done(function() {
     2256                        _hideColumns();
     2257                    });
    17382258            } );
    17392259
     
    17602280         */
    17612281        hideLoadingScreen : _hideLoadingScreen,
    1762 
     2282        /**
     2283         * Hide Show User table Columns and Columns Data
     2284         */
     2285        hideColumns : _hideColumns,
    17632286        /**
    17642287         * Get the table form
  • crm-by-tpc/trunk/load.php

    r1267270 r1492501  
    11<?php
    22/**
    3  * Plugin Name: CRM (Free)
    4  * Plugin URI: http://www.theportlandcompany.com/product/customer-relationship-manager-plugin-for-wordpress
     3 * Plugin Name: IM CRM (Free)
     4 * Plugin URI: https://www.iteratemarketing.com/product/crm-plugin-for-wordpress
    55 * Description: The CRM Plugin for WordPress is an unobtrusive application that extends the native WordPress Users section to provide better sorting, filtering and search utilities for a variety of purposes such as business professionals who want to track and organize their sales leads with ease.
    6  * Author: The Portland Company
    7  * Author URI: http://www.theportlandcompany.com
    8  * Version: 1.1.5
     6 * Author: Iterate Marketing
     7 * Author URI: http://www.iteratemarketing.com/
     8 * Version: 1.1.6
    99 */
    1010defined( 'TPC_CRM_ROOT'      ) or define( 'TPC_CRM_ROOT'     , dirname( __FILE__ ) );
     
    1212defined( 'TPC_CRM_SLUG'      ) or define( 'TPC_CRM_SLUG'     , 'tpc-crm' );
    1313defined( 'TPC_CRM_INSTALLED' ) or define( 'TPC_CRM_INSTALLED', true );
    14 defined( 'TPC_CRM_FREE_VERSION') or define( 'TPC_CRM_FREE_VERSION', '1.1.5');
     14defined( 'TPC_CRM_FREE_VERSION') or define( 'TPC_CRM_FREE_VERSION', '1.1.6');
    1515
    1616require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'start.php' );
     
    5050    $featurePointer = new TPC_CRM_Admin_FeaturePointers( );
    5151    $featurePointer->run( );
     52
     53    $settingsPage = new TPC_CRM_Admin_Settings();
     54    $settingsPage->run();
    5255
    5356    do_action( 'tpc_crm_loaded' );
  • crm-by-tpc/trunk/readme.md

    r1267270 r1492501  
    1 # CRM (Free) #
    2 **Contributors:** d363f86b
     1# IM CRM (Free) #
     2**Contributors:** d363f86b, tafhim
    33Repository: http://plugins.svn.wordpress.org/crm-by-tpc/
    44
    5 **Donate link:** http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/
     5**Donate link:** https://www.iteratemarketing.com/product/crm-plugin-for-wordpress
    66
    7 ***Plugin URI***: [http://www.theportlandcompany.com/product/crm-plugin-for-wordpress](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress)
     7***Plugin URI***: [https://wordpress.org/plugins/crm-by-tpc/](https://wordpress.org/plugins/crm-by-tpc/)
    88
    9 ***Author***: [http://www.theportlandcompany.com](The Portland Company)
     9***Author***: [https://www.iteratemarketing.com/](Iterate Marketing)
    1010
    11 ***Version***: 1.1.4
     11***Version***: 1.1.6
    1212
    1313**Tags:** crm, customer relationship manager, customer relations manager, address book, crm tool, crm plugin, wordpress crm, wp crm, crm wp, crm wordpress
     
    1515**Requires at least:** 3.0.1
    1616
    17 **Tested up to:** 4.3
     17**Tested up to:** 4.5
    1818
    1919**Stable tag:** 2.2.1
     
    2222
    2323## Description ##
    24 [![Video Demonstration](http://www.theportlandcompany.com/wp-content/uploads/2014/04/youtube-bptpi.png)](https://www.youtube.com/watch?v=FfasyDqY0C0&feature=youtube_gdata_player)
     24[![Video Demonstration](https://www.youtube.com/watch?v=FfasyDqY0C0&feature=youtube_gdata_player)](https://www.youtube.com/watch?v=FfasyDqY0C0&feature=youtube_gdata_player)
    2525
    2626### Demonstration Site ###
    27 [DEMONSTRATION SITE »](http://crm.theportlandcompany.com/wp-admin)
     27[DEMONSTRATION SITE »](http://demos.iteratemarketing.com/?preview#CRM Plugin for WordPress by The Portland Company)
    2828
    2929### Overview ###
     
    3434
    3535### Premium Features ###
    36 [Click Here to Purchase the Premium Version »](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
     36[Click Here to Purchase the Premium Version »](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress)
    3737
    3838* **Presets** – Save your search queries and Filters by giving it a name and saving them. Then just click on that Preset’s name to instantly restore the search queries and Filters along with their respective results. [Available in the Premium Version](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
    39 * **Create Custom Fields** – Integration with Advanced Custom Fields Plugin by Elliott Condon allows Users to quickly and easily create unlimited custom fields that can be displayed in the Users table via Screen Options so they can be quickly and easily searched and filtered. [Available in the Premium Version](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
    40 * **Sortable Columns** – Simply drag and drop columns into a new order and save that order with your Preset so you can quickly and easily find the information you’re. [Available in the Premium Version](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
     39* **Create Custom Fields** – Integration with Advanced Custom Fields Plugin by Elliott Condon allows Users to quickly and easily create unlimited custom fields that can be displayed in the Users table via Screen Options so they can be quickly and easily searched and filtered. [Available in the Premium Version](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress)
     40* **Sortable Columns** – Simply drag and drop columns into a new order and save that order with your Preset so you can quickly and easily find the information you’re. [Available in the Premium Version](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress)
    4141
    4242### Get Premium for just $29! ###
    43 [Click Here to Purchase the Premium Version »](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
     43[Click Here to Purchase the Premium Version »](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress)
    4444
    45451. [Leave a Review on WordPress](http://wordpress.org/plugins/crm-by-tpc/)
    46 2. Send a message to [Support](http://www.theportlandcompany.com/contact-and-support/)
    47 3. [We'll send you a coupon to upgrade for just $29! »](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
     462. Send a message via [Support forums](https://www.iteratemarketing.com/forums)
     473. [We'll send you a coupon to upgrade for just $29! »](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress)
    4848
    4949
    5050## Frequently Asked Questions ##
    51 [You can find our FAQ section on our website.](http://www.theportlandcompany.com/category/products-services/plugins/crm-plugin-for-wordpress/faq/)
     51[Contact us via the support forums](https://www.iteratemarketing.com/question/category/customer-relationship-manager)
    5252
    5353## Screenshots ##
  • crm-by-tpc/trunk/readme.txt

    r1241787 r1492501  
    1 === CRM (Free) ===
    2 Contributors: d363f86b
     1=== IM CRM (Free) ===
     2Contributors: d363f86b, tafhim
    33Repository: http://plugins.svn.wordpress.org/crm-by-tpc/
    44
    5 Donate link: http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/
     5Donate link: https://www.iteratemarketing.com/product/crm-plugin-for-wordpress
    66
    7 ***Plugin URI***: [http://www.theportlandcompany.com/product/crm-plugin-for-wordpress](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress)
     7***Plugin URI***: [https://wordpress.org/plugins/crm-by-tpc/](https://wordpress.org/plugins/crm-by-tpc/)
    88
    9 ***Author***: [http://www.theportlandcompany.com](The Portland Company)
     9***Author***: [https://www.iteratemarketing.com/](Iterate Marketing)
    1010
    11 ***Version***: 1.1.4
     11***Version***: 1.1.6
    1212
    1313Tags: crm, customer relationship manager, customer relations manager, address book, crm tool, crm plugin, wordpress crm, wp crm, crm wp, crm wordpress
     
    1515Requires at least: 3.0.1
    1616
    17 Tested up to: 4.3
     17Tested up to: 4.5
    1818
    1919Stable tag: 2.2.1
     
    2525
    2626= Demonstration Site =
    27 [DEMONSTRATION SITE »](http://crm.theportlandcompany.com/wp-admin)
     27[DEMONSTRATION SITE »](http://demos.iteratemarketing.com/?preview#CRM Plugin for WordPress by The Portland Company)
    2828
    2929= Overview =
     
    3434
    3535= Premium Features =
    36 [Click Here to Purchase the Premium Version »](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
     36[Click Here to Purchase the Premium Version »](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress)
    3737
    3838* **Presets** – Save your search queries and Filters by giving it a name and saving them. Then just click on that Preset’s name to instantly restore the search queries and Filters along with their respective results. [Available in the Premium Version](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
    39 * **Create Custom Fields** – Integration with Advanced Custom Fields Plugin by Elliott Condon allows Users to quickly and easily create unlimited custom fields that can be displayed in the Users table via Screen Options so they can be quickly and easily searched and filtered. [Available in the Premium Version](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
    40 * **Sortable Columns** – Simply drag and drop columns into a new order and save that order with your Preset so you can quickly and easily find the information you’re. [Available in the Premium Version](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
     39* **Create Custom Fields** – Integration with Advanced Custom Fields Plugin by Elliott Condon allows Users to quickly and easily create unlimited custom fields that can be displayed in the Users table via Screen Options so they can be quickly and easily searched and filtered. [Available in the Premium Version](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress)
     40* **Sortable Columns** – Simply drag and drop columns into a new order and save that order with your Preset so you can quickly and easily find the information you’re. [Available in the Premium Version](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress)
    4141
    4242= Get Premium for just $29! =
    43 [Click Here to Purchase the Premium Version »](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
     43[Click Here to Purchase the Premium Version »](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress)
    4444
    45451. [Leave a Review on WordPress](http://wordpress.org/plugins/crm-by-tpc/)
    46 2. Send a message to [Support](http://www.theportlandcompany.com/contact-and-support/)
    47 3. [We'll send you a coupon to upgrade for just $29! »](http://www.theportlandcompany.com/product/crm-plugin-for-wordpress/)
     462. Send a message via [Support forums](https://www.iteratemarketing.com/forums)
     473. [We'll send you a coupon to upgrade for just $29! »](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress)
    4848
    4949
    5050== Frequently Asked Questions ==
    51 [You can find our FAQ section on our website.](http://www.theportlandcompany.com/category/products-services/plugins/crm-plugin-for-wordpress/faq/)
     51[Contact us via the support forums](https://www.iteratemarketing.com/question/category/customer-relationship-manager)
    5252
    5353== Screenshots ==
Note: See TracChangeset for help on using the changeset viewer.