Changeset 2365 in ExiteCMS


Ignore:
Timestamp:
07/29/10 17:48:33 (5 weeks ago)
Author:
root
Message:

added support for Trac 0.12 Multirepos

Location:
modules/ExiteCMS/tracsvn/php-files/modules/tracsvn
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/admin.php

    r2093 r2365  
    3636    $database = stripinput($_POST['database']); 
    3737    $url = stripinput($_POST['url']); 
     38    $repo = stripinput($_POST['repo']); 
    3839    $trac_url = stripinput($_POST['trac_url']); 
    3940    $cmd = stripinput($_POST['cmd']); 
     
    4445    $view_diff = isNum($_POST['view_diff']) ? $_POST['view_diff'] : 102; 
    4546    $view_file = isNum($_POST['view_file']) ? $_POST['view_file'] : 102; 
    46      
     47 
    4748    $variables['message'] = ""; 
    4849 
     
    5152        $variables['message'] = ($variables['message'] == "" ? "" : "<br />") . $locale['406']; 
    5253    } else { 
     54        // if a repo is defined, check if it exists 
     55        if (!empty($repo)) { 
     56            if(!dbtable_exists("repository", $database)) { 
     57                $variables['message'] = ($variables['message'] == "" ? "" : "<br />") . $locale['459']; 
     58            } else { 
     59                $result = dbquery("SELECT * FROM ".$database.".repository WHERE name = '".mysql_real_escape_string($repo)."'"); 
     60                if (!dbrows($result)) { 
     61                    $variables['message'] = ($variables['message'] == "" ? "" : "<br />") . $locale['460']; 
     62                } 
     63            } 
     64        } 
    5365        // check if the cmd points to svn 
    5466        $_tmp = explode(" ", $cmd); 
     
    8698        $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$database."' WHERE cfg_name = 'tracsvn_database'"); 
    8799        $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$url."' WHERE cfg_name = 'tracsvn_url'"); 
     100        $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$repo."' WHERE cfg_name = 'tracsvn_repo'"); 
    88101        $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$trac_url."' WHERE cfg_name = 'tracsvn_trac_url'"); 
    89102        $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$cmd."' WHERE cfg_name = 'tracsvn_svncmd'"); 
     
    121134    $database = $settings['tracsvn_database']; 
    122135    $url = $settings['tracsvn_url']; 
     136    $repo = $settings['tracsvn_repo']; 
    123137    $trac_url = $settings['tracsvn_trac_url']; 
    124138    $cmd = $settings['tracsvn_svncmd']; 
     
    190204$variables['database'] = $database; 
    191205$variables['url'] = $url; 
     206$variables['repo'] = $repo; 
    192207$variables['trac_url'] = $trac_url; 
    193208$variables['cmd'] = $cmd; 
  • modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/module_installer.php

    r2323 r2365  
    2424$mod_title = "Trac-SVN reports"; 
    2525$mod_description = "This ExiteCMS module provides a reporting of Trac Project management, and connects to SVN to retrieve details status information"; 
    26 $mod_version = "0.1.6"; 
     26$mod_version = "0.1.7"; 
    2727$mod_developer = "WanWizard"; 
    2828$mod_email = "wanwizard@exitecms.org"; 
     
    129129$localestrings['en']['456'] = "Non-public repository paths:"; 
    130130$localestrings['en']['457'] = "Trac base URL:"; 
     131$localestrings['en']['458'] = "Trac SVN repository name:"; 
     132$localestrings['en']['459'] = "A repository name is given, but your Trac installation has no support for multirepos"; 
     133$localestrings['en']['460'] = "The repository name entered can not be located in the Trac database"; 
    131134 
    132135$localestrings['en']['500'] = "Changeset"; 
     
    211214$localestrings['nl']['456'] = "Niet publieke repository paden:"; 
    212215$localestrings['nl']['457'] = "Trac basis URL:"; 
     216$localestrings['nl']['458'] = "Trac SVN repository naam:"; 
     217$localestrings['nl']['459'] = "Een repository naam is ingevoerd, maar de Trac installatie heeft geen multirepos ondersteuning"; 
     218$localestrings['nl']['460'] = "De repository naam die is ingevoerd kan niet gevonden worden in de Trac database"; 
    213219 
    214220$localestrings['nl']['500'] = "Changeset"; 
     
    243249$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_database', '')"); 
    244250$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_url', '')"); 
     251$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_repo', '')"); 
    245252$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_trac_url', '')"); 
    246253$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_svncmd', '/usr/bin/svn')"); 
     
    270277$mod_uninstall_cmds[] = array('type' => 'db', 'value' => "DELETE FROM ##PREFIX##configuration WHERE cfg_name = 'tracsvn_database'"); 
    271278$mod_uninstall_cmds[] = array('type' => 'db', 'value' => "DELETE FROM ##PREFIX##configuration WHERE cfg_name = 'tracsvn_url'"); 
     279$mod_uninstall_cmds[] = array('type' => 'db', 'value' => "DELETE FROM ##PREFIX##configuration WHERE cfg_name = 'tracsvn_repo'"); 
    272280$mod_uninstall_cmds[] = array('type' => 'db', 'value' => "DELETE FROM ##PREFIX##configuration WHERE cfg_name = 'tracsvn_trac_url'"); 
    273281$mod_uninstall_cmds[] = array('type' => 'db', 'value' => "DELETE FROM ##PREFIX##configuration WHERE cfg_name = 'tracsvn_svncmd'"); 
     
    322330            case "0.1.5": 
    323331                // no upgrades this version 
     332            case "0.1.6": 
     333                // add the new trac repo name (support for v0.12 multirepos) 
     334                $result = dbquery("INSERT INTO ".$db_prefix."configuration( cfg_name, cfg_value ) VALUES ('tracsvn_repo', '')"); 
    324335            default: 
    325336                // do this with every upgrade 
  • modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/templates/modules.tracsvn.admin.tpl

    r2093 r2365  
    5858            <td width='50%' class='tbl'> 
    5959                <input type='text' name='url' value='{$url}' maxlength='255' class='textbox' style='width:300px;' /> 
     60            </td> 
     61        </tr> 
     62        <tr> 
     63            <td width='50%' class='tbl'> 
     64                {$locale.458} 
     65            </td> 
     66            <td width='50%' class='tbl'> 
     67                <input type='text' name='repo' value='{$repo}' maxlength='50' class='textbox' style='width:250px;' /> 
    6068            </td> 
    6169        </tr> 
     
    126134        </tr> 
    127135    </table> 
    128 </form>  
     136</form> 
    129137{include file="_closetable.tpl"} 
    130138{include file="_opentable.tpl" name=$_name title=$locale.407 state=$_state style=$_style} 
  • modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/templates/modules.tracsvn.side_panel.tpl

    r2093 r2365  
    2020{include file="_openside_x.tpl" name=$_name title=$locale.401 state=$_state style=$_style} 
    2121    {if $rev != 0} 
    22         <div style="text-align:center;cursor:pointer;" onclick="window.open('{$settings.tracsvn_trac_url}changeset/{$rev}')" title="{$locale.110} {$locale.402} {$rev}"> 
     22        <div style="text-align:center;cursor:pointer;" onclick="window.open('{$settings.tracsvn_trac_url}changeset/{$rev}{$repo}')" title="{$locale.110} {$locale.402} {$rev}"> 
    2323            <span class='small'>{$locale.402}</span> 
    2424            <b>{$rev}</b> 
     
    2828            <b>{$date|date_format:"%d %b %Y · %H:%M"}</b> 
    2929            <br /> 
    30             <span class='small'>{$locale.404}</span>  
     30            <span class='small'>{$locale.404}</span> 
    3131            <b>{$dev.user_name}</b> 
    3232        </div> 
  • modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/tracsvn.side_panel.php

    r2359 r2365  
    3030        $data = dbarray($result); 
    3131        $variables['rev'] = (int) $data['rev']; 
     32        if (empty($settings['tracsvn_repo'])) { 
     33            $variables['repo'] = ""; 
     34        } else { 
     35            $variables['repo'] = '/' . $settings['tracsvn_repo']; 
     36        } 
    3237        if (strlen($data['time']) > 10) $data['time'] = substr($data['time'],0,10); 
    3338        $variables['date'] = $data['time']; 
Note: See TracChangeset for help on using the changeset viewer.