Changeset 660 for trunk/Modules/Translation
- Timestamp:
- Dec 20, 2013, 11:26:04 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/TranslationList.php
r658 r660 23 23 $Filter['State'] = GetParameter('state', 0, true, true); 24 24 $Output .= '<td><select name="state">'; 25 if($Filter['State'] == 0) $Selected = ' selected="selected"'; 26 else $Selected = ''; 27 $Output .= '<option value="0"'.$Selected.'>Všechny</option>'; 28 if($Filter['State'] == 1) $Selected = ' selected="selected"'; 29 else $Selected = ''; 30 $Output .= '<option value="1"'.$Selected.'>Nepřeložené</option>'; 31 if($Filter['State'] == 2) $Selected = ' selected="selected"'; 32 else $Selected = ''; 33 $Output .= '<option value="2"'.$Selected.'>Přeložené</option>'; 34 if($Filter['State'] == 3) $Selected = ' selected="selected"'; 35 else $Selected = ''; 36 $Output .= '<option value="3"'.$Selected.'>Rozpracované</option>'; 37 if($Filter['State'] == 4) $Selected = ' selected="selected"'; 38 else $Selected = ''; 39 $Output .= '<option value="4"'.$Selected.'>Anglické</option>'; 40 if($Filter['State'] == 5) $Selected = ' selected="selected"'; 41 else $Selected = ''; 42 $Output .= '<option value="5"'.$Selected.'>Rozpracované-Nepřeložené</option>'; 43 if($Filter['State'] == 6) $Selected = ' selected="selected"'; 44 else $Selected = ''; 45 $Output .= '<option value="6"'.$Selected.'>S chybějícím $N,$S..</option>'; 25 $StateTypes = array('Všechny','Nepřeložené','Přeložené','Rozpracované','Anglické','Rozpracované-Nepřeložené','Chybějící $ ($N,$s..)','Chybějící $-Neopravený'); 26 foreach ($StateTypes as $index=>$StateType) { 27 if($Filter['State'] == $index) $Selected = ' selected="selected"'; 28 else $Selected = ''; 29 $Output .= '<option value="'.$index.'"'.$Selected.'>'.$StateType.'</option>'; 30 } 46 31 $Output .= '</select></td>'; 47 32 … … 158 143 if($Filter['Group'] != 0) 159 144 { 145 $WithoutAlter = ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE '. 146 '(`Sub`.`Language` <> '.$this->System->Config['OriginalLanguage'].')'.$LanguageFilter. 147 ' AND (`Sub`.`Entry` = `T`.`Entry`) AND (`Sub`.`ID` != `T`.`ID`) AND (`Sub`.`Complete` = 1) AND '. 148 '(`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`))'; 149 foreach($TranslationTree[$Filter['Group']]['Items'] as $GroupItem) 150 if($GroupItem['Visible'] == 1) { 151 $ItemsVar[] = 'LENGTH(`T`.`'.$GroupItem['Column'].'`) - LENGTH( REPLACE( `T`.`'.$GroupItem['Column'].'`, \'$\', \'\' ) ) '. 152 ' < ('. 153 'SELECT LENGTH(`Sub`.`'.$GroupItem['Column'].'`) - LENGTH( REPLACE( `Sub`.`'.$GroupItem['Column'].'`, \'$\', \'\' ) ) FROM `'.$Table.'` AS `Sub` WHERE '. 154 ' `Sub`.`Entry` = `T`.`Entry` AND `Sub`.`Language` = '.$this->System->Config['OriginalLanguage'].' AND '. 155 '`Sub`.`VersionStart` = `T`.`VersionStart` AND `Sub`.`VersionEnd` = `T`.`VersionEnd`'. 156 ')'; 157 } 160 158 if($Filter['State'] == 0) $Filter['SQL'] .= $UserFilter.$VersionFilter.''; 161 159 else if($Filter['State'] == 1) $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$this->System->Config['OriginalLanguage'].') '. … … 168 166 ') AND (`T`.`Complete` = 0)'; 169 167 else if($Filter['State'] == 4) $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$this->System->Config['OriginalLanguage'].')'; 170 else if($Filter['State'] == 5) $Filter['SQL'] .= $UserFilter.$VersionFilter.' AND (`T`.`Language` != '.$this->System->Config['OriginalLanguage']. 168 else if($Filter['State'] == 5) $Filter['SQL'] .= $UserFilter.$VersionFilter.$WithoutAlter. 169 ' AND (`T`.`Language` != '.$this->System->Config['OriginalLanguage']. 171 170 ') AND (`T`.`Complete` = 0)'. 172 'AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE '. 173 '(`Sub`.`Language` <> '.$this->System->Config['OriginalLanguage'].')'.$LanguageFilter. 174 ' AND (`Sub`.`Entry` = `T`.`Entry`) AND (`Sub`.`Complete` = 1) AND '. 175 '(`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`))'; 176 else if($Filter['State'] == 6) { 177 178 if($Filter['Group'] != 0) 179 foreach($TranslationTree[$Filter['Group']]['Items'] as $GroupItem) 180 if($GroupItem['Visible'] == 1) { 181 $Items[] = ''. 182 '`T`.`'.$GroupItem['Column'].'` NOT LIKE "%$%" '. 183 ' AND EXISTS ('. 184 'SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE `Sub`.`'.$GroupItem['Column'].'` LIKE "%$%"'. 185 ' AND `Sub`.`Entry` = `T`.`Entry` AND `Sub`.`Language` = '.$this->System->Config['OriginalLanguage'].' AND '. 186 '`Sub`.`VersionStart` = `T`.`VersionStart` AND `Sub`.`VersionEnd` = `T`.`VersionEnd`'. 187 ')'. 188 ''; 189 } 171 ''; 172 else if($Filter['State'] == 6) { 190 173 $Filter['SQL'] .= $UserFilter.$VersionFilter.' AND (`T`.`Complete` = 1) AND `T`.`Language` != '.$this->System->Config['OriginalLanguage']; 191 192 $Filter['SQL'] .= ' AND ('.implode(' OR ', $Items).') '; 193 194 195 196 } 174 $Filter['SQL'] .= ' AND ('.implode(' OR ', $ItemsVar).') '; 175 } 176 else if($Filter['State'] == 7) { 177 $Filter['SQL'] .= $UserFilter.$VersionFilter.' AND (`T`.`Complete` = 1) AND `T`.`Language` != '.$this->System->Config['OriginalLanguage']; 178 $Filter['SQL'] .= ' '. $WithoutAlter; 179 $Filter['SQL'] .= ' AND ('.implode(' OR ', $ItemsVar).') '; 180 } 197 181 } 198 182
Note:
See TracChangeset
for help on using the changeset viewer.