Esempio n. 1
0
	/**
	 * @see	wcf\data\DatabaseObjectList::__construct()
	 */
	public function __construct() {
		parent::__construct();
		
		if (!empty($this->sqlSelects)) $this->sqlSelects .= ',';
		$this->sqlSelects .= "user_option_value.*";
		$this->sqlJoins .= " LEFT JOIN wcf".WCF_N."_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)";
	}
 /**
  * @see	\wcf\data\DatabaseObjectList::__construct()
  */
 public function __construct($useSqlOr = false)
 {
     parent::__construct();
     if ($useSqlOr) {
         $this->conditionBuilder = new PreparedStatementConditionBuilder(true, 'OR');
     }
 }
 /**
  * @see	\wcf\data\DatabaseObjectList::__construct()
  */
 public function __construct()
 {
     parent::__construct();
     $this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar, user_table.enableGravatar, user_table.gravatarFileExtension";
     $this->sqlSelects .= ", user_avatar.*";
     $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = user_profile_visitor.userID)";
     $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)";
 }
 /**
  * @see	\wcf\data\DatabaseObjectList::readObjects()
  */
 public function readObjects()
 {
     if (!empty($this->sqlSelects)) {
         $this->sqlSelects .= ',';
     }
     $this->sqlSelects .= "(SELECT COUNT(*) FROM wcf" . WCF_N . "_package_update WHERE packageUpdateServerID = " . $this->getDatabaseTableAlias() . ".packageUpdateServerID) AS packages";
     parent::readObjects();
 }
 /**
  * @see	\wcf\data\DatabaseObjectList::readObjects()
  */
 public function readObjects()
 {
     if (!empty($this->sqlSelects)) {
         $this->sqlSelects .= ',';
     }
     $this->sqlSelects .= "\tuser_table.username, acp_session.sessionID AS active,\n\t\t\t\t\t(SELECT COUNT(*) FROM wcf" . WCF_N . "_acp_session_access_log WHERE sessionLogID = " . $this->getDatabaseTableAlias() . ".sessionLogID) AS accesses";
     $this->sqlJoins .= "\tLEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = " . $this->getDatabaseTableAlias() . ".userID)\n\t\t\t\t\tLEFT JOIN wcf" . WCF_N . "_acp_session acp_session ON (acp_session.sessionID = " . $this->getDatabaseTableAlias() . ".sessionID)";
     parent::readObjects();
 }
 /**
  * @see wcf\data\DatabaseObjectList::readObjects()
  */
 public function readObjects()
 {
     if (!empty($this->sqlSelects)) {
         $this->sqlSelects .= ',';
     }
     $this->sqlSelects .= "CASE WHEN package.instanceName <> '' THEN package.instanceName ELSE package.packageName END AS packageName";
     $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_package package ON (package.packageID = " . $this->getDatabaseTableAlias() . ".packageID)";
     parent::readObjects();
 }
 /**
  * @see \wcf\data\DatabaseObjectList::readObjects()
  */
 public function readObjects()
 {
     parent::readObjects();
     EventHandler::getInstance()->fireAction($this, 'afterReadObjects');
     // cache userids
     $userIDs = array();
     foreach ($this->objects as $object) {
         $userIDs[] = $object->userID;
         $userIDs[] = $object->executedUserID;
     }
     array_unique($userIDs);
     UserProfile::getUserProfiles($userIDs);
 }
Esempio n. 8
0
 /**
  * @see	\wcf\data\DatabaseObjectList::readObjects()
  */
 public function readObjects()
 {
     parent::readObjects();
     foreach ($this->objects as $template) {
         if ($template->application != 'wcf') {
             $application = ApplicationHandler::getInstance()->getApplication($template->application);
         } else {
             $application = ApplicationHandler::getInstance()->getWCF();
         }
         $package = PackageCache::getInstance()->getPackage($application->packageID);
         // set directory of the application package the template
         // belongs to
         $template->packageDir = $package->packageDir;
     }
 }
 /**
  * @see	\wcf\data\DatabaseObjectList::readObjects()
  */
 public function readObjects()
 {
     parent::readObjects();
     // get categories
     if ($this->categoryLoading) {
         if (!empty($this->objectIDs)) {
             $conditionBuilder = new PreparedStatementConditionBuilder();
             $conditionBuilder->add('entryID IN (?)', array($this->objectIDs));
             $sql = "SELECT\t*\n\t\t\t\t\tFROM\tfilebase" . WCF_N . "_entry_to_category\n\t\t\t\t\t" . $conditionBuilder;
             $statement = WCF::getDB()->prepareStatement($sql);
             $statement->execute($conditionBuilder->getParameters());
             while ($row = $statement->fetchArray()) {
                 if (isset($this->objects[$row['entryID']])) {
                     $this->objects[$row['entryID']]->setCategoryID($row['categoryID']);
                 }
             }
         }
     }
 }
Esempio n. 10
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->objectList = new EditHistoryEntryList();
     $this->objectList->sqlOrderBy = "time DESC, entryID DESC";
     $this->objectList->getConditionBuilder()->add('objectTypeID = ?', array($this->objectType->objectTypeID));
     $this->objectList->getConditionBuilder()->add('objectID = ?', array($this->objectID));
     $this->objectList->readObjects();
     // valid IDs were given, calculate diff
     if ($this->old && $this->new) {
         $a = explode("\n", StringUtil::unifyNewlines($this->old->getMessage()));
         $b = explode("\n", StringUtil::unifyNewlines($this->new->getMessage()));
         $this->diff = new Diff($a, $b);
     }
     // set default values
     if (!isset($_REQUEST['oldID']) && !isset($_REQUEST['newID'])) {
         foreach ($this->objectList as $object) {
             $this->oldID = $object->entryID;
             break;
         }
         $this->newID = 'current';
     }
 }
Esempio n. 11
0
 /**
  * Counts the displayed items.
  * 
  * @return	integer
  */
 public function countItems()
 {
     // call countItems event
     EventHandler::getInstance()->fireAction($this, 'countItems');
     return $this->objectList->countObjects();
 }
 /**
  * @see	\wcf\system\worker\IWorker::execute()
  */
 public function execute()
 {
     $this->objectList->readObjects();
     SearchIndexManager::getInstance()->beginBulkOperation();
     EventHandler::getInstance()->fireAction($this, 'execute');
 }