Skip to content

Commit 7fa9308

Browse files
committed
[update] version 4.2
1 parent 7f1f911 commit 7fa9308

File tree

113 files changed

+2356
-1007
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+2356
-1007
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dhtmlxGantt v.4.1
1+
dhtmlxGantt v.4.2
22
=================
33

44
[![Join the chat at https://gitter.im/dhtmlx/dhtmlx](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dhtmlx/dhtmlx)

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gantt",
3-
"version": "4.1.0",
3+
"version": "4.2.1",
44
"homepage": "http://dhtmlx.com/docs/products/dhtmlxGantt/",
55
"description": "An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.",
66
"main": [

codebase/connector/base_connector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ class Connector {
330330
public function __construct($db,$type=false, $item_type=false, $data_type=false, $render_type = false){
331331
$this->exec_time=microtime(true);
332332

333-
if (!$type) $type="MySQL";
333+
if (!$type) $type="PDO";
334334
if (class_exists($type."DBDataWrapper",false)) $type.="DBDataWrapper";
335335
if (!$item_type) $item_type="DataItem";
336336
if (!$data_type) $data_type="DataProcessor";

codebase/connector/db_common.php

+1-64
Original file line numberDiff line numberDiff line change
@@ -1100,69 +1100,6 @@ public function __construct($data){
11001100
$this->index = 0;
11011101
}
11021102
}
1103-
/*! Implementation of DataWrapper for MySQL
1104-
**/
1105-
class MySQLDBDataWrapper extends DBDataWrapper{
1106-
protected $last_result;
1107-
public function query($sql){
1108-
LogMaster::log($sql);
1109-
$res=mysql_query($sql,$this->connection);
1110-
if ($res===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
1111-
$this->last_result = $res;
1112-
return $res;
1113-
}
1114-
1115-
public function get_next($res){
1116-
if (!$res)
1117-
$res = $this->last_result;
1118-
1119-
return mysql_fetch_assoc($res);
1120-
}
1121-
1122-
public function get_new_id(){
1123-
return mysql_insert_id($this->connection);
1124-
}
1125-
1126-
public function escape($data){
1127-
return mysql_real_escape_string($data, $this->connection);
1128-
}
11291103

1130-
public function tables_list() {
1131-
$result = mysql_query("SHOW TABLES");
1132-
if ($result===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
1133-
1134-
$tables = array();
1135-
while ($table = mysql_fetch_array($result)) {
1136-
$tables[] = $table[0];
1137-
}
1138-
return $tables;
1139-
}
1140-
1141-
public function fields_list($table) {
1142-
$result = mysql_query("SHOW COLUMNS FROM `".$table."`");
1143-
if ($result===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
1144-
1145-
$fields = array();
1146-
$id = "";
1147-
while ($field = mysql_fetch_assoc($result)) {
1148-
if ($field['Key'] == "PRI")
1149-
$id = $field["Field"];
1150-
else
1151-
$fields[] = $field["Field"];
1152-
}
1153-
return array("fields" => $fields, "key" => $id );
1154-
}
1155-
1156-
/*! escape field name to prevent sql reserved words conflict
1157-
@param data
1158-
unescaped data
1159-
@return
1160-
escaped data
1161-
*/
1162-
public function escape_name($data){
1163-
if ((strpos($data,"`")!==false || is_int($data)) || (strpos($data,".")!==false))
1164-
return $data;
1165-
return '`'.$data.'`';
1166-
}
1167-
}
1104+
include_once(__DIR__."/db_pdo.php");
11681105
?>

codebase/connector/db_mysql.php

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
/*! Implementation of DataWrapper for MySQL
4+
**/
5+
class MySQLDBDataWrapper extends DBDataWrapper{
6+
protected $last_result;
7+
public function query($sql){
8+
LogMaster::log($sql);
9+
$res=mysql_query($sql,$this->connection);
10+
if ($res===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
11+
$this->last_result = $res;
12+
return $res;
13+
}
14+
15+
public function get_next($res){
16+
if (!$res)
17+
$res = $this->last_result;
18+
19+
return mysql_fetch_assoc($res);
20+
}
21+
22+
public function get_new_id(){
23+
return mysql_insert_id($this->connection);
24+
}
25+
26+
public function escape($data){
27+
return mysql_real_escape_string($data, $this->connection);
28+
}
29+
30+
public function tables_list() {
31+
$result = mysql_query("SHOW TABLES");
32+
if ($result===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
33+
34+
$tables = array();
35+
while ($table = mysql_fetch_array($result)) {
36+
$tables[] = $table[0];
37+
}
38+
return $tables;
39+
}
40+
41+
public function fields_list($table) {
42+
$result = mysql_query("SHOW COLUMNS FROM `".$table."`");
43+
if ($result===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
44+
45+
$fields = array();
46+
$id = "";
47+
while ($field = mysql_fetch_assoc($result)) {
48+
if ($field['Key'] == "PRI")
49+
$id = $field["Field"];
50+
else
51+
$fields[] = $field["Field"];
52+
}
53+
return array("fields" => $fields, "key" => $id );
54+
}
55+
56+
/*! escape field name to prevent sql reserved words conflict
57+
@param data
58+
unescaped data
59+
@return
60+
escaped data
61+
*/
62+
public function escape_name($data){
63+
if ((strpos($data,"`")!==false || is_int($data)) || (strpos($data,".")!==false))
64+
return $data;
65+
return '`'.$data.'`';
66+
}
67+
}

codebase/connector/mixed_connector.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ function __construct($dataType = "json") {
1818

1919
public function add($name, $conn) {
2020
$this->connectors[$name] = $conn;
21-
$conn->simple = true;
2221
}
2322

2423
public function render() {

codebase/dhtmlxgantt.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)