Merge pull request #1260 from Nexus633/master

FIX #1225
This commit is contained in:
Jan 2020-07-14 22:19:16 +02:00 committed by GitHub
commit 5c53d612ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View File

@ -109,7 +109,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$topic_name = $ui->description('topic_name', 'post');
$maintopic = $ui->description('maintopic', 'post');
$priority = ($ui->id('priority', 1, 'post')) ? $ui->id('priority', 1, 'post') : 1;
$priority = ($ui->id('priority', 1, 'post') ? $ui->id('priority', 1, 'post') : 1);
$query = $sql->prepare("SELECT `id` FROM `ticket_topics` WHERE `topic`=? AND `maintopic`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($topic_name, $maintopic, $resellerLockupID));
@ -120,12 +120,16 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
} else {
$maintopic = ($maintopic == "none" ? 0 : $maintopic);
$query = $sql->prepare("INSERT INTO `ticket_topics` (`topic`,`maintopic`,`priority`,`resellerid`) VALUES (?,?,?,?)");
$query->execute(array($topic_name, $maintopic, $priority, $resellerLockupID));
$id = $sql->lastInsertId();
$maintopic = ($maintopic == 0 ? "none" : $maintopic);
if ($maintopic == "none") {
$query = $sql->prepare("UPDATE `ticket_topics` SET `maintopic`=:id, priority='NULL' WHERE `id`=:id AND `resellerid`=:reseller_id LIMIT 1");
$query = $sql->prepare("UPDATE `ticket_topics` SET `maintopic`=:id WHERE `id`=:id AND `resellerid`=:reseller_id LIMIT 1");
$query->execute(array(':id' => $id,':reseller_id' => $resellerLockupID));
}
@ -229,7 +233,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query->execute(array($resellerLockupID));
$query2 = $sql->prepare("SELECT `text` FROM `translations` WHERE `type`='ti' AND `lang`=? AND `transID`=? AND `resellerID`=? LIMIT 1");
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row) {
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$topics = '';
$query2->execute(array($user_language, $row['id'],$resellerLockupID));
@ -285,12 +289,11 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
if ($ui->description('maintopic', 'post')){
$topic_name = $ui->description('topic_name', 'post');
$priority = ($ui->id('priority', 1, 'post')) ? $ui->id('priority', 1, 'post') : 1;
$priority = ($ui->id('priority', 1, 'post') ? $ui->id('priority', 1, 'post') : 1);
$maintopic = $ui->description('maintopic', 'post');
if ($maintopic == "none") {
$maintopic = $id;
$priority = 0;
}
$query = $sql->prepare("UPDATE `ticket_topics` SET `topic`=:topic,`maintopic`=:maintopic,`priority`=:priority WHERE `id`=:id AND `resellerid`=:reseller_id LIMIT 1");
@ -345,7 +348,9 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
} else if ($row2['priority']==3) {
$priority = $sprache->priority_high;
} else if ($row2['priority']==4) {
$priority = $sprache->priority_highest;
$priority = $sprache->priority_very_high;
} else if ($row2['priority']==5) {
$priority = $sprache->priority_critical;
}
if ($row2['text'] != null and $row2['text'] != '') {

View File

@ -35,7 +35,7 @@
<label for="inputPriority"><?php echo $sprache->priority;?></label>
<div class="controls">
<select class="form-control" id="inputPriority" name="priority">
<option value="1"><?php echo $sprache->priority_low;?></option>
<option value="1" <?php if($priority=="1") echo 'selected="selected"';?>><?php echo $sprache->priority_low;?></option>
<option value="2" <?php if($priority=="2") echo 'selected="selected"';?>><?php echo $sprache->priority_medium;?></option>
<option value="3" <?php if($priority=="3") echo 'selected="selected"';?>><?php echo $sprache->priority_high;?></option>
<option value="4" <?php if($priority=="4") echo 'selected="selected"';?>><?php echo $sprache->priority_very_high;?></option>