diff --git a/include/class.i18n.php b/include/class.i18n.php index bc7634329ea581a81727b0cf80c80a1a490b1f7f..082d8040b7a2e01ab4b99e4dd5ef85a203f2c7fc 100644 --- a/include/class.i18n.php +++ b/include/class.i18n.php @@ -149,6 +149,7 @@ class Internationalization { if (($premade = Canned::create($c)) && isset($c['attachments'])) { $premade->attachments->upload($c['attachments']); + $premade->save(); } } } diff --git a/include/class.ticket.php b/include/class.ticket.php index 7df96993872ba5efb53339b124402c9976a0916d..cc9cbd703ab439d8224634e28ca8a80f7b724bce 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -247,7 +247,7 @@ implements RestrictedAccess, Threadable, TemplateVariable { .' ,count(distinct task.id) as tasks' .' FROM '.TICKET_TABLE.' ticket ' .' LEFT JOIN '.DEPT_TABLE.' dept ON (ticket.dept_id=dept.id) ' - .' LEFT JOIN '.SLA_TABLE.' sla ON (ticket.sla_id=sla.id AND sla.isactive=1) ' + .' LEFT JOIN '.SLA_TABLE.' sla ON (ticket.sla_id=sla.id AND sla.flags & 1 = 1) ' .' LEFT JOIN '.LOCK_TABLE.' tlock ON ( ticket.lock_id=tlock.lock_id AND tlock.expire>NOW()) ' .' LEFT JOIN '.TASK_TABLE.' task diff --git a/include/i18n/en_US/role.yaml b/include/i18n/en_US/role.yaml index ec55b154de8ee10dd0e10c977f323439c5132466..3be09a6392a5c3f8e92d880c18048812b8c77a0f 100644 --- a/include/i18n/en_US/role.yaml +++ b/include/i18n/en_US/role.yaml @@ -31,7 +31,7 @@ task.reply, task.close, task.delete, - kb.premade, + canned.manage, faq.manage, stats.agents, emails.banlist, @@ -43,7 +43,8 @@ org.create, org.edit, org.delete, - search.all] + search.all, + thread.edit] - id: 2 flags: 1 @@ -64,7 +65,7 @@ task.transfer, task.reply, task.close, - kb.premade, + canned.manage, faq.manage, stats.agents, emails.banlist, diff --git a/include/staff/templates/thread-entries.tmpl.php b/include/staff/templates/thread-entries.tmpl.php index f15ea1e061997647ba4ec246a630008f412a0c8e..0be5722c5004d59e9bf62415af5413f5c249e247 100644 --- a/include/staff/templates/thread-entries.tmpl.php +++ b/include/staff/templates/thread-entries.tmpl.php @@ -23,7 +23,7 @@ if (count($entries)) { // changes in dates between thread items. foreach ($entries as $entry) { // Emit all events prior to this entry - while ($event && $event->timestamp <= $entry->created) { + while ($event && $event->timestamp < $entry->created) { $event->render(ThreadEvent::MODE_STAFF); $events->next(); $event = $events->current(); diff --git a/include/staff/templates/thread-entry.tmpl.php b/include/staff/templates/thread-entry.tmpl.php index 01839aac5e37639df635dfc366cb289a159242a8..cc5a704ab300058b15959a048dc0112521e63728 100644 --- a/include/staff/templates/thread-entry.tmpl.php +++ b/include/staff/templates/thread-entry.tmpl.php @@ -5,8 +5,8 @@ $name = $user ? $user->getName() : $entry->poster; $avatar = ''; if ($user && ($url = $user->get_gravatar(48))) $avatar = "<img class=\"avatar\" src=\"{$url}\"> "; -?> +?> <div class="thread-entry <?php echo $entryTypes[$entry->type]; ?> <?php if ($avatar) echo 'avatar'; ?>"> <?php if ($avatar) { ?> <span class="<?php echo ($entry->type == 'M') ? 'pull-right' : 'pull-left'; ?> avatar"> @@ -15,45 +15,45 @@ if ($user && ($url = $user->get_gravatar(48))) <?php } ?> <div class="header"> <div class="pull-right"> -<?php if ($entry->hasActions()) { +<?php if ($entry->hasActions()) { $actions = $entry->getActions(); ?> - <span class="muted-button pull-right" data-dropdown="#entry-action-more-<?php echo $entry->getId(); ?>"> - <i class="icon-caret-down"></i> - </span> - <div id="entry-action-more-<?php echo $entry->getId(); ?>" class="action-dropdown anchor-right"> - <ul class="title"> -<?php foreach ($actions as $group => $list) { + <span class="muted-button pull-right" data-dropdown="#entry-action-more-<?php echo $entry->getId(); ?>"> + <i class="icon-caret-down"></i> + </span> + <div id="entry-action-more-<?php echo $entry->getId(); ?>" class="action-dropdown anchor-right"> + <ul class="title"> +<?php foreach ($actions as $group => $list) { foreach ($list as $id => $action) { ?> - <li> - <a class="no-pjax" href="#" onclick="javascript: + <li> + <a class="no-pjax" href="#" onclick="javascript: <?php echo str_replace('"', '\\"', $action->getJsStub()); ?>; return false;"> - <i class="<?php echo $action->getIcon(); ?>"></i> <?php + <i class="<?php echo $action->getIcon(); ?>"></i> <?php echo $action->getName(); - ?></a></li> -<?php } + ?></a></li> +<?php } } ?> - </ul> + </ul> </div> -<?php } ?> - <span style="vertical-align:middle;" class="textra"> - <?php if ($entry->flags & ThreadEntry::FLAG_EDITED) { ?> - <span class="label label-bare" title="<?php +<?php } ?> + <span style="vertical-align:middle;" class="textra"> +<?php if ($entry->flags & ThreadEntry::FLAG_EDITED) { ?> + <span class="label label-bare" title="<?php echo sprintf(__('Edited on %s by %s'), Format::datetime($entry->updated), 'You'); ?>"><?php echo __('Edited'); ?></span> <?php } ?> - </span> + </span> </div> <?php - echo sprintf(__('<b>%s</b> posted %s'), $name, - sprintf('<time class="relative" datetime="%s" title="%s">%s</time>', - date(DateTime::W3C, Misc::db2gmtime($entry->created)), - Format::daydatetime($entry->created), - Format::relativeTime(Misc::db2gmtime($entry->created)) - ) - ); ?> - <span style="max-width:500px" class="faded title truncate"><?php - echo $entry->title; ?></span> - </span> + echo sprintf(__('<b>%s</b> posted %s'), $name, + sprintf('<time class="relative" datetime="%s" title="%s">%s</time>', + date(DateTime::W3C, Misc::db2gmtime($entry->created)), + Format::daydatetime($entry->created), + Format::relativeTime(Misc::db2gmtime($entry->created)) + ) + ); ?> + <span style="max-width:500px" class="faded title truncate"><?php + echo $entry->title; ?></span> + </span> </div> <div class="thread-body" id="thread-id-<?php echo $entry->getId(); ?>"> <div><?php echo $entry->getBody()->toHtml(); ?></div> diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index b981e2024b28cdeab8ec45cdd79162695228c181..1f5ae3e622570b8c5d5b5cc01411309647f193db 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -435,13 +435,13 @@ $tcount = $ticket->getThreadEntries($types)->count(); echo sprintf(' (%d)', $ticket->getNumTasks()); ?></a></li> </ul> + <div id="ticket_tabs_container"> <div id="ticket_thread" data-thread-id="<?php echo $ticket->getThread()->getId(); ?>" class="tab_content"> - <?php - $ticket->getThread()->render(array('M', 'R', 'N')); - ?> + <div id="thread-items"> + <?php $ticket->getThread()->render(array('M', 'R', 'N')); ?> </div> -<div class="clear" style="padding-bottom:10px;"></div> +<div class="clear"></div> <?php if($errors['err']) { ?> <div id="msg_error"><?php echo $errors['err']; ?></div> <?php }elseif($msg) { ?> diff --git a/include/upgrader/streams/core.sig b/include/upgrader/streams/core.sig index 68f58c5ebd07db09e5e22e9d52f6f4a4c63a1c17..20bbf7d78e595692f660eb24112f04b267799f87 100644 --- a/include/upgrader/streams/core.sig +++ b/include/upgrader/streams/core.sig @@ -1 +1 @@ -9143a511719555e8f8f09b49523bd022 +0d6099a650cc7884eb59a040feab2ce8 diff --git a/include/upgrader/streams/core/9143a511-00000000.cleanup.sql b/include/upgrader/streams/core/9143a511-0d6099a6.cleanup.sql similarity index 100% rename from include/upgrader/streams/core/9143a511-00000000.cleanup.sql rename to include/upgrader/streams/core/9143a511-0d6099a6.cleanup.sql diff --git a/include/upgrader/streams/core/9143a511-00000000.patch.sql b/include/upgrader/streams/core/9143a511-0d6099a6.patch.sql similarity index 96% rename from include/upgrader/streams/core/9143a511-00000000.patch.sql rename to include/upgrader/streams/core/9143a511-0d6099a6.patch.sql index dd28bbed98dfcff312264e17889231ab9f4547e7..6d9d110fc09aa7e7f2a466165a712331f5387e67 100644 --- a/include/upgrader/streams/core/9143a511-00000000.patch.sql +++ b/include/upgrader/streams/core/9143a511-0d6099a6.patch.sql @@ -1,7 +1,7 @@ /** - * @signature 959aca6ed189cd918d227a3ea8a135a3 + * @signature 0d6099a650cc7884eb59a040feab2ce8 * @version v1.10.0 - * @title Retire `private`, `required`, and `edit_mask` for fields + * @title Add events to the ticket thread * */ @@ -115,5 +115,5 @@ ALTER TABLE `%TABLE_PREFIX%attachment` -- Finished with patch UPDATE `%TABLE_PREFIX%config` - SET `value` = '00000000000000000000000000000000' + SET `value` = '0d6099a650cc7884eb59a040feab2ce8' WHERE `key` = 'schema_signature' AND `namespace` = 'core'; diff --git a/scp/css/scp.css b/scp/css/scp.css index fc168fe44e15e5df124f6fa15f2e9a1b88103ece..c965cb7a97cc4a025750ed740c6e0123b532ff97 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -1004,10 +1004,6 @@ img.avatar { background:#f9f9f9; } -#response_options { - margin-top:10px; -} - #response_options > form { padding:0 10px; } @@ -2116,7 +2112,6 @@ tr.disabled th { } .tab_content:not(.left) { padding: 12px 0; - margin: 5px 0; } .left-tabs { margin-left: 48px; @@ -2370,7 +2365,7 @@ td.indented { } } -#ticket_thread::before { +#thread-items::before { border-left: 2px dotted #ddd; border-bottom-color: rgba(0,0,0,0.1); position: absolute; @@ -2382,11 +2377,12 @@ td.indented { right: 0; left: 0; } -#ticket_thread { +#thread-items { z-index: 0; position: relative; - border-bottom: 2px solid #ddd; - border-bottom-color: rgba(0,0,0,0.1); + padding-top: 0; + padding-bottom: 15px; + margin-top: 5px; } .thread-event { padding: 0 2px 15px; diff --git a/setup/inc/streams/core/install-mysql.sql b/setup/inc/streams/core/install-mysql.sql index 963adce7f9fa57eed7c8bd5c81f1ba33cba1a68f..368b1bf1cf5af4c948d43ac56e67b497299d9a35 100644 --- a/setup/inc/streams/core/install-mysql.sql +++ b/setup/inc/streams/core/install-mysql.sql @@ -591,14 +591,13 @@ DROP TABLE IF EXISTS `%TABLE_PREFIX%team`; CREATE TABLE `%TABLE_PREFIX%team` ( `team_id` int(10) unsigned NOT NULL auto_increment, `lead_id` int(10) unsigned NOT NULL default '0', - `flags` int(10) unsigned NOTN ULL default 1, + `flags` int(10) unsigned NOT NULL default 1, `name` varchar(125) NOT NULL default '', `notes` text, `created` datetime NOT NULL, `updated` datetime NOT NULL, PRIMARY KEY (`team_id`), UNIQUE KEY `name` (`name`), - KEY `isnabled` (`isenabled`), KEY `lead_id` (`lead_id`) ) DEFAULT CHARSET=utf8; @@ -727,6 +726,7 @@ CREATE TABLE `%TABLE_PREFIX%thread_event` ( `uid_type` char(1) NOT NULL DEFAULT 'S', `annulled` tinyint(1) unsigned NOT NULL default '0', `timestamp` datetime NOT NULL, + PRIMARY KEY (`id`), KEY `ticket_state` (`thread_id`, `state`, `timestamp`), KEY `ticket_stats` (`timestamp`, `state`) ) DEFAULT CHARSET=utf8; @@ -794,7 +794,6 @@ CREATE TABLE `%TABLE_PREFIX%task` ( KEY `staff_id` (`staff_id`), KEY `team_id` (`team_id`), KEY `created` (`created`), - KEY `sla_id` (`sla_id`), KEY `object` (`object_id`,`object_type`) ) DEFAULT CHARSET=utf8;