From 25ac20dfff53a71aa4067539d8ac3d288fde8953 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Thu, 11 Dec 2014 17:01:22 +0000
Subject: [PATCH] bugs : bug fixes

---
 include/class.dynamic_forms.php          | 1 -
 include/class.thread.php                 | 2 +-
 include/class.ticket.php                 | 2 +-
 include/i18n/en_US/form.yaml             | 2 +-
 include/staff/templates/tickets.tmpl.php | 2 +-
 include/staff/tickets.inc.php            | 2 +-
 6 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index 53f3760e0..be4f4af48 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -698,7 +698,6 @@ class DynamicFormField extends VerySimpleModel {
     static function create($ht=false) {
         $inst = parent::create($ht);
         $inst->set('created', new SqlFunction('NOW'));
-        $inst->flags = self::FLAG_ENABLED;
         if (isset($ht['configuration']))
             $inst->configuration = JsonDataEncoder::encode($ht['configuration']);
         return $inst;
diff --git a/include/class.thread.php b/include/class.thread.php
index e6bf896e0..3ee72e753 100644
--- a/include/class.thread.php
+++ b/include/class.thread.php
@@ -515,7 +515,7 @@ Class ThreadEntry {
     }
 
     function getAttachments() {
-        return $this->attachments->getAll(true, false);
+        return $this->attachments->getAll(false);
     }
 
     function getAttachmentUrls($script='image.php') {
diff --git a/include/class.ticket.php b/include/class.ticket.php
index 067167f64..64fb7dcb0 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -188,7 +188,7 @@ class Ticket {
             return false;
 
         $sql='SELECT  ticket.*, thread.id as thread_id, lock_id, dept.name as dept_name '
-            .' ,count(distinct attach.attach_id) as attachments'
+            .' ,count(distinct attach.id) as attachments'
             .' ,count(distinct task.id) as tasks'
             .' FROM '.TICKET_TABLE.' ticket '
             .' LEFT JOIN '.DEPT_TABLE.' dept ON (ticket.dept_id=dept.id) '
diff --git a/include/i18n/en_US/form.yaml b/include/i18n/en_US/form.yaml
index 577dd5539..6e3d4c9e9 100644
--- a/include/i18n/en_US/form.yaml
+++ b/include/i18n/en_US/form.yaml
@@ -97,7 +97,7 @@
       type: priority # notrans
       name: priority # notrans
       label: Priority Level
-      flags: 0x430A3
+      flags: 0x430B1
       sort: 3
 - type: C # notrans
   title: Company Information
diff --git a/include/staff/templates/tickets.tmpl.php b/include/staff/templates/tickets.tmpl.php
index ca1ff2b40..6e6b6cf5c 100644
--- a/include/staff/templates/tickets.tmpl.php
+++ b/include/staff/templates/tickets.tmpl.php
@@ -145,7 +145,7 @@ if ($results) { ?>
                 title="<?php echo __('Preview Ticket'); ?>"
                 href="tickets.php?id=<?php echo $row['ticket_id']; ?>"
                 data-preview="#tickets/<?php echo $row['ticket_id']; ?>/preview"><?php echo $tid; ?></a></td>
-            <td align="center" nowrap><?php echo Format::db_datetime($row['effective_date']); ?></td>
+            <td align="center" nowrap><?php echo Format::datetime($row['effective_date']); ?></td>
             <td><?php echo $status; ?></td>
             <td><a <?php if ($flag) { ?> class="Icon <?php echo $flag; ?>Ticket" title="<?php echo ucfirst($flag); ?> Ticket" <?php } ?>
                 href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $subject; ?></a>
diff --git a/include/staff/tickets.inc.php b/include/staff/tickets.inc.php
index 14ecb5759..076f0e9ad 100644
--- a/include/staff/tickets.inc.php
+++ b/include/staff/tickets.inc.php
@@ -309,7 +309,7 @@ $_SESSION[':Q:tickets'] = $tickets;
                     href="tickets.php?id=<?php echo $T['ticket_id']; ?>"
                     data-preview="#tickets/<?php echo $T['ticket_id']; ?>/preview"
                     ><?php echo $tid; ?></a></td>
-                <td align="center" nowrap><?php echo Format::db_datetime($T[$date_col ?: 'lastupdate']); ?></td>
+                <td align="center" nowrap><?php echo Format::datetime($T[$date_col ?: 'lastupdate']); ?></td>
                 <td><a <?php if ($flag) { ?> class="Icon <?php echo $flag; ?>Ticket" title="<?php echo ucfirst($flag); ?> Ticket" <?php } ?>
                     href="tickets.php?id=<?php echo $T['ticket_id']; ?>"><?php echo $subject; ?></a>
                      <?php
-- 
GitLab