Beispiel #1
0
 public function move($new_status, \phpbb\titania\tags $tags)
 {
     $this->user->add_lang_ext('phpbb/titania', 'manage');
     $from = $tags->get_tag_name($this->queue_status);
     $to = $tags->get_tag_name($new_status);
     $this->topic_reply(sprintf(phpbb::$user->lang['QUEUE_REPLY_MOVE'], $from, $to));
     $this->queue_status = (int) $new_status;
     $this->queue_progress = 0;
     $this->queue_progress_time = 0;
     $this->submit(false);
     // Send notifications
     $contrib = contribs_overlord::get_contrib_object($this->contrib_id, true);
     $topic = new titania_topic();
     $topic->load($this->queue_topic_id);
     $path_helper = phpbb::$container->get('path_helper');
     $u_view_queue = $topic->get_url(false, array('tag' => $new_status));
     $vars = array('CONTRIB_NAME' => $contrib->contrib_name, 'CATEGORY_NAME' => $to, 'U_VIEW_QUEUE' => $path_helper->strip_url_params($u_view_queue, 'sid'));
     $this->subscriptions->send_notifications(TITANIA_QUEUE_TAG, $new_status, 'new_contrib_queue_cat', $vars, phpbb::$user->data['user_id']);
     // Hooks
     titania::$hook->call_hook_ref(array(__CLASS__, __FUNCTION__), $this);
 }
