Changeset 376 for trunk/save.php
- Timestamp:
- Mar 11, 2010, 8:40:32 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/save.php
r373 r376 6 6 7 7 // Ochrana proti neoprávněnému přístupu 8 // if(Licence(LICENCE_USER) == false) die('Nemáte přístup do této sekce! Je nutné se přihásit.');8 // if($User->Licence(LICENCE_USER) == false) die('Nemáte přístup do této sekce! Je nutné se přihásit.'); 9 9 10 10 $GroupId = LoadGroupIdParameter(); 11 11 $Table = $TranslationTree[$GroupId]['TablePrefix']; 12 if(array_key_exists('entry', $_POST) and Licence(LICENCE_USER))12 if(array_key_exists('entry', $_POST) and $User->Licence(LICENCE_USER)) 13 13 { 14 $entry = $_POST['entry'] * 1; // Make numeric 15 $UserID = $_SESSION['UserID']; 14 $Entry = $_POST['entry'] * 1; // Make numeric 16 15 $TextID = $_POST['ID'] * 1; 17 16 $Language = $_POST['Language'] * 1; 18 if(array_key_exists('End', $_POST)) $ complete = 1;17 if(array_key_exists('End', $_POST)) $Complete = 1; 19 18 else $complete = 0; 20 19 21 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$ entry.')');20 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$Entry.')'); 22 21 if(mysql_num_rows($DbResult) == 0) ErrorMessage('Neznámé Id položky'); 23 22 $LineAJ = mysql_fetch_array($DbResult); 24 23 $LineTake = mysql_fetch_array($Database->SQLCommand('SELECT `VersionEnd`, `VersionStart` FROM `'.$Table.'` WHERE `ID` = '.$TextID)); 25 24 if(mysql_num_rows($DbResult) == 0) ErrorMessage('Neznámé Id položky'); 26 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$User ID.') AND (`Entry` = '.$entry.') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')');25 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$User->Id.') AND (`Entry` = '.$Entry.') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')'); 27 26 $Line = mysql_fetch_array($DbResult); 28 27 if(!$Line) 29 28 { 30 29 $Columns = '`Language` , `User` , `Complete` , `Take` , `VersionStart` , `VersionEnd`'; 31 $Values = $Language.','.$User ID.','.$complete.','.$TextID.','.$LineTake['VersionStart'].','.$LineTake['VersionEnd'];30 $Values = $Language.','.$User->Id.','.$Complete.','.$TextID.','.$LineTake['VersionStart'].','.$LineTake['VersionEnd']; 32 31 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 33 32 { … … 42 41 } 43 42 //echo('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 44 // $Database->SQLCommand('INSERT INTO `'.$Table.'` (` entry`, '.$Columns.') VALUES ('.$entry.','.$Values.')');43 // $Database->SQLCommand('INSERT INTO `'.$Table.'` (`Entry`, '.$Columns.') VALUES ('.$Entry.','.$Values.')'); 45 44 // $LastID = mysql_insert_id(); 46 45 … … 69 68 while($SameTranLine = mysql_fetch_assoc($SameTranID)) 70 69 { 71 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$User ID.') AND (`Entry` = '.$SameTranLine['Entry'].') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')'));70 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$User->Id.') AND (`Entry` = '.$SameTranLine['Entry'].') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')')); 72 71 if(!$Line) 73 72 { … … 94 93 // Konec kontrolování stejných textů 95 94 96 echo('Překlad <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> ('.$ entry.') uložen!<br />');95 echo('Překlad <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> ('.$Entry.') uložen!<br />'); 97 96 foreach($LastIDs as $LastID) 98 97 { … … 102 101 } else 103 102 { 104 $sql = 'UPDATE '.$Table.' SET `Complete` = '.$ complete;103 $sql = 'UPDATE '.$Table.' SET `Complete` = '.$Complete; 105 104 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 106 105 if(array_key_exists($GroupItem['Column'], $_POST)) … … 110 109 $Database->SQLCommand($sql); 111 110 // echo $sql.'<br />'; 112 echo('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> ('.$ entry.') uloženy!<br />');113 WriteLog('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> ('.$ entry.') uloženy!', LOG_TYPE_TRANSLATION);111 echo('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> ('.$Entry.') uloženy!<br />'); 112 WriteLog('Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> ('.$Entry.') uloženy!', LOG_TYPE_TRANSLATION); 114 113 } 115 114 // Address and redirecting … … 119 118 $next = FollowingTran($TextID, $Table, $GroupId); 120 119 echo('<br /><br />'); 121 $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT `Redirecting` FROM `User` WHERE `ID`='.$User ID));120 $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT `Redirecting` FROM `User` WHERE `ID`='.$User->Id)); 122 121 123 122 switch($redirecting['Redirecting']) … … 145 144 146 145 // Aktualizace informace o nutnosti načíst XP 147 $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$User ID);146 $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$User->Id); 148 147 } else 149 148 {
Note:
See TracChangeset
for help on using the changeset viewer.