Changeset 99a13aa99cd589e1d28abdb0ac905497400e6d81
- Timestamp:
- 12/15/11 23:57:45
(1 year ago)
- Author:
- Brad Marshall <brad.marshall@canonical.com>
- git-committer:
- Brad Marshall <brad.marshall@canonical.com> 1323993465 +1000
- git-parent:
[65eb858bb9ff720aea647a6943df2e91d149ff19]
- git-author:
- Brad Marshall <brad.marshall@canonical.com> 1323993465 +1000
- Message:
Updated graph templates to only append a number if there are title clashes, not all the time.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rf561a33 |
r99a13aa |
|
| 48 | 48 | $graph_json = stripslashes($graph_json); |
|---|
| 49 | 49 | $graph_json = json_decode($graph_json, true); |
|---|
| 50 | | $graph_json['title'] = $graph_json['title'].$graph_num; |
|---|
| 51 | 50 | $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 | } |
|---|
| 52 | 58 | |
|---|
| 53 | 59 | $grow = $db->getGraphByGenesis($genesis); |
|---|
| r263fbce |
r99a13aa |
|
| 500 | 500 | return $row; |
|---|
| 501 | 501 | } |
|---|
| | 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 | } |
|---|
| 502 | 510 | function deleteWorksheetGraph($ws_id, $graphid) { |
|---|
| 503 | 511 | $sth = $this->db->prepare("delete from prism.saved_worksheets_dep |
|---|