From d496b10fb10c5af45484094dba91d0a1009866a5 Mon Sep 17 00:00:00 2001 From: aydreeihn <adriane@enhancesoft.com> Date: Tue, 19 Sep 2017 16:24:12 -0500 Subject: [PATCH] remove references to collaborator isactive field --- include/ajax.thread.php | 2 +- include/class.collaborator.php | 1 - include/class.thread.php | 2 -- include/class.ticket.php | 12 +++++------- include/upgrader/streams/core.sig | 2 +- ...2ce8ba7.patch.sql => ad9d0a5f-0ca85857.patch.sql} | 6 +++--- scp/tasks.php | 2 +- scp/tickets.php | 4 ++-- 8 files changed, 13 insertions(+), 18 deletions(-) rename include/upgrader/streams/core/{98ad7d55-b2ce8ba7.patch.sql => ad9d0a5f-0ca85857.patch.sql} (86%) diff --git a/include/ajax.thread.php b/include/ajax.thread.php index e1e8a2663..3a0c92e39 100644 --- a/include/ajax.thread.php +++ b/include/ajax.thread.php @@ -112,7 +112,7 @@ class ThreadAjaxAPI extends AjaxController { if ($user) { // FIXME: Refuse to add ticket owner?? if (($c=$thread->addCollaborator($user, - array('isactive'=>1), $errors))) { + array(), $errors))) { $info = array('msg' => sprintf(__('%s added as a collaborator'), Format::htmlchars($c->getName()))); $c->setCc(); diff --git a/include/class.collaborator.php b/include/class.collaborator.php index 4bd0e7cf8..508167221 100644 --- a/include/class.collaborator.php +++ b/include/class.collaborator.php @@ -196,7 +196,6 @@ implements EmailContact, ITicketUser { if ($errors) return false; $collab = static::create(array( - 'isactive' => isset($info['isactive']) ? $info['isactive'] : 0, 'thread_id' => $info['threadId'], 'user_id' => $info['userId'], )); diff --git a/include/class.thread.php b/include/class.thread.php index f101aef0d..eab798690 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -202,7 +202,6 @@ implements Searchable { 'id__in' => $cids ))->update(array( 'updated' => SqlFunction::NOW(), - 'isactive' => 1, )); foreach ($vars['cid'] as $c) { @@ -225,7 +224,6 @@ implements Searchable { } $inactive->update(array( 'updated' => SqlFunction::NOW(), - 'isactive' => 0, )); } diff --git a/include/class.ticket.php b/include/class.ticket.php index e6c85da6b..4cdb6db1c 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -948,7 +948,6 @@ implements RestrictedAccess, Threadable, Searchable { 'id__in' => $cids ))->update(array( 'updated' => SqlFunction::NOW(), - 'isactive' => 1, )); $collab->save(); } @@ -959,7 +958,6 @@ implements RestrictedAccess, Threadable, Searchable { Q::not(array('id__in' => $cids)) ))->update(array( 'updated' => SqlFunction::NOW(), - 'isactive' => 0, )); } @@ -2349,7 +2347,7 @@ implements RestrictedAccess, Threadable, Searchable { else $user = User::lookup($vars['userId']); - $c = $this->getThread()->addCollaborator($user,array('isactive'=>1), $errors); + $c = $this->getThread()->addCollaborator($user,array(), $errors); foreach (array('To', 'TO', 'Cc', 'CC') as $k) { if ($user && isset($hdr[$k]) && $hdr[$k]) @@ -2607,7 +2605,7 @@ implements RestrictedAccess, Threadable, Searchable { foreach ($vars['ccs'] as $uid) { $user = User::lookup($uid); if (!in_array($uid, $collabIds)) - if (($c2=$ticket->getThread()->addCollaborator($user,array('isactive'=>1), $errors))) + if (($c2=$ticket->getThread()->addCollaborator($user,array(), $errors))) $c2->setCc(); } } @@ -2615,7 +2613,7 @@ implements RestrictedAccess, Threadable, Searchable { foreach ($vars['bccs'] as $uid) { $user = User::lookup($uid); if (!in_array($uid, $collabIds)) - if (($c2=$ticket->getThread()->addCollaborator($user,array('isactive'=>1), $errors))) + if (($c2=$ticket->getThread()->addCollaborator($user,array(), $errors))) $c2->setBcc(); } } @@ -3731,7 +3729,7 @@ implements RestrictedAccess, Threadable, Searchable { if ($ccuser && !$existing = Collaborator::getIdByUserId($ccuser->getId(), $ticket->getThreadId())) { $collabsCc[] = $ccuser->getEmail()->address; - if (($c2=$ticket->getThread()->addCollaborator($ccuser,array('isactive'=>1), $errors))) + if (($c2=$ticket->getThread()->addCollaborator($ccuser,array(), $errors))) $c2->setCc(); } } @@ -3745,7 +3743,7 @@ implements RestrictedAccess, Threadable, Searchable { if ($bccuser && !$existing = Collaborator::getIdByUserId($bccuser->getId(), $ticket->getThreadId())) { $collabsBcc[] = $bccuser; - if (($c2=$ticket->getThread()->addCollaborator($bccuser,array('isactive'=>1), $errors))) + if (($c2=$ticket->getThread()->addCollaborator($bccuser,array(), $errors))) $c2->setBcc(); } } diff --git a/include/upgrader/streams/core.sig b/include/upgrader/streams/core.sig index 891a53e7d..72ff8c4ba 100644 --- a/include/upgrader/streams/core.sig +++ b/include/upgrader/streams/core.sig @@ -1 +1 @@ -ad9d0a5f1bd9f83a4ecb3f590b334eac +0ca8585781bc6656f3ca008212554441 diff --git a/include/upgrader/streams/core/98ad7d55-b2ce8ba7.patch.sql b/include/upgrader/streams/core/ad9d0a5f-0ca85857.patch.sql similarity index 86% rename from include/upgrader/streams/core/98ad7d55-b2ce8ba7.patch.sql rename to include/upgrader/streams/core/ad9d0a5f-0ca85857.patch.sql index 3c10b87fd..ee61ea4e1 100644 --- a/include/upgrader/streams/core/98ad7d55-b2ce8ba7.patch.sql +++ b/include/upgrader/streams/core/ad9d0a5f-0ca85857.patch.sql @@ -1,7 +1,7 @@ /** + * @signature 0ca8585781bc6656f3ca008212554441 * @version v1.11.0 - * @title Add recipients field/collaborator flags - * @signature b2ce8ba794a40ed5380d7cdf30bca233 + * @title Add recipients field and collaborator flags * * This patch adds a new field called recipients to the thread entry table * allowing agents to see a list of recipients for any thread entry where @@ -27,5 +27,5 @@ -- Finished with patch UPDATE `%TABLE_PREFIX%config` - SET `value` = 'b2ce8ba794a40ed5380d7cdf30bca233' + SET `value` = '0ca8585781bc6656f3ca008212554441' WHERE `key` = 'schema_signature' AND `namespace` = 'core'; diff --git a/scp/tasks.php b/scp/tasks.php index 23f83dba0..8ba17864d 100644 --- a/scp/tasks.php +++ b/scp/tasks.php @@ -117,7 +117,7 @@ if($_POST && !$errors): $errors['err']=__('Permission Denied. You are not allowed to add collaborators'); } elseif (!$_POST['user_id'] || !($user=User::lookup($_POST['user_id']))) { $errors['err'] = __('Unknown user selected'); - } elseif ($c2 = $task->addCollaborator($user, array('isactive'=>1), $errors)) { + } elseif ($c2 = $task->addCollaborator($user, array(), $errors)) { $c2->setFlag(Collaborator::FLAG_CC, true); $c2->save(); $msg = sprintf(__('Collaborator %s added'), diff --git a/scp/tickets.php b/scp/tickets.php index a79354e61..d9cc0d52e 100644 --- a/scp/tickets.php +++ b/scp/tickets.php @@ -371,7 +371,7 @@ if($_POST && !$errors): $errors['err']=__('Permission Denied. You are not allowed to add collaborators'); } elseif (!$_POST['user_id'] || !($user=User::lookup($_POST['user_id']))) { $errors['err'] = __('Unknown user selected'); - } elseif ($c2 = $ticket->addCollaborator($user, array('isactive'=>1), $errors)) { + } elseif ($c2 = $ticket->addCollaborator($user, array(), $errors)) { $c2->setFlag(Collaborator::FLAG_CC, true); $c2->save(); $msg = sprintf(__('Collaborator %s added'), @@ -386,7 +386,7 @@ if($_POST && !$errors): $errors['err']=__('Permission Denied. You are not allowed to add collaborators'); } elseif (!$_POST['user_id'] || !($user=User::lookup($_POST['user_id']))) { $errors['err'] = __('Unknown user selected'); - } elseif ($c2 = $ticket->addCollaborator($user, array('isactive'=>1), $errors)) { + } elseif ($c2 = $ticket->addCollaborator($user, array(), $errors)) { $msg = sprintf(__('Collaborator %s added'), Format::htmlchars($user->getName())); } -- GitLab