Changeset 1492501
- Timestamp:
- 09/08/2016 12:50:26 PM (10 years ago)
- Location:
- crm-by-tpc/trunk
- Files:
-
- 4 added
- 5 edited
-
TPC/CRM/Admin/Settings.php (added)
-
TPC/CRM/Admin/Users.php (modified) (4 diffs)
-
assets/icon-128x128.png (added)
-
assets/icon-256x256.png (added)
-
assets/js/admin-users.js (modified) (28 diffs)
-
deployment-scripts (added)
-
load.php (modified) (3 diffs)
-
readme.md (modified) (4 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
crm-by-tpc/trunk/TPC/CRM/Admin/Users.php
r1267270 r1492501 79 79 { 80 80 $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 ); 83 83 $meta_data = get_user_meta($user->ID); 84 84 $html = $wp_list_table->get_single_row( $user->ID, $user, $rows, $i ); … … 88 88 'lastname' => (!empty($user->last_name)) ? strtolower($user->last_name) : "", 89 89 'date_registered' => date("m-d-Y", strtotime($user->user_registered)), 90 'website' => (!empty($user->user_url)) ? strtolower($user->user_url) : "", 90 91 'posts' => $numposts, 91 92 'html' => $html); … … 156 157 'lastname' => (!empty($user->last_name)) ? strtolower($user->last_name) : "", 157 158 'date_registered' => date("m-d-Y", strtotime($user->user_registered)), 159 'website' => (!empty($user->user_url) ? strtolower($user->user_url) : ""), 158 160 'posts' => $numposts, 159 161 'html' => $html); … … 300 302 public function getFilters( ) { 301 303 $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 ); 309 318 310 319 return apply_filters( 'tpc_crm_usrs_table_filters', $filters ); -
crm-by-tpc/trunk/assets/js/admin-users.js
r1267270 r1492501 58 58 } 59 59 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 } 61 76 //Between dates: 62 77 var date_from = $('.filter-inputs input[name="between-dates[from]"]').val(); … … 76 91 } 77 92 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 78 107 //Before date: 79 108 var before_date = $('.filter-inputs input[name="before-date[value]"]').val(); … … 89 118 } 90 119 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 91 133 //After date: 92 134 var after_date = $('.filter-inputs input[name="after-date[value]"]').val(); … … 104 146 105 147 //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 106 183 //Lesser than: 107 184 $('.filter-inputs input[name="lesser-than[value][]"]').each(function() { … … 139 216 }); 140 217 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 141 256 //Greater than: 142 257 $('.filter-inputs input[name="greater-than[value][]"]').each(function() { … … 172 287 if(typeof default_field_chosen !== 'undefined') 173 288 // 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++; 174 337 break; 175 338 } … … 230 393 }); 231 394 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 232 406 //Contains: 233 407 $('.filter-inputs input[name="contains[value][]"]').each(function() { … … 839 1013 } ); 840 1014 841 _getForm().on( 'key down.input', '.filter-input', function(e){1015 _getForm().on( 'keyup.input', '.filter-input', function(e){ 842 1016 fnApplyFilters( ); 843 1017 $this.userDataTable.fnReloadAjax( ); … … 904 1078 _addBetweenDatesFilter( val.field, val.from, val.to ); 905 1079 break; 1080 case "not-between-dates": 1081 _checkFilter( 'not_between_dates' ); 1082 _addBetweenDatesFilter( val.field, val.form, val.to); 1083 break; 906 1084 case "before-date": 907 1085 _checkFilter( 'before_date' ); 908 1086 _addBeforeDate( val.field, val.value ); 1087 break; 1088 case "not-before-date": 1089 _checkFilter( 'not_before_date' ); 1090 _addNotBeforeDate( val.field, val.value ); 909 1091 break; 910 1092 case "after-date": … … 912 1094 _addAfterDate( val.field, val.value ); 913 1095 break; 1096 case "not-after-date": 1097 _checkFilter( 'not_after_date' ); 1098 _addNotAfterDate( val.field, val.value ); 914 1099 case "lesser-than": 915 1100 _checkFilter( 'field_lesser_than' ); … … 917 1102 _addLesserThanField( opt.field, opt.value ); 918 1103 } ); 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 }); 919 1110 break; 920 1111 case "greater-than": … … 924 1115 } ); 925 1116 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 }); 926 1122 case "equals": 927 1123 _checkFilter( 'field_equal' ); … … 930 1126 } ); 931 1127 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; 932 1134 case "contains": 933 1135 _checkFilter( 'field_contains' ); 934 1136 $.each( val, function( j, opt ) { 935 1137 _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 ); 936 1144 } ); 937 1145 break; … … 1100 1308 1101 1309 if( fixValue ) { 1102 var fieldValue = $( '<select class="filter-input" name="greater-than[value][]" disabled></sel ct>' );1310 var fieldValue = $( '<select class="filter-input" name="greater-than[value][]" disabled></select>' ); 1103 1311 } else { 1104 1312 var fieldValue = $( '<input class="filter-input" type="text" name="greater-than[value][]" disabled>' ); … … 1198 1406 fieldValue.removeClass( 'ui-autocomplete-loading' ); 1199 1407 } ); 1200 1408 1201 1409 return { 1202 1410 input : fieldInput, … … 1234 1442 * ================================================================ 1235 1443 */ 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 1236 1518 /** 1237 1519 * Adds a field for between two dates 1238 1520 * @param {string|object} startDate Starting Date 1239 * @param {string|object} endDate End Date k1521 * @param {string|object} endDate End Date 1240 1522 */ 1241 1523 var _addBetweenDatesFilter = function( field, startDate, endDate ) { … … 1307 1589 1308 1590 /** 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 /** 1309 1627 * Adds a before date filter field 1310 1628 * @param {string|object} defaultDate Default date … … 1343 1661 1344 1662 /** 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 /** 1345 1699 * Adds an after date field 1346 1700 * @param {string|object} defaultDate Default date … … 1372 1726 .append( ' is after ') 1373 1727 .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 ); 1374 1756 1375 1757 fields.input.chosen( ); … … 1406 1788 1407 1789 /** 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 /** 1408 1817 * Adds a greater than field 1409 1818 * @param {string} defaultField Default Field Name … … 1433 1842 1434 1843 /** 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 /** 1435 1876 * Adds an equals field 1436 1877 * @param {string} defaultField Default Field Name … … 1463 1904 }; 1464 1905 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 1465 1934 /** 1466 1935 * Adds a contains field … … 1506 1975 } 1507 1976 } 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 } 1509 2004 /** 1510 2005 * Create the Filters sidebar widget … … 1653 2148 .trigger( 'chosen:updated' ) 1654 2149 .trigger( 'userFiltersChanged', [ val ] ); 1655 2150 //alert(val); 1656 2151 val = _checkFilter( val ); 1657 2152 … … 1662 2157 $('.filter-inputs input[name="between-dates[from]"]').trigger('change'); 1663 2158 break; 2159 case "not_between_dates": 2160 _addNotBetweenDatesFilter( ); 2161 $('.filter-inputs input[name="not-between-dates[from]"]').trigger('change'); 2162 break; 1664 2163 case "before_date": 1665 2164 _addBeforeDate( ); 1666 2165 $('.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'); 1667 2170 break; 1668 2171 case "after_date": … … 1670 2173 $('.filter-inputs input[name="after-date[value]"]').trigger('change'); 1671 2174 break; 2175 case "not_after_date": 2176 _addNotAfterDate( ); 2177 $('.filter-inputs input[name="not-after-date[value]"]').trigger('change'); 2178 break; 1672 2179 case "field_lesser_than": 1673 2180 _addLesserThanField( ); 2181 break; 2182 case "field_not_lesser_than": 2183 _addNotLesserThanField( ); 1674 2184 break; 1675 2185 case "field_greater_than": 1676 2186 _addGreaterThanField( ); 1677 2187 break; 2188 case "field_not_greater_than": 2189 _addNotGreaterThanField( ); 2190 break; 1678 2191 case "field_equal": 1679 2192 _addEqualsField( ); 2193 break; 2194 case "field_not_equal": 2195 _addNotEqualsField( ); 1680 2196 break; 1681 2197 case "field_contains": 1682 2198 _addContainsField( ); 1683 2199 break; 2200 case "field_not_contains": 2201 _addNotContainsField(); 1684 2202 default: break; 1685 2203 } … … 1735 2253 $this.userDataTable.fnReloadAjax( ); 1736 2254 } 1737 ); 2255 ).done(function() { 2256 _hideColumns(); 2257 }); 1738 2258 } ); 1739 2259 … … 1760 2280 */ 1761 2281 hideLoadingScreen : _hideLoadingScreen, 1762 2282 /** 2283 * Hide Show User table Columns and Columns Data 2284 */ 2285 hideColumns : _hideColumns, 1763 2286 /** 1764 2287 * Get the table form -
crm-by-tpc/trunk/load.php
r1267270 r1492501 1 1 <?php 2 2 /** 3 * Plugin Name: CRM (Free)4 * Plugin URI: http ://www.theportlandcompany.com/product/customer-relationship-manager-plugin-for-wordpress3 * Plugin Name: IM CRM (Free) 4 * Plugin URI: https://www.iteratemarketing.com/product/crm-plugin-for-wordpress 5 5 * 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 Company7 * Author URI: http://www. theportlandcompany.com8 * Version: 1.1. 56 * Author: Iterate Marketing 7 * Author URI: http://www.iteratemarketing.com/ 8 * Version: 1.1.6 9 9 */ 10 10 defined( 'TPC_CRM_ROOT' ) or define( 'TPC_CRM_ROOT' , dirname( __FILE__ ) ); … … 12 12 defined( 'TPC_CRM_SLUG' ) or define( 'TPC_CRM_SLUG' , 'tpc-crm' ); 13 13 defined( 'TPC_CRM_INSTALLED' ) or define( 'TPC_CRM_INSTALLED', true ); 14 defined( 'TPC_CRM_FREE_VERSION') or define( 'TPC_CRM_FREE_VERSION', '1.1. 5');14 defined( 'TPC_CRM_FREE_VERSION') or define( 'TPC_CRM_FREE_VERSION', '1.1.6'); 15 15 16 16 require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'start.php' ); … … 50 50 $featurePointer = new TPC_CRM_Admin_FeaturePointers( ); 51 51 $featurePointer->run( ); 52 53 $settingsPage = new TPC_CRM_Admin_Settings(); 54 $settingsPage->run(); 52 55 53 56 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 3 3 Repository: http://plugins.svn.wordpress.org/crm-by-tpc/ 4 4 5 **Donate link:** http ://www.theportlandcompany.com/product/crm-plugin-for-wordpress/5 **Donate link:** https://www.iteratemarketing.com/product/crm-plugin-for-wordpress 6 6 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/) 8 8 9 ***Author***: [http ://www.theportlandcompany.com](The Portland Company)9 ***Author***: [https://www.iteratemarketing.com/](Iterate Marketing) 10 10 11 ***Version***: 1.1. 411 ***Version***: 1.1.6 12 12 13 13 **Tags:** crm, customer relationship manager, customer relations manager, address book, crm tool, crm plugin, wordpress crm, wp crm, crm wp, crm wordpress … … 15 15 **Requires at least:** 3.0.1 16 16 17 **Tested up to:** 4. 317 **Tested up to:** 4.5 18 18 19 19 **Stable tag:** 2.2.1 … … 22 22 23 23 ## Description ## 24 [](https://www.youtube.com/watch?v=FfasyDqY0C0&feature=youtube_gdata_player)24 [](https://www.youtube.com/watch?v=FfasyDqY0C0&feature=youtube_gdata_player) 25 25 26 26 ### 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) 28 28 29 29 ### Overview ### … … 34 34 35 35 ### 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) 37 37 38 38 * **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) 41 41 42 42 ### 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) 44 44 45 45 1. [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/)46 2. Send a message via [Support forums](https://www.iteratemarketing.com/forums) 47 3. [We'll send you a coupon to upgrade for just $29! »](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress) 48 48 49 49 50 50 ## 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) 52 52 53 53 ## Screenshots ## -
crm-by-tpc/trunk/readme.txt
r1241787 r1492501 1 === CRM (Free) ===2 Contributors: d363f86b 1 === IM CRM (Free) === 2 Contributors: d363f86b, tafhim 3 3 Repository: http://plugins.svn.wordpress.org/crm-by-tpc/ 4 4 5 Donate link: http ://www.theportlandcompany.com/product/crm-plugin-for-wordpress/5 Donate link: https://www.iteratemarketing.com/product/crm-plugin-for-wordpress 6 6 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/) 8 8 9 ***Author***: [http ://www.theportlandcompany.com](The Portland Company)9 ***Author***: [https://www.iteratemarketing.com/](Iterate Marketing) 10 10 11 ***Version***: 1.1. 411 ***Version***: 1.1.6 12 12 13 13 Tags: crm, customer relationship manager, customer relations manager, address book, crm tool, crm plugin, wordpress crm, wp crm, crm wp, crm wordpress … … 15 15 Requires at least: 3.0.1 16 16 17 Tested up to: 4. 317 Tested up to: 4.5 18 18 19 19 Stable tag: 2.2.1 … … 25 25 26 26 = 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) 28 28 29 29 = Overview = … … 34 34 35 35 = 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) 37 37 38 38 * **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) 41 41 42 42 = 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) 44 44 45 45 1. [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/)46 2. Send a message via [Support forums](https://www.iteratemarketing.com/forums) 47 3. [We'll send you a coupon to upgrade for just $29! »](https://www.iteratemarketing.com/product/crm-plugin-for-wordpress) 48 48 49 49 50 50 == 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) 52 52 53 53 == Screenshots ==
Note: See TracChangeset
for help on using the changeset viewer.