Changeset 855894
- Timestamp:
- 02/11/2014 09:53:15 PM (11 years ago)
- Location:
- td-ticket-system/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
td-ticket-system/trunk/readme.txt
r855292 r855894 5 5 Requires at least: 3.0 6 6 Tested up to: 3.8.1 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 28 28 == Frequently Asked Questions == 29 29 30 None yet...feel free to ask :) 30 Please direct any questions you might have to the <a href="http://wordpress.org/support/plugin/td-ticket-system">support forum</a>. I will be happy to help resolve any issue you might have. 31 31 32 32 == Screenshots == … … 38 38 39 39 == Changelog == 40 41 = 1.0.4 = 42 * Revised the template system to allow changes without fear of overwritting changes on upgrades 43 * Added configurable WP Admin menu position 40 44 41 45 = 1.0.3 = … … 57 61 58 62 == Upgrade Notice == 63 = 1.0.4 = 64 Allows you to retain template changes when upgrading 59 65 60 66 = 1.0.3 = -
td-ticket-system/trunk/td-ticketsystem.php
r855292 r855894 4 4 * Plugin URI: http://www.transcendevelopment.com/td-ticket-system/ 5 5 * Description: A ticket system for Wordpress to maintain reliable communication with customers without the worry of missing emails. 6 * Version: 1.0. 36 * Version: 1.0.4 7 7 * Author: TranscenDevelopment 8 8 * Author URI: http://www.transcendevelopment.com … … 39 39 define('TDTTSDIR', plugin_dir_path( __FILE__ )); 40 40 define('TDPLUGINURL', plugins_url().'/td-ticket-system/'); 41 define('TDTTSVER', '1.0.3'); 41 define('TDTTSVER', '1.0.4'); 42 43 $td_tts_menuPos = get_option('td_tts_menuPos') . '.312'; 44 if(empty($td_tts_menuPos)) {$td_tts_menuPos='26.312';} 45 46 define('TDTTSMENUPOS', $td_tts_menuPos); 42 47 43 48 add_action('admin_menu', 'td_tts_regMenuPage'); … … 58 63 function td_tts_regMenuPage() { 59 64 //---------------------------------------------------------// 60 add_menu_page('The Ticket System', 'Ticket System', 'administrator', 'tdtts10', 'td_tts_mainTTSAdmin', TDTTSICON, 26.312);65 add_menu_page('The Ticket System', 'Ticket System', 'administrator', 'tdtts10', 'td_tts_mainTTSAdmin', TDTTSICON, TDTTSMENUPOS); 61 66 #add_submenu_page('tdtts10', 'Ticket System Departments', 'Departments', 'administrator', 'tdtts10_2', 'td_tts_departments'); 67 add_submenu_page('tdtts10', 'Ticket System Settings', 'Templates', 'administrator', 'tdtts10_2', 'td_tts_templates'); 62 68 add_submenu_page('tdtts10', 'Ticket System Settings', 'Settings', 'administrator', 'tdtts10_1', 'td_tts_adminfunc'); 69 } 70 //---------------------------------------------------------// 71 function td_tts_templates() { 72 //---------------------------------------------------------// 73 $action = $_REQUEST[action]; 74 $showTemplate = $_POST['td_tts_showTemplate']; 75 if (empty($showTemplate)) {$showTemplate = 'td_tts_contactForm';} 76 $displayBox1 = 'block'; $displayBox2 = 'none'; $displayBox3 = 'none'; 77 $displayBox4 = 'none'; $displayBox5 = 'none'; $displayBox6 = 'none'; 78 79 if ($action == 'td_tts_saveTemplates') { 80 $td_tts_styles = stripslashes( filter_var($_POST[td_tts_styles], FILTER_SANITIZE_SPECIAL_CHARS) ); 81 $td_tts_notification = stripslashes( filter_var($_POST[td_tts_notification], FILTER_SANITIZE_SPECIAL_CHARS) ); 82 $td_tts_responsenote = stripslashes( filter_var($_POST[td_tts_responsenote], FILTER_SANITIZE_SPECIAL_CHARS) ); 83 $td_tts_contactForm = stripslashes( filter_var($_POST[td_tts_contactForm], FILTER_SANITIZE_SPECIAL_CHARS) ); 84 $td_tts_loginForm = stripslashes( filter_var($_POST[td_tts_loginForm], FILTER_SANITIZE_SPECIAL_CHARS) ); 85 $td_tts_successPage = stripslashes( filter_var($_POST[td_tts_successPage], FILTER_SANITIZE_SPECIAL_CHARS) ); 86 if ($showTemplate == 'td_tts_styles') { 87 delete_option('td_tts_styles'); 88 add_option('td_tts_styles', $td_tts_styles, '', 'yes'); 89 $displayBox1='none'; $displayBox6='block'; 90 } 91 if ($showTemplate == 'td_tts_notification') { 92 delete_option('td_tts_notification'); 93 add_option('td_tts_notification', $td_tts_notification, '', 'yes'); 94 $displayBox1='none'; $displayBox3='block'; 95 } 96 if ($showTemplate == 'td_tts_responsenote') { 97 delete_option('td_tts_responsenote'); 98 add_option('td_tts_responsenote', $td_tts_responsenote, '', 'yes'); 99 $displayBox1='none'; $displayBox4='block'; 100 } 101 if ($showTemplate == 'td_tts_contactForm') { 102 delete_option('td_tts_contactForm'); 103 add_option('td_tts_contactForm', $td_tts_contactForm, '', 'yes'); 104 } 105 if ($showTemplate == 'td_tts_loginForm') { 106 delete_option('td_tts_loginForm'); 107 add_option('td_tts_loginForm', $td_tts_loginForm, '', 'yes'); 108 $displayBox1='none'; $displayBox2='block'; 109 } 110 if ($showTemplate == 'td_tts_successPage') { 111 delete_option('td_tts_successPage'); 112 add_option('td_tts_successPage', $td_tts_successPage, '', 'yes'); 113 $displayBox1='none'; $displayBox5='block'; 114 } 115 $td_tts_savedTempMessage = 'Template Changes Saved'; 116 } elseif ($action == 'populateDefaultTemplates') {td_tts_populateDefaultTemplates();} 117 118 $td_tts_styles = get_option('td_tts_styles'); 119 $td_tts_notification = get_option('td_tts_notification'); 120 $td_tts_responsenote = get_option('td_tts_responsenote'); 121 $td_tts_contactForm = get_option('td_tts_contactForm'); 122 $td_tts_loginForm = get_option('td_tts_loginForm'); 123 $td_tts_successPage = get_option('td_tts_successPage'); 124 125 echo td_tts_howdoyado(); 126 echo <<<"HTML" 127 <h1>TD Ticket System - Templates</h1> 128 <a href="javascript:void(0);" onclick="td_tts_showTemp('td_tts_contactForm');">Contact Form</a> | 129 <a href="javascript:void(0);" onclick="td_tts_showTemp('td_tts_loginForm');">Login Form</a> | 130 <a href="javascript:void(0);" onclick="td_tts_showTemp('td_tts_notification');">Email Notification</a> | 131 <a href="javascript:void(0);" onclick="td_tts_showTemp('td_tts_responsenote');">Response Notification</a> | 132 <a href="javascript:void(0);" onclick="td_tts_showTemp('td_tts_successPage');">Success Page</a> | 133 <a href="javascript:void(0);" onclick="td_tts_showTemp('td_tts_styles');">Stylesheet</a> 134 <div style="padding:5px 0 0 0;color:green">$td_tts_savedTempMessage</div> 135 <form method="post" name="td_tts_templateForm"> 136 <div id="td_tts_contactFormBox" style="display:$displayBox1"> 137 <h2>Contact Form</h2> 138 <textarea name="td_tts_contactForm" id="td_tts_contactForm" style="width:50%;height:200px;">$td_tts_contactForm</textarea> 139 </div> 140 <div id="td_tts_loginFormBox" style="display:$displayBox2"> 141 <h2>Login Form</h2> 142 <textarea name="td_tts_loginForm" id="td_tts_loginForm" style="width:50%;height:200px">$td_tts_loginForm</textarea> 143 </div> 144 <div id="td_tts_notificationBox" style="display:$displayBox3"> 145 <h2>Email Notification</h2> 146 <textarea name="td_tts_notification" id="td_tts_notification" style="width:50%;height:200px">$td_tts_notification</textarea> 147 </div> 148 <div id="td_tts_responsenoteBox" style="display:$displayBox4"> 149 <h2>Response Notification</h2> 150 <textarea name="td_tts_responsenote" id="td_tts_responsenote" style="width:50%;height:200px">$td_tts_responsenote</textarea> 151 </div> 152 <div id="td_tts_successPageBox" style="display:$displayBox5"> 153 <h2>Success Page</h2> 154 <textarea name="td_tts_successPage" id="td_tts_successPage" style="width:50%;height:200px">$td_tts_successPage</textarea> 155 </div> 156 <div id="td_tts_stylesBox" style="display:$displayBox6"> 157 <h2>Stylesheet</h2> 158 <textarea name="td_tts_styles" id="td_tts_styles" style="width:50%;height:200px">$td_tts_styles</textarea> 159 </div> 160 <div style="width:50%;text-align:right"><input type="submit" value="Save Changes" /></div> 161 <input type="hidden" name="td_tts_showTemplate" id="td_tts_showTemplate" value="$showTemplate" /> 162 <input type="hidden" name="action" value="td_tts_saveTemplates" /> 163 </form> 164 <div style="width:35%;border:1px solid #aaa;padding:8px 0 8px 15px;margin-top:25px;"> 165 <a href="javascript:void(0);" onclick="if(confirm('Are you sure??')){location.href='?page=tdtts10_2&action=populateDefaultTemplates';}else{return false;}">Restore Default Templates</a> - This will overwrite your current templates. 166 </div> 167 HTML; 63 168 } 64 169 //---------------------------------------------------------// … … 209 314 $setAr = td_tts_getAllSettings(); 210 315 316 $menuPos = get_option('td_tts_menuPos'); 317 211 318 echo td_tts_linkStyles(); 212 319 echo td_tts_howdoyado(); … … 261 368 <strong>If using ReCaptcha - Your Private Key</strong><br /> 262 369 <input type="text" name="rcPriKey" value="$setAr[8]" size="40" /> 370 </div> 371 372 <div style="padding:5px;border:1px solid #c0c0c0;margin-bottom:5px;"> 373 <strong>Wordpress Menu Position</strong><br /> 374 The lower the number the higher the Ticket System will show in your WP admin menu.<br /> 375 <br /><input type="text" name="menuPos" size="3" value="$menuPos" /> Default position is 26 if blank. 263 376 </div> 264 377 … … 319 432 </script> 320 433 <script> 434 function td_tts_showTemp(x) { 435 document.getElementById("td_tts_contactFormBox").style.display='none'; 436 document.getElementById("td_tts_loginFormBox").style.display='none'; 437 document.getElementById("td_tts_notificationBox").style.display='none'; 438 document.getElementById("td_tts_responsenoteBox").style.display='none'; 439 document.getElementById("td_tts_successPageBox").style.display='none'; 440 document.getElementById("td_tts_stylesBox").style.display='none'; 441 442 document.getElementById('td_tts_showTemplate').value = x; 443 document.getElementById(x+"Box").style.display='block'; 444 445 } 321 446 function td_tts_adminMessageDelete(x) { 322 447 var ticket = x; … … 596 721 $response = $wpdb->get_results($sqlQuery2); 597 722 598 $theMessage = file_get_contents(TDTTSDIR.'includes/emailnotification.php');723 $theMessage = html_entity_decode( get_option('td_tts_notification') ); 599 724 $theMessage = str_replace("[%userMessage%]", $theMess, $theMessage); 600 725 $theMessage = str_replace("[%userEmail%]", $userEmail, $theMessage); … … 746 871 $response = $wpdb->get_results($sqlQuery); 747 872 748 $successPage = file_get_contents(TDTTSDIR.'includes/success.php');749 $theMessage = file_get_contents(TDTTSDIR.'includes/emailnotification.php');873 $successPage = html_entity_decode( get_option('td_tts_successPage') ); 874 $theMessage = html_entity_decode( get_option('td_tts_notification') ); 750 875 $theMessage = str_replace("[%userMessage%]", $message, $theMessage); 751 876 $theMessage = str_replace("[%userEmail%]", $email, $theMessage); … … 909 1034 910 1035 $subj = "Your ticket has received a response - re: $subject"; 911 $theMessage = file_get_contents(TDTTSDIR.'includes/responsenotification.php');1036 $theMessage = html_entity_decode( get_option('td_tts_responsenote') ); 912 1037 $theMessage = str_replace("[%userMessage%]", $theMess, $theMessage); 913 1038 $theMessage = str_replace("[%userEmail%]", $userEmail, $theMessage); … … 945 1070 $devCredit = 0; 946 1071 $setAr = td_tts_getAllSettings(); 947 if ($setAr[3] == 'checked') {$devCredit = =1;}1072 if ($setAr[3] == 'checked') {$devCredit = 1;} 948 1073 949 1074 $retVal = td_tts_linkStyles(); … … 983 1108 984 1109 if ($action == 'td_tts_ticketLogIn') { 985 $retVal .= file_get_contents(TDTTSDIR.'includes/login.php'); 986 } else {$retVal .= file_get_contents(TDTTSDIR.'includes/form.php');} 1110 $retVal .= html_entity_decode( get_option('td_tts_loginForm') ); 1111 } else { 1112 $retVal .= html_entity_decode( get_option('td_tts_contactForm') ); 1113 } 987 1114 988 1115 if ($devCredit == 1) { … … 1030 1157 $likesPizza = $_POST[likesPizza]; 1031 1158 1159 $td_tts_menuPos = $_POST[menuPos]; 1160 delete_option('td_tts_menuPos'); 1161 add_option('td_tts_menuPos', $td_tts_menuPos, '', 'yes'); 1162 1032 1163 # Email notification setting 1033 1164 $sqlQuery = "DELETE FROM " . SET_TABLE . " WHERE setName = \"enote\" "; … … 1110 1241 global $wpdb; 1111 1242 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 1112 1243 $td_tts_version = get_option('td_tts_db_version'); 1244 if (empty($td_tts_version)) { 1113 1245 $table_name1 = MESS_TABLE; 1114 1246 $table_name2 = RESP_TABLE; … … 1167 1299 1168 1300 dbDelta( $sql4 ); 1169 1170 add_option( "td_tts_db_version", "1.0" ); 1301 } 1302 1303 if ($td_tts_version != '1.0.4') { 1304 td_tts_populateDefaultTemplates(); 1305 } 1306 add_option( "td_tts_db_version", "1.0.4" ); 1171 1307 } 1172 1308 //---------------------------------------------------------// … … 1185 1321 function td_tts_linkStyles() { 1186 1322 //---------------------------------------------------------// 1187 $ styleurl = TDPLUGINURL . 'includes/styles.css';1323 $td_tts_stylesheet = html_entity_decode( get_option('td_tts_styles') ); 1188 1324 $retVal = <<<"HTML" 1189 <link href="$styleurl" rel="stylesheet" type="text/css" /> 1325 <style> 1326 $td_tts_stylesheet 1327 </style> 1190 1328 HTML; 1191 1329 return $retVal; 1330 } 1331 //---------------------------------------------------------// 1332 function td_tts_populateDefaultTemplates() { 1333 //---------------------------------------------------------// 1334 1335 $td_tts_styles = stripslashes( filter_var( file_get_contents(TDTTSDIR.'includes/default_styles.css'), FILTER_SANITIZE_SPECIAL_CHARS ) ); 1336 delete_option('td_tts_styles'); 1337 add_option('td_tts_styles', $td_tts_styles, '', 'yes'); 1338 1339 $td_tts_notification = stripslashes( filter_var( file_get_contents(TDTTSDIR.'includes/default_emailnotification.php'), FILTER_SANITIZE_SPECIAL_CHARS ) ); 1340 delete_option('td_tts_notification'); 1341 add_option('td_tts_notification', $td_tts_notification, '', 'yes'); 1342 1343 $td_tts_responsenote = stripslashes( filter_var( file_get_contents(TDTTSDIR.'includes/default_responsenotification.php'), FILTER_SANITIZE_SPECIAL_CHARS ) ); 1344 delete_option('td_tts_responsenote'); 1345 add_option('td_tts_responsenote', $td_tts_responsenote, '', 'yes'); 1346 1347 $td_tts_contactForm = stripslashes( filter_var( file_get_contents(TDTTSDIR.'includes/default_form.php'), FILTER_SANITIZE_SPECIAL_CHARS ) ); 1348 delete_option('td_tts_contactForm'); 1349 add_option('td_tts_contactForm', $td_tts_contactForm, '', 'yes'); 1350 1351 $td_tts_loginForm = stripslashes( filter_var( file_get_contents(TDTTSDIR.'includes/default_login.php'), FILTER_SANITIZE_SPECIAL_CHARS ) ); 1352 delete_option('td_tts_loginForm'); 1353 add_option('td_tts_loginForm', $td_tts_loginForm, '', 'yes'); 1354 1355 $td_tts_successPage = stripslashes( filter_var( file_get_contents(TDTTSDIR.'includes/default_success.php'), FILTER_SANITIZE_SPECIAL_CHARS ) ); 1356 delete_option('td_tts_successPage'); 1357 add_option('td_tts_successPage', $td_tts_successPage, '', 'yes'); 1358 1192 1359 } 1193 1360 //---------------------------------------------------------//
Note: See TracChangeset
for help on using the changeset viewer.