Changeset 716


Ignore:
Timestamp:
Jan 5, 2014, 5:10:40 PM (11 years ago)
Author:
maron
Message:
  • Added: Featured export by Database
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Download/Download.php

    r706 r716  
    7878       
    7979        function ShowDownload() {
    80          
     80          global $System;
    8181    $Output = '<h3>Stažení češtiny</h3><br />';
    8282   
     
    9090                $Output .= '<table class="BaseTable">';
    9191                $Output .= '<tr><th>Stáhnout</th><th>Název</th><th>Datum vytvoření</th><th>Popis</th></tr>';
    92       foreach ($this->System->Config['Web']['RecommendedExport'] as $ExportId) {
    93                 $DbRows = $this->System->Database->query('SELECT *, (SELECT Version FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersion` FROM `Export` WHERE `Id`='.$ExportId);
    94                     $DbExport = $DbRows->fetch_assoc();
     92                $DbRows = $this->System->Database->query('SELECT *, (SELECT Version FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersion` FROM `Export` WHERE `Featured`=1');
     93      while ($DbExport = $DbRows->fetch_assoc()) {
     94     
     95        $ExportId = $DbExport['Id'];
    9596                   
    96         $Export = new Export($this->System);
    97         $Export->Id = $ExportId;
    98         $Export->Init();
    99         $Export->LoadFilters();
    100 
     97                    $filename = $System->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'Instalace_CzechWoW_'.$DbExport['ClientVersion'].'.exe';
     98                           
    10199                          if ($DbExport['OutputType'] == 10)
    102           $Output .= '<tr><td><a href="'.$this->System->Link('/'.$Export->TempDirRelative.'Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe').'">CzechWoW_'.$Export->ClientVersion['Version'].'.exe</a><br /> <a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
     100          $Output .= '<tr><td><a href="'.$System->Link('/'.$filename).'">CzechWoW_'.$DbExport['ClientVersion'].'.exe</a><br /> <a href="'.$System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
    103101        else
    104           $Output .= '<tr><td><a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId.'&amp;Tab=7').'">Exportovat</a><br /> <a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
     102          $Output .= '<tr><td><a href="'.$System->Link('/export/?Action=View&amp;ExportId='.$ExportId.'&amp;Tab=7').'">Exportovat</a><br /> <a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
    105103                               
    106104        $Output .= '<td>'.$DbExport['Title'].'</td>'; //.'<td>'.$DbExport['ClientVersion'].'</td>';
    107105                               
    108                           if (($DbExport['OutputType'] == 10) and (file_exists($Export->TempDir.'Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe')))
    109           $Output .= '<td>'.date('d.m.y H:i',filemtime($Export->TempDir.'Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe')).'</td>';
     106                          if (($DbExport['OutputType'] == 10) and (file_exists($filename)))
     107          $Output .= '<td>'.date('d.m.y H:i',filemtime($filename)).'</td>';
    110108        else
    111109          $Output .= '<td></td>';
  • trunk/Modules/Export/Page.php

    r697 r716  
    279279                                if(array_key_exists('WithDiacritic', $_POST)) $WithDiacritic = 1;
    280280                                else $WithDiacritic = 0;
    281                                 $this->System->Database->query('UPDATE `Export` SET `Title`="'.$_POST['Title'].'", `Description`="'.$_POST['Description'].'", `WithDiacritic`='.$WithDiacritic.' WHERE Id='.$Export['Id']);
     281                                if (array_key_exists('Featured', $_POST)) $Export['Featured'] = 1;
     282                                $this->System->Database->query('UPDATE `Export` SET `Title`="'.$_POST['Title'].'", `Featured`='.$Export['Featured'].', `Description`="'.$_POST['Description'].'", `WithDiacritic`='.$WithDiacritic.' WHERE Id='.$Export['Id']);
    282283                                $Export['Title'] = $_POST['Title'];
    283284                                $Export['Description'] = $_POST['Description'];
     
    294295                                $Output .= '<input type="hidden" name="Operation" value="Save"/>'.
    295296                                                '<tr><td colspan="2">';
    296         $Output .= ' <a href="?Action=Clone&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu klonovat položku?\');">Klonovat</a>';
    297297        if($Editable) $Output .= ' <input type="submit" value="Uložit" '.$DisabledInput[$Editable].'/>';
     298        $Output .= ' <a href="?Action=Clone&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu klonovat položku?\');">Klonovat</a> ';
     299        if($this->System->User->Licence(LICENCE_ADMIN))
     300          $Output .= CheckBox('Featured', $Export['Featured'], '', 'CheckBox', !$Editable). ' Doporučený ';
    298301        $Output .= '</td></tr>';
    299302                        }
  • trunk/admin/UpdateTrace.php

    r712 r716  
    27112711}
    27122712
     2713function UpdateTo716($Manager)
     2714{
     2715        $Manager->Execute('ALTER TABLE  `Export` ADD  `Featured` TINYINT NOT NULL');   
     2716}
     2717
     2718
    27132719$Updates = array(
    27142720        498 => array('Revision' => 506, 'Function' => 'UpdateTo506'),
     
    27312737        678 => array('Revision' => 695 , 'Function' => 'UpdateTo695'),
    27322738        695 => array('Revision' => 712 , 'Function' => 'UpdateTo712'),
     2739        712 => array('Revision' => 716 , 'Function' => 'UpdateTo716'),
    27332740);
  • trunk/includes/Version.php

    r715 r716  
    66// and system will need database update.
    77
    8 $Revision = 715; // Subversion revision
    9 $DatabaseRevision = 712; // Database structure revision
     8$Revision = 716; // Subversion revision
     9$DatabaseRevision = 716; // Database structure revision
    1010$ReleaseTime = '2014-01-05';
Note: See TracChangeset for help on using the changeset viewer.