Changeset 278
- Timestamp:
- Aug 25, 2009, 8:55:39 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/save.php
r220 r278 37 37 if(array_key_exists($GroupItem['Column'], $_POST)) 38 38 { 39 if ( $GroupItem['Column'] <> 'ShortCut'){39 if (($GroupItem['Column'] <> 'ShortCut') and ($GroupItem['Column'] <> 'Rank')) { 40 40 $Columns .= ', `'.$GroupItem['Column'].'`'; 41 41 $Values .= ', "'.@$_POST[$GroupItem['Column']].'"'; … … 48 48 49 49 //kontrolování stejných textů 50 51 50 52 $Where = 'Language = 0'; 51 53 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 52 54 { 53 if ( $GroupItem['Column'] <> 'ShortCut')55 if (($GroupItem['Column'] <> 'ShortCut') and ($GroupItem['Column'] <> 'Rank')) 54 56 if(array_key_exists($GroupItem['Column'], $_POST)) { 55 57 $Where .= ' AND `'.$GroupItem['Column'].'` = "'.addslashes($LineAJ[$GroupItem['Column']]).'"'; … … 57 59 $Where .= ' AND `'.$GroupItem['Column'].'` = ""'; 58 60 } 61 if ($GroupItem['Column'] == 'Rank') { 62 if (array_key_exists('Rank',$_POST)) { 63 $Rank = substr($_POST['Rank'], 0 ,strpos($_POST['Rank'],' ')); 64 if (strlen($Rank)<= 2) 65 $Rank = substr($_POST['Rank'], strpos($_POST['Rank'],' ')+1); 66 } else { 67 $Rank = 'Úroveň'; 68 } 69 } 59 70 } 60 71 … … 65 76 AND VersionStart = '.$LineTake['VersionStart'].' AND VersionEnd = '.$LineTake['VersionEnd'])); 66 77 if(!$Line) { 67 if ($GroupItem['Column'] <> 'ShortCut') 68 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.') VALUES ('.$SameTranLine['entry'].','.$Values.')'); 69 else 70 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.', `ShortCut`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$SameTranLine['ShortCut'].'")'); 71 $LastIDs[] = mysql_insert_id(); 78 if ($GroupItem['Column'] <> 'ShortCut') { 79 if (isset($Rank)) { 80 $Rank_number = substr($SameTranLine['Rank'], strpos($SameTranLine['Rank'],' ')+1); 81 if ($Rank_number <> '') { 82 $Rank_cur = $Rank.' '.$Rank_number; 83 } else { 84 $Rank_cur = $SameTranLine['Rank']; 85 } 86 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.', `Rank`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$Rank_cur.'")'); 87 } else { 88 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.') VALUES ('.$SameTranLine['entry'].','.$Values.')'); 89 } 90 } else { 91 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.', `ShortCut`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$SameTranLine['ShortCut'].'")'); 92 } 93 $LastIDs[] = mysql_insert_id(); 72 94 } 73 95 } 96 97 //konec kontrolování stejných textů 74 98 75 99 echo('Překlad <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a> ('.$entry.') uložen!<br />');
Note:
See TracChangeset
for help on using the changeset viewer.