Changeset 2261940
- Timestamp:
- 03/16/2020 05:44:57 PM (6 years ago)
- Location:
- cf7-db-tool/trunk
- Files:
-
- 5 edited
-
assets/css/cf7-bulk-mail.css (modified) (2 diffs)
-
assets/js/cf7-db-bulkmail.js (modified) (5 diffs)
-
cf7-db-tool.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
src/BulkMail.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cf7-db-tool/trunk/assets/css/cf7-bulk-mail.css
r2245565 r2261940 115 115 #cf7-db-bulkmail .wp-editor-wrap { 116 116 width: 100%; 117 padding: 6px 10px 117 padding: 6px 10px; 118 border-radius:5px; 118 119 } 119 120 #cf7-db-bulkmail .dbtool-radio-wrap { … … 132 133 } 133 134 .cf7-dbt-container.bulkmail .cf7-dbt-sidebar-inner{ 134 margin-top: 40px 135 } 135 margin-top: 20px 136 } 137 138 .select_user_wrapper #select_all, .select_user_wrapper #ResetData{ 139 color: #fff; 140 text-shadow: none; 141 cursor: pointer; 142 display: inline-block; 143 min-height: 1em; 144 outline: 0; 145 border: none; 146 vertical-align: baseline; 147 font-family: Lato,'Helvetica Neue',Arial,Helvetica,sans-serif; 148 margin: 0 .25em 0 0; 149 padding: .78571429em 1.5em .78571429em; 150 text-transform: none; 151 text-shadow: none; 152 font-weight: 700; 153 line-height: 1em; 154 font-style: normal; 155 text-align: center; 156 text-decoration: none; 157 border-radius: .28571429rem; 158 -webkit-box-shadow: 0 0 0 1px transparent inset, 0 0 0 0 rgba(34,36,38,.15) inset; 159 box-shadow: 0 0 0 1px transparent inset, 0 0 0 0 rgba(34,36,38,.15) inset; 160 -webkit-user-select: none; 161 -moz-user-select: none; 162 -ms-user-select: none; 163 user-select: none; 164 -webkit-transition: opacity .1s ease,background-color .1s ease,color .1s ease,background .1s ease,-webkit-box-shadow .1s ease; 165 transition: opacity .1s ease,background-color .1s ease,color .1s ease,background .1s ease,-webkit-box-shadow .1s ease; 166 transition: opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease; 167 transition: opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease,-webkit-box-shadow .1s ease; 168 will-change: ''; 169 -webkit-tap-highlight-color: transparent; 170 } 171 .select_user_wrapper #select_all{ 172 background-color: #2185d0; 173 } 174 .select_user_wrapper #select_all:hover{ 175 background-color: #1678c2; 176 } 177 .select_user_wrapper #ResetData{ 178 background-color: #db2828; 179 color: #fff; 180 } 181 .select_user_wrapper #ResetData:hover{ 182 background-color: #d01919; 183 } 184 185 .select_user_wrapper #ResetData{ 186 opacity: 0.65; 187 cursor: not-allowed; 188 } 189 190 191 192 136 193 137 194 @media screen and (max-width: 1300px) { -
cf7-db-tool/trunk/assets/js/cf7-db-bulkmail.js
r2245565 r2261940 4 4 $(document).ready(function(){ 5 5 var OBJ = { 6 department : 0, 7 session : 0 6 cf7form : 0, 8 7 } 9 8 // $('#select-department_list').on('change', function() { … … 12 11 // }); 13 12 14 // $('#select-session_list').on('change', function() { 15 // OBJ.session = $(this).find(":selected").val() ; 16 // callFromDB(); 17 // }); 18 // function callFromDB() { 19 // if(OBJ.department != 0 && OBJ.session != 0){ 20 // $.post(ajax_object.ajax_url,{ 21 // 'action':'bulkMailAjaxDataAction', 22 // 'department': OBJ.department, 23 // 'session': OBJ.session, 24 // },function(data){ 25 // if(data == 0){ 26 // alert('No Data Found'); 27 // }else{ 28 // //console.log(data); 29 // $('#dbtool-user-list').html(data); 30 // } 31 // }) 32 // 33 // } 34 // } 13 $('#select-session_list').on('change', function() { 14 OBJ.cf7form = $(this).find(":selected").val() ; 15 callFromDB(); 16 }); 17 function callFromDB() { 18 if(OBJ.cf7form != 0 ){ 19 $.post(ajax_object.ajax_url,{ 20 'action':'bulkMailAjaxDataAction', 21 'department': OBJ.cf7form, 22 },function(data){ 23 if(data == 0){ 24 alert('No Data Found'); 25 }else{ 26 //console.log(data); 27 $('#dbtool-user-list').html(data); 28 } 29 }) 30 31 } 32 } 35 33 }); 36 34 })(jQuery); 37 35 // arguments: reference to select list, callback function (optional) 36 37 var Totalusers = document.getElementById("dbtool-user-list"); 38 var resetButton = document.getElementById('ResetData') 39 38 40 function getSelectedOptions(sel, fn) { 39 41 var opts = [], opt; … … 71 73 // anonymous function onchange for select list with id demoSel 72 74 document.getElementById('dbtool-user-list').onchange = function(e) { 73 74 75 // get reference to display textarea 75 76 var display = document.getElementById('dbtool-recipient-emails'); 76 77 77 // callback fn handles selected options 78 78 getSelectedOptions(this, callback); 79 79 80 81 82 83 if(resetButton.computedStyleMap().get('cursor').value=='not-allowed') { 84 resetButton.style.cssText = "opacity: 1;cursor: pointer;" 85 } 80 86 }; 81 87 … … 83 89 document.getElementById('select_all').onclick = function(e) { 84 90 var TargetToInputForm = document.getElementById('dbtool-recipient-emails'); 85 var Totalusers = document.getElementById("dbtool-user-list"); 91 86 92 TargetToInputForm.value = ''; 87 93 var emailList = ""; … … 93 99 emailList = emailList.slice(0, emailList.length-1); 94 100 TargetToInputForm.value = emailList; 101 resetButton.style.cssText = "opacity: 1;cursor: pointer;" 95 102 return false; // don't return online form 96 103 }; 104 105 // Reset function for disable remove from mail list 106 107 resetButton.onclick = function(e) { 108 for (var i = 0; i < Totalusers.length; i++) { 109 Totalusers.options[i].removeAttribute("disabled"); 110 } 111 this.style.cssText = "opacity: 0.65;cursor: not-allowed;" 112 } -
cf7-db-tool/trunk/cf7-db-tool.php
r2245565 r2261940 8 8 * Text Domain: cf7-db-tool 9 9 * Tags: contact, cf7, contact form 7, db, export, save, wpcf7, contact form 7 db, contact form 7 database, contact form 7 data export, contact form 7 database addon 10 * Version: 3.0. 010 * Version: 3.0.1 11 11 */ 12 12 13 define('CF7_DBT_VERSION', '3.0. 0');14 define('CF7_DBT_DB_VERSION', '3.0. 0');13 define('CF7_DBT_VERSION', '3.0.1'); 14 define('CF7_DBT_DB_VERSION', '3.0.1'); 15 15 define('CF7_DBT_PATH', __DIR__); 16 16 define('CF7_DBT_URL', plugins_url(basename(CF7_DBT_PATH))); -
cf7-db-tool/trunk/readme.txt
r2245575 r2261940 4 4 Requires at least: 4.8 5 5 Tested up to: 5.3 6 Stable tag: 3.0. 06 Stable tag: 3.0.1 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 31 31 Upcoming features: 32 32 33 * Email integrationf with bulk mail 33 * Choose bulk mail contacts from cf7 forms 34 * Email integration with bulk mail 34 35 35 36 … … 95 96 *Bulk email feature added 96 97 98 = 3.0.1 = 99 *Release Date - March 16, 2020* 100 *Bulk email validation complete, design changed & Reset button issue fixed 101 -
cf7-db-tool/trunk/src/BulkMail.php
r2245565 r2261940 11 11 12 12 $this->cf7DBBulkMail(); 13 //add_action('wp_ajax_bulkMailAjaxDataAction',[$this,'bulkMailAjaxDataAction']);13 add_action('wp_ajax_bulkMailAjaxDataAction',[$this,'bulkMailAjaxDataAction']); 14 14 15 15 } … … 173 173 <input type="button" id="select_all" name="select_all" value="Select All user"> 174 174 </div> 175 <button type="reset" id="ResetData">Reset Data</button> 176 <!-- <div class="select-department">--> 177 <!-- <select id="select-department_list">--> 178 <!-- <option value="">-- --><?php //_e( 'Select Department', 'dumhall' ); ?><!-- --</option>--> 179 <!-- --><?php 180 // 181 // $users = get_users( array( 'fields' => array( 'ID' ) ) ); 182 // foreach($users as $user_id){ 183 // $data = get_user_meta ( $user_id->ID); 184 // if(!empty($data['department'][0])){ 185 // echo '<option value="' . esc_html( $data['department'][0]) . '">' . esc_html( $data['department'][0] ) . '</option>'; 186 // } 187 // } 188 // ?> 189 <!-- </select>--> 190 <!-- </div>--> 191 <!-- <div class="select-session">--> 192 <!-- <select id="select-session_list">--> 193 <!-- <option value="">-- --><?php //_e( 'Select Session', 'dumhall' ); ?><!-- --</option>--> 194 <!-- --><?php 195 // 196 // $users = get_users( array( 'fields' => array( 'ID' ) ) ); 197 // foreach($users as $user_id){ 198 // $data = get_user_meta ( $user_id->ID); 199 // if(isset($data['session'][0])){ 200 // echo '<option value="' . esc_html( $data['session'][0]) . '">' . esc_html( $data['session'][0] ) . '</option>'; 201 // } 202 // } 203 // ?> 204 <!-- </select>--> 205 <!-- </div>--> 175 176 <!-- <div class="select-department">--> 177 <!-- <select id="select-department_list">--> 178 <!-- <option value="">-- --><?php //_e( 'Select Department', 'dumhall' ); ?><!-- --</option>--> 179 <!-- --><?php 180 // 181 // $users = get_users( array( 'fields' => array( 'ID' ) ) ); 182 // foreach($users as $user_id){ 183 // $data = get_user_meta ( $user_id->ID); 184 // if(!empty($data['department'][0])){ 185 // echo '<option value="' . esc_html( $data['department'][0]) . '">' . esc_html( $data['department'][0] ) . '</option>'; 186 // } 187 // } 188 // ?> 189 <!-- </select>--> 190 <!-- </div>--> 191 <!-- <div class="select-session">--> 192 <!-- <select id="select-session_list">--> 193 <!-- <option value="">-- --><?php //_e( 'Select Form', 'dumhall' ); ?><!-- --</option>--> 194 <!-- <option value="1">hell</option>--> 195 <!-- <option value="2">hell2</option>--> 196 <!-- <option value="3">hell3</option>--> 197 <!-- <option value="4">hell4</option>--> 198 <!-- --><?php 199 // 200 // 201 // ?><!-- $users = get_users( array( 'fields' => array( 'ID' ) ) );--> 202 <!-- foreach($users as $user_id){--> 203 <!-- $data = get_user_meta ( $user_id->ID);--> 204 <!-- if(isset($data['session'][0])){--> 205 <!-- echo '<option value="' . esc_html( $data['session'][0]) . '">' . esc_html( $data['session'][0] ) . '</option>';--> 206 <!-- }--> 207 <!-- }--> 208 <!-- </select>--> 209 <!-- </div>--> 210 211 <div class="reset-entery-data"> 212 <button type="reset" id="ResetData">Reset Data</button> 213 </div> 206 214 </div> 207 215 </td> … … 271 279 // Ajax request for load targeted form users 272 280 public function bulkMailAjaxDataAction(){ 273 echo " test";274 275 // this is required to terminate immediately and return a proper response276 $department = '';277 $session = '';278 if(isset($_POST['department'])){279 $department = sanitize_text_field($_POST['department']);280 }281 if(isset($_POST['session'])){282 $session = sanitize_text_field($_POST['session']);283 }284 $args = array(285 'meta_query' => array(286 'relation' => 'AND', // Could be OR, default is AND287 array(288 'key' => 'department',289 'value' => $department,290 'compare' => '=='291 ),292 array(293 'key' => 'session',294 'value' => $session,295 'compare' => '=='296 )297 )298 );299 $users = get_users( $args );300 301 foreach ( $users as $user ) {302 //var_dump($user->user_email);303 // $session = $user->session;304 if ( $user->first_name && $user->last_name ) {305 $user_fullname = ' (' . $user->first_name . ' ' . $user->last_name . ')';306 } else {307 $user_fullname = '';308 }309 echo '<option value="' . esc_html( $user->user_email ) . '">' . esc_html( $user->user_email ) . esc_html( $user_fullname) .'</option>';310 311 };281 echo "<script>alert('hello');</script>"; 282 283 // // this is required to terminate immediately and return a proper response 284 // $department = ''; 285 // $session = ''; 286 // if(isset($_POST['department'])){ 287 // $department = sanitize_text_field($_POST['department']); 288 // } 289 // if(isset($_POST['session'])){ 290 // $session = sanitize_text_field($_POST['session']); 291 // } 292 // $args = array( 293 // 'meta_query' => array( 294 // 'relation' => 'AND', // Could be OR, default is AND 295 // array( 296 // 'key' => 'department', 297 // 'value' => $department, 298 // 'compare' => '==' 299 // ), 300 // array( 301 // 'key' => 'session', 302 // 'value' => $session, 303 // 'compare' => '==' 304 // ) 305 // ) 306 // ); 307 // $users = get_users( $args ); 308 // 309 // foreach ( $users as $user ) { 310 // //var_dump($user->user_email); 311 // // $session = $user->session; 312 // if ( $user->first_name && $user->last_name ) { 313 // $user_fullname = ' (' . $user->first_name . ' ' . $user->last_name . ')'; 314 // } else { 315 // $user_fullname = ''; 316 // } 317 // echo '<option value="' . esc_html( $user->user_email ) . '">' . esc_html( $user->user_email ) . esc_html( $user_fullname) .'</option>'; 318 // 319 // }; 312 320 wp_die(); 313 321 }
Note: See TracChangeset
for help on using the changeset viewer.