diff --git a/include/class.filter.php b/include/class.filter.php index 4a66737c11bb468c6184c1c1b8431e97d93a09fd..08b42338bba5c5ca7f7bba5f69370dc314a37d3d 100644 --- a/include/class.filter.php +++ b/include/class.filter.php @@ -369,6 +369,7 @@ class Filter { $sql='DELETE FROM '.FILTER_TABLE.' WHERE id='.db_input($id).' LIMIT 1'; if(db_query($sql) && ($num=db_affected_rows())) { db_query('DELETE FROM '.FILTER_RULE_TABLE.' WHERE filter_id='.db_input($id)); + db_query('DELETE FROM '.FILTER_ACTION_TABLE.' WHERE filter_id='.db_input($id)); } return $num; diff --git a/include/class.orm.php b/include/class.orm.php index 1325bbab7b23a6a55db15c02a70168a55b7e1771..473be838ceba796105db5770b71d1f620f895f5e 100644 --- a/include/class.orm.php +++ b/include/class.orm.php @@ -2110,6 +2110,14 @@ extends ModelResultSet { return $object; } + + function merge(InstrumentedList $list, $save=false) { + foreach ($list as $object) + $this->add($object, $save); + + return $this; + } + function remove($object, $delete=true) { if ($delete) $object->delete(); diff --git a/include/class.queue.php b/include/class.queue.php index 6b4c1adc1cab13613ffd170f80a6d568e4cf5518..b4343d43eb17a622c1af41083ed79fa4cb819b3e 100644 --- a/include/class.queue.php +++ b/include/class.queue.php @@ -253,6 +253,7 @@ class CustomQueue extends VerySimpleModel { 'topic_id', 'created', 'est_duedate', + 'duedate', ) ); @@ -2825,7 +2826,8 @@ extends QueueColumnFilter { static $desc = /* @trans */ "Date and Time"; function filter($text, $row) { - return $text->changeTo(Format::datetime($text->value)); + return $text ? + $text->changeTo(Format::datetime($text->value)) : ''; } } diff --git a/include/class.thread.php b/include/class.thread.php index 2aa82cd494a89ba6f3a6c8f2adf73b519dea6bf2..b499b95ed59c497d37d70955079f9501e3b58e80 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -848,20 +848,24 @@ implements TemplateVariable { } function getBody() { - if (!isset($this->_body)) { $body = $this->body; if ($body == null && $this->getNumAttachments()) { - foreach ($this->attachments as $a) + $attachments = Attachment::objects() + ->filter(array( + 'inline' => 1, + 'object_id' => $this->getId(), + 'type' => ObjectModel::OBJECT_TYPE_THREAD, + 'file__type__in' => array('text/html','text/plain')) + ); + foreach ($attachments as $a) if ($a->inline && ($f=$a->getFile())) $body .= $f->getData(); } - $this->_body = ThreadEntryBody::fromFormattedText($body, $this->format, array('balanced' => $this->hasFlag(self::FLAG_BALANCED)) ); } - return $this->_body; } diff --git a/include/class.ticket.php b/include/class.ticket.php index 95699e8f7949cc901bdb1fca6f7dcbaf8fd147dc..ede3112f149acde3ba2a6a781d07929cdde5ac70 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -3708,15 +3708,15 @@ implements RestrictedAccess, Threadable, Searchable { $errors += $form->errors(); if ($vars['topicId']) { - if ($topic=Topic::lookup($vars['topicId'])) { + if (($topic=Topic::lookup($vars['topicId'])) + && $topic->isActive()) { foreach ($topic_forms as $topic_form) { $TF = $topic_form->getForm($vars); if (!$TF->isValid($field_filter('topic'))) $errors = array_merge($errors, $TF->errors()); } - } - else { - $errors['topicId'] = 'Invalid help topic selected'; + } else { + $vars['topicId'] = 0; } } diff --git a/include/client/footer.inc.php b/include/client/footer.inc.php index 37369a7d3e131766679266cb346f8bcc83bb9931..6ff20f28a519799dcd852a85a1bc1fc4f21b708e 100644 --- a/include/client/footer.inc.php +++ b/include/client/footer.inc.php @@ -1,7 +1,8 @@ </div> </div> <div id="footer"> - <p><?php echo __('Copyright ©'); ?> <?php echo date('Y'); ?> <?php echo (string) $ost->company ?: 'osTicket.com'; ?> - <?php echo __('All rights reserved.'); ?></p> + <p><?php echo __('Copyright ©'); ?> <?php echo date('Y'); ?> <?php + echo Format::htmlchars((string) $ost->company ?: 'osTicket.com'); ?> - <?php echo __('All rights reserved.'); ?></p> <a id="poweredBy" href="http://osticket.com" target="_blank"><?php echo __('Helpdesk software - powered by osTicket'); ?></a> </div> <div id="overlay"></div> diff --git a/include/staff/footer.inc.php b/include/staff/footer.inc.php index 8ab46960a950cf9d116ff66db72b0b72846663fe..2376cf96ec2947289b2bb5bfbfe04355288d2494 100644 --- a/include/staff/footer.inc.php +++ b/include/staff/footer.inc.php @@ -2,7 +2,8 @@ </div> <?php if (!isset($_SERVER['HTTP_X_PJAX'])) { ?> <div id="footer"> - <?php echo __('Copyright ©') ?> 2006-<?php echo date('Y'); ?> <?php echo (string) $ost->company ?: 'osTicket.com'; ?> <?php echo __('All Rights Reserved.'); ?> + <?php echo __('Copyright ©') ?> 2006-<?php echo date('Y'); ?> <?php + echo Format::htmlchars((string) $ost->company ?: 'osTicket.com'); ?> <?php echo __('All Rights Reserved.'); ?> </div> <?php if(is_object($thisstaff) && $thisstaff->isStaff()) { ?>