Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
Update 1.2.2
Browse files Browse the repository at this point in the history
For changes see readme
  • Loading branch information
timdah committed Nov 18, 2015
1 parent 9a388b9 commit ddf5d9a
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 43 deletions.
4 changes: 3 additions & 1 deletion css/ts_form.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
cursor: pointer;
flex-shrink: 0 !important;
}
#go:hover {
#ticket > div > #go:hover {
background: white;
color: #778495;
}
Expand All @@ -78,6 +78,8 @@
justify-content: center;
align-items: center;
}


/* Thanks to css-spinners.com */
@-moz-keyframes three-quarters-loader {
0% {
Expand Down
40 changes: 22 additions & 18 deletions css/ts_system.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,26 +121,30 @@
}

.button {
position: relative;
vertical-align: top;
height: 35px !important;
padding: 0px 10px;
color: white;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
background: #3498db;
border: 0;
border-radius: 2px;
border-bottom: 2px solid #2a8bcc;
cursor: pointer;
-webkit-box-shadow: inset 0 -2px #2a8bcc;
box-shadow: inset 0 -2px #2a8bcc;
position: relative;
vertical-align: top;
height: 35px !important;
padding: 0px 10px;
color: white;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
background: #3498db;
border: 0;
border-radius: 2px;
border-bottom: 2px solid #2a8bcc;
cursor: pointer;
-webkit-box-shadow: inset 0 -2px #2a8bcc;
box-shadow: inset 0 -2px #2a8bcc;
}
.button:hover {
background: #3498db;
}
.button:active {
top: 1px;
outline: none;
-webkit-box-shadow: none;
box-shadow: none;
top: 1px;
outline: none;
-webkit-box-shadow: none;
box-shadow: none;
padding: 0px 10px !important;
}

/*###################################################################################################*/
Expand Down
2 changes: 1 addition & 1 deletion includes/db-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

$db_version = $wpdb->get_var("SELECT ts_value FROM wp_sts_options WHERE ts_option = 'db_version'");
if($db_version == DB_VERSION) {
return;
exit;
} else if($db_version < DB_VERSION){
if($db_version < 102) {
$wpdb->query("ALTER TABLE wp_sts_tickets
Expand Down
20 changes: 18 additions & 2 deletions includes/mail.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
<?php
// Zugriff einschränken
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
global $wpdb;
?>

<?php
// Um $wpdb nutzen zu können
global $wpdb;
// Check if JavaScript is manipulated
function checkText($str) {
if(strlen(trim($str)) == 0) {
echo '<p>' . _e('Let JavaScript do what it is supposed to do!', 'simple-support-ticket-system') . '</p>';
echo '<p><form onsubmit="back();return false;"><input class="button" value="';
_e('Back', 'simple-support-ticket-system');
echo '" type="submit"></input></form></p>';
// abort script
exit;
} else {
return true;
}
}

// Check for invalid Text
checkText($_POST["name"]); checkText($_POST["mail"]); checkText($_POST["title"]); checkText($_POST["problem"]);

$absendername = sanitize_text_field($_POST["name"]);
$absendermail = sanitize_email($_POST["mail"]);
$title = sanitize_text_field($_POST["title"]);
Expand Down
43 changes: 28 additions & 15 deletions js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ jQuery(document).ready(function() {
});
});

function checkText(string) {
if (/\S/.test(string)) {
// string is not empty and not just whitespace
return true;
} else {
alert("Invalid Input");
return false;
}
}

function submitTicket() {
if(jQuery('#rcheck').val() != ''){return;}

Expand All @@ -24,22 +34,25 @@ function submitTicket() {
var termin = jQuery('#add_termin').val();
} else {var termin = '';}

var data = {
'action': 'MAIL',
'name':name,
'mail':mail,
'title':title,
'problem':problem,
'status':status,
'telefon':telefon,
'raum':raum,
'rechner':rechner,
'termin':termin
};
if(checkText(name) && checkText(mail) && checkText(title) && checkText(problem)) {

var data = {
'action': 'MAIL',
'name':name,
'mail':mail,
'title':title,
'problem':problem,
'status':status,
'telefon':telefon,
'raum':raum,
'rechner':rechner,
'termin':termin
};

jQuery.post(ajax_object.ajax_url, data, function(response) {
jQuery('#ajax').html(response);
});
jQuery.post(ajax_object.ajax_url, data, function(response) {
jQuery('#ajax').html(response);
});
}
}

function back() {
Expand Down
15 changes: 11 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: en0x
Tags: ticket, simple, system, support, plugin, request, help, desk
Requires at least: 3.0.1
Tested up to: 4.3
Stable tag: 1.2
Stable tag: 1.2.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -25,10 +25,11 @@ You can use it as a help desk for co-workers in your Intranet or as a contact fo

* Independet Login from Wordpress, or when you are logged in into Wordpress, then you will be automatically logged in.
* Normal users can take, edit their own and adopt tickets. They also can add appointments.
* Admin users can edit all tickets and allocate tickets to other users
* You can add notes and solutions to every ticket
* You can filter tickets for Issuer, name or mail of creator, done tickets, solution or problems
* Admin users can edit all tickets and allocate tickets to other users.
* You can add notes and solutions to every ticket.
* You can filter tickets for Issuer, name or mail of creator, done tickets, solution or problems.
* Datepicker Field
* Under "New Tickets" the tickets automatically reload every 30 seconds.

== Installation ==

Expand Down Expand Up @@ -57,6 +58,12 @@ Not yet!


== Changelog ==
= 1.2.2 =
* Only whitespace in necessary fields isn't allowed anymore.
* Database Update only loads when user is admin.
= 1.2.1 =
* Security Update
* Special thanks to the user "iberiam"
= 1.2 =
* You can rename the optional fields and the datepicker field.
* You can also hide these fields.
Expand Down
6 changes: 4 additions & 2 deletions simple-support-ticket-system.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: http://en00x.github.io/Simple-Ticket-System-WordPress/
Author: Tim Dahlmanns
Description: Simple and fast ticket system to receive and store Problems of Customers or Visitors, with a great search function.
Version: 1.2
Version: 1.2.2
Domain Path: /languages
Text Domain: simple-support-ticket-system
License: GPL2
Expand Down Expand Up @@ -42,7 +42,9 @@ function myplugin_activate() {

// Update
function db_version_update() {
include_once(TS_DIR.'includes/db-update.php');
if( is_admin() ) {
include_once(TS_DIR.'includes/db-update.php');
}
}
add_action( 'init', 'db_version_update' );

Expand Down

0 comments on commit ddf5d9a

Please sign in to comment.