diff --git a/include/class.topic.php b/include/class.topic.php index 75c06b7dfe2037147669501cbcb164714e738a37..32df895cd79f9ec5adeefe235e600845e8e4b160 100644 --- a/include/class.topic.php +++ b/include/class.topic.php @@ -195,19 +195,6 @@ implements TemplateVariable, Searchable { return !!($this->flags & self::FLAG_ACTIVE); } - function clearInactiveTopic($topic_id) { - global $cfg; - - $emails = Email::objects()->filter(array('topic_id'=>$topic_id))->values_flat('email_id'); - if ($emails) { - foreach ($emails as $email_id) { - $email = Email::lookup($email_id[0]); - $email->topic_id = $cfg->getDefaultTopicId(); - $email->save(); - } - } - } - function getStatus() { if($this->flags & self::FLAG_ACTIVE) return 'Active'; diff --git a/scp/helptopics.php b/scp/helptopics.php index ea1d7b8bd147812bec28021627c3399db9a71cd6..40580549e8b3b1da1c0292f6e279801844d68139 100644 --- a/scp/helptopics.php +++ b/scp/helptopics.php @@ -28,9 +28,6 @@ if($_POST){ if(!$topic){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('help topic')); }elseif($topic->update($_POST,$errors)){ - if ($_POST["status"] != __('Active')) - Topic::clearInactiveTopic($topic->getId()); - $msg=sprintf(__('Successfully updated %s.'), __('this help topic')); }elseif(!$errors['err']){ @@ -101,11 +98,8 @@ if($_POST){ $t->setFlag(Topic::FLAG_ACTIVE, false); $filter_actions = FilterAction::objects()->filter(array('type' => 'topic', 'configuration' => '{"topic_id":'. $t->getId().'}')); FilterAction::setFilterFlag($filter_actions, 'topic', true); - if($t->save()) { + if($t->save()) $num++; - //remove topic_id for emails using disabled topic - Topic::clearInactiveTopic($t->getId()); - } } if ($num > 0) { if($num==$count) @@ -130,11 +124,8 @@ if($_POST){ $t->setFlag(Topic::FLAG_ACTIVE, false); $filter_actions = FilterAction::objects()->filter(array('type' => 'topic', 'configuration' => '{"topic_id":'. $t->getId().'}')); FilterAction::setFilterFlag($filter_actions, 'topic', true); - if($t->save()) { + if($t->save()) $num++; - //remove topic_id for emails using disabled topic - Topic::clearInactiveTopic($t->getId()); - } } if ($num > 0) { if($num==$count)