Changeset 626 for trunk/Modules/Team/Team.php
- Timestamp:
- Dec 4, 2013, 9:50:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Team/Team.php
r622 r626 20 20 'Title' => T('Teams'), 21 21 'Hint' => T('List of translating teams'), 22 'Link' => $this->System->Link('/team/ ?search='),22 'Link' => $this->System->Link('/team/'), 23 23 'Permission' => LICENCE_ANONYMOUS, 24 24 'Icon' => '', 25 25 ), 1); 26 if(array_key_exists('Search', $this->System->ModuleManager->Modules)) 27 $this->System->ModuleManager->Modules['Search']->RegisterSearch('team', 28 T('Teams'), array('Name'), '`Team`', $this->System->Link('/team/?search=')); 26 29 } 27 30 } … … 36 39 $Output .= 'Týmy jsou seskupení překladatelů, kteří se hlásí k něčemu společnému jako např. WoW serveru, způsobu překladu, ke stejnému hernímu spolku, aj. Být členem týmu samo o sobě nemá žádný zásadní důsledek a spíše to může pomoci se lépe orientovat mezi překladateli někomu, kdo sestavuje export.<br/>'; 37 40 38 if($this->System->User->Licence(LICENCE_USER)) 41 if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search']; 42 else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = ''; 43 if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = ''; 44 45 if($this->System->User->Licence(LICENCE_USER)) 39 46 $Output .= '<br /><div style="text-align: center;"><a href="?action=create">'.T('Create translating team').'</a></div><br/>'; 47 if($_SESSION['search'] != '') 48 { 49 $SearchQuery = ' AND ((`Name` LIKE "%'.$_SESSION['search'].'%") OR (`Description` LIKE "%'.$_SESSION['search'].'%"))'; 50 $Output .= '<div><a href="?search=">'.sprintf(T('Disable filter "%s"'), $_SESSION['search']).'</a></div>'; 51 } else $SearchQuery = ''; 40 52 41 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Team` ');53 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Team` WHERE 1'.$SearchQuery); 42 54 $DbRow = $DbResult->fetch_row(); 43 55 $PageList = GetPageList($DbRow[0]); … … 56 68 57 69 $Order = GetOrderTableHeader($TableColumns, 'NumberUser', 1); 58 $Output .= $Order['Output']; 59 60 if(array_key_exists('search', $_GET)) $_SESSION['search'] = ' WHERE `Name` LIKE "%'.$_GET['search'].'%" OR `Description` LIKE "%'.$_GET['search'].'%"'; 61 else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = ''; 62 if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = ''; 70 $Output .= $Order['Output']; 63 71 64 72 $DbResult = $this->Database->query('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) AS `NumberUser`, '. 65 73 '(SELECT `Name` FROM `User` WHERE `User`.`ID`=`Team`.`Leader`) AS `LeaderName` '. 66 'FROM `Team` '.$_SESSION['search'].$Order['SQL'].$PageList['SQLLimit']);74 'FROM `Team` WHERE 1'.$SearchQuery.$Order['SQL'].$PageList['SQLLimit']); 67 75 while($Team = $DbResult->fetch_assoc()) 68 76 {
Note:
See TracChangeset
for help on using the changeset viewer.