Changeset 560 for trunk/Modules/User/Profile.php
- Timestamp:
- Aug 13, 2013, 10:47:43 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/Profile.php
r554 r560 27 27 } 28 28 29 function ExportList() 30 { 31 $Output = ''; 32 $Filter = ' WHERE `Export`.`User` = '.$this->System->User->Id; 33 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` '.$Filter); 34 $DbRow = $DbResult->fetch_row(); 35 $PageList = GetPageList($DbRow[0]); 36 37 $Output .= '<h3>Exporty</h3>'. 38 $PageList['Output']; 39 40 $TableColumns = array( 41 array('Name' => 'TimeCreate', 'Title' => 'Čas vytvoření'), 42 array('Name' => 'Title', 'Title' => 'Označení'), 43 // array('Name' => 'UserCount', 'Title' => 'Vybraných překladatelů'), 44 // array('Name' => 'GroupCount', 'Title' => 'Překladových skupin'), 45 array('Name' => 'OutputType', 'Title' => 'Typ výstupu'), 46 array('Name' => 'ClientVersion', 'Title' => 'Verze klienta'), 47 array('Name' => 'UsedCount', 'Title' => 'Prohlédnutí výstupu'), 48 ); 49 $Order = GetOrderTableHeader($TableColumns, 'TimeCreate', 1); 50 $Output .= '<table class="BaseTable">'. 51 $Order['Output']; 52 53 $DbResult = $this->System->Database->query('SELECT `User`.`Name` AS `UserName`, `Export`.`Id`, `Export`.`TimeCreate`, `Export`.`Title`, `Export`.`User`, `Export`.`UsedCount`, (SELECT Version FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersion`,(SELECT Name FROM `ExportOutputType` WHERE `ExportOutputType`.`Id`=`Export`.`OutputType`) AS `OutputType`, (SELECT COUNT(*) FROM `ExportGroup` WHERE `ExportGroup`.`Export`=`Export`.`Id`) AS `GroupCount`, (SELECT COUNT(*) FROM `ExportUser` WHERE `ExportUser`.`Export`=`Export`.`Id`) AS `UserCount` FROM `Export` LEFT JOIN `User` ON `User`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']); 54 while($Export = $DbResult->fetch_assoc()) 55 { 56 $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'. 57 '<td>'.$Export['Title'].'</td>'. 58 '<td>'.$Export['OutputType'].'</td>'. 59 '<td>'.$Export['ClientVersion'].'</td>'. 60 '<td>'.$Export['UsedCount'].'</td>'; 61 } 62 $Output .= '</table>'. 63 $PageList['Output']; 64 65 $Output .= '<div style="text-align: center;"><a href="'.$this->System->Link('/export/').'">Stránka exportů</a></div>'; 66 return($Output); 67 } 68 69 function ShowLastTranslated() 70 { 71 $Count = 20; 72 $Output = '<strong>Poslední překlady:</strong>'; 73 74 $GroupListQuery = 'SELECT `Group`.* FROM `Group`'; 75 $Query = ''; 76 $UnionItems = array(); 77 $DbResult = $this->Database->query($GroupListQuery); 78 if($DbResult->num_rows > 0) 79 { 80 while($DbRow = $DbResult->fetch_assoc()) 81 { 82 $UnionItems[] = 'SELECT `T`.`ID`, `T`.`Take`, `T`.`User`, `T`.`ModifyTime`, `T`.`Group`, `T`.`GroupName` '. 83 'FROM (SELECT `T`.`User`, `T`.`ID`, `T`.`ModifyTime`, '. 84 $DbRow['Id'].' AS `Group`, "'.addslashes($DbRow['Name']).'" AS `GroupName`, `T`.`Take` FROM `'. 85 $DbRow['TablePrefix'].'` AS `T` '. 86 'WHERE (`T`.`Complete` = 1) AND '. 87 '(`T`.`Language` != '.$this->System->Config['OriginalLanguage'].') AND '. 88 '(`T`.`User` = '.$this->System->User->Id.') ORDER BY `T`.`ModifyTime` DESC LIMIT '. 89 $Count.') AS `T`'; 90 } 91 $Query = 'SELECT `TT`.*, `User`.`Name` AS `UserName`, `User`.`Id` AS `UserId` '. 92 'FROM ('.implode(' UNION ', $UnionItems).') AS `TT` '. 93 'JOIN `User` ON `User`.`Id` = `TT`.`User` '. 94 'ORDER BY `ModifyTime` DESC LIMIT '.$Count; 95 $DbResult = $this->Database->query($Query); 96 $Output .= '<table class="BaseTable"><tr>'. 97 '<th>Datum</th><th>Nový</th><th>Zdroj</th><th>Skupina</th></tr>'; 98 while($DbRow = $DbResult->fetch_assoc()) 99 { 100 $Output .= '<tr><td>'.HumanDate($DbRow['ModifyTime']).'</td>'. 101 '<td><a href="form.php?group='.$DbRow['Group'].'&ID='.$DbRow['ID'].'">'.$DbRow['ID'].'</a></td>'. 102 '<td><a href="form.php?group='.$DbRow['Group'].'&ID='.$DbRow['Take'].'">'.$DbRow['Take'].'</a></td>'. 103 '<td><a href="TranslationList.php?group='.$DbRow['Group'].'&action=filter">'.$DbRow['GroupName'].'</a></td></tr>'; 104 } 105 $Output .= '</table>'; 106 } 107 return($Output); 108 } 109 29 110 function ShowProfile() 30 111 { 31 global $User, $Config;32 33 112 $Output = ''; 34 113 $Query = 'SELECT `User`.`Name`, `UserTrace`.`LastLogin`, `UserTrace`.`LastIP`, '. … … 57 136 $Output .= '<fieldset><legend>Text profilu:</legend>'.str_replace("\n", '<br/>', $UserLine['Info']).'</fieldset><br/>'; 58 137 59 if($User->Licence(LICENCE_MODERATOR)) 138 $Output .= '<table class="Home"><tr>'. 139 '<td>'.$this->ShowLastTranslated().'</td>'. 140 '<td>'.$this->ExportList().'</td>'. 141 '</tr></table>'; 142 143 if($this->System->User->Licence(LICENCE_MODERATOR)) 60 144 { 61 145 $Output .= '<fieldset><legend>Moderování</legend>'; … … 67 151 '<input type="text" name="email" value="'.$UserLine['Email'].'" /><br/>'. 68 152 'Předmět:'. 69 '<input type="text" name="subject" value="'.$ Config['Web']['Title'].'" />'.153 '<input type="text" name="subject" value="'.$this->System->Config['Web']['Title'].'" />'. 70 154 '<br />'. 71 155 '<textarea name="text" rows="20" cols="62">'. 72 156 ''."\n". 73 'S pozdravem '.$ User->Name."\n".157 'S pozdravem '.$this->System->User->Name."\n". 74 158 '--------------------------------------------------------'."\n". 75 $ Config['Web']['Title'].' '.$Config['Web']['Host'].$this->System->Link('/')."\n".159 $this->System->Config['Web']['Title'].' '.$this->System->Config['Web']['Host'].$this->System->Link('/')."\n". 76 160 '</textarea><br/>'. 77 161 '<input type="submit" value="Odeslat" />'. … … 84 168 function Show() 85 169 { 86 global $Config, $User;87 88 170 $Output = $this->SendMail(); 89 171 if(array_key_exists('user', $_GET))
Note:
See TracChangeset
for help on using the changeset viewer.