Changeset 3148231
- Timestamp:
- 09/08/2024 04:13:21 PM (19 months ago)
- Location:
- easy-appointments/trunk
- Files:
-
- 1 added
- 6 edited
-
js/admin.prod.js (modified) (5 diffs)
-
main.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
src/ajax.php (modified) (2 diffs)
-
src/mail.php (modified) (1 diff)
-
src/templates/admin.tpl.php (modified) (1 diff)
-
src/templates/mail.notification.tpl.convert.php (added)
Legend:
- Unmodified
- Added
- Removed
-
easy-appointments/trunk/js/admin.prod.js
r3029121 r3148231 99 99 "click .select-label-option": "changeSelectLabelStyle", 100 100 "click .btn-gdpr-delete-data": "gdprDeleteData", 101 "click #load-default-admin-template": "loadDefaultTemplate" 101 102 }, 102 103 … … 209 210 // process new content 210 211 var $newTemplate = jQuery(event.target); 211 var newContent = this.$el.find($newTemplate.data('textarea')).val(); 212 var elemId = $newTemplate.data('textarea'); 213 214 var newContent = this.$el.find(elemId).val(); 212 215 213 216 if (this.tinymceOn) { … … 220 223 } 221 224 225 if (elemId === '#mail-admin') { 226 // show load admin template button 227 this.$el.find('#load-default-admin-template').show(); 228 } else { 229 // hide admin template button 230 this.$el.find('#load-default-admin-template').hide(); 231 } 232 222 233 this.$el.find('.mail-tab').filter('.selected').removeClass('selected'); 223 234 $newTemplate.addClass('selected'); 235 }, 236 237 loadDefaultTemplate: function () { 238 // wp_ajax_ea_default_template 239 var endpoint = ajaxurl + '?action=ea_default_template&_wpnonce=' + wpApiSettings.nonce; 240 var tiny = this.tinymceOn; 241 var $el = this.$el; 242 243 jQuery.ajax({ 244 url: endpoint, 245 type: 'GET', 246 success: function(content) { 247 if (tiny) { 248 tinymce.get('mail-template').setContent(content); 249 // clear the stack of undo 250 tinymce.activeEditor.undoManager.clear(); 251 return; 252 } 253 254 $el.find('#mail-template').val(newContent); 255 } 256 }); 224 257 }, 225 258 … … 227 260 var prevContent = ''; 228 261 var $prevTemplate = this.$el.find('.mail-tab').filter('.selected'); 262 229 263 if (this.tinymceOn) { 230 264 prevContent = tinymce.get('mail-template').getContent(); … … 232 266 prevContent = this.$el.find('#mail-template').val(); 233 267 } 268 234 269 this.$el.find($prevTemplate.data('textarea')).val(prevContent); 235 270 }, -
easy-appointments/trunk/main.php
r3147273 r3148231 5 5 * Plugin URI: https://easy-appointments.com/ 6 6 * Description: Simple and easy to use management system for Appointments and Bookings 7 * Version: 3.12. 07 * Version: 3.12.1 8 8 * Requires PHP: 5.3 9 9 * Author: Nikola Loncar … … 22 22 * Currently plugin version. 23 23 */ 24 define( 'EASY_APPOINTMENTS_VERSION', '3.12. 0' );24 define( 'EASY_APPOINTMENTS_VERSION', '3.12.1' ); 25 25 26 26 // path for source files -
easy-appointments/trunk/readme.txt
r3147273 r3148231 6 6 Tested up to: 6.6 7 7 Requires PHP: 5.3 8 Stable tag: 3.12. 08 Stable tag: 3.12.1 9 9 License: GPLv2 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 214 214 == Changelog == 215 215 216 = 3.12.1 (2024-09-08) = 217 * Added new option to load default Admin email template to mail editor 218 216 219 = 3.12.0 (2024-09-06) = 217 220 * Fixed issue with DI52 dependency conflict between versions with other plugins -
easy-appointments/trunk/src/ajax.php
r3059359 r3148231 161 161 add_action('wp_ajax_ea_field', array($this, 'ajax_field')); 162 162 add_action('wp_ajax_ea_export', array($this, 'ajax_export')); 163 add_action('wp_ajax_ea_default_template', array($this, 'ajax_default_template')); 163 164 } 164 165 } … … 771 772 } 772 773 774 public function ajax_default_template() 775 { 776 $this->validate_admin_nonce(); 777 $this->validate_access_rights('settings'); 778 779 $content = $this->mail->get_default_admin_template(); 780 781 wp_die($content); 782 } 783 773 784 /** 774 785 * Errors for tools page -
easy-appointments/trunk/src/mail.php
r2577616 r3148231 308 308 309 309 wp_die($content, $title); 310 } 311 312 public function get_default_admin_template() 313 { 314 $template_path = $this->utils->get_template_path('mail.notification.tpl.convert.php'); 315 $meta_fields = $this->models->get_all_rows('ea_meta_fields'); 316 317 // render template 318 ob_start(); 319 require $template_path; 320 return ob_get_clean(); 310 321 } 311 322 -
easy-appointments/trunk/src/templates/admin.tpl.php
r3131833 r3148231 285 285 </tbody> 286 286 </table> 287 <a id="load-default-admin-template" href="#" style="padding-top: 5px; padding-bottom: 5px; display: none;"><?php _e('Load default admin template', 'easy-appointments'); ?></a> 287 288 <div><small><?php _e('Available tags', 'easy-appointments'); ?>: #id#, #date#, #start#, #end#, #status#, #created#, #price#, #ip#, #link_confirm#, #link_cancel#, #url_confirm#, #url_cancel#, #service_name#, #service_duration#, #service_price#, #worker_name#, #worker_email#, #worker_phone#, #location_name#, #location_address#, #location_location#, <?php echo implode(', ', EADBModels::get_custom_fields_tags()); ?></small></div> 288 289 </div>
Note: See TracChangeset
for help on using the changeset viewer.