[Customisation Database Commits] r674 - in /trunk/titania: ariel_convert.php includes/constants.php includes/objects/post.php includes/objects/queue.php includes/objects/topic.php includes/overlords/queue.php includes/overlords/topics.php

Nathan Guse exreaction at phpbb.com
Fri Mar 5 00:05:30 GMT 2010


Author: exreaction
Date: Fri Mar  5 00:05:29 2010
New Revision: 674

Log:
The topic type should be set by the first post in the topic, not by setting it when declaring the topic.

Adding the Titania queue discussion type for topics

Modified:
    trunk/titania/ariel_convert.php
    trunk/titania/includes/constants.php
    trunk/titania/includes/objects/post.php
    trunk/titania/includes/objects/queue.php
    trunk/titania/includes/objects/topic.php
    trunk/titania/includes/overlords/queue.php
    trunk/titania/includes/overlords/topics.php

Modified: trunk/titania/ariel_convert.php
==============================================================================
*** trunk/titania/ariel_convert.php (original)
--- trunk/titania/ariel_convert.php Fri Mar  5 00:05:29 2010
***************
*** 453,459 ****
  				continue;
  			}
  
! 			$topic = new titania_topic(TITANIA_QUEUE);
  			$topic->parent_id = $row['queue_id'];
  			$topic->topic_url = 'manage/queue/q_' . $row['queue_id'];
  			$post = false;
--- 453,459 ----
  				continue;
  			}
  
! 			$topic = new titania_topic;
  			$topic->parent_id = $row['queue_id'];
  			$topic->topic_url = 'manage/queue/q_' . $row['queue_id'];
  			$post = false;

Modified: trunk/titania/includes/constants.php
==============================================================================
*** trunk/titania/includes/constants.php (original)
--- trunk/titania/includes/constants.php Fri Mar  5 00:05:29 2010
***************
*** 68,73 ****
--- 68,74 ----
  define('TITANIA_TOPIC', 6);
  define('TITANIA_AUTHOR', 7);
  define('TITANIA_CATEGORY', 8);
+ define('TITANIA_QUEUE_DISCUSSION', 9);
  
  // Errorbox types
  define('TITANIA_ERROR', 1);

Modified: trunk/titania/includes/objects/post.php
==============================================================================
*** trunk/titania/includes/objects/post.php (original)
--- trunk/titania/includes/objects/post.php Fri Mar  5 00:05:29 2010
***************
*** 104,109 ****
--- 104,114 ----
  
  		switch ($type)
  		{
+ 			case 'queue_discussion' :
+ 			case TITANIA_QUEUE_DISCUSSION :
+ 				$this->post_type = TITANIA_QUEUE_DISCUSSION;
+ 			break;
+ 
  			case 'tracker' :
  			case TITANIA_TRACKER :
  				$this->post_type = TITANIA_TRACKER;
***************
*** 130,136 ****
  		}
  		else if (is_int($topic))
  		{
! 			$this->topic = new titania_topic($this->post_type, $topic);
  			if (!$this->topic->load())
  			{
  				trigger_error('NO_TOPIC');
--- 135,141 ----
  		}
  		else if (is_int($topic))
  		{
! 			$this->topic = new titania_topic($topic);
  			if (!$this->topic->load())
  			{
  				trigger_error('NO_TOPIC');
***************
*** 140,146 ****
  		}
  		else
  		{
! 			$this->topic = new titania_topic($this->post_type);
  		}
  	}
  
--- 145,151 ----
  		}
  		else
  		{
! 			$this->topic = new titania_topic;
  		}
  	}
  