Beispiel #2
0
     titania::add_lang('contributions');
     $revision = $queue->get_revision();
     $public_notes_preview = false;
     if (titania_types::$types[$contrib->contrib_type]->update_public) {
         $public_notes_preview = $action == 'deny' ? false : sprintf(phpbb::$user->lang[titania_types::$types[$contrib->contrib_type]->update_public], $revision->revision_version) . ($public_notes ? sprintf(phpbb::$user->lang[titania_types::$types[$contrib->contrib_type]->update_public . '_NOTES'], $public_notes) : '');
         $uid = $bitfield = $options = false;
         generate_text_for_storage($public_notes_preview, $uid, $bitfield, $options, true, true, true);
         $public_notes_preview = titania_generate_text_for_display($public_notes_preview, $uid, $bitfield, $options);
     }
     phpbb::$template->assign_vars(array('ERROR' => implode('<br />', $error), 'L_TOPIC_REVIEW' => phpbb::$user->lang['QUEUE_REVIEW'], 'PAGE_TITLE_EXPLAIN' => phpbb::$user->lang[($action == 'approve' ? 'APPROVE_QUEUE' : 'DENY_QUEUE') . '_CONFIRM'], 'PUBLIC_MESSAGE' => $public_notes, 'PUBLIC_PREVIEW_SUBJECT' => isset($_POST['preview']) ? 'Re: ' . $contrib->contrib_name : false, 'PUBLIC_PREVIEW_MESSAGE' => isset($_POST['preview']) ? $public_notes_preview : false, 'S_CONTRIB_APPROVE' => $action == 'approve' ? true : false, 'S_STYLE_DEMO_INSTALL' => $action == 'approve' && $contrib->contrib_type == TITANIA_TYPE_STYLE && titania::$config->demo_style_path ? true : false, 'S_STYLE_DEMO_INSTALL_CHECKED' => isset($_POST['style_demo_install']) ? true : false, 'S_PUBLIC_NOTES' => $action == 'approve' && titania_types::$types[$contrib->contrib_type]->update_public ? true : false, 'TOPIC_TITLE' => $contrib->contrib_name));
     // Setup the sort tool
     $topic_sort = posts_overlord::build_sort();
     $topic_sort->set_defaults(false, false, 'd');
     // Load the topic
     $topic = new titania_topic();
     $topic->load($queue->queue_topic_id);
     // Display the posts for review
     posts_overlord::display_topic($topic, $topic_sort);
     titania::page_header(phpbb::$user->lang[$action == 'approve' ? 'APPROVE_QUEUE' : 'DENY_QUEUE'] . ': ' . $contrib->contrib_name);
     titania::page_footer(false, 'manage/queue_validate.html');
     break;
 case 'notes':
     $queue = queue_overlord::get_queue_object($queue_id, true);
     // Load the message object
     $message_object = new titania_message($queue);
     $message_object->set_auth(array('bbcode' => true, 'smilies' => true));
     $message_object->set_settings(array('display_subject' => false));
     // Submit check...handles running $post->post_data() if required
     $submit = $message_object->submit_check();
     if ($submit) {
         $queue->submit();
Beispiel #3
0
 /**
  * Display queue topic review.
  *
  * @return null
  */
 protected function display_topic_review()
 {
     // Setup the sort tool
     $topic_sort = \posts_overlord::build_sort();
     $topic_sort->set_defaults(false, false, 'd');
     // Load the topic
     $topic = new \titania_topic();
     $topic->load($this->queue->queue_topic_id);
     // Display the posts for review
     \posts_overlord::display_topic($topic, $topic_sort);
 }
Beispiel #4
0
    /**
     * Rebuild (or create) the first post in the queue topic
     */
    public function update_first_queue_post($post_subject = false)
    {
        titania::add_lang('manage');
        if (!$this->queue_topic_id) {
            $sql = 'SELECT contrib_type FROM ' . TITANIA_CONTRIBS_TABLE . '
				WHERE contrib_id = ' . $this->contrib_id;
            phpbb::$db->sql_query($sql);
            $contrib_type = phpbb::$db->sql_fetchfield('contrib_type');
            phpbb::$db->sql_freeresult();
            // Create the topic
            $post = new titania_post(TITANIA_QUEUE);
            $post->post_access = TITANIA_ACCESS_TEAMS;
            $post->topic->parent_id = $this->queue_id;
            $post->topic->topic_category = $contrib_type;
            $post->topic->topic_url = 'manage/queue/q_' . $this->queue_id;
        } else {
            // Load the first post
            $topic = new titania_topic();
            $topic->topic_id = $this->queue_topic_id;
            $topic->load();
            $post = new titania_post($topic->topic_type, $topic, $topic->topic_first_post_id);
            $post->load();
        }
        if ($post_subject) {
            $post->post_subject = $post_subject;
        }
        $post->post_user_id = $this->submitter_user_id;
        $post->post_time = $this->queue_submit_time;
        // Reset the post text
        $post->post_text = '';
        // Queue Discussion Link
        $queue_topic = $this->get_queue_discussion_topic();
        $post->post_text .= '[url=' . $queue_topic->get_url() . ']' . phpbb::$user->lang['QUEUE_DISCUSSION_TOPIC'] . "[/url]\n\n";
        // Put text saying whether repacking is allowed or not
        $post->post_text .= phpbb::$user->lang[$this->queue_allow_repack ? 'QUEUE_REPACK_ALLOWED' : 'QUEUE_REPACK_NOT_ALLOWED'] . "\n\n";
        // Add the queue notes
        if ($this->queue_notes) {
            $queue_notes = $this->queue_notes;
            titania_decode_message($queue_notes, $this->queue_notes_uid);
            $post->post_text .= '[quote=&quot;' . users_overlord::get_user($this->submitter_user_id, 'username', true) . '&quot;]' . $queue_notes . "[/quote]\n";
        }
        // Add the MPV results
        if ($this->mpv_results) {
            $mpv_results = $this->mpv_results;
            titania_decode_message($mpv_results, $this->mpv_results_uid);
            $post->post_text .= '[quote=&quot;' . phpbb::$user->lang['VALIDATION_MPV'] . '&quot;]' . $mpv_results . "[/quote]\n";
        }
        // Add the Automod results
        if ($this->automod_results) {
            $post->post_text .= '[quote=&quot;' . phpbb::$user->lang['VALIDATION_AUTOMOD'] . '&quot;]' . $this->automod_results . "[/quote]\n";
        }
        // Prevent errors from different configurations
        phpbb::$config['min_post_chars'] = 1;
        phpbb::$config['max_post_chars'] = 0;
        // Hooks
        titania::$hook->call_hook_ref(array(__CLASS__, __FUNCTION__), $post, $this);
        // Store the post
        $post->generate_text_for_storage(true, true, true);
        $post->submit();
        $this->queue_topic_id = $post->topic_id;
    }