Skip to content

Commit

Permalink
[update] version 4.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKlimenkov committed Feb 5, 2015
1 parent 32504c3 commit f56a047
Show file tree
Hide file tree
Showing 161 changed files with 686 additions and 3,493 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dhtmlxScheduler v.4.2.0
dhtmlxScheduler v.4.3.0
=====================

dhtmlxScheduler is a JavaScript event calendar that allows you to add a Google-like scheduler to your web app or website. Intuitive drag-and-drop interface allows the end users to quickly manage events and appointments in different views: Day, Week, Month, Year, Agenda, Timeline, etc. Very lightweight, highly customizable, and fast, dhtmlxScheduler provides a quick way to add an Ajax-based event calendar on a web page.
Expand Down
3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "scheduler",
"version": "4.2.0",
"version": "4.3.0",
"homepage": "http://dhtmlx.com/docs/products/dhtmlxScheduler/",
"description": "JavaScript event calendar. Allows to manage events and appointments in different views",
"main": "codebase/dhtmlxscheduler.js",
"keywords": [
"calendar",
"scheduler",
"dhtmlx",
"timeline",
"agenda",
"month",
"day",
Expand Down
2 changes: 1 addition & 1 deletion codebase/connector/combo_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function select(){
function to_xml_start(){
if ($this->skip) return "";

return "<option ".($this->selected?"selected='true' ":"")."value='".$this->get_id()."'><![CDATA[".$this->data[$this->config->text[0]["name"]]."]]>";
return "<option ".($this->selected?"selected='true'":"")."value='".$this->xmlentities($this->get_id())."'><![CDATA[".$this->data[$this->config->text[0]["name"]]."]]>";
}
/*! return self as XML string, ending part
*/
Expand Down
2 changes: 1 addition & 1 deletion codebase/connector/crosslink_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function get_only_related($filters){
public function afterProcessing($action){
$status = $action->get_status();

$master_key = $action->get_value($this->master_name);
$master_key = $action->get_id();//value($this->master_name);
$link_key = $action->get_value($this->link_name);
$link_key = explode(',', $link_key);

Expand Down
16 changes: 12 additions & 4 deletions codebase/connector/data_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ function to_xml(){
for ($i=0; $i<sizeof($this->config->text); $i++){
$extra = $this->config->text[$i]["name"];
$data[$extra]=$this->data[$extra];
if (is_null($data[$extra]))
$data[$extra] = "";
}

if ($this->userdata !== false)
Expand Down Expand Up @@ -366,6 +368,7 @@ function set_kids($value){

class TreeDataConnector extends DataConnector{
protected $parent_name = 'parent';
public $rootId = "0";

/*! constructor
Expand Down Expand Up @@ -395,15 +398,18 @@ protected function parse_request(){
if (isset($_GET[$this->parent_name]))
$this->request->set_relation($_GET[$this->parent_name]);
else
$this->request->set_relation("0");
$this->request->set_relation($this->rootId);

$this->request->set_limit(0,0); //netralize default reaction on dyn. loading mode
}

/*! renders self as xml, starting part
*/
protected function xml_start(){
$attributes = " parent='".$this->request->get_relation()."' ";
$attributes = " ";
if (!$this->rootId || $this->rootId != $this->request->get_relation())
$attributes = " parent='".$this->request->get_relation()."' ";

foreach($this->attributes as $k=>$v)
$attributes .= " ".$k."='".$v."'";

Expand All @@ -426,7 +432,9 @@ protected function output_as_xml($res){
if ($this->simple) return $result;

$data = array();
$data["parent"] = $this->request->get_relation();
if (!$this->rootId || $this->rootId != $this->request->get_relation())
$data["parent"] = $this->request->get_relation();

$data["data"] = $result;

$this->fill_collections();
Expand Down Expand Up @@ -517,4 +525,4 @@ function to_xml_end(){
}


?>
?>
2 changes: 1 addition & 1 deletion codebase/connector/db_common.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ abstract class DataWrapper{
@param config
DataConfig instance
*/
public function __construct($connection,$config){
public function __construct($connection = false,$config = false){
$this->config=$config;
$this->connection=$connection;
}
Expand Down
25 changes: 25 additions & 0 deletions codebase/connector/db_pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,31 @@ protected function select_query($select,$from,$where,$sort,$start,$count){
return $sql;
}

public function tables_list() {
$result = $this->query("SHOW TABLES");
if ($result===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));

$tables = array();
while ($table = $result->next()) {
$tables[] = $table[0];
}
return $tables;
}

public function fields_list($table) {
$result = $this->query("SHOW COLUMNS FROM `".$table."`");
if ($result===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));

$fields = array();
$id = "";
while ($field = $result->next()) {
if ($field['Key'] == "PRI")
$id = $field["Field"];
else
$fields[] = $field["Field"];
}
return array("fields" => $fields, "key" => $id );
}

public function get_next($res){
$data = $res->next();
Expand Down
2 changes: 1 addition & 1 deletion codebase/connector/db_phpcake.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public function select($sql){
else
$res = $this->connection->find("all");

$temp = array();
if (sizeof($res)){
$name = get_class($this->connection);
$temp = array();
for ($i=sizeof($res)-1; $i>=0; $i--)
$temp[]=&$res[$i][$name];
}
Expand Down
6 changes: 4 additions & 2 deletions codebase/connector/db_phpci.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ public function query($sql){
if ($res===false) {
throw new Exception("CI - sql execution failed");
}

return new PHPCIResultSet($res);

if (is_object($res))
return new PHPCIResultSet($res);
return new ArrayQueryWrapper(array());
}

public function get_next($res){
Expand Down
2 changes: 1 addition & 1 deletion codebase/connector/db_phpyii.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public function select($sql){
else
$res = $this->connection->findAll();

$temp = array();
if (sizeof($res)){
$temp = array();
foreach ($res as $obj)
$temp[]=$obj->getAttributes();
}
Expand Down
10 changes: 5 additions & 5 deletions codebase/connector/gantt_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ public function render_links($table,$id="",$fields=false,$extra=false,$relation_
class GanttDataProcessor extends DataProcessor{
function name_data($data){
if ($data=="start_date")
return $this->config->text[0]["db_name"];
return $this->config->text[0]["name"];
if ($data=="id")
return $this->config->id["db_name"];
return $this->config->id["name"];
if ($data=="duration" && $this->config->text[1]["name"] == "duration")
return $this->config->text[1]["db_name"];
return $this->config->text[1]["name"];
if ($data=="end_date" && $this->config->text[1]["name"] == "end_date")
return $this->config->text[1]["db_name"];
return $this->config->text[1]["name"];
if ($data=="text")
return $this->config->text[2]["db_name"];
return $this->config->text[2]["name"];

return $data;
}
Expand Down
11 changes: 9 additions & 2 deletions codebase/connector/grid_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,20 @@ public function to_xml_start(){
for ($i=0; $i < sizeof($this->config->text); $i++){
$str.="<cell";
$name=$this->config->text[$i]["name"];
$xmlcontent = false;
if (isset($this->cell_attrs[$name])){
$cattrs=$this->cell_attrs[$name];
foreach ($cattrs as $k => $v)
foreach ($cattrs as $k => $v){
$str.=" ".$k."='".$this->xmlentities($v)."'";
if ($k == "xmlcontent")
$xmlcontent = true;
}
}
$value = isset($this->data[$name]) ? $this->data[$name] : '';
$str.="><![CDATA[".$value."]]></cell>";
if (!$xmlcontent)
$str.="><![CDATA[".$value."]]></cell>";
else
$str.=">".$value."</cell>";
}
if ($this->userdata !== false)
foreach ($this->userdata as $key => $value)
Expand Down
4 changes: 2 additions & 2 deletions codebase/connector/strategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class MultitableTreeRenderStrategy extends TreeRenderStrategy {

private $level = 0;
private $max_level = null;
protected $sep = "#";
protected $sep = ",";

public function __construct($conn) {
parent::__construct($conn);
Expand Down Expand Up @@ -341,7 +341,7 @@ public function set_max_level($max_level) {
$this->max_level = $max_level;
}
public function parse_id($id, $set_level = true) {
$parts = explode('#', urldecode($id));
$parts = explode($this->sep, $id, 2);
if (count($parts) === 2) {
$level = $parts[0] + 1;
$id = $parts[1];
Expand Down
3 changes: 2 additions & 1 deletion codebase/connector/tree_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function to_xml_end(){
**/
class TreeConnector extends Connector{
protected $parent_name = 'id';
public $rootId = "0";

/*! constructor
Expand Down Expand Up @@ -180,7 +181,7 @@ public function parse_request(){
if (isset($_GET[$this->parent_name]))
$this->request->set_relation($_GET[$this->parent_name]);
else
$this->request->set_relation("0");
$this->request->set_relation($this->rootId);

$this->request->set_limit(0,0); //netralize default reaction on dyn. loading mode
}
Expand Down
2 changes: 1 addition & 1 deletion codebase/connector/treedatamultitable_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected function set_relation() {

public function xml_start(){
if (isset($_GET[$this->parent_name])) {
return "<data parent='".$this->render->level_id($_GET[$this->parent_name], $this->render->get_level() - 1)."'>";
return "<data parent='".$this->xmlentities($this->render->level_id($_GET[$this->parent_name], $this->render->get_level() - 1))."'>";
} else {
return "<data parent='0'>";
}
Expand Down
3 changes: 2 additions & 1 deletion codebase/connector/treegrid_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function set_kids($value){
**/
class TreeGridConnector extends GridConnector{
protected $parent_name = 'id';
protected $rootId = "0";

/*! constructor
Expand Down Expand Up @@ -82,7 +83,7 @@ public function parse_request(){
if (isset($_GET[$this->parent_name]))
$this->request->set_relation($_GET[$this->parent_name]);
else
$this->request->set_relation("0");
$this->request->set_relation($this->rootId);

$this->request->set_limit(0,0); //netralize default reaction on dyn. loading mode
}
Expand Down
1 change: 0 additions & 1 deletion codebase/connector/treegridmultitable_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public function __construct($res,$type=false,$item_type=false,$data_type=false,$
$data_type="TreeGridMultitableDataProcessor";
if (!$render_type) $render_type="MultitableTreeRenderStrategy";
parent::__construct($res,$type,$item_type,$data_type,$render_type);
$this->render->set_separator("%23");
}

public function render(){
Expand Down
2 changes: 1 addition & 1 deletion codebase/connector/treemultitable_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected function set_relation() {

public function xml_start(){
if (isset($_GET[$this->parent_name])) {
return "<tree id='".($this->render->level_id($_GET[$this->parent_name], $this->get_level() - 1))."'>";
return "<tree id='".$this->xmlentities($this->render->level_id($_GET[$this->parent_name], $this->get_level() - 1))."'>";
} else {
return "<tree id='0'>";
}
Expand Down
4 changes: 2 additions & 2 deletions codebase/dhtmlxscheduler.css

Large diffs are not rendered by default.

Loading

0 comments on commit f56a047

Please sign in to comment.