***************
*** 351,356 ****
--- 356,362 ----
  		if (!$this->topic->topic_id)
  		{
  			$this->topic->__set_array(array(
+ 				'topic_type'		=> $this->post_type,
  				'topic_access'		=> $this->post_access,
  				'topic_approved'	=> $this->post_approved,
  				'topic_user_id'		=> $this->post_user_id,

Modified: trunk/titania/includes/objects/queue.php
==============================================================================
*** trunk/titania/includes/objects/queue.php (original)
--- trunk/titania/includes/objects/queue.php Fri Mar  5 00:05:29 2010
***************
*** 216,224 ****
  
  	public function approve()
  	{
- 		// Send notification message
- 		$this->send_approve_deny_notification();
- 
  		// Update the revisions table
  		$sql_ary = array(
  			'revision_validated'	=> true,
--- 216,221 ----
***************
*** 242,247 ****
--- 239,247 ----
  		$this->queue_close_time = titania::$time;
  		$this->queue_close_user = phpbb::$user->data['user_id'];
  		$this->submit(false);
+ 
+ 		// Send notification message
+ 		$this->send_approve_deny_notification();
  	}
  
  	public function deny()

Modified: trunk/titania/includes/objects/topic.php
==============================================================================
*** trunk/titania/includes/objects/topic.php (original)
--- trunk/titania/includes/objects/topic.php Fri Mar  5 00:05:29 2010
***************
*** 58,67 ****
  	/**
  	 * Constructor class for titania topics
  	 *
- 	 * @param int|string $type The type of topic ('tracker', 'queue', 'normal').  Normal/default meaning support/discussion.  Constants for the type can be sent instead of a string
  	 * @param int $topic_id The topic_id, 0 for making a new topic
  	 */
! 	public function __construct($type = TITANIA_SUPPORT, $topic_id = 0)
  	{
  		// Configure object properties
  		$this->object_config = array_merge($this->object_config, array(
--- 58,66 ----
  	/**
  	 * Constructor class for titania topics
  	 *
  	 * @param int $topic_id The topic_id, 0 for making a new topic
  	 */
! 	public function __construct($topic_id = 0)
  	{
  		// Configure object properties
  		$this->object_config = array_merge($this->object_config, array(
***************
*** 101,123 ****
  			'topic_last_post_subject'		=> array('default' => ''),
  		));
  
- 		switch ($type)
- 		{
- 			case 'tracker' :
- 			case TITANIA_TRACKER :
- 				$this->topic_type = TITANIA_TRACKER;
- 			break;
- 
- 			case 'queue' :
- 			case TITANIA_QUEUE :
- 				$this->topic_type = TITANIA_QUEUE;
- 			break;
- 
- 			default :
- 				$this->topic_type = TITANIA_SUPPORT;
- 			break;
- 		}
- 
  		$this->topic_id = $topic_id;
  	}
  
--- 100,105 ----

Modified: trunk/titania/includes/overlords/queue.php
==============================================================================
*** trunk/titania/includes/overlords/queue.php (original)
--- trunk/titania/includes/overlords/queue.php Fri Mar  5 00:05:29 2010
***************
*** 235,241 ****
  		$contrib->assign_details();
  
  		// Load the topic
! 		$topic = new titania_topic();
  		$topic->topic_id = $row['queue_topic_id'];
  		$topic->load();
  
--- 235,241 ----
  		$contrib->assign_details();
  
  		// Load the topic
! 		$topic = new titania_topic;
  		$topic->topic_id = $row['queue_topic_id'];
  		$topic->load();
  

Modified: trunk/titania/includes/overlords/topics.php
==============================================================================
*** trunk/titania/includes/overlords/topics.php (original)
--- trunk/titania/includes/overlords/topics.php Fri Mar  5 00:05:29 2010
***************
*** 261,267 ****
  			default :
  				$page_url = $object->get_url('support');
  				$sql_ary['WHERE'] .= ' AND t.parent_id = ' . (int) $object->contrib_id;
! 				$sql_ary['WHERE'] .= ' AND t.topic_type = ' . TITANIA_SUPPORT;
  			break;
  		}
  
--- 261,268 ----
  			default :
  				$page_url = $object->get_url('support');
  				$sql_ary['WHERE'] .= ' AND t.parent_id = ' . (int) $object->contrib_id;
! 				// We also display the queue discussion topic between validators and authors in the support area
! 				$sql_ary['WHERE'] .= ' AND (t.topic_type = ' . TITANIA_SUPPORT . ' OR t.topic_type = ' . TITANIA_QUEUE_DISCUSSION . ')';
  			break;
  		}
  




More information about the customisationdb-commits mailing list