Show
Ignore:
Timestamp:
12/16/11 23:31:19 (2 years ago)
Author:
Theo Schlossnagle <jesus@lethargy.org>
git-committer:
Theo Schlossnagle <jesus@lethargy.org> 1324078279 -0800
git-parent:

[eb91b667acfd9618209c5fc3f666c574f85ef510], [99a13aa99cd589e1d28abdb0ac905497400e6d81]

git-author:
Theo Schlossnagle <jesus@lethargy.org> 1324078279 -0800
Message:

Merge pull request #38 from brad-marshall/master

Graph template unique title fix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ui/web/htdocs/template_graph.php

    rf561a33 r99a13aa  
    4848            $graph_json = stripslashes($graph_json); 
    4949            $graph_json = json_decode($graph_json, true); 
    50             $graph_json['title'] = $graph_json['title'].$graph_num; 
    5150            $graph_json['genesis'] = $genesis; 
     51 
     52        // Check to see if this title exists 
     53        $titlerow = $db->getGraphByTitle($title); 
     54        // if it does, append $graph_num to it 
     55        if ($titlerow['graphid']) { 
     56           $graph_json['title'] = $graph_json['title'].$graph_num; 
     57        } 
    5258 
    5359            $grow = $db->getGraphByGenesis($genesis); 
  • ui/web/lib/Reconnoiter_DB.php

    r263fbce r99a13aa  
    500500    return $row; 
    501501  } 
     502  function getGraphByTitle($title) { 
     503    $sth = $this->db->prepare("select * 
     504                                 from prism.saved_graphs 
     505                                where title=?"); 
     506    $sth->execute(array($title)); 
     507    $row = $sth->fetch(); 
     508    return $row; 
     509  } 
    502510  function deleteWorksheetGraph($ws_id, $graphid) { 
    503511    $sth = $this->db->prepare("delete from prism.saved_worksheets_dep