summaryrefslogtreecommitdiff
path: root/addons/web_calendar/static/lib/dhtmlxScheduler/codebase
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_calendar/static/lib/dhtmlxScheduler/codebase')
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/base_connector.php706
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/combo_connector.php89
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/connector.js141
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/crosslink_connector.php120
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/dataprocessor.php465
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_common.php959
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mssql.php66
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mysqli.php53
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_oracle.php79
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_pdo.php65
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_postgre.php66
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/grid_connector.php268
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/scheduler_connector.php121
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/tools.php254
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/tree_connector.php274
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/treegrid_connector.php161
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/update.php262
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css5
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js195
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js4275
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_glossy.css5
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_mobile.css5
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_mobile.js318
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_active_links.js6
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_agenda_view.js10
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js8
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_cookie.js6
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_editors.js10
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_expand.js8
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_html_templates.js5
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_key_nav.js6
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js12
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_map_view.js29
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js26
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multiselect.js7
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multisource.js5
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_offline.js9
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_outerdrag.js6
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_pdf.js14
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js9
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js35
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_serialize.js8
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_timeline.js34
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_tooltip.js11
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.css5
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.js26
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_treetimeline.js19
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_units.js16
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_url.js6
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_week_agenda.js18
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_year_view.js17
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/but_repeat.gifbin0 -> 1149 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/buttons.pngbin0 -> 281 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/calendar.gifbin0 -> 622 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_big.gifbin0 -> 1321 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_small.gifbin0 -> 388 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/colapce-expand-icon.gifbin0 -> 452 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controls.gifbin0 -> 2496 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.pngbin0 -> 152 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg_now.pngbin0 -> 152 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.pngbin0 -> 230 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/loading.gifbin0 -> 3951 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.pngbin0 -> 247 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.pngbin0 -> 252 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/but_repeat.gifbin0 -> 1149 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/buttons.gifbin0 -> 616 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/calendar.gifbin0 -> 622 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.gifbin0 -> 1321 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.gifbin0 -> 388 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/colapce-expand-icon.gifbin0 -> 452 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/controlls5.pngbin0 -> 2835 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg.pngbin0 -> 89 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg_now.pngbin0 -> 89 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.pngbin0 -> 148 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.pngbin0 -> 230 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.pngbin0 -> 230 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.pngbin0 -> 124 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.pngbin0 -> 207 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/loading.gifbin0 -> 3951 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.pngbin0 -> 145 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.pngbin0 -> 350 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.pngbin0 -> 138 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.pngbin0 -> 177 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-separator.gifbin0 -> 259 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.pngbin0 -> 290 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.pngbin0 -> 300 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/add.pngbin0 -> 1404 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/arrow_left.pngbin0 -> 1955 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/arrow_right.pngbin0 -> 1975 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/event.pngbin0 -> 1096 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/event_focus.pngbin0 -> 1062 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/noevents.pngbin0 -> 1687 bytes
-rw-r--r--addons/web_calendar/static/lib/dhtmlxScheduler/codebase/readme.txt16
93 files changed, 9339 insertions, 0 deletions
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/base_connector.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/base_connector.php
new file mode 100644
index 00000000000..aab70e3c6ea
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/base_connector.php
@@ -0,0 +1,706 @@
+<?php
+
+require_once("tools.php");
+require_once("db_common.php");
+require_once("dataprocessor.php");
+require_once("update.php");
+
+//enable buffering to catch and ignore any custom output before XML generation
+//because of this command, it strongly recommended to include connector's file before any other libs
+//in such case it will handle any extra output from not well formed code of other libs
+ini_set("output_buffering","On");
+ob_start();
+
+class OutputWriter{
+ private $start;
+ private $end;
+ private $type;
+
+ public function __construct($start, $end = ""){
+ $this->start = $start;
+ $this->end = $end;
+ $this->type = "xml";
+ }
+ public function add($add){
+ $this->start.=$add;
+ }
+ public function reset(){
+ $this->start="";
+ $this->end="";
+ }
+ public function set_type($add){
+ $this->type=$add;
+ }
+ public function output($name="", $inline=true){
+ ob_clean();
+ if ($this->type == "xml")
+ header("Content-type: text/xml");
+
+ echo $this->__toString();
+ }
+ public function __toString(){
+ return $this->start.$this->end;
+ }
+}
+
+/*! EventInterface
+ Base class , for iterable collections, which are used in event
+**/
+class EventInterface{
+ protected $request; ////!< DataRequestConfig instance
+ public $rules=array(); //!< array of sorting rules
+
+ /*! constructor
+ creates a new interface based on existing request
+ @param request
+ DataRequestConfig object
+ */
+ public function __construct($request){
+ $this->request = $request;
+ }
+
+ /*! remove all elements from collection
+ */
+ public function clear(){
+ array_splice($rules,0);
+ }
+ /*! get index by name
+
+ @param name
+ name of field
+ @return
+ index of named field
+ */
+ public function index($name){
+ $len = sizeof($this->rules);
+ for ($i=0; $i < $len; $i++) {
+ if ($this->rules[$i]["name"]==$name)
+ return $i;
+ }
+ return false;
+ }
+}
+/*! Wrapper for collection of sorting rules
+**/
+class SortInterface extends EventInterface{
+ /*! constructor
+ creates a new interface based on existing request
+ @param request
+ DataRequestConfig object
+ */
+ public function __construct($request){
+ parent::__construct($request);
+ $this->rules = &$request->get_sort_by_ref();
+ }
+ /*! add new sorting rule
+
+ @param name
+ name of field
+ @param dir
+ direction of sorting
+ */
+ public function add($name,$dir){
+ $this->request->set_sort($name,$dir);
+ }
+ public function store(){
+ $this->request->set_sort_by($this->rules);
+ }
+}
+/*! Wrapper for collection of filtering rules
+**/
+class FilterInterface extends EventInterface{
+ /*! constructor
+ creates a new interface based on existing request
+ @param request
+ DataRequestConfig object
+ */
+ public function __construct($request){
+ $this->request = $request;
+ $this->rules = &$request->get_filters_ref();
+ }
+ /*! add new filatering rule
+
+ @param name
+ name of field
+ @param value
+ value to filter by
+ @param rule
+ filtering rule
+ */
+ public function add($name,$value,$rule){
+ $this->request->set_filter($name,$value,$rule);
+ }
+ public function store(){
+ $this->request->set_filters($this->rules);
+ }
+}
+
+/*! base class for component item representation
+**/
+class DataItem{
+ protected $data; //!< hash of data
+ protected $config;//!< DataConfig instance
+ protected $index;//!< index of element
+ protected $skip;//!< flag , which set if element need to be skiped during rendering
+ /*! constructor
+
+ @param data
+ hash of data
+ @param config
+ DataConfig object
+ @param index
+ index of element
+ */
+ function __construct($data,$config,$index){
+ $this->config=$config;
+ $this->data=$data;
+ $this->index=$index;
+ $this->skip=false;
+ }
+ /*! get named value
+
+ @param name
+ name or alias of field
+ @return
+ value from field with provided name or alias
+ */
+ public function get_value($name){
+ return $this->data[$name];
+ }
+ /*! set named value
+
+ @param name
+ name or alias of field
+ @param value
+ value for field with provided name or alias
+ */
+ public function set_value($name,$value){
+ return $this->data[$name]=$value;
+ }
+ /*! get id of element
+ @return
+ id of element
+ */
+ public function get_id(){
+ $id = $this->config->id["name"];
+ if (array_key_exists($id,$this->data))
+ return $this->data[$id];
+ return false;
+ }
+ /*! change id of element
+
+ @param value
+ new id value
+ */
+ public function set_id($value){
+ $this->data[$this->config->id["name"]]=$value;
+ }
+ /*! get index of element
+
+ @return
+ index of element
+ */
+ public function get_index(){
+ return $this->index;
+ }
+ /*! mark element for skiping ( such element will not be rendered )
+ */
+ public function skip(){
+ $this->skip=true;
+ }
+
+ /*! return self as XML string
+ */
+ public function to_xml(){
+ return $this->to_xml_start().$this->to_xml_end();
+ }
+
+ /*! replace xml unsafe characters
+
+ @param string
+ string to be escaped
+ @return
+ escaped string
+ */
+ protected function xmlentities($string) {
+ return str_replace( array( '&', '"', "'", '<', '>', '’' ), array( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;', '&apos;' ), $string);
+ }
+
+ /*! return starting tag for self as XML string
+ */
+ public function to_xml_start(){
+ $str="<item";
+ for ($i=0; $i < sizeof($this->config->data); $i++){
+ $name=$this->config->data[$i]["name"];
+ $str.=" ".$name."='".$this->xmlentities($this->data[$name])."'";
+ }
+ return $str.">";
+ }
+ /*! return ending tag for XML string
+ */
+ public function to_xml_end(){
+ return "</item>";
+ }
+}
+
+
+
+
+
+/*! Base connector class
+ This class used as a base for all component specific connectors.
+ Can be used on its own to provide raw data.
+**/
+class Connector {
+ protected $config;//DataConfig instance
+ protected $request;//DataRequestConfig instance
+ protected $names;//!< hash of names for used classes
+ private $encoding="utf-8";//!< assigned encoding (UTF-8 by default)
+ private $editing=false;//!< flag of edit mode ( response for dataprocessor )
+ private $updating=false;//!< flag of update mode ( response for data-update )
+ private $db; //!< db connection resource
+ protected $dload;//!< flag of dyn. loading mode
+ public $access; //!< AccessMaster instance
+
+ public $sql; //DataWrapper instance
+ public $event; //EventMaster instance
+ public $limit=false;
+
+ private $id_seed=0; //!< default value, used to generate auto-IDs
+ protected $live_update = false; // actions table name for autoupdating
+
+ /*! constructor
+
+ Here initilization of all Masters occurs, execution timer initialized
+ @param db
+ db connection resource
+ @param type
+ string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+ @param item_type
+ name of class, which will be used for item rendering, optional, DataItem will be used by default
+ @param data_type
+ name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default.
+ */
+ public function __construct($db,$type=false, $item_type=false, $data_type=false){
+ $this->exec_time=microtime(true);
+
+ if (!$type) $type="MySQL";
+ if (class_exists($type."DBDataWrapper",false)) $type.="DBDataWrapper";
+ if (!$item_type) $item_type="DataItem";
+ if (!$data_type) $data_type="DataProcessor";
+
+ $this->names=array(
+ "db_class"=>$type,
+ "item_class"=>$item_type,
+ "data_class"=>$data_type,
+ );
+
+ $this->config = new DataConfig();
+ $this->request = new DataRequestConfig();
+ $this->event = new EventMaster();
+ $this->access = new AccessMaster();
+
+ if (!class_exists($this->names["db_class"],false))
+ throw new Exception("DB class not found: ".$this->names["db_class"]);
+ $this->sql = new $this->names["db_class"]($db,$this->config);
+
+ $this->db=$db;//saved for options connectors, if any
+
+ EventMaster::trigger_static("connectorCreate",$this);
+ }
+
+ /*! return db connection resource
+ nested class may neeed to access live connection object
+ @return
+ DB connection resource
+ */
+ protected function get_connection(){
+ return $this->db;
+ }
+
+ public function get_config(){
+ return new DataConfig($this->config);
+ }
+
+ public function get_request(){
+ return new DataRequestConfig($this->config);
+ }
+
+
+ /*! config connector based on table
+
+ @param table
+ name of table in DB
+ @param id
+ name of id field
+ @param fields
+ list of fields names
+ @param extra
+ list of extra fields, optional, such fields will not be included in data rendering, but will be accessible in all inner events
+ @param relation_id
+ name of field used to define relations for hierarchical data organization, optional
+ */
+ public function render_table($table,$id="",$fields=false,$extra=false,$relation_id=false){
+ $this->configure($table,$id,$fields,$extra,$relation_id);
+ return $this->render();
+ }
+ public function configure($table,$id="",$fields=false,$extra=false,$relation_id=false){
+ if ($fields === false){
+ //auto-config
+ $info = $this->sql->fields_list($table);
+ $fields = implode(",",$info["fields"]);
+ if ($info["key"])
+ $id = $info["key"];
+ }
+ $this->config->init($id,$fields,$extra,$relation_id);
+ $this->request->set_source($table);
+ }
+
+ protected function uuid(){
+ return time()."x".$this->id_seed++;
+ }
+
+ /*! config connector based on sql
+
+ @param sql
+ sql query used as base of configuration
+ @param id
+ name of id field
+ @param fields
+ list of fields names
+ @param extra
+ list of extra fields, optional, such fields will not be included in data rendering, but will be accessible in all inner events
+ @param relation_id
+ name of field used to define relations for hierarchical data organization, optional
+ */
+ public function render_sql($sql,$id,$fields,$extra=false,$relation_id=false){
+ $this->config->init($id,$fields,$extra,$relation_id);
+ $this->request->parse_sql($sql);
+ return $this->render();
+ }
+
+ /*! render already configured connector
+
+ @param config
+ configuration of data
+ @param request
+ configuraton of request
+ */
+ public function render_connector($config,$request){
+ $this->config->copy($config);
+ $this->request->copy($request);
+ return $this->render();
+ }
+
+ /*! render self
+ process commands, output requested data as XML
+ */
+ public function render(){
+ EventMaster::trigger_static("connectorInit",$this);
+
+ $this->parse_request();
+ if ($this->live_update !== false && $this->updating!==false) {
+ $this->live_update->get_updates();
+ } else {
+ if ($this->editing){
+ $dp = new $this->names["data_class"]($this,$this->config,$this->request);
+ $dp->process($this->config,$this->request);
+ }
+ else {
+ $wrap = new SortInterface($this->request);
+ $this->event->trigger("beforeSort",$wrap);
+ $wrap->store();
+
+ $wrap = new FilterInterface($this->request);
+ $this->event->trigger("beforeFilter",$wrap);
+ $wrap->store();
+
+ $this->output_as_xml( $this->sql->select($this->request) );
+ }
+ }
+ $this->end_run();
+ }
+
+ /*! prevent SQL injection through column names
+ replace dangerous chars in field names
+ @param str
+ incoming field name
+ @return
+ safe field name
+ */
+ protected function safe_field_name($str){
+ return strtok($str, " \n\t;',");
+ }
+
+ /*! limit max count of records
+ connector will ignore any records after outputing max count
+ @param limit
+ max count of records
+ @return
+ none
+ */
+ public function set_limit($limit){
+ $this->limit = $limit;
+ }
+
+ protected function parse_request_mode(){
+ //detect edit mode
+ if (isset($_GET["editing"])){
+ $this->editing=true;
+ } else if (isset($_POST["ids"])){
+ $this->editing=true;
+ LogMaster::log('While there is no edit mode mark, POST parameters similar to edit mode detected. \n Switching to edit mode ( to disable behavior remove POST[ids]');
+ } else if (isset($_GET['dhx_version'])){
+ $this->updating = true;
+ }
+ }
+
+ /*! parse incoming request, detects commands and modes
+ */
+ protected function parse_request(){
+ //set default dyn. loading params, can be reset in child classes
+ if ($this->dload)
+ $this->request->set_limit(0,$this->dload);
+ else if ($this->limit)
+ $this->request->set_limit(0,$this->limit);
+
+ $this->parse_request_mode();
+
+ if ($this->live_update && ($this->updating || $this->editing)){
+ $this->request->set_version($_GET["dhx_version"]);
+ $this->request->set_user($_GET["dhx_user"]);
+ }
+
+ if (isset($_GET["dhx_sort"]))
+ foreach($_GET["dhx_sort"] as $k => $v){
+ $k = $this->safe_field_name($k);
+ $this->request->set_sort($this->resolve_parameter($k),$v);
+ }
+
+ if (isset($_GET["dhx_filter"]))
+ foreach($_GET["dhx_filter"] as $k => $v){
+ $k = $this->safe_field_name($k);
+ $this->request->set_filter($this->resolve_parameter($k),$v);
+ }
+
+
+ }
+
+ /*! convert incoming request name to the actual DB name
+ @param name
+ incoming parameter name
+ @return
+ name of related DB field
+ */
+ protected function resolve_parameter($name){
+ return $name;
+ }
+
+
+ /*! replace xml unsafe characters
+
+ @param string
+ string to be escaped
+ @return
+ escaped string
+ */
+ private function xmlentities($string) {
+ return str_replace( array( '&', '"', "'", '<', '>', '’' ), array( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;', '&apos;' ), $string);
+ }
+
+ /*! render from DB resultset
+ @param res
+ DB resultset
+ process commands, output requested data as XML
+ */
+ protected function render_set($res){
+ $output="";
+ $index=0;
+ $this->event->trigger("beforeRenderSet",$this,$res,$this->config);
+ while ($data=$this->sql->get_next($res)){
+ $data = new $this->names["item_class"]($data,$this->config,$index);
+ if ($data->get_id()===false)
+ $data->set_id($this->uuid());
+ $this->event->trigger("beforeRender",$data);
+ $output.=$data->to_xml();
+ $index++;
+ }
+ return $output;
+ }
+
+ /*! output fetched data as XML
+ @param res
+ DB resultset
+ */
+ protected function output_as_xml($res){
+ $start="<?xml version='1.0' encoding='".$this->encoding."' ?>".$this->xml_start();
+ $end=$this->render_set($res).$this->xml_end();
+
+ $out = new OutputWriter($start, $end);
+ $this->event->trigger("beforeOutput", $this, $out);
+
+ $out->output();
+ }
+
+
+ /*! end processing
+ stop execution timer, kill the process
+ */
+ protected function end_run(){
+ $time=microtime(true)-$this->exec_time;
+ LogMaster::log("Done in {$time}s");
+ flush();
+ die();
+ }
+
+ /*! set xml encoding
+
+ methods sets only attribute in XML, no real encoding conversion occurs
+ @param encoding
+ value which will be used as XML encoding
+ */
+ public function set_encoding($encoding){
+ $this->encoding=$encoding;
+ }
+
+ /*! enable or disable dynamic loading mode
+
+ @param count
+ count of rows loaded from server, actual only for grid-connector, can be skiped in other cases.
+ If value is a false or 0 - dyn. loading will be disabled
+ */
+ public function dynamic_loading($count){
+ $this->dload=$count;
+ }
+
+ /*! enable logging
+
+ @param path
+ path to the log file. If set as false or empty strig - logging will be disabled
+ @param client_log
+ enable output of log data to the client side
+ */
+ public function enable_log($path=true,$client_log=false){
+ LogMaster::enable_log($path,$client_log);
+ }
+
+ /*! provides infor about current processing mode
+ @return
+ true if processing dataprocessor command, false otherwise
+ */
+ public function is_select_mode(){
+ $this->parse_request_mode();
+ return !$this->editing;
+ }
+
+ public function is_first_call(){
+ $this->parse_request_mode();
+ return !($this->editing || $this->updating || $this->request->get_start() || sizeof($this->request->get_filters()) || sizeof($this->request->get_sort_by()));
+
+ }
+
+ /*! renders self as xml, starting part
+ */
+ protected function xml_start(){
+ return "<data>";
+ }
+ /*! renders self as xml, ending part
+ */
+ protected function xml_end(){
+ return "</data>";
+ }
+
+
+ public function insert($data) {
+ $action = new DataAction('inserted', false, $data);
+ $request = new DataRequestConfig();
+ $request->set_source($this->request->get_source());
+
+ $this->config->limit_fields($data);
+ $this->sql->insert($action,$request);
+ $this->config->restore_fields($data);
+
+ return $action->get_new_id();
+ }
+
+ public function delete($id) {
+ $action = new DataAction('deleted', $id, array());
+ $request = new DataRequestConfig();
+ $request->set_source($this->request->get_source());
+
+ $this->sql->delete($action,$request);
+ return $action->get_status();
+}
+
+ public function update($data) {
+ $action = new DataAction('updated', $data[$this->config->id["name"]], $data);
+ $request = new DataRequestConfig();
+ $request->set_source($this->request->get_source());
+
+ $this->config->limit_fields($data);
+ $this->sql->update($action,$request);
+ $this->config->restore_fields($data);
+
+ return $action->get_status();
+ }
+
+ /*! sets actions_table for Optimistic concurrency control mode and start it
+ @param table_name
+ name of database table which will used for saving actions
+ @param url
+ url used for update notifications
+ */
+ public function enable_live_update($table, $url=false){
+ $this->live_update = new DataUpdate($this->sql, $this->config, $this->request, $table,$url);
+ $this->live_update->set_event($this->event,$this->names["item_class"]);
+ $this->event->attach("beforeOutput", Array($this->live_update, "version_output"));
+ $this->event->attach("beforeFiltering", Array($this->live_update, "get_updates"));
+ $this->event->attach("beforeProcessing", Array($this->live_update, "check_collision"));
+ $this->event->attach("afterProcessing", Array($this->live_update, "log_operations"));
+ }
+}
+
+
+/*! wrapper around options collection, used for comboboxes and filters
+**/
+class OptionsConnector extends Connector{
+ protected $init_flag=false;//!< used to prevent rendering while initialization
+ public function __construct($res,$type=false,$item_type=false,$data_type=false){
+ if (!$item_type) $item_type="DataItem";
+ if (!$data_type) $data_type=""; //has not sense, options not editable
+ parent::__construct($res,$type,$item_type,$data_type);
+ }
+ /*! render self
+ process commands, return data as XML, not output data to stdout, ignore parameters in incoming request
+ @return
+ data as XML string
+ */
+ public function render(){
+ if (!$this->init_flag){
+ $this->init_flag=true;
+ return "";
+ }
+ $res = $this->sql->select($this->request);
+ return $this->render_set($res);
+ }
+}
+
+
+
+class DistinctOptionsConnector extends OptionsConnector{
+ /*! render self
+ process commands, return data as XML, not output data to stdout, ignore parameters in incoming request
+ @return
+ data as XML string
+ */
+ public function render(){
+ if (!$this->init_flag){
+ $this->init_flag=true;
+ return "";
+ }
+ $res = $this->sql->get_variants($this->config->text[0]["db_name"],$this->request);
+ return $this->render_set($res);
+ }
+}
+
+?>
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/combo_connector.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/combo_connector.php
new file mode 100644
index 00000000000..65e6bfe8564
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/combo_connector.php
@@ -0,0 +1,89 @@
+<?php
+require_once("base_connector.php");
+/*! DataItem class for Combo component
+**/
+class ComboDataItem extends DataItem{
+ private $selected;//!< flag of selected option
+
+ function __construct($data,$config,$index){
+ parent::__construct($data,$config,$index);
+
+ $this->selected=false;
+ }
+ /*! mark option as selected
+ */
+ function select(){
+ $this->selected=true;
+ }
+ /*! return self as XML string, starting part
+ */
+ 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 self as XML string, ending part
+ */
+ function to_xml_end(){
+ if ($this->skip) return "";
+ return "</option>";
+ }
+}
+
+/*! Connector for the dhtmlxCombo
+**/
+class ComboConnector extends Connector{
+ private $filter; //!< filtering mask from incoming request
+ private $position; //!< position from incoming request
+
+ /*! constructor
+
+ Here initilization of all Masters occurs, execution timer initialized
+ @param res
+ db connection resource
+ @param type
+ string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+ @param item_type
+ name of class, which will be used for item rendering, optional, DataItem will be used by default
+ @param data_type
+ name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default.
+ */
+ public function __construct($res,$type=false,$item_type=false,$data_type=false){
+ if (!$item_type) $item_type="ComboDataItem";
+ parent::__construct($res,$type,$item_type,$data_type);
+ }
+
+ //parse GET scoope, all operations with incoming request must be done here
+ function parse_request(){
+ parent::parse_request();
+
+ if (isset($_GET["pos"])){
+ if (!$this->dload) //not critical, so just write a log message
+ LogMaster::log("Dyn loading request received, but server side was not configured to process dyn. loading. ");
+ else
+ $this->request->set_limit($_GET["pos"],$this->dload);
+ }
+
+ if (isset($_GET["mask"]))
+ $this->request->set_filter($this->config->text[0]["name"],$_GET["mask"]."%","LIKE");
+
+ LogMaster::log($this->request);
+ }
+
+
+ /*! renders self as xml, starting part
+ */
+ public function xml_start(){
+ if ($this->request->get_start())
+ return "<complete add='true'>";
+ else
+ return "<complete>";
+ }
+
+ /*! renders self as xml, ending part
+ */
+ public function xml_end(){
+ return "</complete>";
+ }
+}
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/connector.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/connector.js
new file mode 100644
index 00000000000..f0d03f7a880
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/connector.js
@@ -0,0 +1,141 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+/*
+ dhx_sort[index]=direction
+ dhx_filter[index]=mask
+*/
+if (window.dhtmlXGridObject){
+ dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point;
+ dhtmlXGridObject.prototype._init_point=function(){
+ var clear_url=function(url){
+ url=url.replace(/(\?|\&)connector[^\f]*/g,"");
+ return url+(url.indexOf("?")!=-1?"&":"?")+"connector=true";
+ }
+ var combine_urls=function(url){
+ return clear_url(url)+(this._connector_sorting||"")+(this._connector_filter||"");
+ }
+ var sorting_url=function(url,ind,dir){
+ this._connector_sorting="&dhx_sort["+ind+"]="+dir;
+ return combine_urls.call(this,url);
+ }
+ var filtering_url=function(url,inds,vals){
+ for (var i=0; i<inds.length; i++)
+ inds[i]="dhx_filter["+inds[i]+"]="+encodeURIComponent(vals[i]);
+ this._connector_filter="&"+inds.join("&");
+ return combine_urls.call(this,url);
+ }
+ this.attachEvent("onCollectValues",function(ind){
+ if (this._con_f_used[ind]){
+ if (typeof(this._con_f_used[ind]) == "object")
+ return this._con_f_used[ind];
+ else
+ return false;
+ }
+ return true;
+ });
+ this.attachEvent("onDynXLS",function(){
+ this.xmlFileUrl=combine_urls.call(this,this.xmlFileUrl);
+ return true;
+ });
+ this.attachEvent("onBeforeSorting",function(ind,type,dir){
+ if (type=="connector"){
+ var self=this;
+ this.clearAndLoad(sorting_url.call(this,this.xmlFileUrl,ind,dir),function(){
+ self.setSortImgState(true,ind,dir);
+ });
+ return false;
+ }
+ return true;
+ });
+ this.attachEvent("onFilterStart",function(a,b){
+ if (this._con_f_used.length){
+ this.clearAndLoad(filtering_url.call(this,this.xmlFileUrl,a,b));
+ return false;
+ }
+ return true;
+ });
+ this.attachEvent("onXLE",function(a,b,c,xml){
+ if (!xml) return;
+ });
+
+ if (this._init_point_connector) this._init_point_connector();
+ }
+ dhtmlXGridObject.prototype._con_f_used=[];
+ dhtmlXGridObject.prototype._in_header_connector_text_filter=function(t,i){
+ if (!this._con_f_used[i])
+ this._con_f_used[i]=1;
+ return this._in_header_text_filter(t,i);
+ }
+ dhtmlXGridObject.prototype._in_header_connector_select_filter=function(t,i){
+ if (!this._con_f_used[i])
+ this._con_f_used[i]=2;
+ return this._in_header_select_filter(t,i);
+ }
+ dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load;
+ dhtmlXGridObject.prototype.load=function(url, call, type){
+ if (!this._colls_loaded && this.cellType){
+ var ar=[];
+ for (var i=0; i < this.cellType.length; i++)
+ if (this.cellType[i].indexOf("co")==0 || this._con_f_used[i]==2) ar.push(i);
+ if (ar.length)
+ arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":"?")+"connector=true&dhx_colls="+ar.join(",");
+ }
+ return this.load_connector.apply(this,arguments);
+ }
+ dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead;
+ dhtmlXGridObject.prototype._parseHead=function(url, call, type){
+ this._parseHead_connector.apply(this,arguments);
+ if (!this._colls_loaded){
+ var cols = this.xmlLoader.doXPath("./coll_options", arguments[0]);
+ for (var i=0; i < cols.length; i++){
+ var f = cols[i].getAttribute("for");
+ var v = [];
+ var combo=null;
+ if (this.cellType[f] == "combo")
+ combo = this.getColumnCombo(f);
+ if (this.cellType[f].indexOf("co")==0)
+ combo=this.getCombo(f);
+
+ var os = this.xmlLoader.doXPath("./item",cols[i]);
+ for (var j=0; j<os.length; j++){
+ var val=os[j].getAttribute("value");
+
+ if (combo){
+ var lab=os[j].getAttribute("label")||val;
+
+ if (combo.addOption)
+ combo.addOption([[val, lab]]);
+ else
+ combo.put(val,lab);
+
+ v[v.length]=lab;
+ } else
+ v[v.length]=val;
+ }
+ if (this._con_f_used[f*1])
+ this._con_f_used[f*1]=v;
+ };
+ this._colls_loaded=true;
+ }
+ }
+
+
+
+
+}
+
+if (window.dataProcessor){
+ dataProcessor.prototype.init_original=dataProcessor.prototype.init;
+ dataProcessor.prototype.init=function(obj){
+ this.init_original(obj);
+ obj._dataprocessor=this;
+
+ this.setTransactionMode("POST",true);
+ this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true";
+ }
+}
+dhtmlxError.catchError("LoadXML",function(a,b,c){
+ alert(c[0].responseText);
+});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/crosslink_connector.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/crosslink_connector.php
new file mode 100644
index 00000000000..313fac10585
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/crosslink_connector.php
@@ -0,0 +1,120 @@
+<?php
+
+class DelayedConnector extends Connector{
+ protected $init_flag=false;//!< used to prevent rendering while initialization
+ private $data_mode=false;//!< flag to separate xml and data request modes
+ private $data_result=false;//<! store results of query
+
+ public function dataMode($name){
+ $this->data_mode = $name;
+ $this->data_result=array();
+ }
+ public function getDataResult(){
+ return $this->data_result;
+ }
+
+ public function render(){
+ if (!$this->init_flag){
+ $this->init_flag=true;
+ return "";
+ }
+ return parent::render();
+ }
+
+ protected function output_as_xml($res){
+ if ($this->data_mode){
+ while ($data=$this->sql->get_next($res)){
+ $this->data_result[]=$data[$this->data_mode];
+ }
+ }
+ else
+ return parent::output_as_xml($res);
+ }
+ protected function end_run(){
+ if (!$this->data_mode)
+ parent::end_run();
+ }
+}
+
+class CrossOptionsConnector extends Connector{
+ public $options, $link;
+ private $master_name, $link_name, $master_value;
+
+ public function __construct($res,$type=false,$item_type=false,$data_type=false){
+ $this->options = new OptionsConnector($res,$type,$item_type,$data_type);
+ $this->link = new DelayedConnector($res,$type,$item_type,$data_type);
+
+ EventMaster::attach_static("connectorInit",array($this, "handle"));
+ }
+ public function handle($conn){
+ if ($conn instanceof DelayedConnector) return;
+ if ($conn instanceof OptionsConnector) return;
+
+ $this->master_name = $this->link->get_config()->id["db_name"];
+ $this->link_name = $this->options->get_config()->id["db_name"];
+
+ $this->link->event->attach("beforeFilter",array($this, "get_only_related"));
+
+ if (isset($_GET["dhx_crosslink_".$this->link_name])){
+ $this->get_links($_GET["dhx_crosslink_".$this->link_name]);
+ die();
+ }
+
+ if (!$this->dload){
+ $conn->event->attach("beforeRender", array($this, "getOptions"));
+ $conn->event->attach("beforeRenderSet", array($this, "prepareConfig"));
+ }
+
+
+ $conn->event->attach("afterProcessing", array($this, "afterProcessing"));
+ }
+ public function prepareConfig($conn, $res, $config){
+ $config->add_field($this->link_name);
+ }
+ public function getOptions($data){
+ $this->link->dataMode($this->link_name);
+
+ $this->get_links($data->get_value($this->master_name));
+
+ $data->set_value($this->link_name, implode(",",$this->link->getDataResult()));
+ }
+ public function get_links($id){
+ $this->master_value = $id;
+ $this->link->render();
+ }
+ public function get_only_related($filters){
+ $index = $filters->index($this->master_name);
+ if ($index!==false){
+ $filters->rules[$index]["value"]=$this->master_value;
+ } else
+ $filters->add($this->master_name, $this->master_value, "=");
+ }
+ public function afterProcessing($action){
+ $status = $action->get_status();
+
+ $master_key = $action->get_value($this->master_name);
+ $link_key = $action->get_value($this->link_name);
+ $link_key = explode(',', $link_key);
+
+ if ($status == "inserted")
+ $master_key = $action->get_new_id();
+
+ switch ($status){
+ case "deleted":
+ $this->link->delete($master_key);
+ break;
+ case "updated":
+ $this->link->delete($master_key);
+ case "inserted":
+ for ($i=0; $i < sizeof($link_key); $i++)
+ if ($link_key[$i]!="")
+ $this->link->insert(array(
+ $this->link_name => $link_key[$i],
+ $this->master_name => $master_key
+ ));
+ break;
+ }
+ }
+}
+
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/dataprocessor.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/dataprocessor.php
new file mode 100644
index 00000000000..551a3ce7cb2
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/dataprocessor.php
@@ -0,0 +1,465 @@
+<?php
+/*! Base DataProcessor handling
+**/
+class DataProcessor{
+ protected $connector;//!< Connector instance
+ protected $config;//!< DataConfig instance
+ protected $request;//!< DataRequestConfig instance
+
+ /*! constructor
+
+ @param connector
+ Connector object
+ @param config
+ DataConfig object
+ @param request
+ DataRequestConfig object
+ */
+ function __construct($connector,$config,$request){
+ $this->connector= $connector;
+ $this->config=$config;
+ $this->request=$request;
+ }
+
+ /*! convert incoming data name to valid db name
+ redirect to Connector->name_data by default
+ @param data
+ data name from incoming request
+ @return
+ related db_name
+ */
+ function name_data($data){
+ return $data;
+ }
+ /*! retrieve data from incoming request and normalize it
+
+ @param ids
+ array of extected IDs
+ @return
+ hash of data
+ */
+ function get_post_values($ids){
+ $data=array();
+ for ($i=0; $i < sizeof($ids); $i++)
+ $data[$ids[$i]]=array();
+
+ foreach ($_POST as $key => $value) {
+ $details=explode("_",$key,2);
+ if (sizeof($details)==1) continue;
+
+ $name=$this->name_data($details[1]);
+ $data[$details[0]][$name]=$value;
+ }
+
+ return $data;
+ }
+ /*! process incoming request ( save|update|delete )
+ */
+ function process(){
+ LogMaster::log("DataProcessor object initialized",$_POST);
+
+ $results=array();
+
+ if (!isset($_POST["ids"]))
+ throw new Exception("Incorrect incoming data, ID of incoming records not recognized");
+
+ $ids=explode(",",$_POST["ids"]);
+ $rows_data=$this->get_post_values($ids);
+ $failed=false;
+
+ try{
+ if ($this->connector->sql->is_global_transaction())
+ $this->connector->sql->begin_transaction();
+
+ for ($i=0; $i < sizeof($ids); $i++) {
+ $rid = $ids[$i];
+ LogMaster::log("Row data [{$rid}]",$rows_data[$rid]);
+
+ if (!isset($_POST[$rid."_!nativeeditor_status"]))
+ throw new Exception("Status of record [{$rid}] not found in incoming request");
+ $status = $_POST[$rid."_!nativeeditor_status"];
+
+ $action=new DataAction($status,$rid,$rows_data[$rid]);
+ $results[]=$action;
+ $this->inner_process($action);
+ }
+
+ } catch(Exception $e){
+ $failed=true;
+ }
+
+ if ($this->connector->sql->is_global_transaction()){
+ if (!$failed)
+ for ($i=0; $i < sizeof($results); $i++)
+ if ($results[$i]->get_status()=="error" || $results[$i]->get_status()=="invalid"){
+ $failed=true;
+ break;
+ }
+ if ($failed){
+ for ($i=0; $i < sizeof($results); $i++)
+ $results[$i]->error();
+ $this->connector->sql->rollback_transaction();
+ }
+ else
+ $this->connector->sql->commit_transaction();
+ }
+
+ $this->output_as_xml($results);
+ }
+
+ /*! converts status string to the inner mode name
+
+ @param status
+ external status string
+ @return
+ inner mode name
+ */
+ protected function status_to_mode($status){
+ switch($status){
+ case "updated":
+ return "update";
+ break;
+ case "inserted":
+ return "insert";
+ break;
+ case "deleted":
+ return "delete";
+ break;
+ default:
+ return $status;
+ break;
+ }
+ }
+ /*! process data updated request received
+
+ @param action
+ DataAction object
+ @return
+ DataAction object with details of processing
+ */
+ protected function inner_process($action){
+
+ if ($this->connector->sql->is_record_transaction())
+ $this->connector->sql->begin_transaction();
+
+ try{
+
+ $mode = $this->status_to_mode($action->get_status());
+ if (!$this->connector->access->check($mode)){
+ LogMaster::log("Access control: {$operation} operation blocked");
+ $action->error();
+ } else {
+ $check = $this->connector->event->trigger("beforeProcessing",$action);
+ if (!$action->is_ready())
+ $this->check_exts($action,$mode);
+ $check = $this->connector->event->trigger("afterProcessing",$action);
+ }
+
+ } catch (Exception $e){
+ $action->set_status("error");
+ }
+
+ if ($this->connector->sql->is_record_transaction()){
+ if ($action->get_status()=="error" || $action->get_status()=="invalid")
+ $this->connector->sql->rollback_transaction();
+ else
+ $this->connector->sql->commit_transaction();
+ }
+
+ return $action;
+ }
+ /*! check if some event intercepts processing, send data to DataWrapper in other case
+
+ @param action
+ DataAction object
+ @param mode
+ name of inner mode ( will be used to generate event names )
+ */
+ function check_exts($action,$mode){
+ $old_config = new DataConfig($this->config);
+
+ $this->connector->event->trigger("before".$mode,$action);
+ if ($action->is_ready())
+ LogMaster::log("Event code for ".$mode." processed");
+ else {
+ //check if custom sql defined
+ $sql = $this->connector->sql->get_sql($mode,$action);
+ if ($sql)
+ $this->connector->sql->query($sql);
+ else{
+ $action->sync_config($this->config);
+ $method=array($this->connector->sql,$mode);
+ if (!is_callable($method))
+ throw new Exception("Unknown dataprocessing action: ".$mode);
+ call_user_func($method,$action,$this->request);
+ }
+ }
+ $this->connector->event->trigger("after".$mode,$action);
+
+ $this->config = $old_config;
+ }
+
+ /*! output xml response for dataprocessor
+
+ @param results
+ array of DataAction objects
+ */
+ function output_as_xml($results){
+ LogMaster::log("Edit operation finished",$results);
+ ob_clean();
+ header("Content-type:text/xml");
+ echo "<?xml version='1.0' ?>";
+ echo "<data>";
+ for ($i=0; $i < sizeof($results); $i++)
+ echo $results[$i]->to_xml();
+ echo "</data>";
+ }
+
+}
+
+/*! contain all info related to action and controls customizaton
+**/
+class DataAction{
+ private $status; //!< cuurent status of record
+ private $id;//!< id of record
+ private $data;//!< data hash of record
+ private $userdata;//!< hash of extra data , attached to record
+ private $nid;//!< new id value , after operation executed
+ private $output;//!< custom output to client side code
+ private $attrs;//!< hash of custtom attributes
+ private $ready;//!< flag of operation's execution
+ private $addf;//!< array of added fields
+ private $delf;//!< array of deleted fields
+
+
+ /*! constructor
+
+ @param status
+ current operation status
+ @param id
+ record id
+ @param data
+ hash of data
+ */
+ function __construct($status,$id,$data){
+ $this->status=$status;
+ $this->id=$id;
+ $this->data=$data;
+ $this->nid=$id;
+
+ $this->output="";
+ $this->attrs=array();
+ $this->ready=false;
+
+ $this->addf=array();
+ $this->delf=array();
+ }
+
+
+ /*! add custom field and value to DB operation
+
+ @param name
+ name of field which will be added to DB operation
+ @param value
+ value which will be used for related field in DB operation
+ */
+ function add_field($name,$value){
+ LogMaster::log("adding field: ".$name.", with value: ".$value);
+ $this->data[$name]=$value;
+ $this->addf[]=$name;
+ }
+ /*! remove field from DB operation
+
+ @param name
+ name of field which will be removed from DB operation
+ */
+ function remove_field($name){
+ LogMaster::log("removing field: ".$name);
+ $this->delf[]=$name;
+ }
+
+ /*! sync field configuration with external object
+
+ @param slave
+ SQLMaster object
+ @todo
+ check , if all fields removed then cancel action
+ */
+ function sync_config($slave){
+ foreach ($this->addf as $k => $v)
+ $slave->add_field($v);
+ foreach ($this->delf as $k => $v)
+ $slave->remove_field($v);
+ }
+ /*! get value of some record's propery
+
+ @param name
+ name of record's property ( name of db field or alias )
+ @return
+ value of related property
+ */
+ function get_value($name){
+ if (!array_key_exists($name,$this->data)){
+ LogMaster::log("Incorrect field name used: ".$name);
+ LogMaster::log("data",$this->data);
+ return "";
+ }
+ return $this->data[$name];
+ }
+ /*! set value of some record's propery
+
+ @param name
+ name of record's property ( name of db field or alias )
+ @param value
+ value of related property
+ */
+ function set_value($name,$value){
+ LogMaster::log("change value of: ".$name." as: ".$value);
+ $this->data[$name]=$value;
+ }
+ /*! get hash of data properties
+
+ @return
+ hash of data properties
+ */
+ function get_data(){
+ return $this->data;
+ }
+ /*! get some extra info attached to record
+ deprecated, exists just for backward compatibility, you can use set_value instead of it
+ @param name
+ name of userdata property
+ @return
+ value of related userdata property
+ */
+ function get_userdata_value($name){
+ return $this->get_value($name);
+ }
+ /*! set some extra info attached to record
+ deprecated, exists just for backward compatibility, you can use get_value instead of it
+ @param name
+ name of userdata property
+ @param value
+ value of userdata property
+ */
+ function set_userdata_value($name,$value){
+ return $this->set_value($name,$value);
+ }
+ /*! get current status of record
+
+ @return
+ string with status value
+ */
+ function get_status(){
+ return $this->status;
+ }
+ /*! assign new status to the record
+
+ @param status
+ new status value
+ */
+ function set_status($status){
+ $this->status=$status;
+ }
+ /*! get id of current record
+
+ @return
+ id of record
+ */
+ function get_id(){
+ return $this->id;
+ }
+ /*! sets custom response text
+
+ can be accessed through defineAction on client side. Text wrapped in CDATA, so no extra escaping necessary
+ @param text
+ custom response text
+ */
+ function set_response_text($text){
+ $this->set_response_xml("<![CDATA[".$text."]]>");
+ }
+ /*! sets custom response xml
+
+ can be accessed through defineAction on client side
+ @param text
+ string with XML data
+ */
+ function set_response_xml($text){
+ $this->output=$text;
+ }
+ /*! sets custom response attributes
+
+ can be accessed through defineAction on client side
+ @param name
+ name of custom attribute
+ @param value
+ value of custom attribute
+ */
+ function set_response_attribute($name,$value){
+ $this->attrs[$name]=$value;
+ }
+ /*! check if action finished
+
+ @return
+ true if action finished, false otherwise
+ */
+ function is_ready(){
+ return $this->ready;
+ }
+ /*! return new id value
+
+ equal to original ID normally, after insert operation - value assigned for new DB record
+ @return
+ new id value
+ */
+ function get_new_id(){
+ return $this->nid;
+ }
+
+ /*! set result of operation as error
+ */
+ function error(){
+ $this->status="error";
+ $this->ready=true;
+ }
+ /*! set result of operation as invalid
+ */
+ function invalid(){
+ $this->status="invalid";
+ $this->ready=true;
+ }
+ /*! confirm successful opeation execution
+ @param id
+ new id value, optional
+ */
+ function success($id=false){
+ if ($id!==false)
+ $this->nid = $id;
+ $this->ready=true;
+ }
+ /*! convert DataAction to xml format compatible with client side dataProcessor
+ @return
+ DataAction operation report as XML string
+ */
+ function to_xml(){
+ $str="<action type='{$this->status}' sid='{$this->id}' tid='{$this->nid}' ";
+ foreach ($this->attrs as $k => $v) {
+ $str.=$k."='".$v."' ";
+ }
+ $str.=">{$this->output}</action>";
+ return $str;
+ }
+ /*! convert self to string ( for logs )
+
+ @return
+ DataAction operation report as plain string
+ */
+ function __toString(){
+ return "action:{$this->status}; sid:{$this->id}; tid:{$this->nid};";
+ }
+
+
+}
+
+
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_common.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_common.php
new file mode 100644
index 00000000000..7ef239c0488
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_common.php
@@ -0,0 +1,959 @@
+<?php
+require_once("tools.php");
+
+/*! manager of data request
+**/
+class DataRequestConfig{
+ private $filters; //!< array of filtering rules
+ private $relation=false; //!< ID or other element used for linking hierarchy
+ private $sort_by; //!< sorting field
+ private $start; //!< start of requested data
+ private $count; //!< length of requested data
+
+ private $user;
+ private $version;
+
+ //for render_sql
+ private $source; //!< souce table or another source destination
+ private $fieldset; //!< set of data, which need to be retrieved from source
+
+ /*! constructor
+
+ @param proto
+ DataRequestConfig object, optional, if provided then new request object will copy all properties from provided one
+ */
+ public function __construct($proto=false){
+ if ($proto)
+ $this->copy($proto);
+ else{
+ $start=0;
+ $this->filters=array();
+ $this->sort_by=array();
+ }
+ }
+
+ /*! copy parameters of source object into self
+
+ @param proto
+ source object
+ */
+ public function copy($proto){
+ $this->filters =$proto->get_filters();
+ $this->sort_by =$proto->get_sort_by();
+ $this->count =$proto->get_count();
+ $this->start =$proto->get_start();
+ $this->source =$proto->get_source();
+ $this->fieldset =$proto->get_fieldset();
+ $this->relation =$proto->get_relation();
+ $this->user = $proto->user;
+ $this->version = $proto->version;
+ }
+
+ /*! convert self to string ( for logs )
+ @return
+ self as plain string,
+ */
+ public function __toString(){
+ $str="Source:{$this->source}\nFieldset:{$this->fieldset}\nWhere:";
+ for ($i=0; $i < sizeof($this->filters); $i++)
+ $str.=$this->filters[$i]["name"]." ".$this->filters[$i]["operation"]." ".$this->filters[$i]["value"].";";
+ $str.="\nStart:{$this->start}\nCount:{$this->count}\n";
+ for ($i=0; $i < sizeof($this->sort_by); $i++)
+ $str.=$this->sort_by[$i]["name"]."=".$this->sort_by[$i]["direction"].";";
+ $str.="\nRelation:{$this->relation}";
+ return $str;
+ }
+
+ /*! returns set of filtering rules
+ @return
+ set of filtering rules
+ */
+ public function get_filters(){
+ return $this->filters;
+ }
+ public function &get_filters_ref(){
+ return $this->filters;
+ }
+ public function set_filters($data){
+ $this->filters=$data;
+ }
+
+
+ public function get_user(){
+ return $this->user;
+ }
+ public function set_user($user){
+ $this->user = $user;
+ }
+ public function get_version(){
+ return $this->version;
+ }
+ public function set_version($version){
+ $this->version = $version;
+ }
+
+ /*! returns list of used fields
+ @return
+ list of used fields
+ */
+ public function get_fieldset(){
+ return $this->fieldset;
+ }
+ /*! returns name of source table
+ @return
+ name of source table
+ */
+ public function get_source(){
+ return $this->source;
+ }
+ /*! returns set of sorting rules
+ @return
+ set of sorting rules
+ */
+ public function get_sort_by(){
+ return $this->sort_by;
+ }
+ public function &get_sort_by_ref(){
+ return $this->sort_by;
+ }
+ public function set_sort_by($data){
+ $this->sort_by=$data;
+ }
+
+ /*! returns start index
+ @return
+ start index
+ */
+ public function get_start(){
+ return $this->start;
+ }
+ /*! returns count of requested records
+ @return
+ count of requested records
+ */
+ public function get_count(){
+ return $this->count;
+ }
+ /*! returns name of relation id
+ @return
+ relation id name
+ */
+ public function get_relation(){
+ return $this->relation;
+ }
+
+ /*! sets sorting rule
+
+ @param field
+ name of column
+ @param order
+ direction of sorting
+ */
+ public function set_sort($field,$order=false){
+ if (!$field && !$order)
+ $this->sort_by=array();
+ else{
+ $order=strtolower($order)=="asc"?"ASC":"DESC";
+ $this->sort_by[]=array("name"=>$field,"direction" => $order);
+ }
+ }
+ /*! sets filtering rule
+
+ @param field
+ name of column
+ @param value
+ value for filtering
+ @param operation
+ operation for filtering, optional , LIKE by default
+ */
+ public function set_filter($field,$value,$operation=false){
+ array_push($this->filters,array("name"=>$field,"value"=>$value,"operation"=>$operation));
+ }
+
+ /*! sets list of used fields
+
+ @param value
+ list of used fields
+ */
+ public function set_fieldset($value){
+ $this->fieldset=$value;
+ }
+ /*! sets name of source table
+
+ @param value
+ name of source table
+ */
+ public function set_source($value){
+ $this->source=trim($value);
+ if (!$this->source) throw new Exception("Source of data can't be empty");
+ }
+ /*! sets data limits
+
+ @param start
+ start index
+ @param count
+ requested count of data
+ */
+ public function set_limit($start,$count){
+ $this->start=$start;
+ $this->count=$count;
+ }
+ /*! sets name of relation id
+
+ @param value
+ name of relation id field
+ */
+ public function set_relation($value){
+ $this->relation=$value;
+ }
+ /*! parse incoming sql, to fill other properties
+
+ @param sql
+ incoming sql string
+ */
+ public function parse_sql($sql){
+ $sql= preg_replace("/[ \n\t]+limit[\n ,0-9]/i","",$sql);
+
+ $data = preg_split("/[ \n\t]+\\_from\\_/i",$sql,2);
+ if (count($data)!=2)
+ $data = preg_split("/[ \n\t]+from/i",$sql,2);
+ $this->fieldset = preg_replace("/^[\s]*select/i","",$data[0],1);
+
+ $table_data = preg_split("/[ \n\t]+where/i",$data[1],2);
+ if (sizeof($table_data)>1){ //where construction exists
+ $this->set_source($table_data[0]);
+ $where_data = preg_split("/[ \n\t]+order[ ]+by/i",$table_data[1],2);
+ $this->filters[]=$where_data[0];
+ if (sizeof($where_data)==1) return; //end of line detected
+ $data=$where_data[1];
+ } else {
+ $table_data = preg_split("/[ \n\t]+order[ ]+by/i",$table_data[0],2);
+ $this->set_source($table_data[0]);
+ if (sizeof($table_data)==1) return; //end of line detected
+ $data=$table_data[1];
+ }
+
+ if (trim($data)){ //order by construction exists
+ $s_data = preg_split("/\\,/",trim($data));
+ for ($i=0; $i < count($s_data); $i++) {
+ $data=preg_split("/[ ]+/",trim($s_data[$i]),2);
+ $this->set_sort($data[0],$data[1]);
+ }
+
+ }
+ }
+}
+
+/*! manager of data configuration
+**/
+class DataConfig{
+ public $id;////!< name of ID field
+ public $relation_id;//!< name or relation ID field
+ public $text;//!< array of text fields
+ public $data;//!< array of all known fields , fields which exists only in this collection will not be included in dataprocessor's operations
+
+
+ /*! converts self to the string, for logging purposes
+ **/
+ public function __toString(){
+ $str="ID:{$this->id['db_name']}(ID:{$this->id['name']})\n";
+ $str.="Relation ID:{$this->relation_id['db_name']}({$this->relation_id['name']})\n";
+ $str.="Data:";
+ for ($i=0; $i<sizeof($this->text); $i++)
+ $str.="{$this->text[$i]['db_name']}({$this->text[$i]['name']}),";
+
+ $str.="\nExtra:";
+ for ($i=0; $i<sizeof($this->data); $i++)
+ $str.="{$this->data[$i]['db_name']}({$this->data[$i]['name']}),";
+
+ return $str;
+ }
+
+ /*! removes un-used fields from configuration
+ @param name
+ name of field , which need to be preserved
+ */
+ public function minimize($name){
+ for ($i=0; $i < sizeof($this->text); $i++){
+ if ($this->text[$i]["name"]==$name){
+ $this->text[$i]["name"]="value";
+ $this->data=array($this->text[$i]);
+ $this->text=array($this->text[$i]);
+ return;
+ }
+ }
+ throw new Exception("Incorrect dataset minimization, master field not found.");
+ }
+
+ public function limit_fields($data){
+ if (isset($this->full_field_list))
+ $this->restore_fields();
+ $this->full_field_list = $this->text;
+ $this->text = array();
+
+ for ($i=0; $i < sizeof($this->full_field_list); $i++) {
+ if (array_key_exists($this->full_field_list[$i]["name"],$data))
+ $this->text[] = $this->full_field_list[$i];
+ }
+ }
+
+ public function restore_fields(){
+ if (isset($this->full_field_list))
+ $this->text = $this->full_field_list;
+ }
+
+ /*! initialize inner state by parsing configuration parameters
+
+ @param id
+ name of id field
+ @param fields
+ name of data field(s)
+ @param extra
+ name of extra field(s)
+ @param relation
+ name of relation field
+
+ */
+ public function init($id,$fields,$extra,$relation){
+ $this->id = $this->parse($id,false);
+ $this->text = $this->parse($fields,true);
+ $this->data = array_merge($this->text,$this->parse($extra,true));
+ $this->relation_id = $this->parse($relation,false);
+ }
+
+ /*! parse configuration string
+
+ @param key
+ key string from configuration
+ @param mode
+ multi names flag
+ @return
+ parsed field name object
+ */
+ private function parse($key,$mode){
+ if ($mode){
+ if (!$key) return array();
+ $key=explode(",",$key);
+ for ($i=0; $i < sizeof($key); $i++)
+ $key[$i]=$this->parse($key[$i],false);
+ return $key;
+ }
+ $key=explode("(",$key);
+ $data=array("db_name"=>trim($key[0]), "name"=>trim($key[0]));
+ if (sizeof($key)>1)
+ $data["name"]=substr(trim($key[1]),0,-1);
+ return $data;
+ }
+
+ /*! constructor
+ init public collectons
+ @param proto
+ DataConfig object used as prototype for new one, optional
+ */
+ public function __construct($proto=false){
+ if ($proto!==false)
+ $this->copy($proto);
+ else {
+ $this->text=array();
+ $this->data=array();
+ $this->id=array("name"=>"dhx_auto_id", "db_name"=>"dhx_auto_id");
+ $this->relation_id=array("name"=>"", "db_name"=>"");
+ }
+ }
+
+ /*! copy properties from source object
+
+ @param proto
+ source object
+ */
+ public function copy($proto){
+ $this->id = $proto->id;
+ $this->relation_id = $proto->relation_id;
+ $this->text = $proto->text;
+ $this->data = $proto->data;
+ }
+
+ /*! returns list of data fields (db_names)
+ @return
+ list of data fields ( ready to be used in SQL query )
+ */
+ public function db_names_list($db){
+ $out=array();
+ if ($this->id["db_name"])
+ array_push($out,$db->escape_name($this->id["db_name"]));
+ if ($this->relation_id["db_name"])
+ array_push($out,$db->escape_name($this->relation_id["db_name"]));
+
+ for ($i=0; $i < sizeof($this->data); $i++){
+ if ($this->data[$i]["db_name"]!=$this->data[$i]["name"])
+ $out[]=$db->escape_name($this->data[$i]["db_name"])." as ".$this->data[$i]["name"];
+ else
+ $out[]=$db->escape_name($this->data[$i]["db_name"]);
+ }
+
+ return $out;
+ }
+
+ /*! add field to dataset config ($text collection)
+
+ added field will be used in all auto-generated queries
+ @param name
+ name of field
+ @param aliase
+ aliase of field, optional
+ */
+ public function add_field($name,$aliase=false){
+ if ($aliase===false) $aliase=$name;
+
+ //adding to list of data-active fields
+ if ($this->id["db_name"]==$name || $this->relation_id["db_name"] == $name){
+ LogMaster::log("Field name already used as ID, be sure that it is really necessary.");
+ }
+ if ($this->is_field($name,$this->text)!=-1)
+ throw new Exception('Data field already registered: '.$name);
+ array_push($this->text,array("db_name"=>$name,"name"=>$aliase));
+
+ //adding to list of all fields as well
+ if ($this->is_field($name,$this->data)==-1)
+ array_push($this->data,array("db_name"=>$name,"name"=>$aliase));
+
+ }
+
+ /*! remove field from dataset config ($text collection)
+
+ removed field will be excluded from all auto-generated queries
+ @param name
+ name of field, or aliase of field
+ */
+ public function remove_field($name){
+ $ind = $this->is_field($name);
+ if ($ind==-1) throw new Exception('There was no such data field registered as: '.$name);
+ array_splice($this->text,$ind,1);
+ //we not deleting field from $data collection, so it will not be included in data operation, but its data still available
+ }
+
+ /*! check if field is a part of dataset
+
+ @param name
+ name of field
+ @param collection
+ collection, against which check will be done, $text collection by default
+ @return
+ returns true if field already a part of dataset, otherwise returns true
+ */
+ private function is_field($name,$collection = false){
+ if (!$collection)
+ $collection=$this->text;
+
+ for ($i=0; $i<sizeof($collection); $i++)
+ if ($collection[$i]["name"] == $name || $collection[$i]["db_name"] == $name) return $i;
+ return -1;
+ }
+
+
+}
+
+/*! Base abstraction class, used for data operations
+ Class abstract access to data, it is a base class to all DB wrappers
+**/
+abstract class DataWrapper{
+ protected $connection;
+ protected $config;//!< DataConfig instance
+ /*! constructor
+ @param connection
+ DB connection
+ @param config
+ DataConfig instance
+ */
+ public function __construct($connection,$config){
+ $this->config=$config;
+ $this->connection=$connection;
+ }
+
+ /*! insert record in storage
+
+ @param data
+ DataAction object
+ @param source
+ DataRequestConfig object
+ */
+ abstract function insert($data,$source);
+
+ /*! delete record from storage
+
+ @param data
+ DataAction object
+ @param source
+ DataRequestConfig object
+ */
+ abstract function delete($data,$source);
+
+ /*! update record in storage
+
+ @param data
+ DataAction object
+ @param source
+ DataRequestConfig object
+ */
+ abstract function update($data,$source);
+
+ /*! select record from storage
+
+ @param source
+ DataRequestConfig object
+ */
+ abstract function select($source);
+
+ /*! get size of storage
+
+ @param source
+ DataRequestConfig object
+ */
+ abstract function get_size($source);
+
+ /*! get all variations of field in storage
+
+ @param name
+ name of field
+ @param source
+ DataRequestConfig object
+ */
+ abstract function get_variants($name,$source);
+
+ /*! checks if there is a custom sql string for specified db operation
+
+ @param name
+ name of DB operation
+ @param data
+ hash of data
+ @return
+ sql string
+ */
+ public function get_sql($name,$data){
+ return ""; //custom sql not supported by default
+ }
+
+ /*! begins DB transaction
+ */
+ public function begin_transaction(){
+ throw new Exception("Data wrapper not supports transactions.");
+ }
+ /*! commits DB transaction
+ */
+ public function commit_transaction(){
+ throw new Exception("Data wrapper not supports transactions.");
+ }
+ /*! rollbacks DB transaction
+ */
+ public function rollback_transaction(){
+ throw new Exception("Data wrapper not supports transactions.");
+ }
+}
+
+/*! Common database abstraction class
+ Class provides base set of methods to access and change data in DB, class used as a base for DB-specific wrappers
+**/
+abstract class DBDataWrapper extends DataWrapper{
+ private $transaction = false; //!< type of transaction
+ private $sequence=false;//!< sequence name
+ private $sqls = array();//!< predefined sql actions
+
+
+ /*! assign named sql query
+ @param name
+ name of sql query
+ @param data
+ sql query text
+ */
+ public function attach($name,$data){
+ $name=strtolower($name);
+ $this->sqls[$name]=$data;
+ }
+ /*! replace vars in sql string with actual values
+
+ @param matches
+ array of field name matches
+ @return
+ value for the var name
+ */
+ public function get_sql_callback($matches){
+ return $this->escape($this->temp->get_value($matches[1]));
+ }
+ public function get_sql($name,$data){
+ $name=strtolower($name);
+ if (!array_key_exists($name,$this->sqls)) return "";
+
+
+ $str = $this->sqls[$name];
+ $this->temp = $data; //dirty
+ $str = preg_replace_callback('|\{([^}]+)\}|',array($this,"get_sql_callback"),$str);
+ unset ($this->temp); //dirty
+ return $str;
+ }
+
+ public function insert($data,$source){
+ $sql=$this->insert_query($data,$source);
+ $this->query($sql);
+ $data->success($this->get_new_id());
+ }
+ public function delete($data,$source){
+ $sql=$this->delete_query($data,$source);
+ $this->query($sql);
+ $data->success();
+ }
+ public function update($data,$source){
+ $sql=$this->update_query($data,$source);
+ $this->query($sql);
+ $data->success();
+ }
+ public function select($source){
+ $select=$source->get_fieldset();
+ if (!$select){
+ $select=$this->config->db_names_list($this);
+ $select = implode(",",$select);
+ }
+
+ $where=$this->build_where($source->get_filters(),$source->get_relation());
+ $sort=$this->build_order($source->get_sort_by());
+
+ return $this->query($this->select_query($select,$source->get_source(),$where,$sort,$source->get_start(),$source->get_count()));
+ }
+ public function get_size($source){
+ $count = new DataRequestConfig($source);
+
+ $count->set_fieldset("COUNT(*) as DHX_COUNT ");
+ $count->set_sort(null);
+ $count->set_limit(0,0);
+
+ $res=$this->select($count);
+ $data=$this->get_next($res);
+ if (array_key_exists("DHX_COUNT",$data)) return $data["DHX_COUNT"];
+ else return $data["dhx_count"]; //postgresql
+ }
+ public function get_variants($name,$source){
+ $count = new DataRequestConfig($source);
+ $count->set_fieldset("DISTINCT ".$this->escape_name($name)." as value");
+ $count->set_sort(null);
+ $count->set_limit(0,0);
+
+ return $this->select($count);
+ }
+
+ public function sequence($sec){
+ $this->sequence=$sec;
+ }
+
+
+ /*! create an sql string for filtering rules
+
+ @param rules
+ set of filtering rules
+ @param relation
+ name of relation id field
+ @return
+ sql string with filtering rules
+ */
+ protected function build_where($rules,$relation=false){
+ $sql=array();
+ for ($i=0; $i < sizeof($rules); $i++)
+ if (is_string($rules[$i]))
+ array_push($sql,$rules[$i]);
+ else
+ if ($rules[$i]["value"]!=""){
+ if (!$rules[$i]["operation"])
+ array_push($sql,$this->escape_name($rules[$i]["name"])." LIKE '%".$this->escape($rules[$i]["value"])."%'");
+ else
+ array_push($sql,$this->escape_name($rules[$i]["name"])." ".$rules[$i]["operation"]." '".$this->escape($rules[$i]["value"])."'");
+ }
+ if ($relation!==false)
+ array_push($sql,$this->escape_name($this->config->relation_id["db_name"])." = '".$this->escape($relation)."'");
+ return implode(" AND ",$sql);
+ }
+ /*! convert sorting rules to sql string
+
+ @param by
+ set of sorting rules
+ @return
+ sql string for set of sorting rules
+ */
+ protected function build_order($by){
+ if (!sizeof($by)) return "";
+ $out = array();
+ for ($i=0; $i < sizeof($by); $i++)
+ if ($by[$i]["name"])
+ $out[]=$this->escape_name($by[$i]["name"])." ".$by[$i]["direction"];
+ return implode(",",$out);
+ }
+
+ /*! generates sql code for select operation
+
+ @param select
+ list of fields in select
+ @param from
+ table name
+ @param where
+ list of filtering rules
+ @param sort
+ list of sorting rules
+ @param start
+ start index of fetching
+ @param count
+ count of records to fetch
+ @return
+ sql string for select operation
+ */
+ protected function select_query($select,$from,$where,$sort,$start,$count){
+ $sql="SELECT ".$select." FROM ".$from;
+ if ($where) $sql.=" WHERE ".$where;
+ if ($sort) $sql.=" ORDER BY ".$sort;
+ if ($start || $count) $sql.=" LIMIT ".$start.",".$count;
+ return $sql;
+ }
+ /*! generates update sql
+
+ @param data
+ DataAction object
+ @param request
+ DataRequestConfig object
+ @return
+ sql string, which updates record with provided data
+ */
+ protected function update_query($data,$request){
+ $sql="UPDATE ".$request->get_source()." SET ";
+ $temp=array();
+ for ($i=0; $i < sizeof($this->config->text); $i++) {
+ $step=$this->config->text[$i];
+
+ if ($data->get_value($step["name"])===Null)
+ $step_value ="Null";
+ else
+ $step_value = "'".$this->escape($data->get_value($step["name"]))."'";
+ $temp[$i]= $this->escape_name($step["db_name"])."=". $step_value;
+ }
+ if ($relation = $this->config->relation_id["db_name"]){
+ $temp[]= $this->escape_name($relation)."='".$this->escape($data->get_value($relation))."'";
+ }
+ $sql.=implode(",",$temp)." WHERE ".$this->escape_name($this->config->id["db_name"])."='".$this->escape($data->get_id())."'";
+
+ //if we have limited set - set constraints
+ $where=$this->build_where($request->get_filters(),$request->get_relation());
+ if ($where) $sql.=" AND (".$where.")";
+
+ return $sql;
+ }
+
+ /*! generates delete sql
+
+ @param data
+ DataAction object
+ @param request
+ DataRequestConfig object
+ @return
+ sql string, which delete record
+ */
+ protected function delete_query($data,$request){
+ $sql="DELETE FROM ".$request->get_source();
+ $sql.=" WHERE ".$this->escape_name($this->config->id["db_name"])."='".$this->escape($data->get_id())."'";
+
+ //if we have limited set - set constraints
+ $where=$this->build_where($request->get_filters(),$request->get_relation());
+ if ($where) $sql.=" AND (".$where.")";
+
+ return $sql;
+ }
+
+ /*! generates insert sql
+
+ @param data
+ DataAction object
+ @param request
+ DataRequestConfig object
+ @return
+ sql string, which inserts new record with provided data
+ */
+ protected function insert_query($data,$request){
+ $temp_n=array();
+ $temp_v=array();
+ foreach($this->config->text as $k => $v){
+ $temp_n[$k]=$this->escape_name($v["db_name"]);
+ if ($data->get_value($v["name"])===Null)
+ $temp_v[$k]="Null";
+ else
+ $temp_v[$k]="'".$this->escape($data->get_value($v["name"]))."'";
+ }
+ if ($relation = $this->config->relation_id["db_name"]){
+ $temp_n[]=$this->escape_name($relation);
+ $temp_v[]="'".$this->escape($data->get_value($relation))."'";
+ }
+ if ($this->sequence){
+ $temp_n[]=$this->escape_name($this->config->id["db_name"]);
+ $temp_v[]=$this->sequence;
+ }
+
+ $sql="INSERT INTO ".$request->get_source()."(".implode(",",$temp_n).") VALUES (".implode(",",$temp_v).")";
+
+ return $sql;
+ }
+
+ /*! sets the transaction mode, used by dataprocessor
+
+ @param mode
+ mode name
+ */
+ public function set_transaction_mode($mode){
+ if ($mode!="none" && $mode!="global" && $mode!="record")
+ throw new Exception("Unknown transaction mode");
+ $this->transaction=$mode;
+ }
+ /*! returns true if global transaction mode was specified
+ @return
+ true if global transaction mode was specified
+ */
+ public function is_global_transaction(){
+ return $this->transaction == "global";
+ }
+ /*! returns true if record transaction mode was specified
+ @return
+ true if record transaction mode was specified
+ */
+ public function is_record_transaction(){
+ return $this->transaction == "record";
+ }
+
+
+ public function begin_transaction(){
+ $this->query("BEGIN");
+ }
+ public function commit_transaction(){
+ $this->query("COMMIT");
+ }
+ public function rollback_transaction(){
+ $this->query("ROLLBACK");
+ }
+
+ /*! exec sql string
+
+ @param sql
+ sql string
+ @return
+ sql result set
+ */
+ abstract protected function query($sql);
+ /*! returns next record from result set
+
+ @param res
+ sql result set
+ @return
+ hash of data
+ */
+ abstract public function get_next($res);
+ /*! returns new id value, for newly inserted row
+ @return
+ new id value, for newly inserted row
+ */
+ abstract protected function get_new_id();
+ /*! escape data to prevent sql injections
+ @param data
+ unescaped data
+ @return
+ escaped data
+ */
+ abstract public function escape($data);
+
+ /*! escape field name to prevent sql reserved words conflict
+ @param data
+ unescaped data
+ @return
+ escaped data
+ */
+ public function escape_name($data){
+ return $data;
+ }
+
+ /*! get list of tables in the database
+
+ @return
+ array of table names
+ */
+ public function tables_list() {
+ throw new Exception("Not implemented");
+ }
+
+ /*! returns list of fields for the table in question
+
+ @param table
+ name of table in question
+ @return
+ array of field names
+ */
+ public function fields_list($table) {
+ throw new Exception("Not implemented");
+ }
+
+}
+/*! Implementation of DataWrapper for MySQL
+**/
+class MySQLDBDataWrapper extends DBDataWrapper{
+ protected $last_result;
+ public function query($sql){
+ LogMaster::log($sql);
+ $res=mysql_query($sql,$this->connection);
+ if ($res===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
+ $this->last_result = $res;
+ return $res;
+ }
+
+ public function get_next($res){
+ if (!$res)
+ $res = $this->last_result;
+
+ return mysql_fetch_assoc($res);
+ }
+
+ protected function get_new_id(){
+ return mysql_insert_id($this->connection);
+ }
+
+ public function escape($data){
+ return mysql_real_escape_string($data);
+ }
+
+ public function tables_list() {
+ $result = mysql_query("SHOW TABLES");
+ if ($result===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
+
+ $tables = array();
+ while ($table = mysql_fetch_array($result)) {
+ $tables[] = $table[0];
+ }
+ return $tables;
+ }
+
+ public function fields_list($table) {
+ $result = mysql_query("SHOW COLUMNS FROM `".$table."`");
+ if ($result===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
+
+ $fields = array();
+ $id = "";
+ while ($field = mysql_fetch_assoc($result)) {
+ if ($field['Key'] == "PRI")
+ $id = $field["Field"];
+ else
+ $fields[] = $field["Field"];
+ }
+ return array("fields" => $fields, "key" => $id );
+ }
+
+ /*! escape field name to prevent sql reserved words conflict
+ @param data
+ unescaped data
+ @return
+ escaped data
+ */
+ public function escape_name($data){
+ if ((strpos($data,"`")!==false || intval($data)==$data) || (strpos($data,".")!==false))
+ return $data;
+ return '`'.$data.'`';
+ }
+}
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mssql.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mssql.php
new file mode 100644
index 00000000000..4cad2217878
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mssql.php
@@ -0,0 +1,66 @@
+<?php
+require_once("db_common.php");
+/*! MSSQL implementation of DataWrapper
+**/
+class MsSQLDBDataWrapper extends DBDataWrapper{
+ private $last_id=""; //!< ID of previously inserted record
+ private $insert_operation=false; //!< flag of insert operation
+ private $start_from=false; //!< index of start position
+
+ public function query($sql){
+ LogMaster::log($sql);
+ $res = mssql_query($sql,$this->connection);
+ if ($this->insert_operation){
+ $last = mssql_fetch_assoc($res);
+ $this->last_id = $last["dhx_id"];
+ mssql_free_result($res);
+ }
+ if ($this->start_from)
+ mssql_data_seek($res,$this->start_from);
+ return $res;
+ }
+
+ public function get_next($res){
+ return mssql_fetch_assoc($res);
+ }
+
+ protected function get_new_id(){
+ /*
+ MSSQL doesn't support identity or auto-increment fields
+ Insert SQL returns new ID value, which stored in last_id field
+ */
+ return $this->last_id;
+ }
+
+ protected function insert_query($data,$request){
+ $sql = parent::insert_query($data,$request);
+ $this->insert_operation=true;
+ return $sql.";SELECT @@IDENTITY AS dhx_id";
+ }
+
+ protected function select_query($select,$from,$where,$sort,$start,$count){
+ $sql="SELECT " ;
+ if ($count)
+ $sql.=" TOP ".($count+$start);
+ $sql.=" ".$select." FROM ".$from;
+ if ($where) $sql.=" WHERE ".$where;
+ if ($sort) $sql.=" ORDER BY ".$sort;
+ if ($start && $count)
+ $this->start_from=$start;
+ else
+ $this->start_from=false;
+ return $sql;
+ }
+
+ public function escape($data){
+ /*
+ there is no special escaping method for mssql - use common logic
+ */
+ return str_replace("'","''",$data);
+ }
+
+ public function begin_transaction(){
+ $this->query("BEGIN TRAN");
+ }
+}
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mysqli.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mysqli.php
new file mode 100644
index 00000000000..a33ca71bbe4
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mysqli.php
@@ -0,0 +1,53 @@
+<?php
+
+require_once("db_common.php");
+
+class MySQLiDBDataWrapper extends MySQLDBDataWrapper{
+
+ public function query($sql){
+ LogMaster::log($sql);
+ $res = $this->connection->query($sql);
+ if ($res===false) throw new Exception("MySQL operation failed\n".$this->connection->error);
+ return $res;
+ }
+
+ public function get_next($res){
+ return $res->fetch_assoc();
+ }
+
+ protected function get_new_id(){
+ return $this->connection->insert_id;
+ }
+
+ public function escape($data){
+ return $this->connection->real_escape_string($data);
+ }
+
+ public function tables_list() {
+ $result = $this->connection->query("SHOW TABLES");
+ if ($result===false) throw new Exception("MySQL operation failed\n".$this->connection->error);
+
+ $tables = array();
+ while ($table = $result->fetch_array()) {
+ $tables[] = $table[0];
+ }
+ return $tables;
+ }
+
+ public function fields_list($table) {
+ $result = $this->connection->query("SHOW COLUMNS FROM `".$table."`");
+ if ($result===false) throw new Exception("MySQL operation failed\n".$this->connection->error);
+ $fields = array();
+ while ($field = $result->fetch_array()) {
+ if ($field['Key'] == "PRI") {
+ $fields[$field[0]] = 1;
+ } else {
+ $fields[$field[0]] = 0;
+ }
+ }
+ return $fields;
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_oracle.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_oracle.php
new file mode 100644
index 00000000000..46c3e88bebe
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_oracle.php
@@ -0,0 +1,79 @@
+<?php
+require_once("db_common.php");
+/*! Implementation of DataWrapper for Oracle
+**/
+class OracleDBDataWrapper extends DBDataWrapper{
+ private $last_id=""; //id of previously inserted record
+ private $insert_operation=false; //flag of insert operation
+
+ public function query($sql){
+ LogMaster::log($sql);
+ $stm = oci_parse($this->connection,$sql);
+ if ($stm===false) throw new Exception("Oracle - sql parsing failed\n".oci_error($this->connection));
+
+ $out = array(0=>null);
+ if($this->insert_operation){
+ oci_bind_by_name($stm,":outID",$out[0],999);
+ $this->insert_operation=false;
+ }
+
+
+ $mode = ($this->is_record_transaction() || $this->is_global_transaction())?OCI_DEFAULT:OCI_COMMIT_ON_SUCCESS;
+ $res=oci_execute($stm,$mode);
+ if ($res===false) throw new Exception("Oracle - sql execution failed\n".oci_error($this->connection));
+
+ $this->last_id=$out[0];
+
+ return $stm;
+ }
+
+ public function get_next($res){
+ $data = oci_fetch_assoc($res);
+ if (array_key_exists("VALUE",$data))
+ $data["value"]=$data["VALUE"];
+ return $data;
+ }
+
+ protected function get_new_id(){
+ /*
+ Oracle doesn't support identity or auto-increment fields
+ Insert SQL returns new ID value, which stored in last_id field
+ */
+ return $this->last_id;
+ }
+
+ protected function insert_query($data,$request){
+ $sql = parent::insert_query($data,$request);
+ $this->insert_operation=true;
+ return $sql." returning ".$this->config->id["db_name"]." into :outID";
+ }
+
+ protected function select_query($select,$from,$where,$sort,$start,$count){
+ $sql="SELECT ".$select." FROM ".$from;
+ if ($where) $sql.=" WHERE ".$where;
+ if ($sort) $sql.=" ORDER BY ".$sort;
+ if ($start || $count)
+ $sql="SELECT * FROM ( select /*+ FIRST_ROWS(".$count.")*/dhx_table.*, ROWNUM rnum FROM (".$sql.") dhx_table where ROWNUM <= ".($count+$start)." ) where rnum >".$start;
+ return $sql;
+ }
+
+ public function escape($data){
+ /*
+ as far as I can see the only way to escape data is by using oci_bind_by_name
+ while it is neat solution in common case, it conflicts with existing SQL building logic
+ fallback to simple escaping
+ */
+ return str_replace("'","''",$data);
+ }
+
+ public function begin_transaction(){
+ //auto-start of transaction
+ }
+ public function commit_transaction(){
+ oci_commit($this->connection);
+ }
+ public function rollback_transaction(){
+ oci_rollback($this->connection);
+ }
+}
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_pdo.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_pdo.php
new file mode 100644
index 00000000000..8fb6cf4578b
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_pdo.php
@@ -0,0 +1,65 @@
+<?php
+require_once("db_common.php");
+/*! Implementation of DataWrapper for PDO
+
+if you plan to use it for Oracle - use Oracle connection type instead
+**/
+class PDODBDataWrapper extends DBDataWrapper{
+ private $last_result;//!< store result or last operation
+
+ public function query($sql){
+ LogMaster::log($sql);
+
+ $res=$this->connection->query($sql);
+ if ($res===false) throw new Exception("PDO - sql execution failed\n".$this->connection->errorInfo());
+
+ return new PDOResultSet($res);
+ }
+
+ protected function select_query($select,$from,$where,$sort,$start,$count){
+ $sql="SELECT ".$select." FROM ".$from;
+ if ($where) $sql.=" WHERE ".$where;
+ if ($sort) $sql.=" ORDER BY ".$sort;
+ if ($start || $count) {
+ if ($this->connection->getAttribute(PDO::ATTR_DRIVER_NAME)=="pgsql")
+ $sql.=" OFFSET ".$start." LIMIT ".$count;
+ else
+ $sql.=" LIMIT ".$start.",".$count;
+ }
+ return $sql;
+ }
+
+
+ public function get_next($res){
+ $data = $res->next();
+ return $data;
+ }
+
+ protected function get_new_id(){
+ return $this->connection->lastInsertId();
+ }
+
+ public function escape($str){
+ $res=$this->connection->quote($str);
+ if ($res===false) //not supported by pdo driver
+ return str_replace("'","''",$str);
+ return substr($res,1,-1);
+ }
+
+}
+
+class PDOResultSet{
+ private $res;
+ public function __construct($res){
+ $this->res = $res;
+ }
+ public function next(){
+ $data = $this->res->fetch(PDO::FETCH_ASSOC);
+ if (!$data){
+ $this->res->closeCursor();
+ return null;
+ }
+ return $data;
+ }
+}
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_postgre.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_postgre.php
new file mode 100644
index 00000000000..08f1b1aaa79
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_postgre.php
@@ -0,0 +1,66 @@
+<?php
+require_once("db_common.php");
+/*! Implementation of DataWrapper for PostgreSQL
+**/
+class PostgreDBDataWrapper extends DBDataWrapper{
+ public function query($sql){
+ LogMaster::log($sql);
+
+ $res=pg_query($this->connection,$sql);
+ if ($res===false) throw new Exception("Postgre - sql execution failed\n".pg_last_error($this->connection));
+
+ return $res;
+ }
+
+ protected function select_query($select,$from,$where,$sort,$start,$count){
+ $sql="SELECT ".$select." FROM ".$from;
+ if ($where) $sql.=" WHERE ".$where;
+ if ($sort) $sql.=" ORDER BY ".$sort;
+ if ($start || $count)
+ $sql.=" OFFSET ".$start." LIMIT ".$count;
+ return $sql;
+ }
+
+ public function get_next($res){
+ return pg_fetch_assoc($res);
+ }
+
+ protected function get_new_id(){
+ $res = pg_query( $this->connection, "SELECT LASTVAL() AS seq");
+ $data = pg_fetch_assoc($res);
+ pg_free_result($res);
+ return $data['seq'];
+ }
+
+ public function escape($data){
+ //need to use oci_bind_by_name
+ return pg_escape_string($this->connection,$data);
+ }
+
+ public function tables_list() {
+ $sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'";
+ $res = pg_query($this->connection, $sql);
+ $tables = array();
+ while ($table = pg_fetch_assoc($res)) {
+ $tables[] = $table['table_name'];
+ }
+ return $tables;
+ }
+
+ public function fields_list($table) {
+ $sql = "SELECT * FROM information_schema.constraint_column_usage";
+ $result = pg_query($this->connection, $sql);
+ $field = pg_fetch_assoc($result);
+ $id = $field['column_name'];
+
+ $sql = "SELECT * FROM information_schema.columns WHERE table_name ='".$table."';";
+ $result = pg_query($this->connection, $sql);
+ $fields = array();
+ $id = "";
+ while ($field = pg_fetch_assoc($result)) {
+ $fields[] = $field["column_name"];
+ }
+ return array('fields' => $fields, 'key' => $id );
+ }
+}
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/grid_connector.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/grid_connector.php
new file mode 100644
index 00000000000..5167528739f
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/grid_connector.php
@@ -0,0 +1,268 @@
+<?php
+require_once("base_connector.php");
+require_once("grid_config.php");
+
+//require_once("grid_dataprocessor.php");
+
+/*! DataItem class for Grid component
+**/
+
+class GridDataItem extends DataItem{
+ protected $row_attrs;//!< hash of row attributes
+ protected $cell_attrs;//!< hash of cell attributes
+ protected $userdata;
+
+ function __construct($data,$name,$index=0){
+ parent::__construct($data,$name,$index);
+
+ $this->row_attrs=array();
+ $this->cell_attrs=array();
+ $this->userdata=array();
+ }
+ /*! set color of row
+
+ @param color
+ color of row
+ */
+ function set_row_color($color){
+ $this->row_attrs["bgColor"]=$color;
+ }
+ /*! set style of row
+
+ @param color
+ color of row
+ */
+ function set_row_style($color){
+ $this->row_attrs["style"]=$color;
+ }
+ /*! assign custom style to the cell
+
+ @param name
+ name of column
+ @param value
+ css style string
+ */
+ function set_cell_style($name,$value){
+ $this->set_cell_attribute($name,"style",$value);
+ }
+ /*! assign custom class to specific cell
+
+ @param name
+ name of column
+ @param value
+ css class name
+ */
+ function set_cell_class($name,$value){
+ $this->set_cell_attribute($name,"class",$value);
+ }
+ /*! set custom cell attribute
+
+ @param name
+ name of column
+ @param attr
+ name of attribute
+ @param value
+ value of attribute
+ */
+ function set_cell_attribute($name,$attr,$value){
+ if (!$this->cell_attrs[$name]) $this->cell_attrs[$name]=array();
+ $this->cell_attrs[$name][$attr]=$value;
+ }
+
+ /*! set userdata section for the item
+
+ @param name
+ name of userdata
+ @param value
+ value of userdata
+ */
+ function set_userdata($name, $value){
+ $this->userdata[$name]=$value;
+ }
+
+ /*! set custom row attribute
+
+ @param attr
+ name of attribute
+ @param value
+ value of attribute
+ */
+ function set_row_attribute($attr,$value){
+ $this->row_attrs[$attr]=$value;
+ }
+
+ /*! return self as XML string, starting part
+ */
+ public function to_xml_start(){
+ if ($this->skip) return "";
+
+ $str="<row id='".$this->get_id()."'";
+ foreach ($this->row_attrs as $k=>$v)
+ $str.=" ".$k."='".$v."'";
+ $str.=">";
+ for ($i=0; $i < sizeof($this->config->text); $i++){
+ $str.="<cell";
+ $name=$this->config->text[$i]["name"];
+ if (isset($this->cell_attrs[$name])){
+ $cattrs=$this->cell_attrs[$name];
+ foreach ($cattrs as $k => $v)
+ $str.=" ".$k."='".$this->xmlentities($v)."'";
+ }
+ $str.="><![CDATA[".$this->data[$name]."]]></cell>";
+ }
+ foreach ($this->userdata as $key => $value)
+ $str.="<userdata name='".$key."'><![CDATA[".$value."]]></userdata>";
+
+ return $str;
+ }
+ /*! return self as XML string, ending part
+ */
+ public function to_xml_end(){
+ if ($this->skip) return "";
+
+ return "</row>";
+ }
+}
+/*! Connector for the dhtmlxgrid
+**/
+class GridConnector extends Connector{
+ protected $extra_output="";//!< extra info which need to be sent to client side
+ private $options=array();//!< hash of OptionsConnector
+
+ /*! constructor
+
+ Here initilization of all Masters occurs, execution timer initialized
+ @param res
+ db connection resource
+ @param type
+ string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+ @param item_type
+ name of class, which will be used for item rendering, optional, DataItem will be used by default
+ @param data_type
+ name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default.
+ */
+ public function __construct($res,$type=false,$item_type=false,$data_type=false){
+ if (!$item_type) $item_type="GridDataItem";
+ if (!$data_type) $data_type="GridDataProcessor";
+ parent::__construct($res,$type,$item_type,$data_type);
+ }
+
+
+ protected function parse_request(){
+ parent::parse_request();
+
+ if (isset($_GET["dhx_colls"]))
+ $this->fill_collections($_GET["dhx_colls"]);
+
+ if (isset($_GET["posStart"]) && isset($_GET["count"]))
+ $this->request->set_limit($_GET["posStart"],$_GET["count"]);
+ }
+ protected function resolve_parameter($name){
+ if (intval($name).""==$name)
+ return $this->config->text[intval($name)]["db_name"];
+ return $name;
+ }
+
+ /*! replace xml unsafe characters
+
+ @param string
+ string to be escaped
+ @return
+ escaped string
+ */
+ private function xmlentities($string) {
+ return str_replace( array( '&', '"', "'", '<', '>', '’' ), array( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;', '&apos;' ), $string);
+ }
+
+ /*! assign options collection to the column
+
+ @param name
+ name of the column
+ @param options
+ array or connector object
+ */
+ public function set_options($name,$options){
+ if (is_array($options)){
+ $str="";
+ foreach($options as $k => $v)
+ $str.="<item value='".$this->xmlentities($k)."' label='".$this->xmlentities($v)."' />";
+ $options=$str;
+ }
+ $this->options[$name]=$options;
+ }
+ /*! generates xml description for options collections
+
+ @param list
+ comma separated list of column names, for which options need to be generated
+ */
+ protected function fill_collections($list){
+ $names=explode(",",$list);
+ for ($i=0; $i < sizeof($names); $i++) {
+ $name = $this->resolve_parameter($names[$i]);
+ if (!array_key_exists($name,$this->options)){
+ $this->options[$name] = new DistinctOptionsConnector($this->get_connection(),$this->names["db_class"]);
+ $c = new DataConfig($this->config);
+ $r = new DataRequestConfig($this->request);
+ $c->minimize($name);
+
+ $this->options[$name]->render_connector($c,$r);
+ }
+
+ $this->extra_output.="<coll_options for='{$names[$i]}'>";
+ if (!is_string($this->options[$name]))
+ $this->extra_output.=$this->options[$name]->render();
+ else
+ $this->extra_output.=$this->options[$name];
+ $this->extra_output.="</coll_options>";
+ }
+ }
+
+ /*! renders self as xml, starting part
+ */
+ protected function xml_start(){
+ if ($this->dload){
+ if ($pos=$this->request->get_start())
+ return "<rows pos='".$pos."'>";
+ else
+ return "<rows total_count='".$this->sql->get_size($this->request)."'>";
+ }
+ else
+ return "<rows>";
+ }
+
+
+ /*! renders self as xml, ending part
+ */
+ protected function xml_end(){
+ return $this->extra_output."</rows>";
+ }
+
+ public function set_config($config = false){
+ if (gettype($config) == 'boolean')
+ $config = new GridConfiguration($config);
+
+ $this->event->attach("beforeOutput", Array($config, "attachHeaderToXML"));
+ }
+}
+
+/*! DataProcessor class for Grid component
+**/
+class GridDataProcessor extends DataProcessor{
+
+ /*! convert incoming data name to valid db name
+ converts c0..cN to valid field names
+ @param data
+ data name from incoming request
+ @return
+ related db_name
+ */
+ function name_data($data){
+ if ($data == "gr_id") return $this->config->id["name"];
+ $parts=explode("c",$data);
+ if ($parts[0]=="" && intval($parts[1])==$parts[1])
+ return $this->config->text[intval($parts[1])]["name"];
+ return $data;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/scheduler_connector.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/scheduler_connector.php
new file mode 100644
index 00000000000..82a1f4601e0
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/scheduler_connector.php
@@ -0,0 +1,121 @@
+<?php
+require_once("base_connector.php");
+
+/*! DataItem class for Scheduler component
+**/
+class SchedulerDataItem extends DataItem{
+ /*! return self as XML string
+ */
+ function to_xml(){
+ if ($this->skip) return "";
+
+ $str="<event id='".$this->get_id()."' >";
+ $str.="<start_date><![CDATA[".$this->data[$this->config->text[0]["name"]]."]]></start_date>";
+ $str.="<end_date><![CDATA[".$this->data[$this->config->text[1]["name"]]."]]></end_date>";
+ $str.="<text><![CDATA[".$this->data[$this->config->text[2]["name"]]."]]></text>";
+ for ($i=3; $i<sizeof($this->config->text); $i++){
+ $extra = $this->config->text[$i]["name"];
+ $str.="<".$extra."><![CDATA[".$this->data[$extra]."]]></".$extra.">";
+ }
+ return $str."</event>";
+ }
+}
+
+
+/*! Connector class for dhtmlxScheduler
+**/
+class SchedulerConnector extends Connector{
+
+ protected $extra_output="";//!< extra info which need to be sent to client side
+ private $options=array();//!< hash of OptionsConnector
+
+
+ /*! assign options collection to the column
+
+ @param name
+ name of the column
+ @param options
+ array or connector object
+ */
+ public function set_options($name,$options){
+ if (is_array($options)){
+ $str="";
+ foreach($options as $k => $v)
+ $str.="<item value='".$this->xmlentities($k)."' label='".$this->xmlentities($v)."' />";
+ $options=$str;
+ }
+ $this->options[$name]=$options;
+ }
+ /*! generates xml description for options collections
+
+ @param list
+ comma separated list of column names, for which options need to be generated
+ */
+ protected function fill_collections(){
+ foreach ($this->options as $k=>$v) {
+ $name = $k;
+ $this->extra_output.="<coll_options for='{$name}'>";
+ if (!is_string($this->options[$name]))
+ $this->extra_output.=$this->options[$name]->render();
+ else
+ $this->extra_output.=$this->options[$name];
+ $this->extra_output.="</coll_options>";
+ }
+ }
+
+ /*! renders self as xml, ending part
+ */
+ protected function xml_end(){
+ $this->fill_collections();
+ return $this->extra_output."</data>";
+ }
+
+
+ /*! constructor
+
+ Here initilization of all Masters occurs, execution timer initialized
+ @param res
+ db connection resource
+ @param type
+ string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+ @param item_type
+ name of class, which will be used for item rendering, optional, DataItem will be used by default
+ @param data_type
+ name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default.
+ */
+ public function __construct($res,$type=false,$item_type=false,$data_type=false){
+ if (!$item_type) $item_type="SchedulerDataItem";
+ if (!$data_type) $data_type="SchedulerDataProcessor";
+ parent::__construct($res,$type,$item_type,$data_type);
+ }
+
+ //parse GET scoope, all operations with incoming request must be done here
+ function parse_request(){
+ parent::parse_request();
+ if (count($this->config->text)){
+ if (isset($_GET["to"]))
+ $this->request->set_filter($this->config->text[0]["name"],$_GET["to"],"<");
+ if (isset($_GET["from"]))
+ $this->request->set_filter($this->config->text[1]["name"],$_GET["from"],">");
+ }
+ }
+}
+
+/*! DataProcessor class for Scheduler component
+**/
+class SchedulerDataProcessor extends DataProcessor{
+ function name_data($data){
+ if ($data=="start_date")
+ return $this->config->text[0]["db_name"];
+ if ($data=="id")
+ return $this->config->id["db_name"];
+ if ($data=="end_date")
+ return $this->config->text[1]["db_name"];
+ if ($data=="text")
+ return $this->config->text[2]["db_name"];
+
+ return $data;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/tools.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/tools.php
new file mode 100644
index 00000000000..c5b92e6ab2b
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/tools.php
@@ -0,0 +1,254 @@
+<?php
+/*!
+ @file
+ Inner classes, which do common tasks. No one of them is purposed for direct usage.
+*/
+
+/*! Class which allows to assign|fire events.
+*/
+class EventMaster{
+ private $events;//!< hash of event handlers
+ private static $eventsStatic=array();
+
+ /*! constructor
+ */
+ function __construct(){
+ $this->events=array();
+ }
+ /*! Method check if event with such name already exists.
+ @param name
+ name of event, case non-sensitive
+ @return
+ true if event with such name registered, false otherwise
+ */
+ public function exist($name){
+ $name=strtolower($name);
+ return (isset($this->events[$name]) && sizeof($this->events[$name]));
+ }
+ /*! Attach custom code to event.
+
+ Only on event handler can be attached in the same time. If new event handler attached - old will be detached.
+
+ @param name
+ name of event, case non-sensitive
+ @param method
+ function which will be attached. You can use array(class, method) if you want to attach the method of the class.
+ */
+ public function attach($name,$method){
+ $name=strtolower($name);
+ if (!array_key_exists($name,$this->events))
+ $this->events[$name]=array();
+ $this->events[$name][]=$method;
+ }
+
+ public static function attach_static($name, $method){
+ $name=strtolower($name);
+ if (!array_key_exists($name,EventMaster::$eventsStatic))
+ EventMaster::$eventsStatic[$name]=array();
+ EventMaster::$eventsStatic[$name][]=$method;
+ }
+
+ public static function trigger_static($name, $method){
+ $arg_list = func_get_args();
+ $name=strtolower(array_shift($arg_list));
+
+ if (isset(EventMaster::$eventsStatic[$name]))
+ foreach(EventMaster::$eventsStatic[$name] as $method){
+ if (is_array($method) && !method_exists($method[0],$method[1]))
+ throw new Exception("Incorrect method assigned to event: ".$method[0].":".$method[1]);
+ if (!is_array($method) && !function_exists($method))
+ throw new Exception("Incorrect function assigned to event: ".$method);
+ call_user_func_array($method, $arg_list);
+ }
+ return true;
+ }
+
+ /*! Detach code from event
+ @param name
+ name of event, case non-sensitive
+ */
+ public function detach($name){
+ $name=strtolower($name);
+ unset($this->events[$name]);
+ }
+ /*! Trigger event.
+ @param name
+ name of event, case non-sensitive
+ @param data
+ value which will be provided as argument for event function,
+ you can provide multiple data arguments, method accepts variable number of parameters
+ @return
+ true if event handler was not assigned , result of event hangler otherwise
+ */
+ public function trigger($name,$data){
+ $arg_list = func_get_args();
+ $name=strtolower(array_shift($arg_list));
+
+ if (isset($this->events[$name]))
+ foreach($this->events[$name] as $method){
+ if (is_array($method) && !method_exists($method[0],$method[1]))
+ throw new Exception("Incorrect method assigned to event: ".$method[0].":".$method[1]);
+ if (!is_array($method) && !function_exists($method))
+ throw new Exception("Incorrect function assigned to event: ".$method);
+ call_user_func_array($method, $arg_list);
+ }
+ return true;
+ }
+}
+
+/*! Class which handles access rules.
+**/
+class AccessMaster{
+ private $rules,$local;
+ /*! constructor
+
+ Set next access right to "allowed" by default : read, insert, update, delete
+ Basically - all common data operations allowed by default
+ */
+ function __construct(){
+ $this->rules=array("read" => true, "insert" => true, "update" => true, "delete" => true);
+ $this->local=true;
+ }
+ /*! change access rule to "allow"
+ @param name
+ name of access right
+ */
+ public function allow($name){
+ $this->rules[$name]=true;
+ }
+ /*! change access rule to "deny"
+
+ @param name
+ name of access right
+ */
+ public function deny($name){
+ $this->rules[$name]=false;
+ }
+
+ /*! change all access rules to "deny"
+ */
+ public function deny_all(){
+ $this->rules=array();
+ }
+
+ /*! check access rule
+
+ @param name
+ name of access right
+ @return
+ true if access rule allowed, false otherwise
+ */
+ public function check($name){
+ if ($this->local){
+ /*!
+ todo
+ add referrer check, to prevent access from remote points
+ */
+ }
+ if (!isset($this->rules[$name]) || !$this->rules[$name]){
+ return false;
+ }
+ return true;
+ }
+}
+
+/*! Controls error and debug logging.
+ Class designed to be used as static object.
+**/
+class LogMaster{
+ private static $_log=false;//!< logging mode flag
+ private static $_output=false;//!< output error infor to client flag
+ private static $session="";//!< all messages generated for current request
+
+ /*! convert array to string representation ( it is a bit more readable than var_dump )
+
+ @param data
+ data object
+ @param pref
+ prefix string, used for formating, optional
+ @return
+ string with array description
+ */
+ private static function log_details($data,$pref=""){
+ if (is_array($data)){
+ $str=array("");
+ foreach($data as $k=>$v)
+ array_push($str,$pref.$k." => ".LogMaster::log_details($v,$pref."\t"));
+ return implode("\n",$str);
+ }
+ return $data;
+ }
+ /*! put record in log
+
+ @param str
+ string with log info, optional
+ @param data
+ data object, which will be added to log, optional
+ */
+ public static function log($str="",$data=""){
+ if (LogMaster::$_log){
+ $message = $str.LogMaster::log_details($data)."\n\n";
+ LogMaster::$session.=$message;
+ error_log($message,3,LogMaster::$_log);
+ }
+ }
+
+ /*! get logs for current request
+ @return
+ string, which contains all log messages generated for current request
+ */
+ public static function get_session_log(){
+ return LogMaster::$session;
+ }
+
+ /*! error handler, put normal php errors in log file
+
+ @param errn
+ error number
+ @param errstr
+ error description
+ @param file
+ error file
+ @param line
+ error line
+ @param context
+ error cntext
+ */
+ public static function error_log($errn,$errstr,$file,$line,$context){
+ LogMaster::log($errstr." at ".$file." line ".$line);
+ }
+
+ /*! exception handler, used as default reaction on any error - show execution log and stop processing
+
+ @param exception
+ instance of Exception
+ */
+ public static function exception_log($exception){
+ LogMaster::log("!!!Uncaught Exception\nCode: " . $exception->getCode() . "\nMessage: " . $exception->getMessage());
+ if (LogMaster::$_output){
+ echo "<pre><xmp>\n";
+ echo LogMaster::get_session_log();
+ echo "\n</xmp></pre>";
+ }
+ die();
+ }
+
+ /*! enable logging
+
+ @param name
+ path to the log file, if boolean false provided as value - logging will be disabled
+ @param output
+ flag of client side output, if enabled - session log will be sent to client side in case of an error.
+ */
+ public static function enable_log($name,$output=false){
+ LogMaster::$_log=$name;
+ LogMaster::$_output=$output;
+ if ($name){
+ set_error_handler(array("LogMaster","error_log"),E_ALL);
+ set_exception_handler(array("LogMaster","exception_log"));
+ LogMaster::log("\n\n====================================\nLog started, ".date("d/m/Y h:m:s")."\n====================================");
+ }
+ }
+}
+
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/tree_connector.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/tree_connector.php
new file mode 100644
index 00000000000..21886548d50
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/tree_connector.php
@@ -0,0 +1,274 @@
+<?php
+require_once("base_connector.php");
+
+/*! DataItem class for Tree component
+**/
+
+class TreeDataItem extends DataItem{
+ private $im0;//!< image of closed folder
+ private $im1;//!< image of opened folder
+ private $im2;//!< image of leaf item
+ private $check;//!< checked state
+ private $kids=-1;//!< checked state
+ private $attrs;//!< collection of custom attributes
+
+ function __construct($data,$config,$index){
+ parent::__construct($data,$config,$index);
+
+ $this->im0=false;
+ $this->im1=false;
+ $this->im2=false;
+ $this->check=false;
+ $this->attrs = array();
+ $this->userdata = array();
+ }
+ /*! get id of parent record
+
+ @return
+ id of parent record
+ */
+ function get_parent_id(){
+ return $this->data[$this->config->relation_id["name"]];
+ }
+ /*! get state of items checkbox
+
+ @return
+ state of item's checkbox as int value, false if state was not defined
+ */
+ function get_check_state(){
+ return $this->check;
+ }
+ /*! set state of item's checkbox
+
+ @param value
+ int value, 1 - checked, 0 - unchecked, -1 - third state
+ */
+ function set_check_state($value){
+ $this->check=$value;
+ }
+
+ /*! return count of child items
+ -1 if there is no info about childs
+ @return
+ count of child items
+ */
+ function has_kids(){
+ return $this->kids;
+ }
+ /*! sets count of child items
+ @param value
+ count of child items
+ */
+ function set_kids($value){
+ $this->kids=$value;
+ }
+
+ /*! set custom attribute
+
+ @param name
+ name of the attribute
+ @param value
+ new value of the attribute
+ */
+ function set_attribute($name, $value){
+ switch($name){
+ case "id":
+ $this->set_id($value);
+ break;
+ case "text":
+ $this->data[$this->config->text[0]["name"]]=$value;
+ break;
+ case "checked":
+ $this->set_check_state($value);
+ break;
+ case "im0":
+ $this->im0=$value;
+ break;
+ case "im1":
+ $this->im1=$value;
+ break;
+ case "im2":
+ $this->im2=$value;
+ break;
+ case "child":
+ $this->set_kids($value);
+ break;
+ default:
+ $this->attrs[$name]=$value;
+ }
+ }
+
+ /*! set userdata section for the item
+
+ @param name
+ name of userdata
+ @param value
+ value of userdata
+ */
+ function set_userdata($name, $value){
+ $this->userdata[$name]=$value;
+ }
+
+ /*! assign image for tree's item
+
+ @param img_folder_closed
+ image for item, which represents folder in closed state
+ @param img_folder_open
+ image for item, which represents folder in opened state, optional
+ @param img_leaf
+ image for item, which represents leaf item, optional
+ */
+ function set_image($img_folder_closed,$img_folder_open=false,$img_leaf=false){
+ $this->im0=$img_folder_closed;
+ $this->im1=$img_folder_open?$img_folder_open:$img_folder_closed;
+ $this->im2=$img_leaf?$img_leaf:$img_folder_closed;
+ }
+ /*! return self as XML string, starting part
+ */
+ function to_xml_start(){
+ if ($this->skip) return "";
+
+ $str1="<item id='".$this->get_id()."' text='".$this->xmlentities($this->data[$this->config->text[0]["name"]])."' ";
+ if ($this->has_kids()==true) $str1.="child='".$this->has_kids()."' ";
+ if ($this->im0) $str1.="im0='".$this->im0."' ";
+ if ($this->im1) $str1.="im1='".$this->im0."' ";
+ if ($this->im2) $str1.="im2='".$this->im0."' ";
+ if ($this->check) $str1.="checked='".$this->check."' ";
+ foreach ($this->attrs as $key => $value)
+ $str1.=$key."='".$this->xmlentities($value)."' ";
+ $str1.=">";
+ foreach ($this->userdata as $key => $value)
+ $str1.="<userdata name='".$key."'><![CDATA[".$value."]]></userdata>";
+
+ return $str1;
+ }
+ /*! return self as XML string, ending part
+ */
+ function to_xml_end(){
+ if ($this->skip) return "";
+ return "</item>";
+ }
+
+}
+
+require_once("filesystem_item.php");
+
+/*! Connector for the dhtmlxtree
+**/
+class TreeConnector extends Connector{
+ private $id_swap = array();
+
+ /*! constructor
+
+ Here initilization of all Masters occurs, execution timer initialized
+ @param res
+ db connection resource
+ @param type
+ string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+ @param item_type
+ name of class, which will be used for item rendering, optional, DataItem will be used by default
+ @param data_type
+ name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default.
+ */
+ public function __construct($res,$type=false,$item_type=false,$data_type=false){
+ if (!$item_type) $item_type="TreeDataItem";
+ if (!$data_type) $data_type="TreeDataProcessor";
+ parent::__construct($res,$type,$item_type,$data_type);
+
+ $this->event->attach("afterInsert",array($this,"parent_id_correction_a"));
+ $this->event->attach("beforeProcessing",array($this,"parent_id_correction_b"));
+ }
+
+ /*! store info about ID changes during insert operation
+ @param dataAction
+ data action object during insert operation
+ */
+ public function parent_id_correction_a($dataAction){
+ $this->id_swap[$dataAction->get_id()]=$dataAction->get_new_id();
+ }
+ /*! update ID if it was affected by previous operation
+ @param dataAction
+ data action object, before any processing operation
+ */
+ public function parent_id_correction_b($dataAction){
+ $relation = $this->config->relation_id["db_name"];
+ $value = $dataAction->get_value($relation);
+
+ if (array_key_exists($value,$this->id_swap))
+ $dataAction->set_value($relation,$this->id_swap[$value]);
+ }
+
+
+ public function parse_request(){
+ parent::parse_request();
+
+ if (isset($_GET["id"]))
+ $this->request->set_relation($_GET["id"]);
+ else
+ $this->request->set_relation("0");
+
+ $this->request->set_limit(0,0); //netralize default reaction on dyn. loading mode
+ }
+
+
+
+ protected function render_set($res){
+ $output="";
+ $index=0;
+ while ($data=$this->sql->get_next($res)){
+ $data = new $this->names["item_class"]($data,$this->config,$index);
+ $this->event->trigger("beforeRender",$data);
+ //there is no info about child elements,
+ //if we are using dyn. loading - assume that it has,
+ //in normal mode juse exec sub-render routine
+ if ($data->has_kids()===-1 && $this->dload)
+ $data->set_kids(true);
+ $output.=$data->to_xml_start();
+ if ($data->has_kids()===-1 || ( $data->has_kids()==true && !$this->dload)){
+ $sub_request = new DataRequestConfig($this->request);
+ $sub_request->set_relation($data->get_id());
+ $output.=$this->render_set($this->sql->select($sub_request));
+ }
+ $output.=$data->to_xml_end();
+ $index++;
+ }
+ return $output;
+ }
+ /*! renders self as xml, starting part
+ */
+ public function xml_start(){
+ return "<tree id='".$this->request->get_relation()."'>";
+ }
+
+ /*! renders self as xml, ending part
+ */
+ public function xml_end(){
+ return "</tree>";
+ }
+}
+
+
+class TreeDataProcessor extends DataProcessor{
+
+ function __construct($connector,$config,$request){
+ parent::__construct($connector,$config,$request);
+ $request->set_relation(false);
+ }
+
+ /*! convert incoming data name to valid db name
+ converts c0..cN to valid field names
+ @param data
+ data name from incoming request
+ @return
+ related db_name
+ */
+ function name_data($data){
+ if ($data=="tr_pid")
+ return $this->config->relation_id["db_name"];
+ if ($data=="tr_text")
+ return $this->config->text[0]["db_name"];
+ return $data;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/treegrid_connector.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/treegrid_connector.php
new file mode 100644
index 00000000000..b410cb46527
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/treegrid_connector.php
@@ -0,0 +1,161 @@
+<?php
+require_once("grid_connector.php");
+
+/*! DataItem class for TreeGrid component
+**/
+class TreeGridDataItem extends GridDataItem{
+ private $kids=-1;//!< checked state
+
+ function __construct($data,$config,$index){
+ parent::__construct($data,$config,$index);
+ $this->im0=false;
+ }
+ /*! return id of parent record
+
+ @return
+ id of parent record
+ */
+ function get_parent_id(){
+ return $this->data[$this->config->relation_id["name"]];
+ }
+ /*! assign image to treegrid's item
+ longer description
+ @param img
+ relative path to the image
+ */
+ function set_image($img){
+ $this->set_cell_attribute($this->config->text[0]["name"],"image",$img);
+ }
+
+ /*! return count of child items
+ -1 if there is no info about childs
+ @return
+ count of child items
+ */
+ function has_kids(){
+ return $this->kids;
+ }
+ /*! sets count of child items
+ @param value
+ count of child items
+ */
+ function set_kids($value){
+ $this->kids=$value;
+ if ($value)
+ $this->set_row_attribute("xmlkids",$value);
+ }
+}
+/*! Connector for dhtmlxTreeGrid
+**/
+class TreeGridConnector extends GridConnector{
+ private $id_swap = array();
+
+ /*! constructor
+
+ Here initilization of all Masters occurs, execution timer initialized
+ @param res
+ db connection resource
+ @param type
+ string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+ @param item_type
+ name of class, which will be used for item rendering, optional, DataItem will be used by default
+ @param data_type
+ name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default.
+ */
+ public function __construct($res,$type=false,$item_type=false,$data_type=false){
+ if (!$item_type) $item_type="TreeGridDataItem";
+ if (!$data_type) $data_type="TreeGridDataProcessor";
+ parent::__construct($res,$type,$item_type,$data_type);
+
+ $this->event->attach("afterInsert",array($this,"parent_id_correction_a"));
+ $this->event->attach("beforeProcessing",array($this,"parent_id_correction_b"));
+ }
+
+ /*! store info about ID changes during insert operation
+ @param dataAction
+ data action object during insert operation
+ */
+ public function parent_id_correction_a($dataAction){
+ $this->id_swap[$dataAction->get_id()]=$dataAction->get_new_id();
+ }
+ /*! update ID if it was affected by previous operation
+ @param dataAction
+ data action object, before any processing operation
+ */
+ public function parent_id_correction_b($dataAction){
+ $relation = $this->config->relation_id["db_name"];
+ $value = $dataAction->get_value($relation);
+
+ if (array_key_exists($value,$this->id_swap))
+ $dataAction->set_value($relation,$this->id_swap[$value]);
+ }
+
+ /*! process treegrid specific options in incoming request
+ */
+ public function parse_request(){
+ parent::parse_request();
+
+ if (isset($_GET["id"]))
+ $this->request->set_relation($_GET["id"]);
+ else
+ $this->request->set_relation("0");
+
+ $this->request->set_limit(0,0); //netralize default reaction on dyn. loading mode
+ }
+
+ /*! process treegrid specific options in incoming request
+ */
+ protected function render_set($res){
+ $output="";
+ $index=0;
+ while ($data=$this->sql->get_next($res)){
+ $data = new $this->names["item_class"]($data,$this->config,$index);
+ $this->event->trigger("beforeRender",$data);
+ //there is no info about child elements,
+ //if we are using dyn. loading - assume that it has,
+ //in normal mode juse exec sub-render routine
+ if ($data->has_kids()===-1 && $this->dload)
+ $data->set_kids(true);
+ $output.=$data->to_xml_start();
+ if ($data->has_kids()===-1 || ( $data->has_kids()==true && !$this->dload)){
+ $sub_request = new DataRequestConfig($this->request);
+ $sub_request->set_relation($data->get_id());
+ $output.=$this->render_set($this->sql->select($sub_request));
+ }
+ $output.=$data->to_xml_end();
+ $index++;
+ }
+ return $output;
+ }
+
+ /*! renders self as xml, starting part
+ */
+ protected function xml_start(){
+ return "<rows parent='".$this->request->get_relation()."'>";
+ }
+}
+
+/*! DataProcessor class for Grid component
+**/
+class TreeGridDataProcessor extends GridDataProcessor{
+
+ function __construct($connector,$config,$request){
+ parent::__construct($connector,$config,$request);
+ $request->set_relation(false);
+ }
+
+ /*! convert incoming data name to valid db name
+ converts c0..cN to valid field names
+ @param data
+ data name from incoming request
+ @return
+ related db_name
+ */
+ function name_data($data){
+
+ if ($data=="gr_pid")
+ return $this->config->relation_id["name"];
+ else return parent::name_data($data);
+ }
+}
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/update.php b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/update.php
new file mode 100644
index 00000000000..014a326b051
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/connector/update.php
@@ -0,0 +1,262 @@
+<?php
+
+/*! DataItemUpdate class for realization Optimistic concurrency control
+ Wrapper for DataItem object
+ It's used during outputing updates instead of DataItem object
+ Create wrapper for every data item with update information.
+*/
+class DataItemUpdate extends DataItem {
+
+
+ /*! constructor
+ @param data
+ hash of data
+ @param config
+ DataConfig object
+ @param index
+ index of element
+ */
+ public function __construct($data,$config,$index,$type){
+ $this->config=$config;
+ $this->data=$data;
+ $this->index=$index;
+ $this->skip=false;
+ $this->child = new $type($data, $config, $index);
+ }
+
+ /*! returns parent_id (for Tree and TreeGrid components)
+ */
+ public function get_parent_id(){
+ if (method_exists($this->child, 'get_parent_id')) {
+ return $this->child->get_parent_id();
+ } else {
+ return '';
+ }
+ }
+
+
+ /*! generate XML on the data hash base
+ */
+ public function to_xml(){
+ $str= "<update ";
+ $str .= 'status="'.$this->data['type'].'" ';
+ $str .= 'id="'.$this->data['dataId'].'" ';
+ $str .= 'parent="'.$this->get_parent_id().'"';
+ $str .= '>';
+ $str .= $this->child->to_xml();
+ $str .= '</update>';
+ return $str;
+ }
+
+ /*! return starting tag for XML string
+ */
+ public function to_xml_start(){
+ $str="<update ";
+ $str .= 'status="'.$this->data['type'].'" ';
+ $str .= 'id="'.$this->data['dataId'].'" ';
+ $str .= 'parent="'.$this->get_parent_id().'"';
+ $str .= '>';
+ $str .= $this->child->to_xml_start();
+ return $str;
+ }
+
+ /*! return ending tag for XML string
+ */
+ public function to_xml_end(){
+ $str = $this->child->to_xml_end();
+ $str .= '</update>';
+ return $str;
+ }
+
+ /*! returns false for outputing only current item without child items
+ */
+ public function has_kids(){
+ return false;
+ }
+
+ /*! sets count of child items
+ @param value
+ count of child items
+ */
+ public function set_kids($value){
+ if (method_exists($this->child, 'set_kids')) {
+ $this->child->set_kids($value);
+ }
+ }
+
+ /*! sets attribute for item
+ */
+ public function set_attribute($name, $value){
+ if (method_exists($this->child, 'set_attribute')) {
+ LogMaster::log("setting attribute: \nname = {$name}\nvalue = {$value}");
+ $this->child->set_attribute($name, $value);
+ } else {
+ LogMaster::log("set_attribute method doesn't exists");
+ }
+ }
+}
+
+
+class DataUpdate{
+
+ protected $table; //!< table , where actions are stored
+ protected $url; //!< url for notification service, optional
+ protected $sql; //!< DB wrapper object
+ protected $config; //!< DBConfig object
+ protected $request; //!< DBRequestConfig object
+ protected $event;
+ protected $item_class;
+ protected $demu;
+
+ //protected $config;//!< DataConfig instance
+ //protected $request;//!< DataRequestConfig instance
+
+ /*! constructor
+
+ @param connector
+ Connector object
+ @param config
+ DataConfig object
+ @param request
+ DataRequestConfig object
+ */
+ function __construct($sql, $config, $request, $table, $url){
+ $this->config= $config;
+ $this->request= $request;
+ $this->sql = $sql;
+ $this->table=$table;
+ $this->url=$url;
+ $this->demu = false;
+ }
+
+ public function set_demultiplexor($path){
+ $this->demu = $path;
+ }
+
+ public function set_event($master, $name){
+ $this->event = $master;
+ $this->item_class = $name;
+ }
+
+ private function select_update($actions_table, $join_table, $id_field_name, $version, $user) {
+ $sql = "SELECT * FROM {$actions_table}";
+ $sql .= " LEFT OUTER JOIN {$join_table} ON ";
+ $sql .= "{$actions_table}.DATAID = {$join_table}.{$id_field_name} ";
+ $sql .= "WHERE {$actions_table}.ID > '{$version}' AND {$actions_table}.USER <> '{$user}'";
+ return $sql;
+ }
+
+ private function get_update_max_version() {
+ $sql = "SELECT MAX(id) as VERSION FROM {$this->table}";
+ $res = $this->sql->query($sql);
+ $data = $this->sql->get_next($res);
+
+ if ($data == false || $data['VERSION'] == false)
+ return 1;
+ else
+ return $data['VERSION'];
+ }
+
+ private function log_update_action($actions_table, $dataId, $status, $user) {
+ $sql = "INSERT INTO {$actions_table} (DATAID, TYPE, USER) VALUES ('{$dataId}', '{$status}', '{$user}')";
+ $this->sql->query($sql);
+ if ($this->demu)
+ file_get_contents($this->demu);
+ }
+
+
+
+
+ /*! records operations in actions_table
+ @param action
+ DataAction object
+ */
+ public function log_operations($action) {
+ $type = $this->sql->escape($action->get_status());
+ $dataId = $this->sql->escape($action->get_new_id());
+ $user = $this->sql->escape($this->request->get_user());
+ if ($type!="error" && $type!="invalid" && $type !="collision") {
+ $this->log_update_action($this->table, $dataId, $type, $user);
+ }
+ }
+
+
+ /*! return action version in XMl format
+ */
+ public function get_version() {
+ $version = $this->get_update_max_version();
+ return "<userdata name='version'>".$version."</userdata>";
+ }
+
+
+ /*! adds action version in output XML as userdata
+ */
+ public function version_output() {
+ echo $this->get_version();
+ }
+
+
+ /*! create update actions in XML-format and sends it to output
+ */
+ public function get_updates() {
+ $sub_request = new DataRequestConfig($this->request);
+ $version = $this->request->get_version();
+ $user = $this->request->get_user();
+
+ $sub_request->parse_sql($this->select_update($this->table, $this->request->get_source(), $this->config->id['db_name'], $version, $user));
+ $sub_request->set_relation(false);
+
+ $output = $this->render_set($this->sql->select($sub_request), $this->item_class);
+
+ ob_clean();
+ header("Content-type:text/xml");
+
+ echo $this->updates_start();
+ echo $this->get_version();
+ echo $output;
+ echo $this->updates_end();
+ }
+
+
+ protected function render_set($res, $name){
+ $output="";
+ $index=0;
+ while ($data=$this->sql->get_next($res)){
+ $data = new DataItemUpdate($data,$this->config,$index, $name);
+ $this->event->trigger("beforeRender",$data);
+ $output.=$data->to_xml();
+ $index++;
+ }
+ return $output;
+ }
+
+ /*! returns update start string
+ */
+ protected function updates_start() {
+ $start = '<updates>';
+ return $start;
+ }
+
+ /*! returns update end string
+ */
+ protected function updates_end() {
+ $start = '</updates>';
+ return $start;
+ }
+
+ /*! checks if action version given by client is deprecated
+ @param action
+ DataAction object
+ */
+ public function check_collision($action) {
+ $version = $this->sql->escape($this->request->get_version());
+ //$user = $this->sql->escape($this->request->get_user());
+ $last_version = $this->get_update_max_version();
+ if (($last_version > $version)&&($action->get_status() == 'update')) {
+ $action->error();
+ $action->set_status('collision');
+ }
+ }
+}
+
+?> \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css
new file mode 100644
index 00000000000..6259fe59eba
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css
@@ -0,0 +1,5 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+.dhx_cal_container{background-color:#C2D5FC;font-family:Tahoma;font-size:8pt;position:relative;overflow:hidden;}.dhx_cal_container div{-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_navline{height:20px;position:absolute;z-index:3;width:750px;color:#2F3A48;}.dhx_cal_navline div{position:absolute;top:2px;white-space:nowrap;}.dhx_cal_navline .dhx_cal_date{font-weight:600;left:210px;}.dhx_cal_button .dhx_left_bg{width:1px;overflow:hidden;height:17px;z-index:20;top:0;}.dhx_cal_prev_button{background-image:url(imgs/buttons.png);background-position:0 0;width:29px;height:17px;left:50px;cursor:pointer;}.dhx_cal_next_button{background-image:url(imgs/buttons.png);background-position:-30px 0;width:29px;height:17px;left:80px;cursor:pointer;}.dhx_cal_today_button{background-image:url(imgs/buttons.png);background-position:-60px 0;width:75px;height:17px;left:112px;cursor:pointer;text-align:center;text-decoration:underline;}.dhx_cal_tab{width:59px;height:19px;text-align:center;text-decoration:underline;padding-top:2px;cursor:pointer;background-color:#D8E1EA;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;}.dhx_cal_tab.active{text-decoration:none;cursor:default;font-weight:bold;border:1px dotted #586A7E;border-bottom:0;background-color:#C2D5FC;}.dhx_cal_header{position:absolute;left:10px;top:23px;width:750px;border-top:1px dotted #8894A3;border-right:1px dotted #8894A3;z-index:2;overflow:hidden;color:#2F3A48;}.dhx_cal_data{border-top:1px dotted #8894A3;position:absolute;top:44px;width:600px;overflow-y:auto;overflow-x:hidden;}.dhx_scale_bar{position:absolute;text-align:center;background-color:#C2D5FC;padding-top:3px;border-left:1px dotted #586A7E;}.dhx_scale_holder{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg.png);}.dhx_scale_holder_now{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg_now.png);}.dhx_scale_hour{height:41px;width:50px;border-bottom:1px dotted #8894A3;background-color:#C2D5FC;text-align:center;line-height:40px;color:#586A7E;overflow:hidden;}.dhx_month_head{background-color:#EBEFF4;color:#2F3A48;border-right:1px dotted #586A7E;height:18px;padding-right:5px;padding-top:3px;text-align:right;}.dhx_month_body{border-right:1px dotted #586A7E;border-bottom:1px dotted #586A7E;background-color:#FFF;}.dhx_now .dhx_month_body{background-color:#E2EDFF;}.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:#ECECEC;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{background-color:#E2E3E6;color:#94A6BB;}.dhx_now .dhx_month_head{background-color:#D1DEF4;font-weight:bold;}.dhx_cal_drag{position:absolute;z-index:9999;background-color:#FFE763;border:1px solid #B7A543;opacity:.5;filter:alpha(opacity=50);}.dhx_loading{position:absolute;width:128px;height:15px;background-image:url(imgs/loading.gif);z-index:9999;}.dhx_multi_day_icon,.dhx_multi_day{background-color:#E1E6FF;background-repeat:no-repeat;border-right:1px dotted #8894A3;}.dhx_multi_day{position:absolute;border-top:1px dotted #8894A3;}.dhx_multi_day_icon{background-image:url(imgs/clock_big.gif);}.dhx_multi_day_icon_small{background-image:url(imgs/clock_small.gif);}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-position:center center;background-color:#E1E6FF;background-repeat:no-repeat;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container{background-color:#d0e5ff;}.dhx_cal_event div{background-color:#FFE763;border:1px solid #B7A543;color:#887A2E;overflow:hidden;width:100%;font-family:Tahoma;font-size:8pt;}.dhx_move_denied .dhx_cal_event .dhx_header,.dhx_move_denied .dhx_cal_event .dhx_title{cursor:default;}.dhx_cal_event .dhx_header{height:1px;margin-left:1px;border-width:1px 1px 0 1px;cursor:pointer;}.dhx_cal_event .dhx_title{height:12px;border-width:0 1px 1px 1px;border-bottom-style:dotted;font-size:7pt;font-weight:bold;text-align:center;background-position:right;background-repeat:no-repeat;cursor:pointer;}.dhx_cal_event .dhx_body{border-width:0 1px 1px 1px;padding:5px;}.dhx_resize_denied .dhx_cal_event .dhx_footer{cursor:default;}.dhx_cal_event .dhx_footer{height:1px;margin-left:2px;border-width:0 1px 1px 1px;cursor:s-resize;}.dhx_cal_event_line{background-color:#FFE763;border:1px solid #B7A543;border-radius:3px;font-family:Tahoma;font-size:8pt;height:13px;padding-left:10px;color:#887A2E;cursor:pointer;overflow:hidden;}.dhx_cal_event_clear{font-family:Tahoma;font-size:8pt;height:13px;padding-left:2px;color:#887A2E;white-space:nowrap;overflow:hidden;cursor:pointer;}.dhx_in_move{background-color:#FFFF80;}div.dhx_cal_editor{background-color:#FFE763;border:1px solid #B7A543;border-top-style:dotted;z-index:999;position:absolute;overflow:hidden;}textarea.dhx_cal_editor{width:100%;height:100%;border:0 solid black;margin:none;padding:none;overflow:auto;}div.dhx_menu_head{background-image:url(imgs/controls.gif);background-position:0 -43px;width:10px;height:10px;margin-left:5px;margin-top:1px;border:none;cursor:default;}div.dhx_menu_icon{background-image:url(imgs/controls.gif);width:20px;height:20px;margin-left:-5px;margin-top:0;border:none;cursor:pointer;}div.icon_details{background-position:0 0;}div.icon_edit{background-position:-22px 0;}div.icon_save{background-position:-84px -1px;}div.icon_cancel{background-position:-62px 0;}div.icon_delete{background-position:-42px 0;}div.dhx_now_time{position:absolute;width:100%;border-bottom:2px dotted red;z-index:1;}div.dhx_time_block{position:absolute;width:100%;background:silver;opacity:.4;filter:alpha(opacity=40);z-index:1;}.dhx_unselectable,.dhx_unselectable div{-webkit-user-select:none;-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_light{background-color:#FFE763;border-radius:5px;font-family:Tahoma;font-size:8pt;border:1px solid #B7A64B;color:#887A2E;position:absolute;z-index:10001;width:580px;height:300px;box-shadow:5px 5px 5px #888;}.dhx_cal_light_wide{width:650px;}.dhx_mark{position:relative;top:3px;background-image:url('./imgs/controls.gif');background-position:0 -43px;padding-left:10px;}.dhx_ie6 .dhx_mark{background-position:6px -41px;}.dhx_cal_light select{font-family:Tahoma;font-size:8pt;color:#887A2E;padding:2px;margin:0;}.dhx_cal_ltitle{padding:2px 0 2px 5px;overflow:hidden;white-space:nowrap;}.dhx_cal_ltitle span{white-space:nowrap;}.dhx_cal_lsection{background-color:#DBCF8C;color:#FFF4B5;font-weight:bold;padding:5px 0 3px 10px;}.dhx_section_time{background-color:#DBCF8C;}.dhx_cal_lsection .dhx_fullday{float:right;margin-right:5px;color:#887A2E;font-size:12px;font-weight:normal;line-height:20px;vertical-align:top;cursor:pointer;}.dhx_cal_lsection{font-size:18px;font-family:Arial;}.dhx_cal_ltext{padding:2px 0 2px 10px;overflow:hidden;}.dhx_cal_ltext textarea{background-color:#FFF4B5;overflow:auto;border:none;color:#887A2E;height:100%;width:100%;outline:none!important;}.dhx_time{font-weight:bold;}.dhx_cal_light .dhx_title{padding-left:10px;}.dhx_cal_larea{border:1px solid #DCC43E;background-color:#FFF4B5;overflow:hidden;margin-left:3px;width:572px;height:1px;}.dhx_btn_set{padding:5px 10px 0 10px;float:left;}.dhx_btn_set div{float:left;height:21px;line-height:21px;vertical-align:middle;cursor:pointer;}.dhx_save_btn{background-image:url('./imgs/controls.gif');background-position:-84px 0;width:21px;}.dhx_cancel_btn{background-image:url('./imgs/controls.gif');background-position:-63px 0;width:20px;}.dhx_delete_btn{background-image:url('./imgs/controls.gif');background-position:-42px 0;width:20px;}.dhx_cal_cover{width:100%;height:100%;position:absolute;z-index:10000;top:0;left:0;background-color:black;opacity:.1;filter:alpha(opacity=10);}.dhx_custom_button{padding:0 3px 0 3px;color:#887A2E;font-family:Tahoma;font-size:8pt;background-color:#FFE763;font-weight:normal;margin-right:5px;margin-top:0;cursor:pointer;}.dhx_custom_button div{cursor:pointer;float:left;height:21px;line-height:21px;vertical-align:middle;}.dhx_cal_light_wide .dhx_cal_larea{border-top-width:0;}.dhx_cal_light_wide .dhx_cal_lsection{border:0;float:left;text-align:right;width:100px;height:20px;font-size:16px;padding:5px 0 0 10px;}.dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #DBCF8C;position:relative;background-color:#DBCF8C;overflow:hidden;}.dhx_cal_light_wide .dhx_section_time{padding-top:2px!important;height:20px!important;}.dhx_section_time{text-align:center;}.dhx_cal_light_wide .dhx_cal_larea{width:730px;}.dhx_cal_light_wide{width:738px;}.dhx_cal_light_wide .dhx_section_time{background:transparent;}.dhx_cal_light_wide .dhx_cal_checkbox label{padding-left:0;}.dhx_cal_wide_checkbox input{margin-top:8px;margin-left:14px;}.dhx_cal_light input{font-family:Tahoma;font-size:8pt;color:#887A2E;}.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{float:none;margin-right:0;color:#FFF4B5;font-weight:bold;font-size:16px;font-family:Arial;cursor:pointer;}.dhx_custom_button{float:right;height:21px;width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_cal_light_wide .dhx_custom_button{position:absolute;top:0;right:0;margin-top:2px;}.dhx_cal_light_wide .dhx_repeat_right{margin-right:55px;}.dhx_scale_bar_header{position:absolute;border-bottom:1px dotted #8894A3;width:100%;}.dhx_expand_icon{position:absolute;top:0;right:0;background-image:url(./imgs/colapce-expand-icon.gif);width:18px;height:18px;cursor:pointer;background-position:0 18px;z-index:16;}.dhx_agenda_area{width:100%;height:100%;overflow-y:auto;background-image:url(./imgs/databg.png);}.dhx_agenda_line{height:21px;clear:both;overflow:hidden;}.dhx_agenda_line div{float:left;width:188px;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_agenda_area .dhx_agenda_line div{border-right:0 dotted #8894A3;}.dhx_v_border{position:absolute;left:186px;top:0;border-right:1px dotted #8894A3;width:1px;height:100%;}.dhx_agenda_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_agenda_line span{padding-left:5px;line-height:21px;}.dhx_year_body{border-left:1px dotted #586A7E;}.dhx_year_week{position:relative;}.dhx_scale_bar_last{border-right:1px dotted #586A7E;}.dhx_year_month{height:18px;padding-top:3px;border:1px dotted #586A7E;text-align:center;vertical-align:middle;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#E2E3E6!important;}.dhx_year_body .dhx_month_body{height:0;overflow:hidden;}.dhx_month_head.dhx_year_event{background-color:#FFE763;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head{cursor:default;}.dhx_tooltip{border:1px solid #BBB;background-image:url(./imgs/databg.png);position:absolute;z-index:9998;width:300px;height:auto;font-family:Tahoma;font-size:8pt;overflow:hidden;}.dhx_tooltip_line{line-height:20px;height:20px;overflow:hidden;}.dhx_tooltip_line .dhx_event_icon{width:20px;height:20px;padding-right:10px;float:left;border-width:0;position:relative;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_tooltip_date{float:left;width:auto;padding-left:5px;text-align:center;}.dhx_text_disabled{color:#887A2E;font-family:Tahoma;font-size:8pt;}.dhx_mini_calendar{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;}.dhx_mini_calendar .dhx_month_head{cursor:pointer;}.dhx_mini_calendar .dhx_calendar_click{background-color:#C2D5FC;}.dhx_cal_navline div.dhx_minical_icon{width:18px;height:18px;left:190px;top:1px;cursor:pointer;background-image:url(./imgs/calendar.gif);}.dhx_matrix_scell{height:100%;}.dhx_matrix_cell,.dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_matrix_cell{background-color:white;}.dhx_matrix_line{overflow:hidden;}.dhx_matrix_cell div,.dhx_matrix_scell div{overflow:hidden;text-align:center;height:auto;}.dhx_cal_lsection .dhx_readonly{font-size:9pt;font-size:8pt;padding:2px;color:#887A2E;}.dhx_matrix_scell.folder,.dhx_data_table.folder .dhx_matrix_cell{background-color:#969394;cursor:pointer;}.dhx_matrix_scell .dhx_scell_level0{padding-left:5px;}.dhx_matrix_scell .dhx_scell_level1{padding-left:20px;}.dhx_matrix_scell .dhx_scell_level2{padding-left:35px;}.dhx_matrix_scell .dhx_scell_level3{padding-left:50px;}.dhx_matrix_scell .dhx_scell_level4{padding-left:65px;}.dhx_matrix_scell.folder{font-weight:bold;text-align:left;}.dhx_matrix_scell.folder .dhx_scell_expand{float:left;width:10px;padding-right:3px;}.dhx_matrix_scell.folder .dhx_scell_name{float:left;width:auto;}.dhx_matrix_scell.item .dhx_scell_name{padding-left:15px;text-align:left;}.dhx_data_table.folder .dhx_matrix_cell{border-right:0;}.dhx_section_timeline{overflow:hidden;padding:4px 0 2px 10px;}.dhx_section_timeline select{width:552px;}.dhx_map_area{width:100%;height:100%;overflow-y:auto;overflow-x:hidden;background-image:url(./imgs/databg.png);}.dhx_map_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_map_line{height:21px;clear:both;overflow:hidden;}.dhx_map{position:absolute;}.dhx_map_line div{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_description{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .dhx_map_description{float:left;border-right:0 dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .line_description{float:left;border-right:1px dotted #8894A3;text-align:left;padding-left:5px;line-height:21px;overflow:hidden;}.dhx_map_line.highlight{background-color:#C4C5CC;}.dhx_map_area .dhx_map_line div{border-right:0 dotted #8894A3;}.dhtmlXTooltip.tooltip{-moz-box-shadow:3px 3px 3px #888;-webkit-box-shadow:3px 3px 3px #888;-o-box-shadow:3px 3px 3px #888;box-shadow:3px 3px 3px #888;filter:progid:DXImageTransform.Microsoft.Shadow(color='#888888',Direction=135,Strength=5);background-color:white;border-left:1px dotted #887A2E;border-top:1px dotted #887A2E;color:#887A2E;cursor:default;padding:10px;position:absolute;z-index:500;}.dhx_cal_checkbox label{padding-left:5px;}.dhx_cal_light .radio{padding:2px 0 2px 10px;}.dhx_cal_light .radio input,.dhx_cal_light .radio label{line-height:15px;}.dhx_cal_light .radio input{vertical-align:middle;margin:0;padding:0;}.dhx_cal_light .radio label{vertical-align:middle;padding-right:10px;}.dhx_cal_light .combo{padding:4px;}.dhx_wa_column{float:left;}.dhx_wa_column_last .dhx_wa_day_cont{border-left:1px dotted #8894A3;}.dhx_wa_scale_bar{font-family:Tahoma;padding-left:10px;font-size:11px;border-top:1px dotted #8894A3;border-bottom:1px dotted #8894A3;}.dhx_wa_day_data{background-color:#FCFEFC;overflow-y:auto;}.dhx_wa_ev_body{border-bottom:1px dotted #789;font-size:12px;padding:5px 0 5px 7px;}.dhx_wa_dnd{font-family:Tahoma;position:absolute;padding-right:7px;color:#887AE2!important;background-color:#FFE763!important;border:1px solid #B7A543;}.dhx_cal_event_selected{background-color:#9cc1db;color:white;}.dhx_second_scale_bar{border-bottom:1px dotted #586A7E;padding-top:2px;}div.dhx_form_repeat input.radio{margin:-4px 0 0 -4px!ie;}div.dhx_form_repeat input.checkbox{margin:0 0 0 -4px!ie;}.dhx_form_repeat,.dhx_form_repeat input{padding:0;margin:0;padding-left:5px;font-family:Tahoma,Verdana;font-size:11px;line-height:24px;}.dhx_form_repeat{overflow:hidden;height:0;background-color:#FFF4B5;}.dhx_cal_light_wide .dhx_form_repeat{background-color:transparent;}.dhx_repeat_center,.dhx_repeat_left{height:115px;padding:10px 0 10px 10px;float:left;}.dhx_repeat_left{width:95px;}.dhx_repeat_center{width:335px;margin-top:12px;}.dhx_repeat_divider{float:left;height:115px;border-left:1px dotted #DCC43E;width:1px;}.dhx_repeat_right{float:right;height:115px;width:160px;padding:10px 3px 10px 10px;margin-top:7px;}input.dhx_repeat_text{height:16px;width:27px;margin:0 4px 0 4px;line-height:18px;padding:0 0 0 2px;}.dhx_form_repeat select{height:20px;width:87px;padding:0 0 0 2px;margin:0 4px 0 4px;}input.dhx_repeat_date{height:18px;width:80px;padding:0 0 0 2px;margin:0 4px 0 4px;background-repeat:no-repeat;background-position:64px 0;border:1px #7f9db9 solid;line-height:18px;}input.dhx_repeat_radio{margin-right:4px;}input.dhx_repeat_checkbox{margin:4px 4px 0 0;}.dhx_repeat_days td{padding-right:5px;}.dhx_repeat_days label{font-size:10px;}.dhx_custom_button{width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_custom_button_recurring{background-image:url(./imgs/but_repeat.gif);background-position:-5px 20px;width:20px;margin-right:10px;}.dhx_cal_light_rec{width:640px;}.dhx_cal_light_rec .dhx_cal_larea{width:632px;}.dhx_cal_light_rec.dhx_cal_light_wide{width:816px;}.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{width:808px;} \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js
new file mode 100644
index 00000000000..2c78468e81e
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js
@@ -0,0 +1,195 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+dhtmlx=function(a){for(var b in a)dhtmlx[b]=a[b];return dhtmlx};
+dhtmlx.extend_api=function(a,b,c){var d=window[a];if(d)window[a]=function(a){if(a&&typeof a=="object"&&!a.tagName&&!(a instanceof Array)){var c=d.apply(this,b._init?b._init(a):arguments),g;for(g in dhtmlx)if(b[g])this[b[g]](dhtmlx[g]);for(g in a)if(b[g])this[b[g]](a[g]);else g.indexOf("on")==0&&this.attachEvent(g,a[g])}else c=d.apply(this,arguments);b._patch&&b._patch(this);return c||this},window[a].prototype=d.prototype,c&&dhtmlXHeir(window[a].prototype,c)};
+dhtmlxAjax={get:function(a,b){var c=new dtmlXMLLoaderObject(!0);c.async=arguments.length<3;c.waitCall=b;c.loadXML(a);return c},post:function(a,b,c){var d=new dtmlXMLLoaderObject(!0);d.async=arguments.length<4;d.waitCall=c;d.loadXML(a,!0,b);return d},getSync:function(a){return this.get(a,null,!0)},postSync:function(a,b){return this.post(a,b,null,!0)}};
+function dtmlXMLLoaderObject(a,b,c,d){this.xmlDoc="";this.async=typeof c!="undefined"?c:!0;this.onloadAction=a||null;this.mainObject=b||null;this.waitCall=null;this.rSeed=d||!1;return this}
+dtmlXMLLoaderObject.prototype.waitLoadFunction=function(a){var b=!0;return this.check=function(){if(a&&a.onloadAction!=null&&(!a.xmlDoc.readyState||a.xmlDoc.readyState==4)&&b){b=!1;if(typeof a.onloadAction=="function")a.onloadAction(a.mainObject,null,null,null,a);if(a.waitCall)a.waitCall.call(this,a),a.waitCall=null}}};
+dtmlXMLLoaderObject.prototype.getXMLTopNode=function(a,b){if(this.xmlDoc.responseXML){var c=this.xmlDoc.responseXML.getElementsByTagName(a);c.length==0&&a.indexOf(":")!=-1&&(c=this.xmlDoc.responseXML.getElementsByTagName(a.split(":")[1]));var d=c[0]}else d=this.xmlDoc.documentElement;if(d)return this._retry=!1,d;if(_isIE&&!this._retry){var e=this.xmlDoc.responseText,b=this.xmlDoc;this._retry=!0;this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=!1;this.xmlDoc.loadXML(e);return this.getXMLTopNode(a,
+b)}dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(a){try{var b=new DOMParser;this.xmlDoc=b.parseFromString(a,"text/xml")}catch(c){this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),this.xmlDoc.async=this.async,this.xmlDoc.loadXML(a)}this.onloadAction(this.mainObject,null,null,null,this);if(this.waitCall)this.waitCall(),this.waitCall=null};
+dtmlXMLLoaderObject.prototype.loadXML=function(a,b,c,d){this.rSeed&&(a+=(a.indexOf("?")!=-1?"&":"?")+"a_dhx_rSeed="+(new Date).valueOf());this.filePath=a;this.xmlDoc=!_isIE&&window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if(this.async)this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);this.xmlDoc.open(b?"POST":"GET",a,this.async);d?(this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")"),this.xmlDoc.setRequestHeader("Content-type",
+"text/xml")):b&&this.xmlDoc.setRequestHeader("Content-type","application/x-www-form-urlencoded");this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(c);this.async||(new this.waitLoadFunction(this))()};dtmlXMLLoaderObject.prototype.destructor=function(){return this.xmlDoc=this.mainObject=this.onloadAction=null};
+dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(a){for(var b={},c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;b._tagvalue=a.firstChild?a.firstChild.nodeValue:"";for(c=0;c<a.childNodes.length;c++){var d=a.childNodes[c].tagName;d&&(b[d]||(b[d]=[]),b[d].push(this.xmlNodeToJSON(a.childNodes[c])))}return b};function callerFunction(a,b){return this.handler=function(c){if(!c)c=window.event;a(c,b);return!0}}function getAbsoluteLeft(a){return getOffset(a).left}
+function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){for(var b=0,c=0;a;)b+=parseInt(a.offsetTop),c+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:b,left:c}}
+function getOffsetRect(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,k=b.left+f-h;return{top:Math.round(i),left:Math.round(k)}}function getOffset(a){return a.getBoundingClientRect&&!_isChrome?getOffsetRect(a):getOffsetSum(a)}
+function convertStringToBoolean(a){typeof a=="string"&&(a=a.toLowerCase());switch(a){case "1":case "true":case "yes":case "y":case 1:case !0:return!0;default:return!1}}function getUrlSymbol(a){return a.indexOf("?")!=-1?"&":"?"}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop)return window.dhtmlDragAndDrop;this.dragStartObject=this.dragStartNode=this.dragNode=this.lastLanding=0;this.tempDOMM=this.tempDOMU=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this}
+dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null;a.dragStarter=null;a.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,b){a.onmousedown=this.preCreateDragCopy;a.dragStarter=b;this.addDragLanding(a,b)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,b){a.dragLanding=b};
+dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if(!((a||event)&&(a||event).button==2)){if(window.dhtmlDragAndDrop.waitDrag)return window.dhtmlDragAndDrop.waitDrag=0,document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU,document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM,!1;window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=
+this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=(new Date).valueOf();a&&a.preventDefault&&a.preventDefault();return!1}};
+dhtmlDragAndDropObject.prototype.callDrag=function(a){if(!a)a=window.event;dragger=window.dhtmlDragAndDrop;if(!((new Date).valueOf()-dragger.downtime<100)){if(a.button==0&&_isIE)return dragger.stopDrag();if(!dragger.dragNode&&dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,a);if(!dragger.dragNode)return dragger.stopDrag();dragger.dragNode.onselectstart=function(){return!1};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);
+document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}if(dragger.dragNode.parentNode!=window.document.body){var b=dragger.gldragNode;if(dragger.gldragNode.old)b=dragger.gldragNode.old;b.parentNode.removeChild(b);var c=dragger.dragNode.pWindow;if(_isIE){var d=document.createElement("Div");d.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=d.childNodes[0]}else dragger.dragNode=dragger.dragNode.cloneNode(!0);dragger.dragNode.pWindow=
+window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=a.clientX+15+(dragger.fx?dragger.fx*-1:0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=a.clientY+3+(dragger.fy?dragger.fy*-1:0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";var e=a.srcElement?a.srcElement:a.target;dragger.checkLanding(e,a)}};
+dhtmlDragAndDropObject.prototype.calculateFramePosition=function(a){if(window.name){for(var b=parent.frames[window.name].frameElement.offsetParent,c=0,d=0;b;)c+=b.offsetLeft,d+=b.offsetTop,b=b.offsetParent;if(parent.dhtmlDragAndDrop){var e=parent.dhtmlDragAndDrop.calculateFramePosition(1);c+=e.split("_")[0]*1;d+=e.split("_")[1]*1}if(a)return c+"_"+d;else this.fx=c;this.fy=d}return"0_0"};
+dhtmlDragAndDropObject.prototype.checkLanding=function(a,b){a&&a.dragLanding?(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding),this.lastLanding=a,this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,b.clientX,b.clientY,b),this.lastLanding_scr=_isIE?b.srcElement:b.target):a&&a.tagName!="BODY"?this.checkLanding(a.parentNode,b):(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding,b.clientX,b.clientY,b),this.lastLanding=
+0,this._onNotFound&&this._onNotFound())};
+dhtmlDragAndDropObject.prototype.stopDrag=function(a,b){dragger=window.dhtmlDragAndDrop;if(!b){dragger.stopFrameRoute();var c=dragger.lastLanding;dragger.lastLanding=null;c&&c.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,c,_isIE?event.srcElement:a.target)}dragger.lastLanding=null;dragger.dragNode&&dragger.dragNode.parentNode==document.body&&dragger.dragNode.parentNode.removeChild(dragger.dragNode);dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode=
+0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(a){a&&window.dhtmlDragAndDrop.stopDrag(1,1);for(var b=0;b<window.frames.length;b++)try{window.frames[b]!=a&&window.frames[b].dhtmlDragAndDrop&&window.frames[b].dhtmlDragAndDrop.stopFrameRoute(window)}catch(c){}try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.stopFrameRoute(window)}catch(d){}};
+dhtmlDragAndDropObject.prototype.initFrameRoute=function(a,b){if(a)window.dhtmlDragAndDrop.preCreateDragCopy({}),window.dhtmlDragAndDrop.dragStartNode=a.dhtmlDragAndDrop.dragStartNode,window.dhtmlDragAndDrop.dragStartObject=a.dhtmlDragAndDrop.dragStartObject,window.dhtmlDragAndDrop.dragNode=a.dhtmlDragAndDrop.dragNode,window.dhtmlDragAndDrop.gldragNode=a.dhtmlDragAndDrop.dragNode,window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag,window.waitDrag=0,!_isIE&&b&&(!_isFF||w<1.8)&&window.dhtmlDragAndDrop.calculateFramePosition();
+try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.initFrameRoute(window)}catch(c){}for(var d=0;d<window.frames.length;d++)try{window.frames[d]!=a&&window.frames[d].dhtmlDragAndDrop&&window.frames[d].dhtmlDragAndDrop.initFrameRoute(window,!a||b?1:0)}catch(e){}};w=_OperaRv=x=_isChrome=_isMacOS=_isKHTML=_isOpera=_isIE=_isFF=!1;navigator.userAgent.indexOf("Macintosh")!=-1&&(_isMacOS=!0);navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&(_isChrome=!0);
+if(navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("Konqueror")!=-1){var x=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5));if(x>525){_isFF=!0;var w=1.9}else _isKHTML=!0}else navigator.userAgent.indexOf("Opera")!=-1?(_isOpera=!0,_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))):navigator.appName.indexOf("Microsoft")!=-1?(_isIE=!0,navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat"&&
+(_isIE=8)):(_isFF=!0,w=parseFloat(navigator.userAgent.split("rv:")[1]));
+dtmlXMLLoaderObject.prototype.doXPath=function(a,b,c,d){if(_isKHTML||!_isIE&&!window.XPathResult)return this.doXPathOpera(a,b);if(_isIE)return b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML),b||dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]),c!=null&&b.setProperty("SelectionNamespaces","xmlns:xsl='"+c+"'"),d=="single"?b.selectSingleNode(a):b.selectNodes(a)||[];else{var e=b;b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML);b||dhtmlxError.throwError("LoadXML",
+"Incorrect XML",[b||this.xmlDoc,this.mainObject]);b.nodeName.indexOf("document")!=-1?e=b:(e=b,b=b.ownerDocument);var f=XPathResult.ANY_TYPE;if(d=="single")f=XPathResult.FIRST_ORDERED_NODE_TYPE;var g=[],h=b.evaluate(a,e,function(){return c},f,null);if(f==XPathResult.FIRST_ORDERED_NODE_TYPE)return h.singleNodeValue;for(var i=h.iterateNext();i;)g[g.length]=i,i=h.iterateNext();return g}};function z(){if(!this.catches)this.catches=[];return this}z.prototype.catchError=function(a,b){this.catches[a]=b};
+z.prototype.throwError=function(a,b,c){if(this.catches[a])return this.catches[a](a,b,c);if(this.catches.ALL)return this.catches.ALL(a,b,c);alert("Error type: "+a+"\nDescription: "+b);return null};window.dhtmlxError=new z;
+dtmlXMLLoaderObject.prototype.doXPathOpera=function(a,b){var c=a.replace(/[\/]+/gi,"/").split("/"),d=null,e=1;if(!c.length)return[];if(c[0]==".")d=[b];else if(c[0]=="")d=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(c[e].replace(/\[[^\]]*\]/g,"")),e++;else return[];for(;e<c.length;e++)d=this._getAllNamedChilds(d,c[e]);c[e-1].indexOf("[")!=-1&&(d=this._filterXPath(d,c[e-1]));return d};
+dtmlXMLLoaderObject.prototype._filterXPath=function(a,b){for(var c=[],b=b.replace(/[^\[]*\[\@/g,"").replace(/[\[\]\@]*/g,""),d=0;d<a.length;d++)a[d].getAttribute(b)&&(c[c.length]=a[d]);return c};
+dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a,b){var c=[];_isKHTML&&(b=b.toUpperCase());for(var d=0;d<a.length;d++)for(var e=0;e<a[d].childNodes.length;e++)_isKHTML?a[d].childNodes[e].tagName&&a[d].childNodes[e].tagName.toUpperCase()==b&&(c[c.length]=a[d].childNodes[e]):a[d].childNodes[e].tagName==b&&(c[c.length]=a[d].childNodes[e]);return c};function dhtmlXHeir(a,b){for(var c in b)typeof b[c]=="function"&&(a[c]=b[c]);return a}
+function dhtmlxEvent(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}dtmlXMLLoaderObject.prototype.xslDoc=null;dtmlXMLLoaderObject.prototype.setXSLParamValue=function(a,b,c){if(!c)c=this.xslDoc;if(c.responseXML)c=c.responseXML;var d=this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+a+"']",c,"http://www.w3.org/1999/XSL/Transform","single");if(d!=null)d.firstChild.nodeValue=b};
+dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(a,b){if(!a)a=this.xslDoc;if(a.responseXML)a=a.responseXML;if(!b)b=this.xmlDoc;if(b.responseXML)b=b.responseXML;if(_isIE){d=new ActiveXObject("Msxml2.DOMDocument.3.0");try{b.transformNodeToObject(a,d)}catch(c){d=b.transformNode(a)}}else{if(!this.XSLProcessor)this.XSLProcessor=new XSLTProcessor,this.XSLProcessor.importStylesheet(a);var d=this.XSLProcessor.transformToDocument(b)}return d};
+dtmlXMLLoaderObject.prototype.doXSLTransToString=function(a,b){var c=this.doXSLTransToObject(a,b);return typeof c=="string"?c:this.doSerialization(c)};dtmlXMLLoaderObject.prototype.doSerialization=function(a){if(!a)a=this.xmlDoc;if(a.responseXML)a=a.responseXML;if(_isIE)return a.xml;else{var b=new XMLSerializer;return b.serializeToString(a)}};
+dhtmlxEventable=function(a){a.dhx_SeverCatcherPath="";a.attachEvent=function(a,c,d){a="ev_"+a.toLowerCase();this[a]||(this[a]=new this.eventCatcher(d||this));return a+":"+this[a].addEvent(c)};a.callEvent=function(a,c){a="ev_"+a.toLowerCase();return this[a]?this[a].apply(this,c):!0};a.checkEvent=function(a){return!!this["ev_"+a.toLowerCase()]};a.eventCatcher=function(a){var c=[],d=function(){for(var d=!0,f=0;f<c.length;f++)if(c[f]!=null)var g=c[f].apply(a,arguments),d=d&&g;return d};d.addEvent=function(a){typeof a!=
+"function"&&(a=eval(a));return a?c.push(a)-1:!1};d.removeEvent=function(a){c[a]=null};return d};a.detachEvent=function(a){if(a!=!1){var c=a.split(":");this[c[0]].removeEvent(c[1])}};a.detachAllEvents=function(){for(var a in this)a.indexOf("ev_")==0&&delete this[a]}};
+function dataProcessor(a){this.serverProcessor=a;this.action_param="!nativeeditor_status";this.object=null;this.updatedRows=[];this.autoUpdate=!0;this.updateMode="cell";this._tMode="GET";this.post_delim="_";this._waitMode=0;this._in_progress={};this._invalid={};this.mandatoryFields=[];this.messages=[];this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",clear:"font-weight:normal;text-decoration:none;"};
+this.enableUTFencoding(!0);dhtmlxEventable(this);return this}
+dataProcessor.prototype={setTransactionMode:function(a,b){this._tMode=a;this._tSend=b},escape:function(a){return this._utf?encodeURIComponent(a):escape(a)},enableUTFencoding:function(a){this._utf=convertStringToBoolean(a)},setDataColumns:function(a){this._columns=typeof a=="string"?a.split(","):a},getSyncState:function(){return!this.updatedRows.length},enableDataNames:function(a){this._endnm=convertStringToBoolean(a)},enablePartialDataSend:function(a){this._changed=convertStringToBoolean(a)},setUpdateMode:function(a,
+b){this.autoUpdate=a=="cell";this.updateMode=a;this.dnd=b},ignore:function(a,b){this._silent_mode=!0;a.call(b||window);this._silent_mode=!1},setUpdated:function(a,b,c){if(!this._silent_mode){var d=this.findRow(a),c=c||"updated",e=this.obj.getUserData(a,this.action_param);e&&c=="updated"&&(c=e);b?(this.set_invalid(a,!1),this.updatedRows[d]=a,this.obj.setUserData(a,this.action_param,c),this._in_progress[a]&&(this._in_progress[a]="wait")):this.is_invalid(a)||(this.updatedRows.splice(d,1),this.obj.setUserData(a,
+this.action_param,""));b||this._clearUpdateFlag(a);this.markRow(a,b,c);b&&this.autoUpdate&&this.sendData(a)}},_clearUpdateFlag:function(){},markRow:function(a,b,c){var d="",e=this.is_invalid(a);e&&(d=this.styles[e],b=!0);if(this.callEvent("onRowMark",[a,b,c,e])&&(d=this.styles[b?c:"clear"]+d,this.obj[this._methods[0]](a,d),e&&e.details)){d+=this.styles[e+"_cell"];for(var f=0;f<e.details.length;f++)if(e.details[f])this.obj[this._methods[1]](a,f,d)}},getState:function(a){return this.obj.getUserData(a,
+this.action_param)},is_invalid:function(a){return this._invalid[a]},set_invalid:function(a,b,c){c&&(b={value:b,details:c,toString:function(){return this.value.toString()}});this._invalid[a]=b},checkBeforeUpdate:function(){return!0},sendData:function(a){if(!this._waitMode||!(this.obj.mytype=="tree"||this.obj._h2)){this.obj.editStop&&this.obj.editStop();if(typeof a=="undefined"||this._tSend)return this.sendAllData();if(this._in_progress[a])return!1;this.messages=[];if(!this.checkBeforeUpdate(a)&&this.callEvent("onValidatationError",
+[a,this.messages]))return!1;this._beforeSendData(this._getRowData(a),a)}},_beforeSendData:function(a,b){if(!this.callEvent("onBeforeUpdate",[b,this.getState(b),a]))return!1;this._sendData(a,b)},serialize:function(a,b){if(typeof a=="string")return a;if(typeof b!="undefined")return this.serialize_one(a,"");else{var c=[],d=[],e;for(e in a)a.hasOwnProperty(e)&&(c.push(this.serialize_one(a[e],e+this.post_delim)),d.push(e));c.push("ids="+this.escape(d.join(",")));return c.join("&")}},serialize_one:function(a,
+b){if(typeof a=="string")return a;var c=[],d;for(d in a)a.hasOwnProperty(d)&&c.push(this.escape((b||"")+d)+"="+this.escape(a[d]));return c.join("&")},_sendData:function(a,b){if(a){if(!this.callEvent("onBeforeDataSending",b?[b,this.getState(b),a]:[null,null,a]))return!1;b&&(this._in_progress[b]=(new Date).valueOf());var c=new dtmlXMLLoaderObject(this.afterUpdate,this,!0),d=this.serverProcessor+(this._user?getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,
+"version")].join("&"):"");this._tMode!="POST"?c.loadXML(d+(d.indexOf("?")!=-1?"&":"?")+this.serialize(a,b)):c.loadXML(d,!0,this.serialize(a,b));this._waitMode++}},sendAllData:function(){if(this.updatedRows.length){this.messages=[];for(var a=!0,b=0;b<this.updatedRows.length;b++)a&=this.checkBeforeUpdate(this.updatedRows[b]);if(!a&&!this.callEvent("onValidatationError",["",this.messages]))return!1;if(this._tSend)this._sendData(this._getAllData());else for(b=0;b<this.updatedRows.length;b++)if(!this._in_progress[this.updatedRows[b]]&&
+!this.is_invalid(this.updatedRows[b])&&(this._beforeSendData(this._getRowData(this.updatedRows[b]),this.updatedRows[b]),this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)))break}},_getAllData:function(){for(var a={},b=!1,c=0;c<this.updatedRows.length;c++){var d=this.updatedRows[c];!this._in_progress[d]&&!this.is_invalid(d)&&this.callEvent("onBeforeUpdate",[d,this.getState(d)])&&(a[d]=this._getRowData(d,d+this.post_delim),b=!0,this._in_progress[d]=(new Date).valueOf())}return b?a:null},setVerificator:function(a,
+b){this.mandatoryFields[a]=b||function(a){return a!=""}},clearVerificator:function(a){this.mandatoryFields[a]=!1},findRow:function(a){for(var b=0,b=0;b<this.updatedRows.length;b++)if(a==this.updatedRows[b])break;return b},defineAction:function(a,b){if(!this._uActions)this._uActions=[];this._uActions[a]=b},afterUpdateCallback:function(a,b,c,d){var e=a,f=c!="error"&&c!="invalid";f||this.set_invalid(a,c);if(this._uActions&&this._uActions[c]&&!this._uActions[c](d))return delete this._in_progress[e];this._in_progress[e]!=
+"wait"&&this.setUpdated(a,!1);var g=a;switch(c){case "update":case "updated":case "inserted":case "insert":b!=a&&(this.obj[this._methods[2]](a,b),a=b);break;case "delete":case "deleted":return this.obj.setUserData(a,this.action_param,"true_deleted"),this.obj[this._methods[3]](a),delete this._in_progress[e],this.callEvent("onAfterUpdate",[a,c,b,d])}this._in_progress[e]!="wait"?(f&&this.obj.setUserData(a,this.action_param,""),delete this._in_progress[e]):(delete this._in_progress[e],this.setUpdated(b,
+!0,this.obj.getUserData(a,this.action_param)));this.callEvent("onAfterUpdate",[a,c,b,d])},afterUpdate:function(a,b,c,d,e){e.getXMLTopNode("data");if(e.xmlDoc.responseXML){for(var f=e.doXPath("//data/action"),g=0;g<f.length;g++){var h=f[g],i=h.getAttribute("type"),k=h.getAttribute("sid"),j=h.getAttribute("tid");a.afterUpdateCallback(k,j,i,h)}a.finalizeUpdate()}},finalizeUpdate:function(){this._waitMode&&this._waitMode--;(this.obj.mytype=="tree"||this.obj._h2)&&this.updatedRows.length&&this.sendData();
+this.callEvent("onAfterUpdateFinish",[]);this.updatedRows.length||this.callEvent("onFullSync",[])},init:function(a){this.obj=a;this.obj._dp_init&&this.obj._dp_init(this)},setOnAfterUpdate:function(a){this.attachEvent("onAfterUpdate",a)},enableDebug:function(){},setOnBeforeUpdateHandler:function(a){this.attachEvent("onBeforeDataSending",a)},setAutoUpdate:function(a,b){a=a||2E3;this._user=b||(new Date).valueOf();this._need_update=!1;this._loader=null;this._update_busy=!1;this.attachEvent("onAfterUpdate",
+function(a,b,c,g){this.afterAutoUpdate(a,b,c,g)});this.attachEvent("onFullSync",function(){this.fullSync()});var c=this;window.setInterval(function(){c.loadUpdate()},a)},afterAutoUpdate:function(a,b){return b=="collision"?(this._need_update=!0,!1):!0},fullSync:function(){if(this._need_update==!0)this._need_update=!1,this.loadUpdate();return!0},getUpdates:function(a,b){if(this._update_busy)return!1;else this._update_busy=!0;this._loader=this._loader||new dtmlXMLLoaderObject(!0);this._loader.async=
+!0;this._loader.waitCall=b;this._loader.loadXML(a)},_v:function(a){return a.firstChild?a.firstChild.nodeValue:""},_a:function(a){for(var b=[],c=0;c<a.length;c++)b[c]=this._v(a[c]);return b},loadUpdate:function(){var a=this,b=this.obj.getUserData(0,"version"),c=this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+b].join("&"),c=c.replace("editing=true&","");this.getUpdates(c,function(){var b=a._loader.doXPath("//userdata");a.obj.setUserData(0,"version",a._v(b[0]));
+var c=a._loader.doXPath("//update");if(c.length){a._silent_mode=!0;for(var f=0;f<c.length;f++){var g=c[f].getAttribute("status"),h=c[f].getAttribute("id"),i=c[f].getAttribute("parent");switch(g){case "inserted":a.callEvent("insertCallback",[c[f],h,i]);break;case "updated":a.callEvent("updateCallback",[c[f],h,i]);break;case "deleted":a.callEvent("deleteCallback",[c[f],h,i])}}a._silent_mode=!1}a._update_busy=!1;a=null})}};
+if(window.dhtmlXGridObject)dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point,dhtmlXGridObject.prototype._init_point=function(){var a=function(a){a=a.replace(/(\?|\&)connector[^\f]*/g,"");return a+(a.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length>0?"&dhx_no_header=1":"")},b=function(b){return a.call(this,b)+(this._connector_sorting||"")+(this._connector_filter||"")},c=function(a,c,d){this._connector_sorting="&dhx_sort["+c+"]="+d;return b.call(this,
+a)},d=function(a,c,d){for(var h=0;h<c.length;h++)c[h]="dhx_filter["+c[h]+"]="+encodeURIComponent(d[h]);this._connector_filter="&"+c.join("&");return b.call(this,a)};this.attachEvent("onCollectValues",function(a){return this._con_f_used[a]?typeof this._con_f_used[a]=="object"?this._con_f_used[a]:!1:!0});this.attachEvent("onDynXLS",function(){this.xmlFileUrl=b.call(this,this.xmlFileUrl);return!0});this.attachEvent("onBeforeSorting",function(a,b,d){if(b=="connector"){var h=this;this.clearAndLoad(c.call(this,
+this.xmlFileUrl,a,d),function(){h.setSortImgState(!0,a,d)});return!1}return!0});this.attachEvent("onFilterStart",function(a,b){return this._con_f_used.length?(this.clearAndLoad(d.call(this,this.xmlFileUrl,a,b)),!1):!0});this.attachEvent("onXLE",function(){});this._init_point_connector&&this._init_point_connector()},dhtmlXGridObject.prototype._con_f_used=[],dhtmlXGridObject.prototype._in_header_connector_text_filter=function(a,b){this._con_f_used[b]||(this._con_f_used[b]=1);return this._in_header_text_filter(a,
+b)},dhtmlXGridObject.prototype._in_header_connector_select_filter=function(a,b){this._con_f_used[b]||(this._con_f_used[b]=2);return this._in_header_select_filter(a,b)},dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load,dhtmlXGridObject.prototype.load=function(a,b,c){if(!this._colls_loaded&&this.cellType){for(var d=[],e=0;e<this.cellType.length;e++)(this.cellType[e].indexOf("co")==0||this._con_f_used[e]==2)&&d.push(e);d.length&&(arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":
+"?")+"connector=true&dhx_colls="+d.join(","))}return this.load_connector.apply(this,arguments)},dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead,dhtmlXGridObject.prototype._parseHead=function(a,b,c){this._parseHead_connector.apply(this,arguments);if(!this._colls_loaded){for(var d=this.xmlLoader.doXPath("./coll_options",arguments[0]),e=0;e<d.length;e++){var f=d[e].getAttribute("for"),g=[],h=null;this.cellType[f]=="combo"&&(h=this.getColumnCombo(f));this.cellType[f].indexOf("co")==
+0&&(h=this.getCombo(f));for(var i=this.xmlLoader.doXPath("./item",d[e]),k=0;k<i.length;k++){var j=i[k].getAttribute("value");if(h){var l=i[k].getAttribute("label")||j;h.addOption?h.addOption([[j,l]]):h.put(j,l);g[g.length]=l}else g[g.length]=j}this._con_f_used[f*1]&&(this._con_f_used[f*1]=g)}this._colls_loaded=!0}};
+if(window.dataProcessor)dataProcessor.prototype.init_original=dataProcessor.prototype.init,dataProcessor.prototype.init=function(a){this.init_original(a);a._dataprocessor=this;this.setTransactionMode("POST",!0);this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true"};dhtmlxError.catchError("LoadXML",function(a,b,c){c[0].status!=0&&alert(c[0].responseText)});window.dhtmlXScheduler=window.scheduler={version:3};dhtmlxEventable(scheduler);
+scheduler.init=function(a,b,c){b=b||new Date;c=c||"week";scheduler.date.init();this._obj=typeof a=="string"?document.getElementById(a):a;this._els=[];this._scroll=!0;this._quirks=_isIE&&document.compatMode=="BackCompat";this._quirks7=_isIE&&navigator.appVersion.indexOf("MSIE 8")==-1;this.get_elements();this.init_templates();this.set_actions();dhtmlxEvent(window,"resize",function(){window.clearTimeout(scheduler._resize_timer);scheduler._resize_timer=window.setTimeout(function(){scheduler.callEvent("onSchedulerResize",
+[])&&scheduler.update_view()},100)});this.set_sizes();scheduler.callEvent("onSchedulerReady",[]);this.setCurrentView(b,c)};scheduler.xy={nav_height:22,min_event_height:40,scale_width:50,bar_height:20,scroll_width:18,scale_height:20,month_scale_height:20,menu_width:25,margin_top:0,margin_left:0,editor_width:140};scheduler.keys={edit_save:13,edit_cancel:27};
+scheduler.set_sizes=function(){var a=this._x=this._obj.clientWidth-this.xy.margin_left,b=this._y=this._obj.clientHeight-this.xy.margin_top,c=this._table_view?0:this.xy.scale_width+this.xy.scroll_width,d=this._table_view?-1:this.xy.scale_width;this.set_xy(this._els.dhx_cal_navline[0],a,this.xy.nav_height,0,0);this.set_xy(this._els.dhx_cal_header[0],a-c,this.xy.scale_height,d,this.xy.nav_height+(this._quirks?-1:1));var e=this._els.dhx_cal_navline[0].offsetHeight;if(e>0)this.xy.nav_height=e;var f=this.xy.scale_height+
+this.xy.nav_height+(this._quirks?-2:0);this.set_xy(this._els.dhx_cal_data[0],a,b-(f+2),0,f+2)};scheduler.set_xy=function(a,b,c,d,e){a.style.width=Math.max(0,b)+"px";a.style.height=Math.max(0,c)+"px";if(arguments.length>3)a.style.left=d+"px",a.style.top=e+"px"};
+scheduler.get_elements=function(){for(var a=this._obj.getElementsByTagName("DIV"),b=0;b<a.length;b++){var c=a[b].className;this._els[c]||(this._els[c]=[]);this._els[c].push(a[b]);var d=scheduler.locale.labels[a[b].getAttribute("name")||c];if(d)a[b].innerHTML=d}};
+scheduler.set_actions=function(){for(var a in this._els)if(this._click[a])for(var b=0;b<this._els[a].length;b++)this._els[a][b].onclick=scheduler._click[a];this._obj.onselectstart=function(){return!1};this._obj.onmousemove=function(a){scheduler._on_mouse_move(a||event)};this._obj.onmousedown=function(a){scheduler._on_mouse_down(a||event)};this._obj.onmouseup=function(a){scheduler._on_mouse_up(a||event)};this._obj.ondblclick=function(a){scheduler._on_dbl_click(a||event)}};
+scheduler.select=function(a){if(!this._table_view&&this.getEvent(a)._timed&&this._select_id!=a)this.editStop(!1),this.unselect(),this._select_id=a,this.updateEvent(a)};scheduler.unselect=function(a){if(!(a&&a!=this._select_id)){var b=this._select_id;this._select_id=null;b&&this.updateEvent(b)}};scheduler.getState=function(){return{mode:this._mode,date:this._date,min_date:this._min_date,max_date:this._max_date,editor_id:this._edit_id,lightbox_id:this._lightbox_id,new_event:this._new_event}};
+scheduler._click={dhx_cal_data:function(a){var b=a?a.target:event.srcElement,c=scheduler._locate_event(b),a=a||event;if(!(c&&!scheduler.callEvent("onClick",[c,a])||scheduler.config.readonly))if(c){scheduler.select(c);var d=b.className;if(d.indexOf("_icon")!=-1)scheduler._click.buttons[d.split(" ")[1].replace("icon_","")](c)}else scheduler._close_not_saved()},dhx_cal_prev_button:function(){scheduler._click.dhx_cal_next_button(0,-1)},dhx_cal_next_button:function(a,b){scheduler.setCurrentView(scheduler.date.add(scheduler.date[scheduler._mode+
+"_start"](scheduler._date),b||1,scheduler._mode))},dhx_cal_today_button:function(){scheduler.setCurrentView(new Date)},dhx_cal_tab:function(){var a=this.getAttribute("name"),b=a.substring(0,a.search("_tab"));scheduler.setCurrentView(scheduler._date,b)},buttons:{"delete":function(a){var b=scheduler.locale.labels.confirm_deleting;(!b||confirm(b))&&scheduler.deleteEvent(a)},edit:function(a){scheduler.edit(a)},save:function(){scheduler.editStop(!0)},details:function(a){scheduler.showLightbox(a)},cancel:function(){scheduler.editStop(!1)}}};
+scheduler.addEventNow=function(a,b,c){var d={};a&&a.constructor.toString().match(/object/i)!==null&&(d=a,a=null);var e=(this.config.event_duration||this.config.time_step)*6E4;a||(a=Math.round((new Date).valueOf()/e)*e);var f=new Date(a);if(!b){var g=this.config.first_hour;g>f.getHours()&&(f.setHours(g),a=f.valueOf());b=a+e}var h=new Date(b);f.valueOf()==h.valueOf()&&h.setTime(h.valueOf()+e);d.start_date=d.start_date||f;d.end_date=d.end_date||h;d.text=d.text||this.locale.labels.new_event;d.id=this._drag_id=
+this.uid();this._drag_mode="new-size";this._loading=!0;this.addEvent(d);this.callEvent("onEventCreated",[this._drag_id,c]);this._loading=!1;this._drag_event={};this._on_mouse_up(c)};
+scheduler._on_dbl_click=function(a,b){b=b||a.target||a.srcElement;if(!this.config.readonly){var c=b.className.split(" ")[0];switch(c){case "dhx_scale_holder":case "dhx_scale_holder_now":case "dhx_month_body":case "dhx_wa_day_data":if(!scheduler.config.dblclick_create)break;var d=this._mouse_coords(a),e=this._min_date.valueOf()+(d.y*this.config.time_step+(this._table_view?0:d.x)*1440)*6E4,e=this._correct_shift(e);this.addEventNow(e,null,a);break;case "dhx_body":case "dhx_wa_ev_body":case "dhx_cal_event_line":case "dhx_cal_event_clear":var f=
+this._locate_event(b);if(!this.callEvent("onDblClick",[f,a]))break;this.config.details_on_dblclick||this._table_view||!this.getEvent(f)._timed?this.showLightbox(f):this.edit(f);break;case "":if(b.parentNode)return scheduler._on_dbl_click(a,b.parentNode);default:var g=this["dblclick_"+c];g&&g.call(this,a)}}};
+scheduler._mouse_coords=function(a){var b,c=document.body,d=document.documentElement;b=a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+(c.scrollLeft||d.scrollLeft||0)-c.clientLeft,y:a.clientY+(c.scrollTop||d.scrollTop||0)-c.clientTop};b.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);b.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els.dhx_cal_data[0].scrollTop;b.ev=a;var e=this["mouse_"+this._mode];if(e)return e.call(this,
+b);if(this._table_view){for(var f=0,f=1;f<this._colsS.heights.length;f++)if(this._colsS.heights[f]>b.y)break;b.y=(Math.max(0,Math.ceil(b.x/this._cols[0])-1)+Math.max(0,f-1)*7)*1440/this.config.time_step;b.x=0}else b.x=Math.max(0,Math.ceil(b.x/this._cols[0])-1),b.y=Math.max(0,Math.ceil(b.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);return b};
+scheduler._close_not_saved=function(){if((new Date).valueOf()-(scheduler._new_event||0)>500&&scheduler._edit_id){var a=scheduler.locale.labels.confirm_closing;(!a||confirm(a))&&scheduler.editStop(scheduler.config.positive_closing)}};scheduler._correct_shift=function(a,b){return a-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(a)).getTimezoneOffset())*6E4*(b?-1:1)};
+scheduler._on_mouse_move=function(a){if(this._drag_mode){var b=this._mouse_coords(a);if(!this._drag_pos||b.custom||this._drag_pos.x!=b.x||this._drag_pos.y!=b.y){this._edit_id!=this._drag_id&&this._close_not_saved();this._drag_pos=b;if(this._drag_mode=="create"){this._close_not_saved();this._loading=!0;var c=this._min_date.valueOf()+(b.y*this.config.time_step+(this._table_view?0:b.x)*1440)*6E4,c=this._correct_shift(c);if(!this._drag_start){this._drag_start=c;return}var d=c;if(d==this._drag_start)return;
+this._drag_id=this.uid();this.addEvent(new Date(this._drag_start),new Date(d),this.locale.labels.new_event,this._drag_id,b.fields);this.callEvent("onEventCreated",[this._drag_id,a]);this._loading=!1;this._drag_mode="new-size"}var e=this.getEvent(this._drag_id);if(this._drag_mode=="move")c=this._min_date.valueOf()+(b.y*this.config.time_step+b.x*1440)*6E4,!b.custom&&this._table_view&&(c+=this.date.time_part(e.start_date)*1E3),c=this._correct_shift(c),d=e.end_date.valueOf()-(e.start_date.valueOf()-c);
+else{c=e.start_date.valueOf();if(this._table_view)d=this._min_date.valueOf()+b.y*this.config.time_step*6E4+(b.custom?0:864E5),this._mode=="month"&&(d=this._correct_shift(d,!1));else if(d=this.date.date_part(new Date(e.end_date)).valueOf()+b.y*this.config.time_step*6E4,this._els.dhx_cal_data[0].style.cursor="s-resize",this._mode=="week"||this._mode=="day")d=this._correct_shift(d);if(this._drag_mode=="new-size")if(d<=this._drag_start)var f=b.shift||(this._table_view&&!b.custom?864E5:0),c=d-(b.shift?
+0:f),d=this._drag_start+(f||this.config.time_step*6E4);else c=this._drag_start;else d<=c&&(d=c+this.config.time_step*6E4)}var g=new Date(d-1),h=new Date(c);if(this._table_view||g.getDate()==h.getDate()&&g.getHours()<this.config.last_hour||scheduler._wa&&scheduler._wa._dnd)e.start_date=h,e.end_date=new Date(d),this.config.update_render?this.update_view():this.updateEvent(this._drag_id);this._table_view&&this.for_rendered(this._drag_id,function(a){a.className+=" dhx_in_move"})}}else if(scheduler.checkEvent("onMouseMove")){var i=
+this._locate_event(a.target||a.srcElement);this.callEvent("onMouseMove",[i,a])}};scheduler._on_mouse_context=function(a,b){return this.callEvent("onContextMenu",[this._locate_event(b),a])};
+scheduler._on_mouse_down=function(a,b){if(!this.config.readonly&&!this._drag_mode){b=b||a.target||a.srcElement;if(a.button==2||a.ctrlKey)return this._on_mouse_context(a,b);switch(b.className.split(" ")[0]){case "dhx_cal_event_line":case "dhx_cal_event_clear":if(this._table_view)this._drag_mode="move";break;case "dhx_header":case "dhx_title":case "dhx_wa_ev_body":this._drag_mode="move";break;case "dhx_footer":this._drag_mode="resize";break;case "dhx_scale_holder":case "dhx_scale_holder_now":case "dhx_month_body":case "dhx_matrix_cell":this._drag_mode=
+"create";break;case "":if(b.parentNode)return scheduler._on_mouse_down(a,b.parentNode);default:this._drag_id=this._drag_mode=null}if(this._drag_mode){var c=this._locate_event(b);!this.config["drag_"+this._drag_mode]||!this.callEvent("onBeforeDrag",[c,this._drag_mode,a])?this._drag_mode=this._drag_id=0:(this._drag_id=c,this._drag_event=scheduler._lame_copy({},this._copy_event(this.getEvent(this._drag_id)||{})))}this._drag_start=null}};
+scheduler._on_mouse_up=function(a){if(this._drag_mode&&this._drag_id){this._els.dhx_cal_data[0].style.cursor="default";var b=this.getEvent(this._drag_id);if(this._drag_event._dhx_changed||!this._drag_event.start_date||b.start_date.valueOf()!=this._drag_event.start_date.valueOf()||b.end_date.valueOf()!=this._drag_event.end_date.valueOf()){var c=this._drag_mode=="new-size";if(this.callEvent("onBeforeEventChanged",[b,a,c]))if(c&&this.config.edit_on_create){this.unselect();this._new_event=new Date;if(this._table_view||
+this.config.details_on_create)return this._drag_mode=null,this.showLightbox(this._drag_id);this._drag_pos=!0;this._select_id=this._edit_id=this._drag_id}else this._new_event||this.callEvent(c?"onEventAdded":"onEventChanged",[this._drag_id,this.getEvent(this._drag_id)]);else c?this.deleteEvent(b.id,!0):(this._drag_event._dhx_changed=!1,scheduler._lame_copy(b,this._drag_event),this.updateEvent(b.id))}this._drag_pos&&this.render_view_data()}this._drag_pos=this._drag_mode=null};
+scheduler.update_view=function(){this._reset_scale();if(this._load_mode&&this._load())return this._render_wait=!0;this.render_view_data()};
+scheduler.setCurrentView=function(a,b){a=a||this._date;b=b||this._mode;if(this.callEvent("onBeforeViewChange",[this._mode,this._date,b,a])){var c="dhx_cal_data",d=this._mode==b&&this.config.preserve_scroll?this._els[c][0].scrollTop:!1;if(this[this._mode+"_view"]&&b&&this._mode!=b)this[this._mode+"_view"](!1);this._close_not_saved();var e="dhx_multi_day";this._els[e]&&(this._els[e][0].parentNode.removeChild(this._els[e][0]),this._els[e]=null);this._mode=b;this._date=a;this._table_view=this._mode==
+"month";for(var f=this._els.dhx_cal_tab,g=0;g<f.length;g++)f[g].className="dhx_cal_tab"+(f[g].getAttribute("name")==this._mode+"_tab"?" active":"");var h=this[this._mode+"_view"];h?h(!0):this.update_view();if(typeof d=="number")this._els[c][0].scrollTop=d;this.callEvent("onViewChange",[this._mode,this._date])}};
+scheduler._render_x_header=function(a,b,c,d){var e=document.createElement("DIV");e.className="dhx_scale_bar";this.set_xy(e,this._cols[a]-1,this.xy.scale_height-2,b,0);e.innerHTML=this.templates[this._mode+"_scale_date"](c,this._mode);d.appendChild(e)};
+scheduler._reset_scale=function(){if(this.templates[this._mode+"_date"]){var a=this._els.dhx_cal_header[0],b=this._els.dhx_cal_data[0],c=this.config;a.innerHTML="";b.scrollTop=0;b.innerHTML="";var d=(c.readonly||!c.drag_resize?" dhx_resize_denied":"")+(c.readonly||!c.drag_move?" dhx_move_denied":"");if(d)b.className="dhx_cal_data"+d;this._cols=[];this._colsS={height:0};this._dy_shift=0;this.set_sizes();var e=parseInt(a.style.width),f=0,g,h,i,k;h=this.date[this._mode+"_start"](new Date(this._date.valueOf()));
+g=i=this._table_view?scheduler.date.week_start(h):h;k=this.date.date_part(new Date);var j=scheduler.date.add(h,1,this._mode),l=7;if(!this._table_view){var o=this.date["get_"+this._mode+"_end"];o&&(j=o(h));l=Math.round((j.valueOf()-h.valueOf())/864E5)}this._min_date=g;this._els.dhx_cal_date[0].innerHTML=this.templates[this._mode+"_date"](h,j,this._mode);for(var m=0;m<l;m++){this._cols[m]=Math.floor(e/(l-m));this._render_x_header(m,f,g,a);if(!this._table_view){var n=document.createElement("DIV"),p=
+"dhx_scale_holder";g.valueOf()==k.valueOf()&&(p="dhx_scale_holder_now");n.className=p+" "+this.templates.week_date_class(g,k);this.set_xy(n,this._cols[m]-1,c.hour_size_px*(c.last_hour-c.first_hour),f+this.xy.scale_width+1,0);b.appendChild(n);this.callEvent("onScaleAdd",[n,g])}g=this.date.add(g,1,"day");e-=this._cols[m];f+=this._cols[m];this._colsS[m]=(this._cols[m-1]||0)+(this._colsS[m-1]||(this._table_view?0:this.xy.scale_width+2));this._colsS.col_length=l+1}this._max_date=g;this._colsS[l]=this._cols[l-
+1]+this._colsS[l-1];if(this._table_view)this._reset_month_scale(b,h,i);else{this._reset_hours_scale(b,h,i);if(c.multi_day){var q="dhx_multi_day";this._els[q]&&(this._els[q][0].parentNode.removeChild(this._els[q][0]),this._els[q]=null);var v=this._els.dhx_cal_navline[0],s=v.offsetHeight+this._els.dhx_cal_header[0].offsetHeight+1,r=document.createElement("DIV");r.className=q;r.style.visibility="hidden";this.set_xy(r,this._colsS[this._colsS.col_length-1]+this.xy.scroll_width,0,0,s);b.parentNode.insertBefore(r,
+b);var u=r.cloneNode(!0);u.className=q+"_icon";u.style.visibility="hidden";this.set_xy(u,this.xy.scale_width,0,0,s);r.appendChild(u);this._els[q]=[r,u];this._els[q][0].onclick=this._click.dhx_cal_data}if(this.config.mark_now){var t=new Date;if(t<this._max_date&&t>this._min_date&&t.getHours()>=this.config.first_hour&&t.getHours()<this.config.last_hour){var A=this.locate_holder_day(t),B=t.getHours()*60+t.getMinutes(),y=document.createElement("DIV");y.className="dhx_now_time";y.style.top=Math.round((B*
+6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+1+"px";b.childNodes[A].appendChild(y)}}}}};
+scheduler._reset_hours_scale=function(a){var b=document.createElement("DIV");b.className="dhx_scale_holder";for(var c=new Date(1980,1,1,this.config.first_hour,0,0),d=this.config.first_hour*1;d<this.config.last_hour;d++){var e=document.createElement("DIV");e.className="dhx_scale_hour";e.style.height=this.config.hour_size_px-(this._quirks?0:1)+"px";e.style.width=this.xy.scale_width+"px";e.innerHTML=scheduler.templates.hour_scale(c);b.appendChild(e);c=this.date.add(c,1,"hour")}a.appendChild(b);if(this.config.scroll_hour)a.scrollTop=
+this.config.hour_size_px*(this.config.scroll_hour-this.config.first_hour)};
+scheduler._reset_month_scale=function(a,b,c){var d=scheduler.date.add(b,1,"month"),e=new Date;this.date.date_part(e);this.date.date_part(c);var f=Math.ceil(Math.round((d.valueOf()-c.valueOf())/864E5)/7),g=[],h=Math.floor(a.clientHeight/f)-22;this._colsS.height=h+22;for(var i=this._colsS.heights=[],k=0;k<=7;k++)g[k]=" style='height:"+h+"px; width:"+((this._cols[k]||0)-1)+"px;' ";var j=0;this._min_date=c;for(var l="<table cellpadding='0' cellspacing='0'>",k=0;k<f;k++){l+="<tr>";for(var o=0;o<7;o++){l+=
+"<td";var m="";c<b?m="dhx_before":c>=d?m="dhx_after":c.valueOf()==e.valueOf()&&(m="dhx_now");l+=" class='"+m+" "+this.templates.month_date_class(c,e)+"' ";l+="><div class='dhx_month_head'>"+this.templates.month_day(c)+"</div><div class='dhx_month_body' "+g[o]+"></div></td>";c=this.date.add(c,1,"day")}l+="</tr>";i[k]=j;j+=this._colsS.height}l+="</table>";this._max_date=c;a.innerHTML=l;return c};
+scheduler.getLabel=function(a,b){for(var c=this.config.lightbox.sections,d=0;d<c.length;d++)if(c[d].map_to==a)for(var e=c[d].options,f=0;f<e.length;f++)if(e[f].key==b)return e[f].label;return""};scheduler.updateCollection=function(a,b){var c=scheduler.serverList(a);if(!c)return!1;c.splice(0,c.length);c.push.apply(c,b||[]);scheduler.callEvent("onOptionsLoad",[]);scheduler.resetLightbox();return!0};scheduler._lame_copy=function(a,b){for(var c in b)a[c]=b[c];return a};
+scheduler.date={init:function(){for(var a=scheduler.locale.date.month_short,b=scheduler.locale.date.month_short_hash={},c=0;c<a.length;c++)b[a[c]]=c;a=scheduler.locale.date.month_full;b=scheduler.locale.date.month_full_hash={};for(c=0;c<a.length;c++)b[a[c]]=c},date_part:function(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a},time_part:function(a){return(a.valueOf()/1E3-a.getTimezoneOffset()*60)%86400},week_start:function(a){var b=a.getDay();scheduler.config.start_on_monday&&
+(b===0?b=6:b--);return this.date_part(this.add(a,-1*b,"day"))},month_start:function(a){a.setDate(1);return this.date_part(a)},year_start:function(a){a.setMonth(0);return this.month_start(a)},day_start:function(a){return this.date_part(a)},add:function(a,b,c){var d=new Date(a.valueOf());switch(c){case "day":d.setDate(d.getDate()+b);if(a.getDate()==d.getDate()&&b){do d.setTime(d.getTime()+36E5);while(a.getDate()==d.getDate())}break;case "week":d.setDate(d.getDate()+7*b);break;case "month":d.setMonth(d.getMonth()+
+b);break;case "year":d.setYear(d.getFullYear()+b);break;case "hour":d.setHours(d.getHours()+b);break;case "minute":d.setMinutes(d.getMinutes()+b);break;default:return scheduler.date["add_"+c](a,b,c)}return d},to_fixed:function(a){return a<10?"0"+a:a},copy:function(a){return new Date(a.valueOf())},date_to_str:function(a,b){a=a.replace(/%[a-zA-Z]/g,function(a){switch(a){case "%d":return'"+scheduler.date.to_fixed(date.getDate())+"';case "%m":return'"+scheduler.date.to_fixed((date.getMonth()+1))+"';case "%j":return'"+date.getDate()+"';
+case "%n":return'"+(date.getMonth()+1)+"';case "%y":return'"+scheduler.date.to_fixed(date.getFullYear()%100)+"';case "%Y":return'"+date.getFullYear()+"';case "%D":return'"+scheduler.locale.date.day_short[date.getDay()]+"';case "%l":return'"+scheduler.locale.date.day_full[date.getDay()]+"';case "%M":return'"+scheduler.locale.date.month_short[date.getMonth()]+"';case "%F":return'"+scheduler.locale.date.month_full[date.getMonth()]+"';case "%h":return'"+scheduler.date.to_fixed((date.getHours()+11)%12+1)+"';
+case "%g":return'"+((date.getHours()+11)%12+1)+"';case "%G":return'"+date.getHours()+"';case "%H":return'"+scheduler.date.to_fixed(date.getHours())+"';case "%i":return'"+scheduler.date.to_fixed(date.getMinutes())+"';case "%a":return'"+(date.getHours()>11?"pm":"am")+"';case "%A":return'"+(date.getHours()>11?"PM":"AM")+"';case "%s":return'"+scheduler.date.to_fixed(date.getSeconds())+"';case "%W":return'"+scheduler.date.to_fixed(scheduler.date.getISOWeek(date))+"';default:return a}});b&&(a=a.replace(/date\.get/g,
+"date.getUTC"));return new Function("date",'return "'+a+'";')},str_to_date:function(a,b){for(var c="var temp=date.split(/[^0-9a-zA-Z]+/g);",d=a.match(/%[a-zA-Z]/g),e=0;e<d.length;e++)switch(d[e]){case "%j":case "%d":c+="set[2]=temp["+e+"]||1;";break;case "%n":case "%m":c+="set[1]=(temp["+e+"]||1)-1;";break;case "%y":c+="set[0]=temp["+e+"]*1+(temp["+e+"]>50?1900:2000);";break;case "%g":case "%G":case "%h":case "%H":c+="set[3]=temp["+e+"]||0;";break;case "%i":c+="set[4]=temp["+e+"]||0;";break;case "%Y":c+=
+"set[0]=temp["+e+"]||0;";break;case "%a":case "%A":c+="set[3]=set[3]%12+((temp["+e+"]||'').toLowerCase()=='am'?0:12);";break;case "%s":c+="set[5]=temp["+e+"]||0;";break;case "%M":c+="set[1]=scheduler.locale.date.month_short_hash[temp["+e+"]]||0;";break;case "%F":c+="set[1]=scheduler.locale.date.month_full_hash[temp["+e+"]]||0;"}var f="set[0],set[1],set[2],set[3],set[4],set[5]";b&&(f=" Date.UTC("+f+")");return new Function("date","var set=[0,0,1,0,0,0]; "+c+" return new Date("+f+");")},getISOWeek:function(a){if(!a)return!1;
+var b=a.getDay();b===0&&(b=7);var c=new Date(a.valueOf());c.setDate(a.getDate()+(4-b));var d=c.getFullYear(),e=Math.round((c.getTime()-(new Date(d,0,1)).getTime())/864E5),f=1+Math.floor(e/7);return f},getUTCISOWeek:function(a){return this.getISOWeek(a)}};
+scheduler.locale={date:{month_full:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),month_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),day_full:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},labels:{dhx_cal_today_button:"Today",day_tab:"Day",week_tab:"Week",month_tab:"Month",new_event:"New event",icon_save:"Save",icon_cancel:"Cancel",icon_details:"Details",
+icon_edit:"Edit",icon_delete:"Delete",confirm_closing:"",confirm_deleting:"Event will be deleted permanently, are you sure?",section_description:"Description",section_time:"Time period",full_day:"Full day",confirm_recurring:"Do you want to edit the whole set of repeated events?",section_recurring:"Repeat event",button_recurring:"Disabled",button_recurring_open:"Enabled",agenda_tab:"Agenda",date:"Date",description:"Description",year_tab:"Year",week_agenda_tab:"Agenda"}};
+scheduler.config={default_date:"%j %M %Y",month_date:"%F %Y",load_date:"%Y-%m-%d",week_date:"%l",day_date:"%D, %F %j",hour_date:"%H:%i",month_day:"%d",xml_date:"%m/%d/%Y %H:%i",api_date:"%d-%m-%Y %H:%i",hour_size_px:42,time_step:5,start_on_monday:1,first_hour:0,last_hour:24,readonly:!1,drag_resize:1,drag_move:1,drag_create:1,dblclick_create:1,edit_on_create:1,details_on_create:0,click_form_details:0,cascade_event_display:!1,cascade_event_count:4,cascade_event_margin:30,drag_lightbox:!0,preserve_scroll:!0,
+server_utc:!1,positive_closing:!1,icons_edit:["icon_save","icon_cancel"],icons_select:["icon_details","icon_edit","icon_delete"],buttons_left:["dhx_save_btn","dhx_cancel_btn"],buttons_right:["dhx_delete_btn"],lightbox:{sections:[{name:"description",height:200,map_to:"text",type:"textarea",focus:!0},{name:"time",height:72,type:"time",map_to:"auto"}]},repeat_date_of_end:"01.01.2010"};scheduler.templates={};
+scheduler.init_templates=function(){var a=scheduler.date.date_to_str,b=scheduler.config,c=function(a,b){for(var c in b)a[c]||(a[c]=b[c])};c(scheduler.templates,{day_date:a(b.default_date),month_date:a(b.month_date),week_date:function(a,b){return scheduler.templates.day_date(a)+" &ndash; "+scheduler.templates.day_date(scheduler.date.add(b,-1,"day"))},day_scale_date:a(b.default_date),month_scale_date:a(b.week_date),week_scale_date:a(b.day_date),hour_scale:a(b.hour_date),time_picker:a(b.hour_date),event_date:a(b.hour_date),
+month_day:a(b.month_day),xml_date:scheduler.date.str_to_date(b.xml_date,b.server_utc),load_format:a(b.load_date,b.server_utc),xml_format:a(b.xml_date,b.server_utc),api_date:scheduler.date.str_to_date(b.api_date),event_header:function(a,b){return scheduler.templates.event_date(a)+" - "+scheduler.templates.event_date(b)},event_text:function(a,b,c){return c.text},event_class:function(){return""},month_date_class:function(){return""},week_date_class:function(){return""},event_bar_date:function(a){return scheduler.templates.event_date(a)+
+" "},event_bar_text:function(a,b,c){return c.text}});this.callEvent("onTemplatesReady",[])};scheduler.uid=function(){if(!this._seed)this._seed=(new Date).valueOf();return this._seed++};scheduler._events={};scheduler.clearAll=function(){this._events={};this._loaded={};this.clear_view()};
+scheduler.addEvent=function(a,b,c,d,e){if(!arguments.length)return this.addEventNow();var f=a;if(arguments.length!=1)f=e||{},f.start_date=a,f.end_date=b,f.text=c,f.id=d;f.id=f.id||scheduler.uid();f.text=f.text||"";if(typeof f.start_date=="string")f.start_date=this.templates.api_date(f.start_date);if(typeof f.end_date=="string")f.end_date=this.templates.api_date(f.end_date);var g=(this.config.event_duration||this.config.time_step)*6E4;f.start_date.valueOf()==f.end_date.valueOf()&&f.end_date.setTime(f.end_date.valueOf()+
+g);f._timed=this.is_one_day_event(f);var h=!this._events[f.id];this._events[f.id]=f;this.event_updated(f);this._loading||this.callEvent(h?"onEventAdded":"onEventChanged",[f.id,f])};scheduler.deleteEvent=function(a,b){var c=this._events[a];if(b||this.callEvent("onBeforeEventDelete",[a,c])&&this.callEvent("onConfirmedBeforeEventDelete",[a,c]))c&&(delete this._events[a],this.unselect(a),this.event_updated(c)),this.callEvent("onEventDeleted",[a])};scheduler.getEvent=function(a){return this._events[a]};
+scheduler.setEvent=function(a,b){this._events[a]=b};scheduler.for_rendered=function(a,b){for(var c=this._rendered.length-1;c>=0;c--)this._rendered[c].getAttribute("event_id")==a&&b(this._rendered[c],c)};scheduler.changeEventId=function(a,b){if(a!=b){var c=this._events[a];if(c)c.id=b,this._events[b]=c,delete this._events[a];this.for_rendered(a,function(a){a.setAttribute("event_id",b)});if(this._select_id==a)this._select_id=b;if(this._edit_id==a)this._edit_id=b;this.callEvent("onEventIdChange",[a,b])}};
+(function(){for(var a="text,Text,start_date,StartDate,end_date,EndDate".split(","),b=function(a){return function(b){return scheduler.getEvent(b)[a]}},c=function(a){return function(b,c){var d=scheduler.getEvent(b);d[a]=c;d._changed=!0;d._timed=this.is_one_day_event(d);scheduler.event_updated(d,!0)}},d=0;d<a.length;d+=2)scheduler["getEvent"+a[d+1]]=b(a[d]),scheduler["setEvent"+a[d+1]]=c(a[d])})();scheduler.event_updated=function(a){this.is_visible_events(a)?this.render_view_data():this.clear_event(a.id)};
+scheduler.is_visible_events=function(a){return a.start_date<this._max_date&&this._min_date<a.end_date};scheduler.is_one_day_event=function(a){var b=a.end_date.getDate()-a.start_date.getDate();return b?(b<0&&(b=Math.ceil((a.end_date.valueOf()-a.start_date.valueOf())/864E5)),b==1&&!a.end_date.getHours()&&!a.end_date.getMinutes()&&(a.start_date.getHours()||a.start_date.getMinutes())):a.start_date.getMonth()==a.end_date.getMonth()&&a.start_date.getFullYear()==a.end_date.getFullYear()};
+scheduler.get_visible_events=function(){var a=[],b=this["filter_"+this._mode],c;for(c in this._events)if(this.is_visible_events(this._events[c])&&(this._table_view||this.config.multi_day||this._events[c]._timed))(!b||b(c,this._events[c]))&&a.push(this._events[c]);return a};
+scheduler.render_view_data=function(a,b){if(!a){if(this._not_render){this._render_wait=!0;return}this._render_wait=!1;this.clear_view();a=this.get_visible_events()}if(this.config.multi_day&&!this._table_view){for(var c=[],d=[],e=0;e<a.length;e++)a[e]._timed?c.push(a[e]):d.push(a[e]);this._rendered_location=this._els.dhx_multi_day[0];this._table_view=!0;this.render_data(d,b);this._table_view=!1;this._rendered_location=this._els.dhx_cal_data[0];this._table_view=!1;this.render_data(c,b)}else this._rendered_location=
+this._els.dhx_cal_data[0],this.render_data(a,b)};scheduler.render_data=function(a,b){for(var a=this._pre_render_events(a,b),c=0;c<a.length;c++)this._table_view?this.render_event_bar(a[c]):this.render_event(a[c])};
+scheduler._pre_render_events=function(a,b){var c=this.xy.bar_height,d=this._colsS.heights,e=this._colsS.heights=[0,0,0,0,0,0,0],f=this._els.dhx_cal_data[0],a=this._table_view?this._pre_render_events_table(a,b):this._pre_render_events_line(a,b);if(this._table_view)if(b)this._colsS.heights=d;else{var g=f.firstChild;if(g.rows){for(var h=0;h<g.rows.length;h++){e[h]++;if(e[h]*c>this._colsS.height-22){for(var i=g.rows[h].cells,k=0;k<i.length;k++)i[k].childNodes[1].style.height=e[h]*c+"px";e[h]=(e[h-1]||
+0)+i[0].offsetHeight}e[h]=(e[h-1]||0)+g.rows[h].cells[0].offsetHeight}e.unshift(0);if(g.parentNode.offsetHeight<g.parentNode.scrollHeight&&!g._h_fix){for(h=0;h<g.rows.length;h++){var j=g.rows[h].cells[6].childNodes[0],l=j.offsetWidth-scheduler.xy.scroll_width+"px";j.style.width=l;j.nextSibling.style.width=l}g._h_fix=!0}}else if(!a.length&&this._els.dhx_multi_day[0].style.visibility=="visible"&&(e[0]=-1),a.length||e[0]==-1){var o=g.parentNode.childNodes,m=(e[0]+1)*c+1+"px";f.style.top=this._els.dhx_cal_navline[0].offsetHeight+
+this._els.dhx_cal_header[0].offsetHeight+parseInt(m)+"px";f.style.height=this._obj.offsetHeight-parseInt(f.style.top)-(this.xy.margin_top||0)+"px";var n=this._els.dhx_multi_day[0];n.style.height=m;n.style.visibility=e[0]==-1?"hidden":"visible";n=this._els.dhx_multi_day[1];n.style.height=m;n.style.visibility=e[0]==-1?"hidden":"visible";n.className=e[0]?"dhx_multi_day_icon":"dhx_multi_day_icon_small";this._dy_shift=(e[0]+1)*c;e[0]=0}}return a};
+scheduler._get_event_sday=function(a){return Math.floor((a.start_date.valueOf()-this._min_date.valueOf())/864E5)};
+scheduler._pre_render_events_line=function(a,b){a.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?1:-1});for(var c=[],d=[],e=0;e<a.length;e++){var f=a[e],g=f.start_date.getHours(),h=f.end_date.getHours();f._sday=this._get_event_sday(f);c[f._sday]||(c[f._sday]=[]);if(!b){f._inner=!1;for(var i=c[f._sday];i.length&&i[i.length-1].end_date<=f.start_date;)i.splice(i.length-1,1);for(var k=!1,j=0;j<i.length;j++)if(i[j].end_date.valueOf()<f.start_date.valueOf()){k=
+!0;f._sorder=i[j]._sorder;i.splice(j,1);f._inner=!0;break}if(i.length)i[i.length-1]._inner=!0;if(!k)if(i.length)if(i.length<=i[i.length-1]._sorder){if(i[i.length-1]._sorder)for(j=0;j<i.length;j++){var l=!1;for(k=0;k<i.length;k++)if(i[k]._sorder==j){l=!0;break}if(!l){f._sorder=j;break}}else f._sorder=0;f._inner=!0}else{l=i[0]._sorder;for(j=1;j<i.length;j++)if(i[j]._sorder>l)l=i[j]._sorder;f._sorder=l+1;f._inner=!1}else f._sorder=0;i.push(f);i.length>(i.max_count||0)?(i.max_count=i.length,f._count=
+i.length):f._count=f._count?f._count:1}if(g<this.config.first_hour||h>=this.config.last_hour)if(d.push(f),a[e]=f=this._copy_event(f),g<this.config.first_hour&&(f.start_date.setHours(this.config.first_hour),f.start_date.setMinutes(0)),h>=this.config.last_hour&&(f.end_date.setMinutes(0),f.end_date.setHours(this.config.last_hour)),f.start_date>f.end_date||g==this.config.last_hour)a.splice(e,1),e--}if(!b){for(e=0;e<a.length;e++)a[e]._count=c[a[e]._sday].max_count;for(e=0;e<d.length;e++)d[e]._count=c[d[e]._sday].max_count}return a};
+scheduler._time_order=function(a){a.sort(function(a,c){return a.start_date.valueOf()==c.start_date.valueOf()?a._timed&&!c._timed?1:!a._timed&&c._timed?-1:a.id>c.id?1:-1:a.start_date>c.start_date?1:-1})};
+scheduler._pre_render_events_table=function(a,b){this._time_order(a);for(var c=[],d=[[],[],[],[],[],[],[]],e=this._colsS.heights,f,g=this._cols.length,h=0;h<a.length;h++){var i=a[h],k=f||i.start_date,j=i.end_date;if(k<this._min_date)k=this._min_date;if(j>this._max_date)j=this._max_date;var l=this.locate_holder_day(k,!1,i);i._sday=l%g;var o=this.locate_holder_day(j,!0,i)||g;i._eday=o%g||g;i._length=o-l;i._sweek=Math.floor((this._correct_shift(k.valueOf(),1)-this._min_date.valueOf())/(864E5*g));var m=
+d[i._sweek],n;for(n=0;n<m.length;n++)if(m[n]._eday<=i._sday)break;if(!i._sorder||!b)i._sorder=n;if(i._sday+i._length<=g)f=null,c.push(i),m[n]=i,e[i._sweek]=m.length-1;else{var p=this._copy_event(i);p._length=g-i._sday;p._eday=g;p._sday=i._sday;p._sweek=i._sweek;p._sorder=i._sorder;p.end_date=this.date.add(k,p._length,"day");c.push(p);m[n]=p;f=p.end_date;e[i._sweek]=m.length-1;h--}}return c};scheduler._copy_dummy=function(){this.start_date=new Date(this.start_date);this.end_date=new Date(this.end_date)};
+scheduler._copy_event=function(a){this._copy_dummy.prototype=a;return new this._copy_dummy};scheduler._rendered=[];scheduler.clear_view=function(){for(var a=0;a<this._rendered.length;a++){var b=this._rendered[a];b.parentNode&&b.parentNode.removeChild(b)}this._rendered=[]};scheduler.updateEvent=function(a){var b=this.getEvent(a);this.clear_event(a);b&&this.is_visible_events(b)&&this.render_view_data([b],!0)};
+scheduler.clear_event=function(a){this.for_rendered(a,function(a,c){a.parentNode&&a.parentNode.removeChild(a);scheduler._rendered.splice(c,1)})};
+scheduler.render_event=function(a){var b=scheduler.xy.menu_width;if(!(a._sday<0)){var c=scheduler.locate_holder(a._sday);if(c){var d=a.start_date.getHours()*60+a.start_date.getMinutes(),e=a.end_date.getHours()*60+a.end_date.getMinutes()||scheduler.config.last_hour*60,f=Math.round((d*6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+1,g=Math.max(scheduler.xy.min_event_height,(e-d)*this.config.hour_size_px/60)+1,h=Math.floor((c.clientWidth-b)/a._count),i=
+a._sorder*h+1;a._inner||(h*=a._count-a._sorder);if(this.config.cascade_event_display)var k=this.config.cascade_event_count,j=this.config.cascade_event_margin,i=a._sorder%k*j,l=a._inner?(a._count-a._sorder-1)%k*j/2:0,h=Math.floor(c.clientWidth-b-i-l);var o=this._render_v_bar(a.id,b+i,f,h,g,a._text_style,scheduler.templates.event_header(a.start_date,a.end_date,a),scheduler.templates.event_text(a.start_date,a.end_date,a));this._rendered.push(o);c.appendChild(o);i=i+parseInt(c.style.left,10)+b;if(this._edit_id==
+a.id){o.style.zIndex=1;h=Math.max(h-4,scheduler.xy.editor_width);o=document.createElement("DIV");o.setAttribute("event_id",a.id);this.set_xy(o,h,g-20,i,f+14);o.className="dhx_cal_editor";var m=document.createElement("DIV");this.set_xy(m,h-6,g-26);m.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;";o.appendChild(m);this._els.dhx_cal_data[0].appendChild(o);this._rendered.push(o);m.innerHTML="<textarea class='dhx_cal_editor'>"+a.text+"</textarea>";if(this._quirks7)m.firstChild.style.height=g-
+12+"px";this._editor=m.firstChild;this._editor.onkeypress=function(a){if((a||event).shiftKey)return!0;var b=(a||event).keyCode;b==scheduler.keys.edit_save&&scheduler.editStop(!0);b==scheduler.keys.edit_cancel&&scheduler.editStop(!1)};this._editor.onselectstart=function(a){return(a||event).cancelBubble=!0};m.firstChild.focus();this._els.dhx_cal_data[0].scrollLeft=0;m.firstChild.select()}if(this._select_id==a.id){if(this.config.cascade_event_display&&this._drag_mode)o.style.zIndex=1;for(var n=this.config["icons_"+
+(this._edit_id==a.id?"edit":"select")],p="",q=a.color?"background-color:"+a.color+";":"",v=a.textColor?"color:"+a.textColor+";":"",s=0;s<n.length;s++)p+="<div class='dhx_menu_icon "+n[s]+"' style='"+q+""+v+"' title='"+this.locale.labels[n[s]]+"'></div>";var r=this._render_v_bar(a.id,i-b+1,f,b,n.length*20+26,"","<div style='"+q+""+v+"' class='dhx_menu_head'></div>",p,!0);r.style.left=i-b+1;this._els.dhx_cal_data[0].appendChild(r);this._rendered.push(r)}}}};
+scheduler._render_v_bar=function(a,b,c,d,e,f,g,h,i){var k=document.createElement("DIV"),j=this.getEvent(a),l="dhx_cal_event",o=scheduler.templates.event_class(j.start_date,j.end_date,j);o&&(l=l+" "+o);var m=j.color?"background-color:"+j.color+";":"",n=j.textColor?"color:"+j.textColor+";":"",p='<div event_id="'+a+'" class="'+l+'" style="position:absolute; top:'+c+"px; left:"+b+"px; width:"+(d-4)+"px; height:"+e+"px;"+(f||"")+'">';p+='<div class="dhx_header" style=" width:'+(d-6)+"px;"+m+'" >&nbsp;</div>';
+p+='<div class="dhx_title" style="'+m+""+n+'">'+g+"</div>";p+='<div class="dhx_body" style=" width:'+(d-(this._quirks?4:14))+"px; height:"+(e-(this._quirks?20:30))+"px;"+m+""+n+'">'+h+"</div>";p+='<div class="dhx_footer" style=" width:'+(d-8)+"px;"+(i?" margin-top:-1px;":"")+""+m+""+n+'" ></div></div>';k.innerHTML=p;return k.firstChild};scheduler.locate_holder=function(a){return this._mode=="day"?this._els.dhx_cal_data[0].firstChild:this._els.dhx_cal_data[0].childNodes[a]};
+scheduler.locate_holder_day=function(a,b){var c=Math.floor((this._correct_shift(a,1)-this._min_date)/864E5);b&&this.date.time_part(a)&&c++;return c};
+scheduler.render_event_bar=function(a){var b=this._rendered_location,c=this._colsS[a._sday],d=this._colsS[a._eday];d==c&&(d=this._colsS[a._eday+1]);var e=this.xy.bar_height,f=this._colsS.heights[a._sweek]+(this._colsS.height?this.xy.month_scale_height+2:2)+a._sorder*e,g=document.createElement("DIV"),h=a._timed?"dhx_cal_event_clear":"dhx_cal_event_line",i=scheduler.templates.event_class(a.start_date,a.end_date,a);i&&(h=h+" "+i);var k=a.color?"background-color:"+a.color+";":"",j=a.textColor?"color:"+
+a.textColor+";":"",l='<div event_id="'+a.id+'" class="'+h+'" style="position:absolute; top:'+f+"px; left:"+c+"px; width:"+(d-c-15)+"px;"+j+""+k+""+(a._text_style||"")+'">';a._timed&&(l+=scheduler.templates.event_bar_date(a.start_date,a.end_date,a));l+=scheduler.templates.event_bar_text(a.start_date,a.end_date,a)+"</div>";l+="</div>";g.innerHTML=l;this._rendered.push(g.firstChild);b.appendChild(g.firstChild)};
+scheduler._locate_event=function(a){for(var b=null;a&&!b&&a.getAttribute;)b=a.getAttribute("event_id"),a=a.parentNode;return b};scheduler.edit=function(a){if(this._edit_id!=a)this.editStop(!1,a),this._edit_id=a,this.updateEvent(a)};scheduler.editStop=function(a,b){if(!(b&&this._edit_id==b)){var c=this.getEvent(this._edit_id);if(c){if(a)c.text=this._editor.value;this._editor=this._edit_id=null;this.updateEvent(c.id);this._edit_stop_event(c,a)}}};
+scheduler._edit_stop_event=function(a,b){this._new_event?(b?this.callEvent("onEventAdded",[a.id,a]):this.deleteEvent(a.id,!0),this._new_event=null):b&&this.callEvent("onEventChanged",[a.id,a])};scheduler.getEvents=function(a,b){var c=[],d;for(d in this._events){var e=this._events[d];e&&e.start_date<b&&e.end_date>a&&c.push(e)}return c};scheduler._loaded={};
+scheduler._load=function(a,b){a=a||this._load_url;a+=(a.indexOf("?")==-1?"?":"&")+"timeshift="+(new Date).getTimezoneOffset();this.config.prevent_cache&&(a+="&uid="+this.uid());var c,b=b||this._date;if(this._load_mode){for(var d=this.templates.load_format,b=this.date[this._load_mode+"_start"](new Date(b.valueOf()));b>this._min_date;)b=this.date.add(b,-1,this._load_mode);c=b;for(var e=!0;c<this._max_date;)c=this.date.add(c,1,this._load_mode),this._loaded[d(b)]&&e?b=this.date.add(b,1,this._load_mode):
+e=!1;var f=c;do c=f,f=this.date.add(c,-1,this._load_mode);while(f>b&&this._loaded[d(f)]);if(c<=b)return!1;for(dhtmlxAjax.get(a+"&from="+d(b)+"&to="+d(c),function(a){scheduler.on_load(a)});b<c;)this._loaded[d(b)]=!0,b=this.date.add(b,1,this._load_mode)}else dhtmlxAjax.get(a,function(a){scheduler.on_load(a)});this.callEvent("onXLS",[]);return!0};
+scheduler.on_load=function(a){this._loading=!0;var b;b=this._process?this[this._process].parse(a.xmlDoc.responseText):this._magic_parser(a);this._not_render=!0;for(var c=0;c<b.length;c++)this.callEvent("onEventLoading",[b[c]])&&this.addEvent(b[c]);this._not_render=!1;this._render_wait&&this.render_view_data();this._loading=!1;this._after_call&&this._after_call();this._after_call=null;this.callEvent("onXLE",[])};scheduler.json={};
+scheduler.json.parse=function(a){if(typeof a=="string")eval("scheduler._temp = "+a+";"),a=scheduler._temp;for(var b=[],c=0;c<a.length;c++)a[c].start_date=scheduler.templates.xml_date(a[c].start_date),a[c].end_date=scheduler.templates.xml_date(a[c].end_date),b.push(a[c]);return b};scheduler.parse=function(a,b){this._process=b;this.on_load({xmlDoc:{responseText:a}})};scheduler.load=function(a,b,c){if(typeof b=="string")this._process=b,b=c;this._load_url=a;this._after_call=b;this._load(a,this._date)};
+scheduler.setLoadMode=function(a){a=="all"&&(a="");this._load_mode=a};scheduler.refresh=function(){alert("not implemented")};scheduler.serverList=function(a,b){return b?this.serverList[a]=b.slice(0):this.serverList[a]=this.serverList[a]||[]};scheduler._userdata={};
+scheduler._magic_parser=function(a){var b;if(!a.getXMLTopNode){var c=a.xmlDoc.responseText,a=new dtmlXMLLoaderObject(function(){});a.loadXMLString(c)}b=a.getXMLTopNode("data");if(b.tagName!="data")return[];for(var d=a.doXPath("//coll_options"),e=0;e<d.length;e++){var f=d[e].getAttribute("for"),g=this.serverList[f];if(g){g.splice(0,g.length);for(var h=a.doXPath(".//item",d[e]),i=0;i<h.length;i++){for(var k=h[i],j=k.attributes,l={key:h[i].getAttribute("value"),label:h[i].getAttribute("label")},o=0;o<
+j.length;o++){var m=j[o];if(!(m.nodeName=="value"||m.nodeName=="label"))l[m.nodeName]=m.nodeValue}g.push(l)}}}d.length&&scheduler.callEvent("onOptionsLoad",[]);for(var n=a.doXPath("//userdata"),e=0;e<n.length;e++){var p=this.xmlNodeToJSON(n[e]);this._userdata[p.name]=p.text}var q=[];b=a.doXPath("//event");for(e=0;e<b.length;e++)q[e]=this.xmlNodeToJSON(b[e]),q[e].text=q[e].text||q[e]._tagvalue,q[e].start_date=this.templates.xml_date(q[e].start_date),q[e].end_date=this.templates.xml_date(q[e].end_date);
+return q};scheduler.xmlNodeToJSON=function(a){for(var b={},c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;for(c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];d.nodeType==1&&(b[d.tagName]=d.firstChild?d.firstChild.nodeValue:"")}if(!b.text)b.text=a.firstChild?a.firstChild.nodeValue:"";return b};
+scheduler.attachEvent("onXLS",function(){if(this.config.show_loading===!0){var a;a=this.config.show_loading=document.createElement("DIV");a.className="dhx_loading";a.style.left=Math.round((this._x-128)/2)+"px";a.style.top=Math.round((this._y-15)/2)+"px";this._obj.appendChild(a)}});scheduler.attachEvent("onXLE",function(){var a;if((a=this.config.show_loading)&&typeof a=="object")this._obj.removeChild(a),this.config.show_loading=!0});
+scheduler.ical={parse:function(a){var b=a.match(RegExp(this.c_start+"[^\u000c]*"+this.c_end,""));if(b.length){b[0]=b[0].replace(/[\r\n]+(?=[a-z \t])/g," ");b[0]=b[0].replace(/\;[^:\r\n]*/g,"");for(var c=[],d,e=RegExp("(?:"+this.e_start+")([^\u000c]*?)(?:"+this.e_end+")","g");d=e.exec(b);){for(var f={},g,h=/[^\r\n]+[\r\n]+/g;g=h.exec(d[1]);)this.parse_param(g.toString(),f);if(f.uid&&!f.id)f.id=f.uid;c.push(f)}return c}},parse_param:function(a,b){var c=a.indexOf(":");if(c!=-1){var d=a.substr(0,c).toLowerCase(),
+e=a.substr(c+1).replace(/\\\,/g,",").replace(/[\r\n]+$/,"");d=="summary"?d="text":d=="dtstart"?(d="start_date",e=this.parse_date(e,0,0)):d=="dtend"&&(d="end_date",e=b.start_date&&b.start_date.getHours()==0?this.parse_date(e,24,0):this.parse_date(e,23,59));b[d]=e}},parse_date:function(a,b,c){var d=a.split("T");d[1]&&(b=d[1].substr(0,2),c=d[1].substr(2,2));var e=d[0].substr(0,4),f=parseInt(d[0].substr(4,2),10)-1,g=d[0].substr(6,2);return scheduler.config.server_utc&&!d[1]?new Date(Date.UTC(e,f,g,b,
+c)):new Date(e,f,g,b,c)},c_start:"BEGIN:VCALENDAR",e_start:"BEGIN:VEVENT",e_end:"END:VEVENT",c_end:"END:VCALENDAR"};scheduler.formSection=function(a){for(var b=this.config.lightbox.sections,c=0;c<b.length;c++)if(b[c].name==a)break;var d=b[c],e=document.getElementById(d.id).nextSibling;return{getValue:function(a){return scheduler.form_blocks[d.type].get_value(e,a||{},d)},setValue:function(a,b){return scheduler.form_blocks[d.type].set_value(e,a,b||{},d)}}};
+scheduler.form_blocks={template:{render:function(a){var b=(a.height||"30")+"px";return"<div class='dhx_cal_ltext dhx_cal_template' style='height:"+b+";'></div>"},set_value:function(a,b){a.innerHTML=b||""},get_value:function(a){return a.innerHTML||""},focus:function(){}},textarea:{render:function(a){var b=(a.height||"130")+"px";return"<div class='dhx_cal_ltext' style='height:"+b+";'><textarea></textarea></div>"},set_value:function(a,b){a.firstChild.value=b||""},get_value:function(a){return a.firstChild.value},
+focus:function(a){var b=a.firstChild;b.select();b.focus()}},select:{render:function(a){for(var b=(a.height||"23")+"px",c="<div class='dhx_cal_ltext' style='height:"+b+";'><select style='width:100%;'>",d=0;d<a.options.length;d++)c+="<option value='"+a.options[d].key+"'>"+a.options[d].label+"</option>";c+="</select></div>";return c},set_value:function(a,b){if(typeof b=="undefined")b=(a.firstChild.options[0]||{}).value;a.firstChild.value=b||""},get_value:function(a){return a.firstChild.value},focus:function(a){var b=
+a.firstChild;b.select&&b.select();b.focus()}},time:{render:function(){var a=scheduler.config,b=this.date.date_part(new Date),c=1440,d=0;scheduler.config.limit_time_select&&(c=60*a.last_hour+1,d=60*a.first_hour,b.setHours(a.first_hour));for(var e="<select>",f=d,g=b.getDate();f<c;){var h=this.templates.time_picker(b);e+="<option value='"+f+"'>"+h+"</option>";b.setTime(b.valueOf()+this.config.time_step*6E4);var i=b.getDate()!=g?1:0,f=i*1440+b.getHours()*60+b.getMinutes()}e+="</select> <select>";for(f=
+1;f<32;f++)e+="<option value='"+f+"'>"+f+"</option>";e+="</select> <select>";for(f=0;f<12;f++)e+="<option value='"+f+"'>"+this.locale.date.month_full[f]+"</option>";e+="</select> <select>";b=b.getFullYear()-5;for(f=0;f<10;f++)e+="<option value='"+(b+f)+"'>"+(b+f)+"</option>";e+="</select> ";return"<div style='height:30px;padding-top:0px;font-size:inherit;' class='dhx_section_time'>"+e+"<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>"+e+"</div>"},set_value:function(a,
+b,c){function d(a,b,c){a[b+0].value=Math.round((c.getHours()*60+c.getMinutes())/scheduler.config.time_step)*scheduler.config.time_step;a[b+1].value=c.getDate();a[b+2].value=c.getMonth();a[b+3].value=c.getFullYear()}var e=a.getElementsByTagName("select");if(scheduler.config.full_day){if(!a._full_day){var f="<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+"&nbsp;</label></input>";scheduler.config.wide_form||(f=a.previousSibling.innerHTML+
+f);a.previousSibling.innerHTML=f;a._full_day=!0}var g=a.previousSibling.getElementsByTagName("input")[0],h=scheduler.date.time_part(c.start_date)===0&&scheduler.date.time_part(c.end_date)===0&&c.end_date.valueOf()-c.start_date.valueOf()<1728E5;g.checked=h;for(var i in e)e[i].disabled=g.checked;g.onclick=function(){if(g.checked){var a=new Date(c.start_date),b=new Date(c.end_date);scheduler.date.date_part(a);b=scheduler.date.add(a,1,"day")}for(var f in e)e[f].disabled=g.checked;d(e,0,a||c.start_date);
+d(e,4,b||c.end_date)}}if(scheduler.config.auto_end_date&&scheduler.config.event_duration)for(var k=function(){c.start_date=new Date(e[3].value,e[2].value,e[1].value,0,e[0].value);c.end_date.setTime(c.start_date.getTime()+scheduler.config.event_duration*6E4);d(e,4,c.end_date)},j=0;j<4;j++)e[j].onchange=k;d(e,0,c.start_date);d(e,4,c.end_date)},get_value:function(a,b){s=a.getElementsByTagName("select");b.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);b.end_date=new Date(s[7].value,
+s[6].value,s[5].value,0,s[4].value);if(b.end_date<=b.start_date)b.end_date=scheduler.date.add(b.start_date,scheduler.config.time_step,"minute")},focus:function(a){a.getElementsByTagName("select")[0].focus()}}};
+scheduler.showCover=function(a){if(a){a.style.display="block";var b=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop,c=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,d=window.innerHeight||document.documentElement.clientHeight;a.style.top=b?Math.round(b+Math.max((d-a.offsetHeight)/2,0))+"px":Math.round(Math.max((d-a.offsetHeight)/2,0)+9)+"px";a.style.left=document.documentElement.scrollWidth>document.body.offsetWidth?Math.round(c+(document.body.offsetWidth-
+a.offsetWidth)/2)+"px":Math.round((document.body.offsetWidth-a.offsetWidth)/2)+"px"}this.show_cover()};scheduler.showLightbox=function(a){if(a&&this.callEvent("onBeforeLightbox",[a])){var b=this._get_lightbox();this.showCover(b);this._fill_lightbox(a,b);this.callEvent("onLightbox",[a])}};
+scheduler._fill_lightbox=function(a,b){var c=this.getEvent(a),d=b.getElementsByTagName("span");scheduler.templates.lightbox_header?(d[1].innerHTML="",d[2].innerHTML=scheduler.templates.lightbox_header(c.start_date,c.end_date,c)):(d[1].innerHTML=this.templates.event_header(c.start_date,c.end_date,c),d[2].innerHTML=(this.templates.event_bar_text(c.start_date,c.end_date,c)||"").substr(0,70));for(var e=this.config.lightbox.sections,f=0;f<e.length;f++){var g=document.getElementById(e[f].id).nextSibling,
+h=this.form_blocks[e[f].type];h.set_value.call(this,g,c[e[f].map_to],c,e[f]);e[f].focus&&h.focus.call(this,g)}scheduler._lightbox_id=a};scheduler._lightbox_out=function(a){for(var b=this.config.lightbox.sections,c=0;c<b.length;c++){var d=document.getElementById(b[c].id),d=d?d.nextSibling:d,e=this.form_blocks[b[c].type],f=e.get_value.call(this,d,a,b[c]);b[c].map_to!="auto"&&(a[b[c].map_to]=f)}return a};
+scheduler._empty_lightbox=function(){var a=scheduler._lightbox_id,b=this.getEvent(a),c=this._get_lightbox();this._lightbox_out(b);b._timed=this.is_one_day_event(b);this.setEvent(b.id,b);this._edit_stop_event(b,!0);this.render_view_data()};scheduler.hide_lightbox=function(){this.hideCover(this._get_lightbox());this._lightbox_id=null;this.callEvent("onAfterLightbox",[])};scheduler.hideCover=function(a){if(a)a.style.display="none";this.hide_cover()};
+scheduler.hide_cover=function(){this._cover&&this._cover.parentNode.removeChild(this._cover);this._cover=null};scheduler.show_cover=function(){this._cover=document.createElement("DIV");this._cover.className="dhx_cal_cover";var a=document.height!==void 0?document.height:document.body.offsetHeight,b=document.documentElement?document.documentElement.scrollHeight:0;this._cover.style.height=Math.max(a,b)+"px";document.body.appendChild(this._cover)};
+scheduler.save_lightbox=function(){if(!this.checkEvent("onEventSave")||this.callEvent("onEventSave",[this._lightbox_id,this._lightbox_out({id:this._lightbox_id}),this._new_event]))this._empty_lightbox(),this.hide_lightbox()};scheduler.startLightbox=function(a,b){this._lightbox_id=a;this.showCover(b)};scheduler.endLightbox=function(a,b){this._edit_stop_event(scheduler.getEvent(this._lightbox_id),a);a&&scheduler.render_view_data();this.hideCover(b)};
+scheduler.resetLightbox=function(){scheduler._lightbox&&scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);scheduler._lightbox=null};scheduler.cancel_lightbox=function(){this.callEvent("onEventCancel",[this._lightbox_id,this._new_event]);this.endLightbox(!1);this.hide_lightbox()};
+scheduler._init_lightbox_events=function(){this._get_lightbox().onclick=function(a){var b=a?a.target:event.srcElement;if(!b.className)b=b.previousSibling;if(b&&b.className)switch(b.className){case "dhx_save_btn":scheduler.save_lightbox();break;case "dhx_delete_btn":var c=scheduler.locale.labels.confirm_deleting;if(!c||confirm(c))scheduler.deleteEvent(scheduler._lightbox_id),scheduler._new_event=null,scheduler.hide_lightbox();break;case "dhx_cancel_btn":scheduler.cancel_lightbox();break;default:if(b.getAttribute("dhx_button"))scheduler.callEvent("onLightboxButton",
+[b.className,b,a]);else if(b.className.indexOf("dhx_custom_button_")!=-1){var d=b.parentNode.getAttribute("index"),e=scheduler.form_blocks[scheduler.config.lightbox.sections[d].type],f=b.parentNode.parentNode;e.button_click(d,b,f,f.nextSibling)}}};this._get_lightbox().onkeydown=function(a){switch((a||event).keyCode){case scheduler.keys.edit_save:if((a||event).shiftKey)break;scheduler.save_lightbox();break;case scheduler.keys.edit_cancel:scheduler.cancel_lightbox()}}};
+scheduler.setLightboxSize=function(){var a=this._lightbox;if(a){var b=a.childNodes[1];b.style.height="0px";b.style.height=b.scrollHeight+"px";a.style.height=b.scrollHeight+50+"px";b.style.height=b.scrollHeight+"px"}};scheduler._init_dnd_events=function(){dhtmlxEvent(document.body,"mousemove",scheduler._move_while_dnd);dhtmlxEvent(document.body,"mouseup",scheduler._finish_dnd);scheduler._init_dnd_events=function(){}};
+scheduler._move_while_dnd=function(a){if(scheduler._dnd_start_lb){if(!document.dhx_unselectable)document.body.className+=" dhx_unselectable",document.dhx_unselectable=!0;var b=scheduler._get_lightbox(),c=a&&a.target?[a.pageX,a.pageY]:[event.clientX,event.clientY];b.style.top=scheduler._lb_start[1]+c[1]-scheduler._dnd_start_lb[1]+"px";b.style.left=scheduler._lb_start[0]+c[0]-scheduler._dnd_start_lb[0]+"px"}};
+scheduler._ready_to_dnd=function(a){var b=scheduler._get_lightbox();scheduler._lb_start=[parseInt(b.style.left,10),parseInt(b.style.top,10)];scheduler._dnd_start_lb=a&&a.target?[a.pageX,a.pageY]:[event.clientX,event.clientY]};scheduler._finish_dnd=function(){if(scheduler._lb_start)scheduler._lb_start=scheduler._dnd_start_lb=!1,document.body.className=document.body.className.replace(" dhx_unselectable",""),document.dhx_unselectable=!1};
+scheduler._get_lightbox=function(){if(!this._lightbox){var a=document.createElement("DIV");a.className="dhx_cal_light";scheduler.config.wide_form&&(a.className+=" dhx_cal_light_wide");scheduler.form_blocks.recurring&&(a.className+=" dhx_cal_light_rec");/msie|MSIE 6/.test(navigator.userAgent)&&(a.className+=" dhx_ie6");a.style.visibility="hidden";var b=this._lightbox_template,c=this.config.buttons_left;scheduler.locale.labels.dhx_save_btn=scheduler.locale.labels.icon_save;scheduler.locale.labels.dhx_cancel_btn=
+scheduler.locale.labels.icon_cancel;scheduler.locale.labels.dhx_delete_btn=scheduler.locale.labels.icon_delete;for(var d=0;d<c.length;d++)b+="<div class='dhx_btn_set'><div dhx_button='1' class='"+c[d]+"'></div><div>"+scheduler.locale.labels[c[d]]+"</div></div>";c=this.config.buttons_right;for(d=0;d<c.length;d++)b+="<div class='dhx_btn_set' style='float:right;'><div dhx_button='1' class='"+c[d]+"'></div><div>"+scheduler.locale.labels[c[d]]+"</div></div>";b+="</div>";a.innerHTML=b;if(scheduler.config.drag_lightbox)a.firstChild.onmousedown=
+scheduler._ready_to_dnd,a.firstChild.onselectstart=function(){return!1},a.firstChild.style.cursor="pointer",scheduler._init_dnd_events();document.body.insertBefore(a,document.body.firstChild);this._lightbox=a;for(var e=this.config.lightbox.sections,b="",d=0;d<e.length;d++){var f=this.form_blocks[e[d].type];if(f){e[d].id="area_"+this.uid();var g="";e[d].button&&(g="<div class='dhx_custom_button' index='"+d+"'><div class='dhx_custom_button_"+e[d].button+"'></div><div>"+this.locale.labels["button_"+
+e[d].button]+"</div></div>");this.config.wide_form&&(b+="<div class='dhx_wrap_section'>");b+="<div id='"+e[d].id+"' class='dhx_cal_lsection'>"+g+this.locale.labels["section_"+e[d].name]+"</div>"+f.render.call(this,e[d]);b+="</div>"}}var h=a.getElementsByTagName("div");h[1].innerHTML=b;this.setLightboxSize();this._init_lightbox_events(this);a.style.display="none";a.style.visibility="visible"}return this._lightbox};scheduler._lightbox_template="<div class='dhx_cal_ltitle'><span class='dhx_mark'>&nbsp;</span><span class='dhx_time'></span><span class='dhx_title'></span></div><div class='dhx_cal_larea'></div>";
+scheduler._dp_init=function(a){a._methods=["setEventTextStyle","","changeEventId","deleteEvent"];this.attachEvent("onEventAdded",function(b){!this._loading&&this.validId(b)&&a.setUpdated(b,!0,"inserted")});this.attachEvent("onConfirmedBeforeEventDelete",function(b){if(this.validId(b)){var c=a.getState(b);if(c=="inserted"||this._new_event)return a.setUpdated(b,!1),!0;if(c=="deleted")return!1;if(c=="true_deleted")return!0;a.setUpdated(b,!0,"deleted");return!1}});this.attachEvent("onEventChanged",function(b){!this._loading&&
+this.validId(b)&&a.setUpdated(b,!0,"updated")});a._getRowData=function(a){var c=this.obj.getEvent(a),d={},e;for(e in c)e.indexOf("_")!=0&&(d[e]=c[e]&&c[e].getUTCFullYear?this.obj.templates.xml_format(c[e]):c[e]);return d};a._clearUpdateFlag=function(){};a.attachEvent("insertCallback",scheduler._update_callback);a.attachEvent("updateCallback",scheduler._update_callback);a.attachEvent("deleteCallback",function(a,c){this.obj.setUserData(c,this.action_param,"true_deleted");this.obj.deleteEvent(c)})};
+scheduler.setUserData=function(a,b,c){a?this.getEvent(a)[b]=c:this._userdata[b]=c};scheduler.getUserData=function(a,b){return a?this.getEvent(a)[b]:this._userdata[b]};scheduler.setEventTextStyle=function(a,b){this.for_rendered(a,function(a){a.style.cssText+=";"+b});var c=this.getEvent(a);c._text_style=b;this.event_updated(c)};scheduler.validId=function(){return!0};
+scheduler._update_callback=function(a){var b=scheduler.xmlNodeToJSON(a.firstChild);b.text=b.text||b._tagvalue;b.start_date=scheduler.templates.xml_date(b.start_date);b.end_date=scheduler.templates.xml_date(b.end_date);scheduler.addEvent(b)};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js
new file mode 100644
index 00000000000..6b2e961051c
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js
@@ -0,0 +1,4275 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+
+window.dhtmlx || (dhtmlx=function(obj){
+ for (var a in obj) dhtmlx[a]=obj[a];
+ return dhtmlx; //simple singleton
+})
+dhtmlx.extend_api=function(name,map,ext){
+ var t = window[name];
+ if (!t) return; //component not defined
+ window[name]=function(obj){
+ if (obj && typeof obj == "object" && !obj.tagName && !(obj instanceof Array)){
+ var that = t.apply(this,(map._init?map._init(obj):arguments));
+ //global settings
+ for (var a in dhtmlx)
+ if (map[a]) this[map[a]](dhtmlx[a]);
+ //local settings
+ for (var a in obj){
+ if (map[a]) this[map[a]](obj[a]);
+ else if (a.indexOf("on")==0){
+ this.attachEvent(a,obj[a]);
+ }
+ }
+ } else
+ var that = t.apply(this,arguments);
+ if (map._patch) map._patch(this);
+ return that||this;
+ };
+ window[name].prototype=t.prototype;
+ if (ext)
+ dhtmlXHeir(window[name].prototype,ext);
+};
+
+dhtmlxAjax={
+ get:function(url,callback){
+ var t=new dtmlXMLLoaderObject(true);
+ t.async=(arguments.length<3);
+ t.waitCall=callback;
+ t.loadXML(url)
+ return t;
+ },
+ post:function(url,post,callback){
+ var t=new dtmlXMLLoaderObject(true);
+ t.async=(arguments.length<4);
+ t.waitCall=callback;
+ t.loadXML(url,true,post)
+ return t;
+ },
+ getSync:function(url){
+ return this.get(url,null,true)
+ },
+ postSync:function(url,post){
+ return this.post(url,post,null,true);
+ }
+}
+
+/**
+ * @desc: xmlLoader object
+ * @type: private
+ * @param: funcObject - xml parser function
+ * @param: object - jsControl object
+ * @param: async - sync/async mode (async by default)
+ * @param: rSeed - enable/disable random seed ( prevent IE caching)
+ * @topic: 0
+ */
+function dtmlXMLLoaderObject(funcObject, dhtmlObject, async, rSeed){
+ this.xmlDoc="";
+
+ if (typeof (async) != "undefined")
+ this.async=async;
+ else
+ this.async=true;
+
+ this.onloadAction=funcObject||null;
+ this.mainObject=dhtmlObject||null;
+ this.waitCall=null;
+ this.rSeed=rSeed||false;
+ return this;
+};
+/**
+ * @desc: xml loading handler
+ * @type: private
+ * @param: dtmlObject - xmlLoader object
+ * @topic: 0
+ */
+dtmlXMLLoaderObject.prototype.waitLoadFunction=function(dhtmlObject){
+ var once = true;
+ this.check=function (){
+ if ((dhtmlObject)&&(dhtmlObject.onloadAction != null)){
+ if ((!dhtmlObject.xmlDoc.readyState)||(dhtmlObject.xmlDoc.readyState == 4)){
+ if (!once)
+ return;
+
+ once=false; //IE 5 fix
+ if (typeof dhtmlObject.onloadAction == "function")
+ dhtmlObject.onloadAction(dhtmlObject.mainObject, null, null, null, dhtmlObject);
+
+ if (dhtmlObject.waitCall){
+ dhtmlObject.waitCall.call(this,dhtmlObject);
+ dhtmlObject.waitCall=null;
+ }
+ }
+ }
+ };
+ return this.check;
+};
+
+/**
+ * @desc: return XML top node
+ * @param: tagName - top XML node tag name (not used in IE, required for Safari and Mozilla)
+ * @type: private
+ * @returns: top XML node
+ * @topic: 0
+ */
+dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName, oldObj){
+ if (this.xmlDoc.responseXML){
+ var temp = this.xmlDoc.responseXML.getElementsByTagName(tagName);
+ if(temp.length==0 && tagName.indexOf(":")!=-1)
+ var temp = this.xmlDoc.responseXML.getElementsByTagName((tagName.split(":"))[1]);
+ var z = temp[0];
+ } else
+ var z = this.xmlDoc.documentElement;
+
+ if (z){
+ this._retry=false;
+ return z;
+ }
+
+ if ((_isIE)&&(!this._retry)){
+ //fall back to MS.XMLDOM
+ var xmlString = this.xmlDoc.responseText;
+ var oldObj = this.xmlDoc;
+ this._retry=true;
+ this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
+ this.xmlDoc.async=false;
+ this.xmlDoc["loadXM"+"L"](xmlString);
+
+ return this.getXMLTopNode(tagName, oldObj);
+ }
+ dhtmlxError.throwError("LoadXML", "Incorrect XML", [
+ (oldObj||this.xmlDoc),
+ this.mainObject
+ ]);
+
+ return document.createElement("DIV");
+};
+
+/**
+ * @desc: load XML from string
+ * @type: private
+ * @param: xmlString - xml string
+ * @topic: 0
+ */
+dtmlXMLLoaderObject.prototype.loadXMLString=function(xmlString){
+ {
+ try{
+ var parser = new DOMParser();
+ this.xmlDoc=parser.parseFromString(xmlString, "text/xml");
+ }
+ catch (e){
+ this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
+ this.xmlDoc.async=this.async;
+ this.xmlDoc["loadXM"+"L"](xmlString);
+ }
+ }
+
+ this.onloadAction(this.mainObject, null, null, null, this);
+
+ if (this.waitCall){
+ this.waitCall();
+ this.waitCall=null;
+ }
+}
+/**
+ * @desc: load XML
+ * @type: private
+ * @param: filePath - xml file path
+ * @param: postMode - send POST request
+ * @param: postVars - list of vars for post request
+ * @topic: 0
+ */
+dtmlXMLLoaderObject.prototype.loadXML=function(filePath, postMode, postVars, rpc){
+ if (this.rSeed)
+ filePath+=((filePath.indexOf("?") != -1) ? "&" : "?")+"a_dhx_rSeed="+(new Date()).valueOf();
+ this.filePath=filePath;
+ if ((!_isIE)&&(window.XMLHttpRequest))
+ this.xmlDoc=new XMLHttpRequest();
+ else {
+ this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP");
+ }
+
+ if (this.async)
+ this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);
+ this.xmlDoc.open(postMode ? "POST" : "GET", filePath, this.async);
+
+ if (rpc){
+ this.xmlDoc.setRequestHeader("User-Agent", "dhtmlxRPC v0.1 ("+navigator.userAgent+")");
+ this.xmlDoc.setRequestHeader("Content-type", "text/xml");
+ }
+
+ else if (postMode)
+ this.xmlDoc.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
+
+ this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");
+ this.xmlDoc.send(null||postVars);
+
+ if (!this.async)
+ (new this.waitLoadFunction(this))();
+};
+/**
+ * @desc: destructor, cleans used memory
+ * @type: private
+ * @topic: 0
+ */
+dtmlXMLLoaderObject.prototype.destructor=function(){
+ this.onloadAction=null;
+ this.mainObject=null;
+ this.xmlDoc=null;
+ return null;
+}
+
+dtmlXMLLoaderObject.prototype.xmlNodeToJSON = function(node){
+ var t={};
+ for (var i=0; i<node.attributes.length; i++)
+ t[node.attributes[i].name]=node.attributes[i].value;
+ t["_tagvalue"]=node.firstChild?node.firstChild.nodeValue:"";
+ for (var i=0; i<node.childNodes.length; i++){
+ var name=node.childNodes[i].tagName;
+ if (name){
+ if (!t[name]) t[name]=[];
+ t[name].push(this.xmlNodeToJSON(node.childNodes[i]));
+ }
+ }
+ return t;
+ }
+
+/**
+ * @desc: Call wrapper
+ * @type: private
+ * @param: funcObject - action handler
+ * @param: dhtmlObject - user data
+ * @returns: function handler
+ * @topic: 0
+ */
+function callerFunction(funcObject, dhtmlObject){
+ this.handler=function(e){
+ if (!e)
+ e=window.event;
+ funcObject(e, dhtmlObject);
+ return true;
+ };
+ return this.handler;
+};
+
+/**
+ * @desc: Calculate absolute position of html object
+ * @type: private
+ * @param: htmlObject - html object
+ * @topic: 0
+ */
+function getAbsoluteLeft(htmlObject){
+ return getOffset(htmlObject).left;
+}
+/**
+ * @desc: Calculate absolute position of html object
+ * @type: private
+ * @param: htmlObject - html object
+ * @topic: 0
+ */
+function getAbsoluteTop(htmlObject){
+ return getOffset(htmlObject).top;
+}
+
+function getOffsetSum(elem) {
+ var top=0, left=0;
+ while(elem) {
+ top = top + parseInt(elem.offsetTop);
+ left = left + parseInt(elem.offsetLeft);
+ elem = elem.offsetParent;
+ }
+ return {top: top, left: left};
+}
+function getOffsetRect(elem) {
+ var box = elem.getBoundingClientRect();
+ var body = document.body;
+ var docElem = document.documentElement;
+ var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;
+ var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
+ var clientTop = docElem.clientTop || body.clientTop || 0;
+ var clientLeft = docElem.clientLeft || body.clientLeft || 0;
+ var top = box.top + scrollTop - clientTop;
+ var left = box.left + scrollLeft - clientLeft;
+ return { top: Math.round(top), left: Math.round(left) };
+}
+function getOffset(elem) {
+ if (elem.getBoundingClientRect && !_isChrome) {
+ return getOffsetRect(elem);
+ } else {
+ return getOffsetSum(elem);
+ }
+}
+
+/**
+* @desc: Convert string to it boolean representation
+* @type: private
+* @param: inputString - string for covertion
+* @topic: 0
+*/
+function convertStringToBoolean(inputString){
+ if (typeof (inputString) == "string")
+ inputString=inputString.toLowerCase();
+
+ switch (inputString){
+ case "1":
+ case "true":
+ case "yes":
+ case "y":
+ case 1:
+ case true:
+ return true;
+ break;
+
+ default: return false;
+ }
+}
+
+/**
+* @desc: find out what symbol to use as url param delimiters in further params
+* @type: private
+* @param: str - current url string
+* @topic: 0
+*/
+function getUrlSymbol(str){
+ if (str.indexOf("?") != -1)
+ return "&"
+ else
+ return "?"
+}
+
+function dhtmlDragAndDropObject(){
+ if (window.dhtmlDragAndDrop)
+ return window.dhtmlDragAndDrop;
+
+ this.lastLanding=0;
+ this.dragNode=0;
+ this.dragStartNode=0;
+ this.dragStartObject=0;
+ this.tempDOMU=null;
+ this.tempDOMM=null;
+ this.waitDrag=0;
+ window.dhtmlDragAndDrop=this;
+
+ return this;
+};
+
+dhtmlDragAndDropObject.prototype.removeDraggableItem=function(htmlNode){
+ htmlNode.onmousedown=null;
+ htmlNode.dragStarter=null;
+ htmlNode.dragLanding=null;
+}
+dhtmlDragAndDropObject.prototype.addDraggableItem=function(htmlNode, dhtmlObject){
+ htmlNode.onmousedown=this.preCreateDragCopy;
+ htmlNode.dragStarter=dhtmlObject;
+ this.addDragLanding(htmlNode, dhtmlObject);
+}
+dhtmlDragAndDropObject.prototype.addDragLanding=function(htmlNode, dhtmlObject){
+ htmlNode.dragLanding=dhtmlObject;
+}
+dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(e){
+ if ((e||event) && (e||event).button == 2)
+ return;
+
+ if (window.dhtmlDragAndDrop.waitDrag){
+ window.dhtmlDragAndDrop.waitDrag=0;
+ document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;
+ document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;
+ return false;
+ }
+
+ window.dhtmlDragAndDrop.waitDrag=1;
+ window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;
+ window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;
+ window.dhtmlDragAndDrop.dragStartNode=this;
+ window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;
+ document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;
+ document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;
+ window.dhtmlDragAndDrop.downtime = new Date().valueOf();
+
+
+ if ((e)&&(e.preventDefault)){
+ e.preventDefault();
+ return false;
+ }
+ return false;
+};
+dhtmlDragAndDropObject.prototype.callDrag=function(e){
+ if (!e)
+ e=window.event;
+ dragger=window.dhtmlDragAndDrop;
+ if ((new Date()).valueOf()-dragger.downtime<100) return;
+
+ if ((e.button == 0)&&(_isIE))
+ return dragger.stopDrag();
+
+ if (!dragger.dragNode&&dragger.waitDrag){
+ dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode, e);
+
+ if (!dragger.dragNode)
+ return dragger.stopDrag();
+
+ dragger.dragNode.onselectstart=function(){return false;}
+ dragger.gldragNode=dragger.dragNode;
+ document.body.appendChild(dragger.dragNode);
+ document.body.onmouseup=dragger.stopDrag;
+ dragger.waitDrag=0;
+ dragger.dragNode.pWindow=window;
+ dragger.initFrameRoute();
+ }
+
+ if (dragger.dragNode.parentNode != window.document.body){
+ var grd = dragger.gldragNode;
+
+ if (dragger.gldragNode.old)
+ grd=dragger.gldragNode.old;
+
+ //if (!document.all) dragger.calculateFramePosition();
+ grd.parentNode.removeChild(grd);
+ var oldBody = dragger.dragNode.pWindow;
+
+ // var oldp=dragger.dragNode.parentObject;
+ if (_isIE){
+ var div = document.createElement("Div");
+ div.innerHTML=dragger.dragNode.outerHTML;
+ dragger.dragNode=div.childNodes[0];
+ } else
+ dragger.dragNode=dragger.dragNode.cloneNode(true);
+
+ dragger.dragNode.pWindow=window;
+ // dragger.dragNode.parentObject=oldp;
+
+ dragger.gldragNode.old=dragger.dragNode;
+ document.body.appendChild(dragger.dragNode);
+ oldBody.dhtmlDragAndDrop.dragNode=dragger.dragNode;
+ }
+
+ dragger.dragNode.style.left=e.clientX+15+(dragger.fx
+ ? dragger.fx*(-1)
+ : 0)
+ +(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";
+ dragger.dragNode.style.top=e.clientY+3+(dragger.fy
+ ? dragger.fy*(-1)
+ : 0)
+ +(document.body.scrollTop||document.documentElement.scrollTop)+"px";
+
+ if (!e.srcElement)
+ var z = e.target;
+ else
+ z=e.srcElement;
+ dragger.checkLanding(z, e);
+}
+
+dhtmlDragAndDropObject.prototype.calculateFramePosition=function(n){
+ //this.fx = 0, this.fy = 0;
+ if (window.name){
+ var el = parent.frames[window.name].frameElement.offsetParent;
+ var fx = 0;
+ var fy = 0;
+
+ while (el){
+ fx+=el.offsetLeft;
+ fy+=el.offsetTop;
+ el=el.offsetParent;
+ }
+
+ if ((parent.dhtmlDragAndDrop)){
+ var ls = parent.dhtmlDragAndDrop.calculateFramePosition(1);
+ fx+=ls.split('_')[0]*1;
+ fy+=ls.split('_')[1]*1;
+ }
+
+ if (n)
+ return fx+"_"+fy;
+ else
+ this.fx=fx;
+ this.fy=fy;
+ }
+ return "0_0";
+}
+dhtmlDragAndDropObject.prototype.checkLanding=function(htmlObject, e){
+ if ((htmlObject)&&(htmlObject.dragLanding)){
+ if (this.lastLanding)
+ this.lastLanding.dragLanding._dragOut(this.lastLanding);
+ this.lastLanding=htmlObject;
+ this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding, this.dragStartNode, e.clientX,
+ e.clientY, e);
+ this.lastLanding_scr=(_isIE ? e.srcElement : e.target);
+ } else {
+ if ((htmlObject)&&(htmlObject.tagName != "BODY"))
+ this.checkLanding(htmlObject.parentNode, e);
+ else {
+ if (this.lastLanding)
+ this.lastLanding.dragLanding._dragOut(this.lastLanding, e.clientX, e.clientY, e);
+ this.lastLanding=0;
+
+ if (this._onNotFound)
+ this._onNotFound();
+ }
+ }
+}
+dhtmlDragAndDropObject.prototype.stopDrag=function(e, mode){
+ dragger=window.dhtmlDragAndDrop;
+
+ if (!mode){
+ dragger.stopFrameRoute();
+ var temp = dragger.lastLanding;
+ dragger.lastLanding=null;
+
+ if (temp)
+ temp.dragLanding._drag(dragger.dragStartNode, dragger.dragStartObject, temp, (_isIE
+ ? event.srcElement
+ : e.target));
+ }
+ dragger.lastLanding=null;
+
+ if ((dragger.dragNode)&&(dragger.dragNode.parentNode == document.body))
+ dragger.dragNode.parentNode.removeChild(dragger.dragNode);
+ dragger.dragNode=0;
+ dragger.gldragNode=0;
+ dragger.fx=0;
+ dragger.fy=0;
+ dragger.dragStartNode=0;
+ dragger.dragStartObject=0;
+ document.body.onmouseup=dragger.tempDOMU;
+ document.body.onmousemove=dragger.tempDOMM;
+ dragger.tempDOMU=null;
+ dragger.tempDOMM=null;
+ dragger.waitDrag=0;
+}
+
+dhtmlDragAndDropObject.prototype.stopFrameRoute=function(win){
+ if (win)
+ window.dhtmlDragAndDrop.stopDrag(1, 1);
+
+ for (var i = 0; i < window.frames.length; i++){
+ try{
+ if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
+ window.frames[i].dhtmlDragAndDrop.stopFrameRoute(window);
+ } catch(e){}
+ }
+
+ try{
+ if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
+ parent.dhtmlDragAndDrop.stopFrameRoute(window);
+ } catch(e){}
+}
+dhtmlDragAndDropObject.prototype.initFrameRoute=function(win, mode){
+ if (win){
+ window.dhtmlDragAndDrop.preCreateDragCopy({});
+ window.dhtmlDragAndDrop.dragStartNode=win.dhtmlDragAndDrop.dragStartNode;
+ window.dhtmlDragAndDrop.dragStartObject=win.dhtmlDragAndDrop.dragStartObject;
+ window.dhtmlDragAndDrop.dragNode=win.dhtmlDragAndDrop.dragNode;
+ window.dhtmlDragAndDrop.gldragNode=win.dhtmlDragAndDrop.dragNode;
+ window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;
+ window.waitDrag=0;
+
+ if (((!_isIE)&&(mode))&&((!_isFF)||(_FFrv < 1.8)))
+ window.dhtmlDragAndDrop.calculateFramePosition();
+ }
+ try{
+ if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
+ parent.dhtmlDragAndDrop.initFrameRoute(window);
+ }catch(e){}
+
+ for (var i = 0; i < window.frames.length; i++){
+ try{
+ if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
+ window.frames[i].dhtmlDragAndDrop.initFrameRoute(window, ((!win||mode) ? 1 : 0));
+ } catch(e){}
+ }
+}
+
+_isFF = false;
+_isIE = false;
+_isOpera = false;
+_isKHTML = false;
+_isMacOS = false;
+_isChrome = false;
+_KHTMLrv = false;
+_OperaRv = false;
+_FFrv = false;
+
+if (navigator.userAgent.indexOf('Macintosh') != -1)
+ _isMacOS=true;
+
+
+if (navigator.userAgent.toLowerCase().indexOf('chrome')>-1)
+ _isChrome=true;
+
+if ((navigator.userAgent.indexOf('Safari') != -1)||(navigator.userAgent.indexOf('Konqueror') != -1)){
+ var _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Safari')+7, 5));
+
+ if (_KHTMLrv > 525){ //mimic FF behavior for Safari 3.1+
+ _isFF=true;
+ var _FFrv = 1.9;
+ } else
+ _isKHTML=true;
+} else if (navigator.userAgent.indexOf('Opera') != -1){
+ _isOpera=true;
+ _OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Opera')+6, 3));
+}
+
+
+else if (navigator.appName.indexOf("Microsoft") != -1){
+ _isIE=true;
+ if (navigator.appVersion.indexOf("MSIE 8.0")!= -1 && document.compatMode != "BackCompat") _isIE=8;
+} else {
+ _isFF=true;
+ var _FFrv = parseFloat(navigator.userAgent.split("rv:")[1])
+}
+
+
+//multibrowser Xpath processor
+dtmlXMLLoaderObject.prototype.doXPath=function(xpathExp, docObj, namespace, result_type){
+ if (_isKHTML || (!_isIE && !window.XPathResult))
+ return this.doXPathOpera(xpathExp, docObj);
+
+ if (_isIE){ //IE
+ if (!docObj)
+ if (!this.xmlDoc.nodeName)
+ docObj=this.xmlDoc.responseXML
+ else
+ docObj=this.xmlDoc;
+
+ if (!docObj)
+ dhtmlxError.throwError("LoadXML", "Incorrect XML", [
+ (docObj||this.xmlDoc),
+ this.mainObject
+ ]);
+
+ if (namespace != null)
+ docObj.setProperty("SelectionNamespaces", "xmlns:xsl='"+namespace+"'"); //
+
+ if (result_type == 'single'){
+ return docObj.selectSingleNode(xpathExp);
+ }
+ else {
+ return docObj.selectNodes(xpathExp)||new Array(0);
+ }
+ } else { //Mozilla
+ var nodeObj = docObj;
+
+ if (!docObj){
+ if (!this.xmlDoc.nodeName){
+ docObj=this.xmlDoc.responseXML
+ }
+ else {
+ docObj=this.xmlDoc;
+ }
+ }
+
+ if (!docObj)
+ dhtmlxError.throwError("LoadXML", "Incorrect XML", [
+ (docObj||this.xmlDoc),
+ this.mainObject
+ ]);
+
+ if (docObj.nodeName.indexOf("document") != -1){
+ nodeObj=docObj;
+ }
+ else {
+ nodeObj=docObj;
+ docObj=docObj.ownerDocument;
+ }
+ var retType = XPathResult.ANY_TYPE;
+
+ if (result_type == 'single')
+ retType=XPathResult.FIRST_ORDERED_NODE_TYPE
+ var rowsCol = new Array();
+ var col = docObj.evaluate(xpathExp, nodeObj, function(pref){
+ return namespace
+ }, retType, null);
+
+ if (retType == XPathResult.FIRST_ORDERED_NODE_TYPE){
+ return col.singleNodeValue;
+ }
+ var thisColMemb = col.iterateNext();
+
+ while (thisColMemb){
+ rowsCol[rowsCol.length]=thisColMemb;
+ thisColMemb=col.iterateNext();
+ }
+ return rowsCol;
+ }
+}
+
+function _dhtmlxError(type, name, params){
+ if (!this.catches)
+ this.catches=new Array();
+
+ return this;
+}
+
+_dhtmlxError.prototype.catchError=function(type, func_name){
+ this.catches[type]=func_name;
+}
+_dhtmlxError.prototype.throwError=function(type, name, params){
+ if (this.catches[type])
+ return this.catches[type](type, name, params);
+
+ if (this.catches["ALL"])
+ return this.catches["ALL"](type, name, params);
+
+ alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);
+ return null;
+}
+
+window.dhtmlxError=new _dhtmlxError();
+
+
+//opera fake, while 9.0 not released
+//multibrowser Xpath processor
+dtmlXMLLoaderObject.prototype.doXPathOpera=function(xpathExp, docObj){
+ //this is fake for Opera
+ var z = xpathExp.replace(/[\/]+/gi, "/").split('/');
+ var obj = null;
+ var i = 1;
+
+ if (!z.length)
+ return [];
+
+ if (z[0] == ".")
+ obj=[docObj]; else if (z[0] == ""){
+ obj=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(z[i].replace(/\[[^\]]*\]/g, ""));
+ i++;
+ } else
+ return [];
+
+ for (i; i < z.length; i++)obj=this._getAllNamedChilds(obj, z[i]);
+
+ if (z[i-1].indexOf("[") != -1)
+ obj=this._filterXPath(obj, z[i-1]);
+ return obj;
+}
+
+dtmlXMLLoaderObject.prototype._filterXPath=function(a, b){
+ var c = new Array();
+ var b = b.replace(/[^\[]*\[\@/g, "").replace(/[\[\]\@]*/g, "");
+
+ for (var i = 0; i < a.length; i++)
+ if (a[i].getAttribute(b))
+ c[c.length]=a[i];
+
+ return c;
+}
+dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a, b){
+ var c = new Array();
+
+ if (_isKHTML)
+ b=b.toUpperCase();
+
+ for (var i = 0; i < a.length; i++)for (var j = 0; j < a[i].childNodes.length; j++){
+ if (_isKHTML){
+ if (a[i].childNodes[j].tagName&&a[i].childNodes[j].tagName.toUpperCase() == b)
+ c[c.length]=a[i].childNodes[j];
+ }
+
+ else if (a[i].childNodes[j].tagName == b)
+ c[c.length]=a[i].childNodes[j];
+ }
+
+ return c;
+}
+
+function dhtmlXHeir(a, b){
+ for (var c in b)
+ if (typeof (b[c]) == "function")
+ a[c]=b[c];
+ return a;
+}
+
+function dhtmlxEvent(el, event, handler){
+ if (el.addEventListener)
+ el.addEventListener(event, handler, false);
+
+ else if (el.attachEvent)
+ el.attachEvent("on"+event, handler);
+}
+
+//============= XSL Extension ===================================
+
+dtmlXMLLoaderObject.prototype.xslDoc=null;
+dtmlXMLLoaderObject.prototype.setXSLParamValue=function(paramName, paramValue, xslDoc){
+ if (!xslDoc)
+ xslDoc=this.xslDoc
+
+ if (xslDoc.responseXML)
+ xslDoc=xslDoc.responseXML;
+ var item =
+ this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+paramName+"']", xslDoc,
+ "http:/\/www.w3.org/1999/XSL/Transform", "single");
+
+ if (item != null)
+ item.firstChild.nodeValue=paramValue
+}
+dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(xslDoc, xmlDoc){
+ if (!xslDoc)
+ xslDoc=this.xslDoc;
+
+ if (xslDoc.responseXML)
+ xslDoc=xslDoc.responseXML
+
+ if (!xmlDoc)
+ xmlDoc=this.xmlDoc;
+
+ if (xmlDoc.responseXML)
+ xmlDoc=xmlDoc.responseXML
+
+ //MOzilla
+ if (!_isIE){
+ if (!this.XSLProcessor){
+ this.XSLProcessor=new XSLTProcessor();
+ this.XSLProcessor.importStylesheet(xslDoc);
+ }
+ var result = this.XSLProcessor.transformToDocument(xmlDoc);
+ } else {
+ var result = new ActiveXObject("Msxml2.DOMDocument.3.0");
+ try{
+ xmlDoc.transformNodeToObject(xslDoc, result);
+ }catch(e){
+ result = xmlDoc.transformNode(xslDoc);
+ }
+ }
+ return result;
+}
+
+dtmlXMLLoaderObject.prototype.doXSLTransToString=function(xslDoc, xmlDoc){
+ var res = this.doXSLTransToObject(xslDoc, xmlDoc);
+ if(typeof(res)=="string")
+ return res;
+ return this.doSerialization(res);
+}
+
+dtmlXMLLoaderObject.prototype.doSerialization=function(xmlDoc){
+ if (!xmlDoc)
+ xmlDoc=this.xmlDoc;
+ if (xmlDoc.responseXML)
+ xmlDoc=xmlDoc.responseXML
+ if (!_isIE){
+ var xmlSerializer = new XMLSerializer();
+ return xmlSerializer.serializeToString(xmlDoc);
+ } else
+ return xmlDoc.xml;
+}
+
+/**
+* @desc:
+* @type: private
+*/
+dhtmlxEventable=function(obj){
+ obj.dhx_SeverCatcherPath="";
+ obj.attachEvent=function(name, catcher, callObj){
+ name='ev_'+name.toLowerCase();
+ if (!this[name])
+ this[name]=new this.eventCatcher(callObj||this);
+
+ return(name+':'+this[name].addEvent(catcher)); //return ID (event name & event ID)
+ }
+ obj.callEvent=function(name, arg0){
+ name='ev_'+name.toLowerCase();
+ if (this[name])
+ return this[name].apply(this, arg0);
+ return true;
+ }
+ obj.checkEvent=function(name){
+ return (!!this['ev_'+name.toLowerCase()])
+ }
+ obj.eventCatcher=function(obj){
+ var dhx_catch = [];
+ var z = function(){
+ var res = true;
+ for (var i = 0; i < dhx_catch.length; i++){
+ if (dhx_catch[i] != null){
+ var zr = dhx_catch[i].apply(obj, arguments);
+ res=res&&zr;
+ }
+ }
+ return res;
+ }
+ z.addEvent=function(ev){
+ if (typeof (ev) != "function")
+ ev=eval(ev);
+ if (ev)
+ return dhx_catch.push(ev)-1;
+ return false;
+ }
+ z.removeEvent=function(id){
+ dhx_catch[id]=null;
+ }
+ return z;
+ }
+ obj.detachEvent=function(id){
+ if (id != false){
+ var list = id.split(':'); //get EventName and ID
+ this[list[0]].removeEvent(list[1]); //remove event
+ }
+ }
+ obj.detachAllEvents = function(){
+ for (var name in this){
+ if (name.indexOf("ev_")==0)
+ delete this[name];
+ }
+ }
+}
+
+/**
+ * @desc: constructor, data processor object
+ * @param: serverProcessorURL - url used for update
+ * @type: public
+ */
+function dataProcessor(serverProcessorURL){
+ this.serverProcessor = serverProcessorURL;
+ this.action_param="!nativeeditor_status";
+
+ this.object = null;
+ this.updatedRows = []; //ids of updated rows
+
+ this.autoUpdate = true;
+ this.updateMode = "cell";
+ this._tMode="GET";
+ this.post_delim = "_";
+
+ this._waitMode=0;
+ this._in_progress={};//?
+ this._invalid={};
+ this.mandatoryFields=[];
+ this.messages=[];
+
+ this.styles={
+ updated:"font-weight:bold;",
+ inserted:"font-weight:bold;",
+ deleted:"text-decoration : line-through;",
+ invalid:"background-color:FFE0E0;",
+ invalid_cell:"border-bottom:2px solid red;",
+ error:"color:red;",
+ clear:"font-weight:normal;text-decoration:none;"
+ };
+
+ this.enableUTFencoding(true);
+ dhtmlxEventable(this);
+
+ return this;
+ }
+
+dataProcessor.prototype={
+ /**
+ * @desc: select GET or POST transaction model
+ * @param: mode - GET/POST
+ * @param: total - true/false - send records row by row or all at once (for grid only)
+ * @type: public
+ */
+ setTransactionMode:function(mode,total){
+ this._tMode=mode;
+ this._tSend=total;
+ },
+ escape:function(data){
+ if (this._utf)
+ return encodeURIComponent(data);
+ else
+ return escape(data);
+ },
+ /**
+ * @desc: allows to set escaping mode
+ * @param: true - utf based escaping, simple - use current page encoding
+ * @type: public
+ */
+ enableUTFencoding:function(mode){
+ this._utf=convertStringToBoolean(mode);
+ },
+ /**
+ * @desc: allows to define, which column may trigger update
+ * @param: val - array or list of true/false values
+ * @type: public
+ */
+ setDataColumns:function(val){
+ this._columns=(typeof val == "string")?val.split(","):val;
+ },
+ /**
+ * @desc: get state of updating
+ * @returns: true - all in sync with server, false - some items not updated yet.
+ * @type: public
+ */
+ getSyncState:function(){
+ return !this.updatedRows.length;
+ },
+ /**
+ * @desc: enable/disable named field for data syncing, will use column ids for grid
+ * @param: mode - true/false
+ * @type: public
+ */
+ enableDataNames:function(mode){
+ this._endnm=convertStringToBoolean(mode);
+ },
+ /**
+ * @desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode
+ * @param: mode - true/false
+ * @type: public
+ */
+ enablePartialDataSend:function(mode){
+ this._changed=convertStringToBoolean(mode);
+ },
+ /**
+ * @desc: set if rows should be send to server automaticaly
+ * @param: mode - "row" - based on row selection changed, "cell" - based on cell editing finished, "off" - manual data sending
+ * @type: public
+ */
+ setUpdateMode:function(mode,dnd){
+ this.autoUpdate = (mode=="cell");
+ this.updateMode = mode;
+ this.dnd=dnd;
+ },
+ ignore:function(code,master){
+ this._silent_mode=true;
+ code.call(master||window);
+ this._silent_mode=false;
+ },
+ /**
+ * @desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)
+ * @param: rowId - id of row to set update-status for
+ * @param: state - true for "updated", false for "not updated"
+ * @param: mode - update mode name
+ * @type: public
+ */
+ setUpdated:function(rowId,state,mode){
+ if (this._silent_mode) return;
+ var ind=this.findRow(rowId);
+
+ mode=mode||"updated";
+ var existing = this.obj.getUserData(rowId,this.action_param);
+ if (existing && mode == "updated") mode=existing;
+ if (state){
+ this.set_invalid(rowId,false); //clear previous error flag
+ this.updatedRows[ind]=rowId;
+ this.obj.setUserData(rowId,this.action_param,mode);
+ if (this._in_progress[rowId])
+ this._in_progress[rowId]="wait";
+ } else{
+ if (!this.is_invalid(rowId)){
+ this.updatedRows.splice(ind,1);
+ this.obj.setUserData(rowId,this.action_param,"");
+ }
+ }
+
+ //clear changed flag
+ if (!state)
+ this._clearUpdateFlag(rowId);
+
+ this.markRow(rowId,state,mode);
+ if (state && this.autoUpdate) this.sendData(rowId);
+ },
+ _clearUpdateFlag:function(id){},
+ markRow:function(id,state,mode){
+ var str="";
+ var invalid=this.is_invalid(id);
+ if (invalid){
+ str=this.styles[invalid];
+ state=true;
+ }
+ if (this.callEvent("onRowMark",[id,state,mode,invalid])){
+ //default logic
+ str=this.styles[state?mode:"clear"]+str;
+
+ this.obj[this._methods[0]](id,str);
+
+ if (invalid && invalid.details){
+ str+=this.styles[invalid+"_cell"];
+ for (var i=0; i < invalid.details.length; i++)
+ if (invalid.details[i])
+ this.obj[this._methods[1]](id,i,str);
+ }
+ }
+ },
+ getState:function(id){
+ return this.obj.getUserData(id,this.action_param);
+ },
+ is_invalid:function(id){
+ return this._invalid[id];
+ },
+ set_invalid:function(id,mode,details){
+ if (details) mode={value:mode, details:details, toString:function(){ return this.value.toString(); }};
+ this._invalid[id]=mode;
+ },
+ /**
+ * @desc: check mandatory fields and varify values of cells, initiate update (if specified)
+ * @param: rowId - id of row to set update-status for
+ * @type: public
+ */
+ checkBeforeUpdate:function(rowId){
+ return true;
+ },
+ /**
+ * @desc: send row(s) values to server
+ * @param: rowId - id of row which data to send. If not specified, then all "updated" rows will be send
+ * @type: public
+ */
+ sendData:function(rowId){
+ if (this._waitMode && (this.obj.mytype=="tree" || this.obj._h2)) return;
+ if (this.obj.editStop) this.obj.editStop();
+
+
+ if(typeof rowId == "undefined" || this._tSend) return this.sendAllData();
+ if (this._in_progress[rowId]) return false;
+
+ this.messages=[];
+ if (!this.checkBeforeUpdate(rowId) && this.callEvent("onValidatationError",[rowId,this.messages])) return false;
+ this._beforeSendData(this._getRowData(rowId),rowId);
+ },
+ _beforeSendData:function(data,rowId){
+ if (!this.callEvent("onBeforeUpdate",[rowId,this.getState(rowId),data])) return false;
+ this._sendData(data,rowId);
+ },
+ serialize:function(data, id){
+ if (typeof data == "string")
+ return data;
+ if (typeof id != "undefined")
+ return this.serialize_one(data,"");
+ else{
+ var stack = [];
+ var keys = [];
+ for (var key in data)
+ if (data.hasOwnProperty(key)){
+ stack.push(this.serialize_one(data[key],key+this.post_delim));
+ keys.push(key);
+ }
+ stack.push("ids="+this.escape(keys.join(",")));
+ return stack.join("&");
+ }
+ },
+ serialize_one:function(data, pref){
+ if (typeof data == "string")
+ return data;
+ var stack = [];
+ for (var key in data)
+ if (data.hasOwnProperty(key))
+ stack.push(this.escape((pref||"")+key)+"="+this.escape(data[key]));
+ return stack.join("&");
+ },
+ _sendData:function(a1,rowId){
+ if (!a1) return; //nothing to send
+ if (!this.callEvent("onBeforeDataSending",rowId?[rowId,this.getState(rowId),a1]:[null, null, a1])) return false;
+
+ if (rowId)
+ this._in_progress[rowId]=(new Date()).valueOf();
+ var a2=new dtmlXMLLoaderObject(this.afterUpdate,this,true);
+
+ var a3 = this.serverProcessor+(this._user?(getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");
+
+ if (this._tMode!="POST")
+ a2.loadXML(a3+((a3.indexOf("?")!=-1)?"&":"?")+this.serialize(a1,rowId));
+ else
+ a2.loadXML(a3,true,this.serialize(a1,rowId));
+
+ this._waitMode++;
+ },
+ sendAllData:function(){
+ if (!this.updatedRows.length) return;
+
+ this.messages=[]; var valid=true;
+ for (var i=0; i<this.updatedRows.length; i++)
+ valid&=this.checkBeforeUpdate(this.updatedRows[i]);
+ if (!valid && !this.callEvent("onValidatationError",["",this.messages])) return false;
+
+ if (this._tSend)
+ this._sendData(this._getAllData());
+ else
+ for (var i=0; i<this.updatedRows.length; i++)
+ if (!this._in_progress[this.updatedRows[i]]){
+ if (this.is_invalid(this.updatedRows[i])) continue;
+ this._beforeSendData(this._getRowData(this.updatedRows[i]),this.updatedRows[i]);
+ if (this._waitMode && (this.obj.mytype=="tree" || this.obj._h2)) return; //block send all for tree
+ }
+ },
+
+
+
+
+
+
+
+
+ _getAllData:function(rowId){
+ var out={};
+ var has_one = false;
+ for(var i=0;i<this.updatedRows.length;i++){
+ var id=this.updatedRows[i];
+ if (this._in_progress[id] || this.is_invalid(id)) continue;
+ if (!this.callEvent("onBeforeUpdate",[id,this.getState(id)])) continue;
+ out[id]=this._getRowData(id,id+this.post_delim);
+ has_one = true;
+ this._in_progress[id]=(new Date()).valueOf();
+ }
+ return has_one?out:null;
+ },
+
+
+ /**
+ * @desc: specify column which value should be varified before sending to server
+ * @param: ind - column index (0 based)
+ * @param: verifFunction - function (object) which should verify cell value (if not specified, then value will be compared to empty string). Two arguments will be passed into it: value and column name
+ * @type: public
+ */
+ setVerificator:function(ind,verifFunction){
+ this.mandatoryFields[ind] = verifFunction||(function(value){return (value!="");});
+ },
+ /**
+ * @desc: remove column from list of those which should be verified
+ * @param: ind - column Index (0 based)
+ * @type: public
+ */
+ clearVerificator:function(ind){
+ this.mandatoryFields[ind] = false;
+ },
+
+
+
+
+
+ findRow:function(pattern){
+ var i=0;
+ for(i=0;i<this.updatedRows.length;i++)
+ if(pattern==this.updatedRows[i]) break;
+ return i;
+ },
+
+
+
+
+
+
+
+
+
+
+
+ /**
+ * @desc: define custom actions
+ * @param: name - name of action, same as value of action attribute
+ * @param: handler - custom function, which receives a XMl response content for action
+ * @type: private
+ */
+ defineAction:function(name,handler){
+ if (!this._uActions) this._uActions=[];
+ this._uActions[name]=handler;
+ },
+
+
+
+
+ /**
+* @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system
+* @param: sid - id of item before update
+* @param: tid - id of item after up0ate
+* @param: action - action name
+* @type: public
+* @topic: 0
+*/
+ afterUpdateCallback:function(sid, tid, action, btag) {
+ var marker = sid;
+ var correct=(action!="error" && action!="invalid");
+ if (!correct) this.set_invalid(sid,action);
+ if ((this._uActions)&&(this._uActions[action])&&(!this._uActions[action](btag)))
+ return (delete this._in_progress[marker]);
+
+ if (this._in_progress[marker]!="wait")
+ this.setUpdated(sid, false);
+
+ var soid = sid;
+
+ switch (action) {
+ case "update":
+ case "updated":
+ case "inserted":
+ case "insert":
+ if (tid != sid) {
+ this.obj[this._methods[2]](sid, tid);
+ sid = tid;
+ }
+ break;
+ case "delete":
+ case "deleted":
+ this.obj.setUserData(sid, this.action_param, "true_deleted");
+ this.obj[this._methods[3]](sid);
+ delete this._in_progress[marker];
+ return this.callEvent("onAfterUpdate", [sid, action, tid, btag]);
+ break;
+ }
+
+ if (this._in_progress[marker]!="wait"){
+ if (correct) this.obj.setUserData(sid, this.action_param,'');
+ delete this._in_progress[marker];
+ } else {
+ delete this._in_progress[marker];
+ this.setUpdated(tid,true,this.obj.getUserData(sid,this.action_param));
+ }
+
+ this.callEvent("onAfterUpdate", [sid, action, tid, btag]);
+ },
+
+ /**
+ * @desc: response from server
+ * @param: xml - XMLLoader object with response XML
+ * @type: private
+ */
+ afterUpdate:function(that,b,c,d,xml){
+ xml.getXMLTopNode("data"); //fix incorrect content type in IE
+ if (!xml.xmlDoc.responseXML) return;
+ var atag=xml.doXPath("//data/action");
+ for (var i=0; i<atag.length; i++){
+ var btag=atag[i];
+ var action = btag.getAttribute("type");
+ var sid = btag.getAttribute("sid");
+ var tid = btag.getAttribute("tid");
+
+ that.afterUpdateCallback(sid,tid,action,btag);
+ }
+ that.finalizeUpdate();
+ },
+ finalizeUpdate:function(){
+ if (this._waitMode) this._waitMode--;
+
+ if ((this.obj.mytype=="tree" || this.obj._h2) && this.updatedRows.length)
+ this.sendData();
+ this.callEvent("onAfterUpdateFinish",[]);
+ if (!this.updatedRows.length)
+ this.callEvent("onFullSync",[]);
+ },
+
+
+
+
+
+ /**
+ * @desc: initializes data-processor
+ * @param: anObj - dhtmlxGrid object to attach this data-processor to
+ * @type: public
+ */
+ init:function(anObj){
+ this.obj = anObj;
+ if (this.obj._dp_init)
+ this.obj._dp_init(this);
+ },
+
+
+ setOnAfterUpdate:function(ev){
+ this.attachEvent("onAfterUpdate",ev);
+ },
+ enableDebug:function(mode){
+ },
+ setOnBeforeUpdateHandler:function(func){
+ this.attachEvent("onBeforeDataSending",func);
+ },
+
+
+
+ /*! starts autoupdate mode
+ @param interval
+ time interval for sending update requests
+ */
+ setAutoUpdate: function(interval, user) {
+ interval = interval || 2000;
+
+ this._user = user || (new Date()).valueOf();
+ this._need_update = false;
+ this._loader = null;
+ this._update_busy = false;
+
+ this.attachEvent("onAfterUpdate",function(sid,action,tid,xml_node){
+ this.afterAutoUpdate(sid, action, tid, xml_node);
+ });
+ this.attachEvent("onFullSync",function(){
+ this.fullSync();
+ });
+
+ var self = this;
+ window.setInterval(function(){
+ self.loadUpdate();
+ }, interval);
+ },
+
+
+ /*! process updating request answer
+ if status == collision version is depricated
+ set flag for autoupdating immidiatly
+ */
+ afterAutoUpdate: function(sid, action, tid, xml_node) {
+ if (action == 'collision') {
+ this._need_update = true;
+ return false;
+ } else {
+ return true;
+ }
+ },
+
+
+ /*! callback function for onFillSync event
+ call update function if it's need
+ */
+ fullSync: function() {
+ if (this._need_update == true) {
+ this._need_update = false;
+ this.loadUpdate();
+ }
+ return true;
+ },
+
+
+ /*! sends query to the server and call callback function
+ */
+ getUpdates: function(url,callback){
+ if (this._update_busy)
+ return false;
+ else
+ this._update_busy = true;
+
+ this._loader = this._loader || new dtmlXMLLoaderObject(true);
+
+ this._loader.async=true;
+ this._loader.waitCall=callback;
+ this._loader.loadXML(url);
+ },
+
+
+ /*! returns xml node value
+ @param node
+ xml node
+ */
+ _v: function(node) {
+ if (node.firstChild) return node.firstChild.nodeValue;
+ return "";
+ },
+
+
+ /*! returns values array of xml nodes array
+ @param arr
+ array of xml nodes
+ */
+ _a: function(arr) {
+ var res = [];
+ for (var i=0; i < arr.length; i++) {
+ res[i]=this._v(arr[i]);
+ };
+ return res;
+ },
+
+
+ /*! loads updates and processes them
+ */
+ loadUpdate: function(){
+ var self = this;
+ var version = this.obj.getUserData(0,"version");
+ var url = this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+version].join("&");
+ url = url.replace("editing=true&","");
+ this.getUpdates(url, function(){
+ var vers = self._loader.doXPath("//userdata");
+ self.obj.setUserData(0,"version",self._v(vers[0]));
+
+ var upds = self._loader.doXPath("//update");
+ if (upds.length){
+ self._silent_mode = true;
+
+ for (var i=0; i<upds.length; i++) {
+ var status = upds[i].getAttribute('status');
+ var id = upds[i].getAttribute('id');
+ var parent = upds[i].getAttribute('parent');
+ switch (status) {
+ case 'inserted':
+ self.callEvent("insertCallback",[upds[i], id, parent]);
+ break;
+ case 'updated':
+ self.callEvent("updateCallback",[upds[i], id, parent]);
+ break;
+ case 'deleted':
+ self.callEvent("deleteCallback",[upds[i], id, parent]);
+ break;
+ }
+ }
+
+ self._silent_mode = false;
+ }
+
+ self._update_busy = false;
+ self = null;
+ });
+ }
+
+};
+
+//(c)dhtmlx ltd. www.dhtmlx.com
+dataProcessor.prototype._o_init = dataProcessor.prototype.init;
+dataProcessor.prototype.init=function(obj){
+ this._console=this._console||this._createConsole();
+ this.attachEvent("onValidatationError",function(rowId){
+ this._log("Validation error for ID="+(rowId||"[multiple]"));
+ return true;
+ });
+ return this._o_init(obj);
+}
+
+dataProcessor.prototype._createConsole=function(){
+ var c=document.createElement("DIV");
+ c.style.cssText='width:450px; height:420px; overflow:auto; position:absolute; z-index:99999; background-color:white; top:0px; right:0px; border:1px dashed black; font-family:Tahoma; Font-size:10pt;';
+ c.innerHTML="<div style='width:100%; background-color:gray; font-weight:bold; color:white;'><span style='cursor:pointer;float:right;' onclick='this.parentNode.parentNode.style.display=\"none\"'><sup>[close]&nbsp;</sup></span><span style='cursor:pointer;float:right;' onclick='this.parentNode.parentNode.childNodes[2].innerHTML=\"\"'><sup>[clear]&nbsp;</sup></span>&nbsp;DataProcessor</div><div style='width:100%; height:200px; overflow-Y:scroll;'>&nbsp;Current state</div><div style='width:100%; height:200px; overflow-Y:scroll;'>&nbsp;Log:</div>";
+ if (document.body) document.body.insertBefore(c,document.body.firstChild);
+ else dhtmlxEvent(window,"load",function(){
+ document.body.insertBefore(c,document.body.firstChild);
+ })
+ dhtmlxEvent(window,"dblclick",function(){
+ c.style.display='';
+ })
+ return c;
+}
+
+dataProcessor.prototype._error=function(data){
+ this._log("<span style='color:red'>"+data+"</span>");
+}
+dataProcessor.prototype._log=function(data){
+ var div=document.createElement("DIV");
+ div.innerHTML = data;
+ var parent=this._console.childNodes[2];
+ parent.appendChild(div);
+ parent.scrollTop=parent.scrollHeight;
+
+ if (window.console && window.console.log)
+ window.console.log("DataProcessor :: "+data.replace("&nbsp;"," ").replace("<b>","").replace("</b>",""));
+
+}
+dataProcessor.prototype._updateStat=function(data){
+ var data=["&nbsp;Current state"];
+ for(var i=0;i<this.updatedRows.length;i++)
+ data.push("&nbsp;ID:"+this.updatedRows[i]+" Status: "+(this.obj.getUserData(this.updatedRows[i],"!nativeeditor_status")||"updated")+", "+(this.is_invalid(this.updatedRows[i])||"valid"))
+ this._console.childNodes[1].innerHTML=data.join("<br/>")+"<hr/>Current mode: "+this.updateMode;
+}
+dataProcessor.prototype.xml_analize=function(xml){
+ if (_isFF){
+ if (!xml.xmlDoc.responseXML)
+ this._error("Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data");
+ else if (xml.xmlDoc.responseXML.firstChild.tagName=="parsererror")
+ this._error(xml.xmlDoc.responseXML.firstChild.textContent);
+ else return true;
+ } else if (_isIE){
+ if (xml.xmlDoc.responseXML.parseError.errorCode)
+ this._error("XML error : "+xml.xmlDoc.responseXML.parseError.reason);
+ else if (!xml.xmlDoc.responseXML.documentElement)
+ this._error("Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data");
+ else return true;
+ }
+ return false;
+}
+
+dataProcessor.wrap=function(name,before,after){
+ var d=dataProcessor.prototype;
+ if (!d._wrap) d._wrap={};
+ d._wrap[name]=d[name];
+ d[name]=function(){
+ if (before) before.apply(this,arguments);
+ var res=d._wrap[name].apply(this,arguments);
+ if (after) after.apply(this,[arguments,res]);
+ return res;
+ }
+};
+
+dataProcessor.wrap("setUpdated",function(rowId,state,mode){
+ this._log("&nbsp;row <b>"+rowId+"</b> "+(state?"marked":"unmarked")+" ["+(mode||"updated")+","+(this.is_invalid(rowId)||"valid")+"]");
+},function(){
+ this._updateStat();
+});
+
+
+
+dataProcessor.wrap("sendData",function(rowId){
+ if (rowId){
+ this._log("&nbsp;Initiating data sending for <b>"+rowId+"</b>");
+ if (this.obj.mytype=="tree"){
+ if (!this.obj._idpull[rowId])
+ this._log("&nbsp;Error! item with such ID not exists <b>"+rowId+"</b>");
+ } else {
+ if (this.rowsAr && !this.obj.rowsAr[rowId])
+ this._log("&nbsp;Error! row with such ID not exists <b>"+rowId+"</b>");
+ }
+ }
+},function(){
+
+});
+
+dataProcessor.wrap("sendAllData",function(){
+ this._log("&nbsp;Initiating data sending for <b>all</b> rows ");
+},function(){
+
+});
+dataProcessor.logSingle=function(data,id){
+ var tdata = {};
+ if (id)
+ tdata[id] = data;
+ else
+ tdata = data;
+
+ var url = [];
+ for (var key in tdata) {
+ url.push("<fieldset><legend>"+key+"</legend>");
+ var suburl = [];
+
+ for (var ikey in tdata[key])
+ suburl.push(ikey+" = "+tdata[key][ikey]);
+
+ url.push(suburl.join("<br>"));
+ url.push("</fieldset>");
+ }
+ return url.join("");
+}
+dataProcessor.wrap("_sendData",function(data,rowId){
+ if (rowId)
+ this._log("&nbsp;Sending in one-by-one mode, current ID = "+rowId);
+ else
+ this._log("&nbsp;Sending all data at once");
+ this._log("&nbsp;Server url: "+this.serverProcessor+" <a onclick='this.parentNode.nextSibling.firstChild.style.display=\"block\"' href='#'>parameters</a>");
+ var url = [];
+ this._log("<blockquote style='display:none;'>"+dataProcessor.logSingle(data,rowId)+"<blockquote>");
+},function(){
+
+});
+
+
+dataProcessor.wrap("afterUpdate",function(that,b,c,d,xml){
+ that._log("&nbsp;Server response received <a onclick='this.nextSibling.style.display=\"block\"' href='#'>details</a><blockquote style='display:none'><code>"+(xml.xmlDoc.responseText||"").replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</code></blockquote>");
+ if (!that.xml_analize(xml)) return;
+ var atag=xml.doXPath("//data/action");
+ if (!atag){
+ that._log("&nbsp;No actions found");
+ var atag=xml.getXMLTopNode("data");
+ if (!atag) that._log("&nbsp;XML not valid");
+ else that._log("&nbsp;Incorrect content type - need to be text/xml");
+ }
+},function(){
+
+});
+
+dataProcessor.wrap("afterUpdateCallback",function(sid,tid,action){
+ if (this.obj.mytype=="tree"){
+ if (!this.obj._idpull[sid]) this._log("Incorrect SID, item with such ID not exists in grid");
+ } else {
+ if (this.obj.rowsAr && !this.obj.rowsAr[sid]) this._log("Incorrect SID, row with such ID not exists in grid");
+ }
+ this._log("&nbsp;Action: "+action+" SID:"+sid+" TID:"+tid);
+},function(){
+
+});
+
+
+
+
+
+
+
+/*
+ dhx_sort[index]=direction
+ dhx_filter[index]=mask
+*/
+if (window.dhtmlXGridObject){
+ dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point;
+ dhtmlXGridObject.prototype._init_point=function(){
+ var clear_url=function(url){
+ url=url.replace(/(\?|\&)connector[^\f]*/g,"");
+ return url+(url.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length > 0 ? "&dhx_no_header=1":"");
+ };
+ var combine_urls=function(url){
+ return clear_url.call(this,url)+(this._connector_sorting||"")+(this._connector_filter||"");
+ };
+ var sorting_url=function(url,ind,dir){
+ this._connector_sorting="&dhx_sort["+ind+"]="+dir;
+ return combine_urls.call(this,url);
+ };
+ var filtering_url=function(url,inds,vals){
+ for (var i=0; i<inds.length; i++)
+ inds[i]="dhx_filter["+inds[i]+"]="+encodeURIComponent(vals[i]);
+ this._connector_filter="&"+inds.join("&");
+ return combine_urls.call(this,url);
+ };
+ this.attachEvent("onCollectValues",function(ind){
+ if (this._con_f_used[ind]){
+ if (typeof(this._con_f_used[ind]) == "object")
+ return this._con_f_used[ind];
+ else
+ return false;
+ }
+ return true;
+ });
+ this.attachEvent("onDynXLS",function(){
+ this.xmlFileUrl=combine_urls.call(this,this.xmlFileUrl);
+ return true;
+ });
+ this.attachEvent("onBeforeSorting",function(ind,type,dir){
+ if (type=="connector"){
+ var self=this;
+ this.clearAndLoad(sorting_url.call(this,this.xmlFileUrl,ind,dir),function(){
+ self.setSortImgState(true,ind,dir);
+ });
+ return false;
+ }
+ return true;
+ });
+ this.attachEvent("onFilterStart",function(a,b){
+ if (this._con_f_used.length){
+ this.clearAndLoad(filtering_url.call(this,this.xmlFileUrl,a,b));
+ return false;
+ }
+ return true;
+ });
+ this.attachEvent("onXLE",function(a,b,c,xml){
+ if (!xml) return;
+ });
+
+ if (this._init_point_connector) this._init_point_connector();
+ };
+ dhtmlXGridObject.prototype._con_f_used=[];
+ dhtmlXGridObject.prototype._in_header_connector_text_filter=function(t,i){
+ if (!this._con_f_used[i])
+ this._con_f_used[i]=1;
+ return this._in_header_text_filter(t,i);
+ };
+ dhtmlXGridObject.prototype._in_header_connector_select_filter=function(t,i){
+ if (!this._con_f_used[i])
+ this._con_f_used[i]=2;
+ return this._in_header_select_filter(t,i);
+ };
+ dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load;
+ dhtmlXGridObject.prototype.load=function(url, call, type){
+ if (!this._colls_loaded && this.cellType){
+ var ar=[];
+ for (var i=0; i < this.cellType.length; i++)
+ if (this.cellType[i].indexOf("co")==0 || this._con_f_used[i]==2) ar.push(i);
+ if (ar.length)
+ arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":"?")+"connector=true&dhx_colls="+ar.join(",");
+ }
+ return this.load_connector.apply(this,arguments);
+ };
+ dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead;
+ dhtmlXGridObject.prototype._parseHead=function(url, call, type){
+ this._parseHead_connector.apply(this,arguments);
+ if (!this._colls_loaded){
+ var cols = this.xmlLoader.doXPath("./coll_options", arguments[0]);
+ for (var i=0; i < cols.length; i++){
+ var f = cols[i].getAttribute("for");
+ var v = [];
+ var combo=null;
+ if (this.cellType[f] == "combo")
+ combo = this.getColumnCombo(f);
+ if (this.cellType[f].indexOf("co")==0)
+ combo=this.getCombo(f);
+
+ var os = this.xmlLoader.doXPath("./item",cols[i]);
+ for (var j=0; j<os.length; j++){
+ var val=os[j].getAttribute("value");
+
+ if (combo){
+ var lab=os[j].getAttribute("label")||val;
+
+ if (combo.addOption)
+ combo.addOption([[val, lab]]);
+ else
+ combo.put(val,lab);
+
+ v[v.length]=lab;
+ } else
+ v[v.length]=val;
+ }
+ if (this._con_f_used[f*1])
+ this._con_f_used[f*1]=v;
+ }
+ this._colls_loaded=true;
+ }
+ };
+}
+
+if (window.dataProcessor){
+ dataProcessor.prototype.init_original=dataProcessor.prototype.init;
+ dataProcessor.prototype.init=function(obj){
+ this.init_original(obj);
+ obj._dataprocessor=this;
+
+ this.setTransactionMode("POST",true);
+ this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true";
+ };
+}
+dhtmlxError.catchError("LoadXML",function(a,b,c){
+ if (c[0].status != 0) {
+ alert(c[0].responseText);
+ }
+});
+
+window.dhtmlXScheduler=window.scheduler={version:3.0};
+dhtmlxEventable(scheduler);
+scheduler.init=function(id,date,mode){
+ date=date||(new Date());
+ mode=mode||"week";
+
+ scheduler.date.init();
+
+ this._obj=(typeof id == "string")?document.getElementById(id):id;
+ this._els=[];
+ this._scroll=true;
+ this._quirks=(_isIE && document.compatMode == "BackCompat");
+ this._quirks7=(_isIE && navigator.appVersion.indexOf("MSIE 8")==-1);
+
+ this.get_elements();
+ this.init_templates();
+ this.set_actions();
+ dhtmlxEvent(window,"resize",function(){
+ window.clearTimeout(scheduler._resize_timer);
+ scheduler._resize_timer=window.setTimeout(function(){
+ if (scheduler.callEvent("onSchedulerResize",[]))
+ scheduler.update_view();
+ }, 100);
+ });
+ this.set_sizes();
+ scheduler.callEvent('onSchedulerReady', []);
+ this.setCurrentView(date,mode);
+};
+scheduler.xy={
+ nav_height:22,
+ min_event_height:40,
+ scale_width:50,
+ bar_height:20,
+ scroll_width:18,
+ scale_height:20,
+ month_scale_height:20,
+ menu_width:25,
+ margin_top:0,
+ margin_left:0,
+ editor_width:140
+};
+scheduler.keys={
+ edit_save:13,
+ edit_cancel:27
+};
+scheduler.set_sizes=function(){
+ var w = this._x = this._obj.clientWidth-this.xy.margin_left;
+ var h = this._y = this._obj.clientHeight-this.xy.margin_top;
+
+ //not-table mode always has scroll - need to be fixed in future
+ var scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);
+ var scale_s=this._table_view?-1:this.xy.scale_width;
+
+ this.set_xy(this._els["dhx_cal_navline"][0],w,this.xy.nav_height,0,0);
+ this.set_xy(this._els["dhx_cal_header"][0],w-scale_x,this.xy.scale_height,scale_s,this.xy.nav_height+(this._quirks?-1:1));
+ //to support alter-skin, we need a way to alter height directly from css
+ var actual_height = this._els["dhx_cal_navline"][0].offsetHeight;
+ if (actual_height > 0) this.xy.nav_height = actual_height;
+
+ var data_y=this.xy.scale_height+this.xy.nav_height+(this._quirks?-2:0);
+ this.set_xy(this._els["dhx_cal_data"][0],w,h-(data_y+2),0,data_y+2);
+};
+scheduler.set_xy=function(node,w,h,x,y){
+ node.style.width=Math.max(0,w)+"px";
+ node.style.height=Math.max(0,h)+"px";
+ if (arguments.length>3){
+ node.style.left=x+"px";
+ node.style.top=y+"px";
+ }
+};
+scheduler.get_elements=function(){
+ //get all child elements as named hash
+ var els=this._obj.getElementsByTagName("DIV");
+ for (var i=0; i < els.length; i++){
+ var name=els[i].className;
+ if (!this._els[name]) this._els[name]=[];
+ this._els[name].push(els[i]);
+
+ //check if name need to be changed
+ var t=scheduler.locale.labels[els[i].getAttribute("name")||name];
+ if (t) els[i].innerHTML=t;
+ }
+};
+scheduler.set_actions=function(){
+ for (var a in this._els)
+ if (this._click[a])
+ for (var i=0; i < this._els[a].length; i++)
+ this._els[a][i].onclick=scheduler._click[a];
+ this._obj.onselectstart=function(e){ return false; };
+ this._obj.onmousemove=function(e){
+ scheduler._on_mouse_move(e||event);
+ };
+ this._obj.onmousedown=function(e){
+ scheduler._on_mouse_down(e||event);
+ };
+ this._obj.onmouseup=function(e){
+ scheduler._on_mouse_up(e||event);
+ };
+ this._obj.ondblclick=function(e){
+ scheduler._on_dbl_click(e||event);
+ }
+};
+scheduler.select=function(id){
+ if (this._table_view || !this.getEvent(id)._timed) return; //temporary block
+ if (this._select_id==id) return;
+ this.editStop(false);
+ this.unselect();
+ this._select_id = id;
+ this.updateEvent(id);
+};
+scheduler.unselect=function(id){
+ if (id && id!=this._select_id) return;
+ var t=this._select_id;
+ this._select_id = null;
+ if (t) this.updateEvent(t);
+};
+scheduler.getState=function(){
+ return {
+ mode: this._mode,
+ date: this._date,
+ min_date: this._min_date,
+ max_date: this._max_date,
+ editor_id: this._edit_id,
+ lightbox_id: this._lightbox_id,
+ new_event: this._new_event
+ };
+};
+scheduler._click={
+ dhx_cal_data:function(e){
+ //debugger;
+ var trg = e?e.target:event.srcElement;
+ var id = scheduler._locate_event(trg);
+
+ e = e || event;
+ if ((id && !scheduler.callEvent("onClick",[id,e])) ||scheduler.config.readonly) return;
+
+ if (id) {
+ scheduler.select(id);
+ var mask = trg.className;
+ if (mask.indexOf("_icon")!=-1)
+ scheduler._click.buttons[mask.split(" ")[1].replace("icon_","")](id);
+ } else
+ scheduler._close_not_saved();
+ },
+ dhx_cal_prev_button:function(){
+ scheduler._click.dhx_cal_next_button(0,-1);
+ },
+ dhx_cal_next_button:function(dummy,step){
+ scheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects
+ scheduler.date[scheduler._mode+"_start"](scheduler._date),(step||1),scheduler._mode));
+ },
+ dhx_cal_today_button:function(){
+ scheduler.setCurrentView(new Date());
+ },
+ dhx_cal_tab:function(){
+ var name = this.getAttribute("name");
+ var mode = name.substring(0, name.search("_tab"));
+ scheduler.setCurrentView(scheduler._date,mode);
+ },
+ buttons:{
+ "delete":function(id){ var c=scheduler.locale.labels.confirm_deleting; if (!c||confirm(c)) scheduler.deleteEvent(id); },
+ edit:function(id){ scheduler.edit(id); },
+ save:function(id){ scheduler.editStop(true); },
+ details:function(id){ scheduler.showLightbox(id); },
+ cancel:function(id){ scheduler.editStop(false); }
+ }
+};
+scheduler.addEventNow=function(start,end,e){
+ var base = {};
+ if (start && start.constructor.toString().match(/object/i) !== null){
+ base = start;
+ start = null;
+ }
+
+ var d = (this.config.event_duration||this.config.time_step)*60000;
+ if (!start) start = Math.round((new Date()).valueOf()/d)*d;
+ var start_date = new Date(start);
+ if (!end){
+ var start_hour = this.config.first_hour;
+ if (start_hour > start_date.getHours()){
+ start_date.setHours(start_hour);
+ start = start_date.valueOf();
+ }
+ end = start+d;
+ }
+ var end_date = new Date(end);
+
+ // scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)
+ if(start_date.valueOf() == end_date.valueOf())
+ end_date.setTime(end_date.valueOf()+d);
+
+ base.start_date = base.start_date||start_date;
+ base.end_date = base.end_date||end_date;
+ base.text = base.text||this.locale.labels.new_event;
+ base.id = this._drag_id = this.uid();
+ this._drag_mode="new-size";
+
+ this._loading=true;
+ this.addEvent(base);
+ this.callEvent("onEventCreated",[this._drag_id,e]);
+ this._loading=false;
+
+ this._drag_event={}; //dummy , to trigger correct event updating logic
+ this._on_mouse_up(e);
+};
+scheduler._on_dbl_click=function(e,src){
+ src = src||(e.target||e.srcElement);
+ if (this.config.readonly) return;
+ var name = src.className.split(" ")[0];
+ switch(name){
+ case "dhx_scale_holder":
+ case "dhx_scale_holder_now":
+ case "dhx_month_body":
+ case "dhx_wa_day_data":
+ if (!scheduler.config.dblclick_create) break;
+ var pos=this._mouse_coords(e);
+ var start=this._min_date.valueOf()+(pos.y*this.config.time_step+(this._table_view?0:pos.x)*24*60)*60000;
+ start = this._correct_shift(start);
+ this.addEventNow(start,null,e);
+ break;
+ case "dhx_body":
+ case "dhx_wa_ev_body":
+ case "dhx_cal_event_line":
+ case "dhx_cal_event_clear":
+ var id = this._locate_event(src);
+ if (!this.callEvent("onDblClick",[id,e])) return;
+ if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed)
+ this.showLightbox(id);
+ else
+ this.edit(id);
+ break;
+ case "":
+ if (src.parentNode)
+ return scheduler._on_dbl_click(e,src.parentNode);
+ default:
+ var t = this["dblclick_"+name];
+ if (t) t.call(this,e);
+ break;
+ }
+};
+
+scheduler._mouse_coords=function(ev){
+ var pos;
+ var b=document.body;
+ var d = document.documentElement;
+ if(ev.pageX || ev.pageY)
+ pos={x:ev.pageX, y:ev.pageY};
+ else pos={
+ x:ev.clientX + (b.scrollLeft||d.scrollLeft||0) - b.clientLeft,
+ y:ev.clientY + (b.scrollTop||d.scrollTop||0) - b.clientTop
+ };
+
+ //apply layout
+ pos.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);
+ pos.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els["dhx_cal_data"][0].scrollTop;
+ pos.ev = ev;
+
+ var handler = this["mouse_"+this._mode];
+ if (handler)
+ return handler.call(this,pos);
+
+ //transform to date
+ if (!this._table_view){
+ pos.x=Math.max(0,Math.ceil(pos.x/this._cols[0])-1);
+ pos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);
+ } else {
+ var dy=0;
+ for (dy=1; dy < this._colsS.heights.length; dy++)
+ if (this._colsS.heights[dy]>pos.y) break;
+
+ pos.y=(Math.max(0,Math.ceil(pos.x/this._cols[0])-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;
+ pos.x=0;
+ }
+
+ return pos;
+}
+scheduler._close_not_saved=function(){
+ if (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){
+ var c=scheduler.locale.labels.confirm_closing;
+ if (!c || confirm(c))
+ scheduler.editStop(scheduler.config.positive_closing);
+ }
+};
+scheduler._correct_shift=function(start, back){
+ return start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);
+};
+scheduler._on_mouse_move=function(e){
+ if (this._drag_mode){
+ var pos=this._mouse_coords(e);
+ if (!this._drag_pos || pos.custom || this._drag_pos.x!=pos.x || this._drag_pos.y!=pos.y){
+
+ if (this._edit_id!=this._drag_id)
+ this._close_not_saved();
+
+ this._drag_pos=pos;
+
+ if (this._drag_mode=="create"){
+ this._close_not_saved();
+ this._loading=true; //will be ignored by dataprocessor
+
+ var start=this._min_date.valueOf()+(pos.y*this.config.time_step+(this._table_view?0:pos.x)*24*60)*60000;
+ //if (this._mode != "week" && this._mode != "day")
+ start = this._correct_shift(start);
+
+ if (!this._drag_start){
+ this._drag_start=start; return;
+ }
+ var end = start;
+ if (end==this._drag_start) return;
+
+ this._drag_id=this.uid();
+ this.addEvent(new Date(this._drag_start), new Date(end),this.locale.labels.new_event,this._drag_id, pos.fields);
+
+ this.callEvent("onEventCreated",[this._drag_id,e]);
+ this._loading=false;
+ this._drag_mode="new-size";
+
+ }
+
+ var ev=this.getEvent(this._drag_id);
+ var start,end;
+ if (this._drag_mode=="move"){
+ start = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;
+ if (!pos.custom && this._table_view) start+=this.date.time_part(ev.start_date)*1000;
+ start = this._correct_shift(start);
+ end = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);
+ } else {
+ start = ev.start_date.valueOf();
+ if (this._table_view) {
+ end = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);
+ if (this._mode == "month")
+ end = this._correct_shift(end, false);
+ }
+ else{
+ end = this.date.date_part(new Date(ev.end_date)).valueOf()+pos.y*this.config.time_step*60000;
+ this._els["dhx_cal_data"][0].style.cursor="s-resize";
+ if (this._mode == "week" || this._mode == "day")
+ end = this._correct_shift(end);
+ }
+ if (this._drag_mode == "new-size"){
+ if (end <= this._drag_start){
+ var shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);
+ start = end-(pos.shift?0:shift);
+ end = this._drag_start+(shift||(this.config.time_step*60000));
+ } else {
+ start = this._drag_start;
+ }
+
+ } else if (end<=start)
+ end=start+this.config.time_step*60000;
+ }
+ var new_end = new Date(end-1);
+ var new_start = new Date(start);
+ //prevent out-of-borders situation for day|week view
+ if ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()<this.config.last_hour) || (scheduler._wa && scheduler._wa._dnd) ){
+ ev.start_date=new_start;
+ ev.end_date=new Date(end);
+ if (this.config.update_render)
+ this.update_view();
+ else
+ this.updateEvent(this._drag_id);
+ }
+ if (this._table_view)
+ this.for_rendered(this._drag_id,function(r){
+ r.className+=" dhx_in_move";
+ })
+ }
+ } else {
+ if (scheduler.checkEvent("onMouseMove")){
+
+ var id = this._locate_event(e.target||e.srcElement);
+ this.callEvent("onMouseMove",[id,e]);
+ }
+ }
+};
+scheduler._on_mouse_context=function(e,src){
+ return this.callEvent("onContextMenu",[this._locate_event(src),e]);
+};
+scheduler._on_mouse_down=function(e,src){
+ if (this.config.readonly || this._drag_mode) return;
+ src = src||(e.target||e.srcElement);
+ if (e.button==2||e.ctrlKey) return this._on_mouse_context(e,src);
+ switch(src.className.split(" ")[0]){
+ case "dhx_cal_event_line":
+ case "dhx_cal_event_clear":
+ if (this._table_view)
+ this._drag_mode="move"; //item in table mode
+ break;
+ case "dhx_header":
+ case "dhx_title":
+ case "dhx_wa_ev_body":
+ this._drag_mode="move"; //item in table mode
+ break;
+ case "dhx_footer":
+ this._drag_mode="resize"; //item in table mode
+ break;
+ case "dhx_scale_holder":
+ case "dhx_scale_holder_now":
+ case "dhx_month_body":
+ case "dhx_matrix_cell":
+ this._drag_mode="create";
+ break;
+ case "":
+ if (src.parentNode)
+ return scheduler._on_mouse_down(e,src.parentNode);
+ default:
+ this._drag_mode=null;
+ this._drag_id=null;
+ }
+ if (this._drag_mode){
+ var id = this._locate_event(src);
+ if (!this.config["drag_"+this._drag_mode] || !this.callEvent("onBeforeDrag",[id, this._drag_mode, e]))
+ this._drag_mode=this._drag_id=0;
+ else {
+ this._drag_id= id;
+ this._drag_event=scheduler._lame_copy({},this._copy_event(this.getEvent(this._drag_id)||{}));
+ }
+ }
+ this._drag_start=null;
+};
+scheduler._on_mouse_up=function(e){
+ if (this._drag_mode && this._drag_id){
+ this._els["dhx_cal_data"][0].style.cursor="default";
+ //drop
+ var ev=this.getEvent(this._drag_id);
+ if (this._drag_event._dhx_changed || !this._drag_event.start_date || ev.start_date.valueOf()!=this._drag_event.start_date.valueOf() || ev.end_date.valueOf()!=this._drag_event.end_date.valueOf()){
+ var is_new=(this._drag_mode=="new-size");
+ if (!this.callEvent("onBeforeEventChanged",[ev,e,is_new])){
+ if (is_new)
+ this.deleteEvent(ev.id, true);
+ else {
+ this._drag_event._dhx_changed = false;
+ scheduler._lame_copy(ev, this._drag_event);
+ this.updateEvent(ev.id);
+ }
+ } else {
+ if (is_new && this.config.edit_on_create){
+ this.unselect();
+ this._new_event=new Date();//timestamp of creation
+ if (this._table_view || this.config.details_on_create) {
+ this._drag_mode=null;
+ return this.showLightbox(this._drag_id);
+ }
+ this._drag_pos=true; //set flag to trigger full redraw
+ this._select_id=this._edit_id=this._drag_id;
+ } else if (!this._new_event)
+ this.callEvent(is_new?"onEventAdded":"onEventChanged",[this._drag_id,this.getEvent(this._drag_id)]);
+ }
+ }
+ if (this._drag_pos) this.render_view_data(); //redraw even if there is no real changes - necessary for correct positioning item after drag
+ }
+ this._drag_mode=null;
+ this._drag_pos=null;
+};
+scheduler.update_view=function(){
+ this._reset_scale();
+ if (this._load_mode && this._load()) return this._render_wait = true;
+ this.render_view_data();
+};
+scheduler.setCurrentView=function(date,mode){
+ date = date || this._date;
+ mode = mode || this._mode;
+
+ if (!this.callEvent("onBeforeViewChange",[this._mode,this._date,mode,date])) return;
+
+ var dhx_cal_data = 'dhx_cal_data';
+ var prev_scroll = (this._mode == mode && this.config.preserve_scroll)?this._els[dhx_cal_data][0].scrollTop:false; // saving current scroll
+
+ //hide old custom view
+ if (this[this._mode+"_view"] && mode && this._mode!=mode)
+ this[this._mode+"_view"](false);
+
+ this._close_not_saved();
+
+ var dhx_multi_day = 'dhx_multi_day';
+ if(this._els[dhx_multi_day]) {
+ this._els[dhx_multi_day][0].parentNode.removeChild(this._els[dhx_multi_day][0]);
+ this._els[dhx_multi_day] = null;
+ }
+
+ this._mode=mode;
+ this._date=date;
+ this._table_view=(this._mode=="month");
+
+ var tabs=this._els["dhx_cal_tab"];
+ for (var i=0; i < tabs.length; i++) {
+ tabs[i].className="dhx_cal_tab"+((tabs[i].getAttribute("name")==this._mode+"_tab")?" active":"");
+ }
+
+ //show new view
+ var view=this[this._mode+"_view"];
+ view?view(true):this.update_view();
+
+ if(typeof prev_scroll == "number") // if we are updating or working with the same view scrollTop should be saved
+ this._els[dhx_cal_data][0].scrollTop = prev_scroll; // restoring original scroll
+
+ this.callEvent("onViewChange",[this._mode,this._date]);
+};
+scheduler._render_x_header = function(i,left,d,h){
+ //header scale
+ var head=document.createElement("DIV"); head.className="dhx_scale_bar";
+ this.set_xy(head,this._cols[i]-1,this.xy.scale_height-2,left,0);//-1 for border
+ head.innerHTML=this.templates[this._mode+"_scale_date"](d,this._mode); //TODO - move in separate method
+ h.appendChild(head);
+};
+scheduler._reset_scale=function(){
+ //current mode doesn't support scales
+ //we mustn't call reset_scale for such modes, so it just to be sure
+ if (!this.templates[this._mode+"_date"]) return;
+
+ var h=this._els["dhx_cal_header"][0];
+ var b=this._els["dhx_cal_data"][0];
+ var c = this.config;
+
+ h.innerHTML="";
+ b.scrollTop=0; //fix flickering in FF
+ b.innerHTML="";
+
+
+ var str=((c.readonly||(!c.drag_resize))?" dhx_resize_denied":"")+((c.readonly||(!c.drag_move))?" dhx_move_denied":"");
+ if (str) b.className = "dhx_cal_data"+str;
+
+
+ this._cols=[]; //store for data section
+ this._colsS={height:0};
+ this._dy_shift=0;
+
+ this.set_sizes();
+ var summ=parseInt(h.style.width); //border delta
+ var left=0;
+
+ var d,dd,sd,today;
+ dd=this.date[this._mode+"_start"](new Date(this._date.valueOf()));
+ d=sd=this._table_view?scheduler.date.week_start(dd):dd;
+ today=this.date.date_part(new Date());
+
+ //reset date in header
+ var ed=scheduler.date.add(dd,1,this._mode);
+ var count = 7;
+
+ if (!this._table_view){
+ var count_n = this.date["get_"+this._mode+"_end"];
+ if (count_n) ed = count_n(dd);
+ count = Math.round((ed.valueOf()-dd.valueOf())/(1000*60*60*24));
+ }
+
+ this._min_date=d;
+ this._els["dhx_cal_date"][0].innerHTML=this.templates[this._mode+"_date"](dd,ed,this._mode);
+
+ for (var i=0; i<count; i++){
+ this._cols[i]=Math.floor(summ/(count-i));
+
+ this._render_x_header(i,left,d,h);
+ if (!this._table_view){
+ var scales=document.createElement("DIV");
+ var cls = "dhx_scale_holder"
+ if (d.valueOf()==today.valueOf()) cls = "dhx_scale_holder_now";
+ scales.className=cls+" "+this.templates.week_date_class(d,today);
+ this.set_xy(scales,this._cols[i]-1,c.hour_size_px*(c.last_hour-c.first_hour),left+this.xy.scale_width+1,0);//-1 for border
+ b.appendChild(scales);
+ this.callEvent("onScaleAdd",[scales, d]);
+ }
+
+ d=this.date.add(d,1,"day");
+ summ-=this._cols[i];
+ left+=this._cols[i];
+ this._colsS[i]=(this._cols[i-1]||0)+(this._colsS[i-1]||(this._table_view?0:this.xy.scale_width+2));
+ this._colsS['col_length'] = count+1;
+ }
+ this._max_date=d;
+ this._colsS[count]=this._cols[count-1]+this._colsS[count-1];
+
+ if (this._table_view) // month view
+ this._reset_month_scale(b,dd,sd);
+ else{
+ this._reset_hours_scale(b,dd,sd);
+ if (c.multi_day){
+ var dhx_multi_day = 'dhx_multi_day';
+
+ if(this._els[dhx_multi_day]) {
+ this._els[dhx_multi_day][0].parentNode.removeChild(this._els[dhx_multi_day][0]);
+ this._els[dhx_multi_day] = null;
+ }
+
+ var navline = this._els["dhx_cal_navline"][0];
+ var top = navline.offsetHeight + this._els["dhx_cal_header"][0].offsetHeight+1;
+
+ var c1 = document.createElement("DIV");
+ c1.className = dhx_multi_day;
+ c1.style.visibility="hidden";
+ this.set_xy(c1, this._colsS[this._colsS.col_length-1]+this.xy.scroll_width, 0, 0, top); // 2 extra borders, dhx_header has -1 bottom margin
+ b.parentNode.insertBefore(c1,b);
+
+ var c2 = c1.cloneNode(true);
+ c2.className = dhx_multi_day+"_icon";
+ c2.style.visibility="hidden";
+ this.set_xy(c2, this.xy.scale_width, 0, 0, top); // dhx_header has -1 bottom margin
+
+ c1.appendChild(c2);
+ this._els[dhx_multi_day]=[c1,c2];
+ this._els[dhx_multi_day][0].onclick = this._click.dhx_cal_data;
+ }
+
+ if (this.config.mark_now){
+ var now = new Date();
+ if (now < this._max_date && now > this._min_date && now.getHours() >= this.config.first_hour && now.getHours()<this.config.last_hour){
+ var day = this.locate_holder_day(now);
+ var sm = now.getHours()*60+now.getMinutes();
+ var now_time = document.createElement("DIV");
+ now_time.className = "dhx_now_time";
+ now_time.style.top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1+"px";
+ b.childNodes[day].appendChild(now_time);
+ }
+ }
+ }
+};
+scheduler._reset_hours_scale=function(b,dd,sd){
+ var c=document.createElement("DIV");
+ c.className="dhx_scale_holder";
+
+ var date = new Date(1980,1,1,this.config.first_hour,0,0);
+ for (var i=this.config.first_hour*1; i < this.config.last_hour; i++) {
+ var cc=document.createElement("DIV");
+ cc.className="dhx_scale_hour";
+ cc.style.height=this.config.hour_size_px-(this._quirks?0:1)+"px";
+ cc.style.width=this.xy.scale_width+"px";
+ cc.innerHTML=scheduler.templates.hour_scale(date);
+
+ c.appendChild(cc);
+ date=this.date.add(date,1,"hour");
+ };
+ b.appendChild(c);
+ if (this.config.scroll_hour)
+ b.scrollTop = this.config.hour_size_px*(this.config.scroll_hour-this.config.first_hour);
+};
+scheduler._reset_month_scale=function(b,dd,sd){
+ var ed=scheduler.date.add(dd,1,"month");
+
+ //trim time part for comparation reasons
+ var cd=new Date();
+ this.date.date_part(cd);
+ this.date.date_part(sd);
+
+ var rows=Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);
+ var tdcss=[];
+ var height=(Math.floor(b.clientHeight/rows)-22);
+
+ this._colsS.height=height+22;
+ var h = this._colsS.heights = [];
+ for (var i=0; i<=7; i++)
+ tdcss[i]=" style='height:"+height+"px; width:"+((this._cols[i]||0)-1)+"px;' "
+
+
+
+ var cellheight = 0;
+ this._min_date=sd;
+ var html="<table cellpadding='0' cellspacing='0'>";
+ for (var i=0; i<rows; i++){
+ html+="<tr>";
+ for (var j=0; j<7; j++){
+ html+="<td";
+ var cls = "";
+ if (sd<dd)
+ cls='dhx_before';
+ else if (sd>=ed)
+ cls='dhx_after';
+ else if (sd.valueOf()==cd.valueOf())
+ cls='dhx_now';
+ html+=" class='"+cls+" "+this.templates.month_date_class(sd,cd)+"' ";
+ html+="><div class='dhx_month_head'>"+this.templates.month_day(sd)+"</div><div class='dhx_month_body' "+tdcss[j]+"></div></td>";
+ sd=this.date.add(sd,1,"day");
+ }
+ html+="</tr>";
+ h[i] = cellheight;
+ cellheight+=this._colsS.height;
+ }
+ html+="</table>";
+ this._max_date=sd;
+
+ b.innerHTML=html;
+ return sd;
+};
+scheduler.getLabel = function(property, key) {
+ var sections = this.config.lightbox.sections;
+ for (var i=0; i<sections.length; i++) {
+ if(sections[i].map_to == property) {
+ var options = sections[i].options;
+ for (var j=0; j<options.length; j++) {
+ if(options[j].key == key) {
+ return options[j].label;
+ }
+ }
+ }
+ }
+ return "";
+};
+scheduler.updateCollection = function(list_name, collection){
+ var list = scheduler.serverList(list_name);
+ if(!list) return false;
+ list.splice(0,list.length);
+ list.push.apply(list, collection||[]);
+ scheduler.callEvent("onOptionsLoad", []);
+ scheduler.resetLightbox();
+ return true;
+};
+scheduler._lame_copy=function(target, source){
+ for(var key in source)
+ target[key] = source[key];
+ return target;
+};
+
+scheduler.date={
+ init:function(){
+ var s = scheduler.locale.date.month_short;
+ var t = scheduler.locale.date.month_short_hash = {};
+ for (var i = 0; i < s.length; i++)
+ t[s[i]]=i;
+
+ var s = scheduler.locale.date.month_full;
+ var t = scheduler.locale.date.month_full_hash = {};
+ for (var i = 0; i < s.length; i++)
+ t[s[i]]=i;
+ },
+ date_part:function(date){
+ date.setHours(0);
+ date.setMinutes(0);
+ date.setSeconds(0);
+ date.setMilliseconds(0);
+ return date;
+ },
+ time_part:function(date){
+ return (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;
+ },
+ week_start:function(date){
+ var shift=date.getDay();
+ if (scheduler.config.start_on_monday){
+ if (shift===0) shift=6;
+ else shift--;
+ }
+ return this.date_part(this.add(date,-1*shift,"day"));
+ },
+ month_start:function(date){
+ date.setDate(1);
+ return this.date_part(date);
+ },
+ year_start:function(date){
+ date.setMonth(0);
+ return this.month_start(date);
+ },
+ day_start:function(date){
+ return this.date_part(date);
+ },
+ add:function(date,inc,mode){
+ var ndate=new Date(date.valueOf());
+ switch(mode){
+ case "day":
+ ndate.setDate(ndate.getDate()+inc);
+ if(date.getDate()==ndate.getDate() && !!inc) {
+ do {
+ ndate.setTime(ndate.getTime()+60*60*1000);
+ } while (date.getDate() == ndate.getDate())
+ }
+ break;
+ case "week": ndate.setDate(ndate.getDate()+7*inc); break;
+ case "month": ndate.setMonth(ndate.getMonth()+inc); break;
+ case "year": ndate.setYear(ndate.getFullYear()+inc); break;
+ case "hour": ndate.setHours(ndate.getHours()+inc); break;
+ case "minute": ndate.setMinutes(ndate.getMinutes()+inc); break;
+ default:
+ return scheduler.date["add_"+mode](date,inc,mode);
+ }
+ return ndate;
+ },
+ to_fixed:function(num){
+ if (num<10) return "0"+num;
+ return num;
+ },
+ copy:function(date){
+ return new Date(date.valueOf());
+ },
+ date_to_str:function(format,utc){
+ format=format.replace(/%[a-zA-Z]/g,function(a){
+ switch(a){
+ case "%d": return "\"+scheduler.date.to_fixed(date.getDate())+\"";
+ case "%m": return "\"+scheduler.date.to_fixed((date.getMonth()+1))+\"";
+ case "%j": return "\"+date.getDate()+\"";
+ case "%n": return "\"+(date.getMonth()+1)+\"";
+ case "%y": return "\"+scheduler.date.to_fixed(date.getFullYear()%100)+\"";
+ case "%Y": return "\"+date.getFullYear()+\"";
+ case "%D": return "\"+scheduler.locale.date.day_short[date.getDay()]+\"";
+ case "%l": return "\"+scheduler.locale.date.day_full[date.getDay()]+\"";
+ case "%M": return "\"+scheduler.locale.date.month_short[date.getMonth()]+\"";
+ case "%F": return "\"+scheduler.locale.date.month_full[date.getMonth()]+\"";
+ case "%h": return "\"+scheduler.date.to_fixed((date.getHours()+11)%12+1)+\"";
+ case "%g": return "\"+((date.getHours()+11)%12+1)+\"";
+ case "%G": return "\"+date.getHours()+\"";
+ case "%H": return "\"+scheduler.date.to_fixed(date.getHours())+\"";
+ case "%i": return "\"+scheduler.date.to_fixed(date.getMinutes())+\"";
+ case "%a": return "\"+(date.getHours()>11?\"pm\":\"am\")+\"";
+ case "%A": return "\"+(date.getHours()>11?\"PM\":\"AM\")+\"";
+ case "%s": return "\"+scheduler.date.to_fixed(date.getSeconds())+\"";
+ case "%W": return "\"+scheduler.date.to_fixed(scheduler.date.getISOWeek(date))+\"";
+ default: return a;
+ }
+ });
+ if (utc) format=format.replace(/date\.get/g,"date.getUTC");
+ return new Function("date","return \""+format+"\";");
+ },
+ str_to_date:function(format,utc){
+ var splt="var temp=date.split(/[^0-9a-zA-Z]+/g);";
+ var mask=format.match(/%[a-zA-Z]/g);
+ for (var i=0; i<mask.length; i++){
+ switch(mask[i]){
+ case "%j":
+ case "%d": splt+="set[2]=temp["+i+"]||1;";
+ break;
+ case "%n":
+ case "%m": splt+="set[1]=(temp["+i+"]||1)-1;";
+ break;
+ case "%y": splt+="set[0]=temp["+i+"]*1+(temp["+i+"]>50?1900:2000);";
+ break;
+ case "%g":
+ case "%G":
+ case "%h":
+ case "%H":
+ splt+="set[3]=temp["+i+"]||0;";
+ break;
+ case "%i":
+ splt+="set[4]=temp["+i+"]||0;";
+ break;
+ case "%Y": splt+="set[0]=temp["+i+"]||0;";
+ break;
+ case "%a":
+ case "%A": splt+="set[3]=set[3]%12+((temp["+i+"]||'').toLowerCase()=='am'?0:12);";
+ break;
+ case "%s": splt+="set[5]=temp["+i+"]||0;";
+ break;
+ case "%M": splt+="set[1]=scheduler.locale.date.month_short_hash[temp["+i+"]]||0;";
+ break;
+ case "%F": splt+="set[1]=scheduler.locale.date.month_full_hash[temp["+i+"]]||0;";
+ break;
+ default:
+ break;
+ }
+ }
+ var code ="set[0],set[1],set[2],set[3],set[4],set[5]";
+ if (utc) code =" Date.UTC("+code+")";
+ return new Function("date","var set=[0,0,1,0,0,0]; "+splt+" return new Date("+code+");");
+ },
+
+ getISOWeek: function(ndate) {
+ if(!ndate) return false;
+ var nday = ndate.getDay();
+ if (nday === 0) {
+ nday = 7;
+ }
+ var first_thursday = new Date(ndate.valueOf());
+ first_thursday.setDate(ndate.getDate() + (4 - nday));
+ var year_number = first_thursday.getFullYear(); // year of the first Thursday
+ var ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)
+ var week_number = 1 + Math.floor( ordinal_date / 7);
+ return week_number;
+ },
+
+ getUTCISOWeek: function(ndate){
+ return this.getISOWeek(ndate);
+ }
+};
+scheduler.locale={
+ date:{
+ month_full:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
+ month_short:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
+ day_full:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
+ day_short:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+ },
+ labels:{
+ dhx_cal_today_button:"Today",
+ day_tab:"Day",
+ week_tab:"Week",
+ month_tab:"Month",
+ new_event:"New event",
+ icon_save:"Save",
+ icon_cancel:"Cancel",
+ icon_details:"Details",
+ icon_edit:"Edit",
+ icon_delete:"Delete",
+ confirm_closing:"",//Your changes will be lost, are your sure ?
+ confirm_deleting:"Event will be deleted permanently, are you sure?",
+ section_description:"Description",
+ section_time:"Time period",
+ full_day:"Full day",
+
+ /*recurring events*/
+ confirm_recurring:"Do you want to edit the whole set of repeated events?",
+ section_recurring:"Repeat event",
+ button_recurring:"Disabled",
+ button_recurring_open:"Enabled",
+
+ /*agenda view extension*/
+ agenda_tab:"Agenda",
+ date:"Date",
+ description:"Description",
+
+ /*year view extension*/
+ year_tab:"Year",
+
+ /* week agenda extension */
+ week_agenda_tab: "Agenda"
+ }
+};
+
+
+/*
+%e Day of the month without leading zeros (01..31)
+%d Day of the month, 2 digits with leading zeros (01..31)
+%j Day of the year, 3 digits with leading zeros (001..366)
+%a A textual representation of a day, two letters
+%W A full textual representation of the day of the week
+
+%c Numeric representation of a month, without leading zeros (0..12)
+%m Numeric representation of a month, with leading zeros (00..12)
+%b A short textual representation of a month, three letters (Jan..Dec)
+%M A full textual representation of a month, such as January or March (January..December)
+
+%y A two digit representation of a year (93..03)
+%Y A full numeric representation of a year, 4 digits (1993..03)
+*/
+
+scheduler.config={
+ default_date: "%j %M %Y",
+ month_date: "%F %Y",
+ load_date: "%Y-%m-%d",
+ week_date: "%l",
+ day_date: "%D, %F %j",
+ hour_date: "%H:%i",
+ month_day : "%d",
+ xml_date:"%m/%d/%Y %H:%i",
+ api_date:"%d-%m-%Y %H:%i",
+
+ hour_size_px:42,
+ time_step:5,
+
+ start_on_monday:1,
+ first_hour:0,
+ last_hour:24,
+ readonly:false,
+ drag_resize:1,
+ drag_move:1,
+ drag_create:1,
+ dblclick_create:1,
+ edit_on_create:1,
+ details_on_create:0,
+ click_form_details:0,
+ cascade_event_display: false,
+ cascade_event_count:4,
+ cascade_event_margin: 30,
+ drag_lightbox:true,
+ preserve_scroll:true,
+
+ server_utc:false,
+
+ positive_closing:false,
+
+ icons_edit:["icon_save","icon_cancel"],
+ icons_select:["icon_details","icon_edit","icon_delete"],
+ buttons_left:["dhx_save_btn","dhx_cancel_btn"],
+ buttons_right:["dhx_delete_btn"],
+ lightbox:{
+ sections:[ {name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
+ {name:"time", height:72, type:"time", map_to:"auto"} ]
+ },
+
+ repeat_date_of_end: "01.01.2010"
+};
+scheduler.templates={};
+scheduler.init_templates=function(){
+ var d=scheduler.date.date_to_str;
+ var c=scheduler.config;
+ var f = function(a,b){
+ for (var c in b)
+ if (!a[c]) a[c]=b[c];
+ };
+ f(scheduler.templates,{
+ day_date:d(c.default_date),
+ month_date:d(c.month_date),
+ week_date:function(d1,d2){
+ return scheduler.templates.day_date(d1)+" &ndash; "+scheduler.templates.day_date(scheduler.date.add(d2,-1,"day"));
+ },
+ day_scale_date:d(c.default_date),
+ month_scale_date:d(c.week_date),
+ week_scale_date:d(c.day_date),
+ hour_scale:d(c.hour_date),
+ time_picker:d(c.hour_date),
+ event_date:d(c.hour_date),
+ month_day:d(c.month_day),
+ xml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),
+ load_format:d(c.load_date,c.server_utc),
+ xml_format:d(c.xml_date,c.server_utc),
+ api_date:scheduler.date.str_to_date(c.api_date),
+ event_header:function(start,end,ev){
+ return scheduler.templates.event_date(start)+" - "+scheduler.templates.event_date(end);
+ },
+ event_text:function(start,end,ev){
+ return ev.text;
+ },
+ event_class:function(start,end,ev){
+ return "";
+ },
+ month_date_class:function(d){
+ return "";
+ },
+ week_date_class:function(d){
+ return "";
+ },
+ event_bar_date:function(start,end,ev){
+ return scheduler.templates.event_date(start)+" ";
+ },
+ event_bar_text:function(start,end,ev){
+ return ev.text;
+ }
+ });
+ this.callEvent("onTemplatesReady",[]);
+};
+
+
+
+scheduler.uid=function(){
+ if (!this._seed) this._seed=(new Date).valueOf();
+ return this._seed++;
+};
+scheduler._events={};
+scheduler.clearAll=function(){
+ this._events={};
+ this._loaded={};
+ this.clear_view();
+};
+scheduler.addEvent=function(start_date,end_date,text,id,extra_data){
+ if(!arguments.length)
+ return this.addEventNow();
+ var ev=start_date;
+ if (arguments.length!=1){
+ ev=extra_data||{};
+ ev.start_date=start_date;
+ ev.end_date=end_date;
+ ev.text=text;
+ ev.id=id;
+ }
+ ev.id = ev.id||scheduler.uid();
+ ev.text = ev.text||"";
+
+ if (typeof ev.start_date == "string") ev.start_date=this.templates.api_date(ev.start_date);
+ if (typeof ev.end_date == "string") ev.end_date=this.templates.api_date(ev.end_date);
+
+ var d = (this.config.event_duration||this.config.time_step)*60000;
+ if(ev.start_date.valueOf() == ev.end_date.valueOf())
+ ev.end_date.setTime(ev.end_date.valueOf()+d);
+
+ ev._timed=this.is_one_day_event(ev);
+
+ var is_new=!this._events[ev.id];
+ this._events[ev.id]=ev;
+ this.event_updated(ev);
+ if (!this._loading)
+ this.callEvent(is_new?"onEventAdded":"onEventChanged",[ev.id,ev]);
+};
+scheduler.deleteEvent=function(id,silent){
+ var ev=this._events[id];
+ if (!silent && (!this.callEvent("onBeforeEventDelete",[id,ev]) || !this.callEvent("onConfirmedBeforeEventDelete", [id,ev])))
+ return;
+ if (ev){
+ delete this._events[id];
+ this.unselect(id);
+ this.event_updated(ev);
+ }
+
+ this.callEvent("onEventDeleted", [id]);
+};
+scheduler.getEvent=function(id){
+ return this._events[id];
+};
+scheduler.setEvent=function(id,hash){
+ this._events[id]=hash;
+};
+scheduler.for_rendered=function(id,method){
+ for (var i=this._rendered.length-1; i>=0; i--)
+ if (this._rendered[i].getAttribute("event_id")==id)
+ method(this._rendered[i],i);
+};
+scheduler.changeEventId=function(id,new_id){
+ if (id == new_id) return;
+ var ev=this._events[id];
+ if (ev){
+ ev.id=new_id;
+ this._events[new_id]=ev;
+ delete this._events[id];
+ }
+ this.for_rendered(id,function(r){
+ r.setAttribute("event_id",new_id);
+ });
+ if (this._select_id==id) this._select_id=new_id;
+ if (this._edit_id==id) this._edit_id=new_id;
+ //if (this._drag_id==id) this._drag_id=new_id;
+ this.callEvent("onEventIdChange",[id,new_id]);
+};
+
+(function(){
+ var attrs=["text","Text","start_date","StartDate","end_date","EndDate"];
+ var create_getter=function(name){
+ return function(id){ return (scheduler.getEvent(id))[name]; };
+ };
+ var create_setter=function(name){
+ return function(id,value){
+ var ev=scheduler.getEvent(id); ev[name]=value;
+ ev._changed=true;
+ ev._timed=this.is_one_day_event(ev);
+ scheduler.event_updated(ev,true);
+ };
+ };
+ for (var i=0; i<attrs.length; i+=2){
+ scheduler["getEvent"+attrs[i+1]]=create_getter(attrs[i]);
+ scheduler["setEvent"+attrs[i+1]]=create_setter(attrs[i]);
+ }
+})();
+
+scheduler.event_updated=function(ev,force){
+ if (this.is_visible_events(ev))
+ this.render_view_data();
+ else this.clear_event(ev.id);
+};
+scheduler.is_visible_events=function(ev){
+ return (ev.start_date<this._max_date && this._min_date<ev.end_date);
+};
+scheduler.is_one_day_event=function(ev){
+ var delta = ev.end_date.getDate()-ev.start_date.getDate();
+
+ if (!delta)
+ return ev.start_date.getMonth()==ev.end_date.getMonth() && ev.start_date.getFullYear()==ev.end_date.getFullYear();
+ else {
+ if (delta < 0) delta = Math.ceil((ev.end_date.valueOf()-ev.start_date.valueOf())/(24*60*60*1000));
+ return (delta == 1 && !ev.end_date.getHours() && !ev.end_date.getMinutes() && (ev.start_date.getHours() || ev.start_date.getMinutes() ));
+ }
+
+};
+scheduler.get_visible_events=function(){
+ //not the best strategy for sure
+ var stack=[];
+ var filter = this["filter_"+this._mode];
+
+ for( var id in this._events)
+ if (this.is_visible_events(this._events[id]))
+ if (this._table_view || this.config.multi_day || this._events[id]._timed)
+ if (!filter || filter(id,this._events[id]))
+ stack.push(this._events[id]);
+
+ return stack;
+};
+scheduler.render_view_data=function(evs, hold){
+ if(!evs){
+ if (this._not_render) {
+ this._render_wait=true;
+ return;
+ }
+ this._render_wait=false;
+
+ this.clear_view();
+ evs=this.get_visible_events();
+ }
+
+ if (this.config.multi_day && !this._table_view){
+
+ var tvs = [];
+ var tvd = [];
+ for (var i=0; i < evs.length; i++){
+ if (evs[i]._timed)
+ tvs.push(evs[i]);
+ else
+ tvd.push(evs[i]);
+ }
+
+ // multiday events
+
+
+
+ this._rendered_location = this._els['dhx_multi_day'][0];
+ this._table_view=true;
+ this.render_data(tvd, hold);
+ this._table_view=false;
+
+ // normal events
+ this._rendered_location = this._els['dhx_cal_data'][0];
+ this._table_view=false;
+ this.render_data(tvs, hold);
+
+ } else {
+ this._rendered_location = this._els['dhx_cal_data'][0];
+ this.render_data(evs, hold);
+ }
+};
+scheduler.render_data=function(evs,hold){
+ evs=this._pre_render_events(evs,hold);
+ for (var i=0; i<evs.length; i++)
+ if (this._table_view)
+ this.render_event_bar(evs[i]);
+ else
+ this.render_event(evs[i]);
+};
+scheduler._pre_render_events=function(evs,hold){
+ var hb = this.xy.bar_height;
+ var h_old = this._colsS.heights;
+ var h=this._colsS.heights=[0,0,0,0,0,0,0];
+ var data = this._els["dhx_cal_data"][0];
+
+ if (!this._table_view) evs=this._pre_render_events_line(evs,hold); //ignore long events for now
+ else evs=this._pre_render_events_table(evs,hold);
+
+ if (this._table_view){
+ if (hold)
+ this._colsS.heights = h_old;
+ else {
+ var evl = data.firstChild;
+ if (evl.rows){
+ for (var i=0; i<evl.rows.length; i++){
+ h[i]++;
+ if ((h[i])*hb > this._colsS.height-22){ // 22 - height of cell's header
+ //we have overflow, update heights
+ var cells = evl.rows[i].cells;
+ for (var j=0; j < cells.length; j++) {
+ cells[j].childNodes[1].style.height = h[i]*hb+"px";
+ }
+ h[i]=(h[i-1]||0)+cells[0].offsetHeight;
+ }
+ h[i]=(h[i-1]||0)+evl.rows[i].cells[0].offsetHeight;
+ }
+ h.unshift(0);
+ if (evl.parentNode.offsetHeight<evl.parentNode.scrollHeight && !evl._h_fix){
+ //we have v-scroll, decrease last day cell
+ for (var i=0; i<evl.rows.length; i++){
+ var cell = evl.rows[i].cells[6].childNodes[0];
+ var w = cell.offsetWidth-scheduler.xy.scroll_width+"px";
+ cell.style.width = w;
+ cell.nextSibling.style.width = w;
+ }
+ evl._h_fix=true;
+ }
+ } else{
+ if (!evs.length && this._els["dhx_multi_day"][0].style.visibility == "visible")
+ h[0]=-1;
+ if (evs.length || h[0]==-1){
+ //shift days to have space for multiday events
+ var childs = evl.parentNode.childNodes;
+ var dh = ((h[0]+1)*hb+1)+"px"; // +1 so multiday events would have 2px from top and 2px from bottom by default
+ data.style.top = (this._els["dhx_cal_navline"][0].offsetHeight + this._els["dhx_cal_header"][0].offsetHeight + parseInt(dh)) + 'px';
+ data.style.height = (this._obj.offsetHeight - parseInt(data.style.top) - (this.xy.margin_top||0)) + 'px';
+ var last = this._els["dhx_multi_day"][0];
+ last.style.height=dh;
+ last.style.visibility=(h[0]==-1?"hidden":"visible");
+ last=this._els["dhx_multi_day"][1];
+ last.style.height=dh;
+ last.style.visibility=(h[0]==-1?"hidden":"visible");
+ last.className=h[0]?"dhx_multi_day_icon":"dhx_multi_day_icon_small";
+ this._dy_shift=(h[0]+1)*hb;
+ h[0] = 0;
+ }
+ }
+ }
+ }
+
+ return evs;
+};
+scheduler._get_event_sday=function(ev){
+ return Math.floor((ev.start_date.valueOf()-this._min_date.valueOf())/(24*60*60*1000));
+};
+scheduler._pre_render_events_line=function(evs,hold){
+ evs.sort(function(a,b){
+ if(a.start_date.valueOf()==b.start_date.valueOf())
+ return a.id>b.id?1:-1;
+ return a.start_date>b.start_date?1:-1;
+ });
+ var days=[]; //events by weeks
+ var evs_originals = [];
+ for (var i=0; i < evs.length; i++) {
+ var ev=evs[i];
+
+ //check scale overflow
+ var sh = ev.start_date.getHours();
+ var eh = ev.end_date.getHours();
+
+ ev._sday=this._get_event_sday(ev);
+ if (!days[ev._sday]) days[ev._sday]=[];
+
+ if (!hold){
+ ev._inner=false;
+
+ var stack=days[ev._sday];
+ while (stack.length && stack[stack.length-1].end_date<=ev.start_date)
+ stack.splice(stack.length-1,1);
+
+ var sorderSet = false;
+ for(var j=0; j<stack.length; j++){
+ if(stack[j].end_date.valueOf()<ev.start_date.valueOf()){
+ sorderSet = true;
+ ev._sorder=stack[j]._sorder;
+ stack.splice(j,1);
+ ev._inner=true;
+ break;
+ }
+ }
+
+ if (stack.length)
+ stack[stack.length-1]._inner=true;
+
+
+ if (!sorderSet) {
+ if (stack.length) {
+ if (stack.length <= stack[stack.length - 1]._sorder) {
+ if (!stack[stack.length - 1]._sorder)
+ ev._sorder = 0;
+ else
+ for (j = 0; j < stack.length; j++) {
+ var _is_sorder = false;
+ for (k = 0; k < stack.length; k++) {
+ if (stack[k]._sorder == j) {
+ _is_sorder = true;
+ break;
+ }
+ }
+ if (!_is_sorder) {
+ ev._sorder = j;
+ break;
+ }
+ }
+ ev._inner = true;
+ }
+ else {
+ var _max_sorder = stack[0]._sorder;
+ for (j = 1; j < stack.length; j++)
+ if (stack[j]._sorder > _max_sorder)
+ _max_sorder = stack[j]._sorder;
+ ev._sorder = _max_sorder + 1;
+ ev._inner = false;
+ }
+
+ }
+ else
+ ev._sorder = 0;
+ }
+
+ stack.push(ev);
+
+ if (stack.length>(stack.max_count||0)) {
+ stack.max_count=stack.length;
+ ev._count=stack.length;
+ }
+ else {
+ ev._count=(ev._count)?ev._count:1;
+ }
+ }
+
+ if (sh < this.config.first_hour || eh >= this.config.last_hour){
+ evs_originals.push(ev);
+ evs[i]=ev=this._copy_event(ev);
+ if (sh < this.config.first_hour){
+ ev.start_date.setHours(this.config.first_hour);
+ ev.start_date.setMinutes(0);
+ }
+ if (eh >= this.config.last_hour){
+ ev.end_date.setMinutes(0);
+ ev.end_date.setHours(this.config.last_hour);
+ }
+ if (ev.start_date>ev.end_date || sh==this.config.last_hour) {
+ evs.splice(i,1); i--; continue;
+ }
+ }
+ }
+ if (!hold){
+ for (var i=0; i < evs.length; i++) {
+ evs[i]._count = days[evs[i]._sday].max_count;
+ }
+ for (var i=0; i < evs_originals.length; i++)
+ evs_originals[i]._count=days[evs_originals[i]._sday].max_count;
+ }
+
+ return evs;
+};
+scheduler._time_order=function(evs){
+ evs.sort(function(a,b){
+ if (a.start_date.valueOf()==b.start_date.valueOf()){
+ if (a._timed && !b._timed) return 1;
+ if (!a._timed && b._timed) return -1;
+ return a.id>b.id?1:-1;
+ }
+ return a.start_date>b.start_date?1:-1;
+ });
+};
+scheduler._pre_render_events_table=function(evs,hold){ // max - max height of week slot
+ this._time_order(evs);
+
+ var out=[];
+ var weeks=[[],[],[],[],[],[],[]]; //events by weeks
+ var max = this._colsS.heights;
+ var start_date;
+ var cols = this._cols.length;
+
+ for (var i=0; i < evs.length; i++) {
+ var ev=evs[i];
+ var sd = (start_date||ev.start_date);
+ var ed = ev.end_date;
+ //trim events which are crossing through current view
+ if (sd<this._min_date) sd=this._min_date;
+ if (ed>this._max_date) ed=this._max_date;
+
+ var locate_s = this.locate_holder_day(sd,false,ev);
+ ev._sday=locate_s%cols;
+ var locate_e = this.locate_holder_day(ed,true,ev)||cols;
+ ev._eday=(locate_e%cols)||cols; //cols used to fill full week, when event end on monday
+ ev._length=locate_e-locate_s;
+
+ //3600000 - compensate 1 hour during winter|summer time shift
+ ev._sweek=Math.floor((this._correct_shift(sd.valueOf(),1)-this._min_date.valueOf())/(60*60*1000*24*cols));
+
+ //current slot
+ var stack=weeks[ev._sweek];
+ //check order position
+ var stack_line;
+
+ for (stack_line=0; stack_line<stack.length; stack_line++)
+ if (stack[stack_line]._eday<=ev._sday)
+ break;
+
+ if(!ev._sorder || !hold ) {
+ ev._sorder=stack_line;
+ }
+
+ if (ev._sday+ev._length<=cols){
+ start_date=null;
+ out.push(ev);
+ stack[stack_line]=ev;
+ //get max height of slot
+ max[ev._sweek]=stack.length-1;
+ } else{ // split long event in chunks
+ var copy=this._copy_event(ev);
+ copy._length=cols-ev._sday;
+ copy._eday=cols; copy._sday=ev._sday;
+ copy._sweek=ev._sweek; copy._sorder=ev._sorder;
+ copy.end_date=this.date.add(sd,copy._length,"day");
+
+ out.push(copy);
+ stack[stack_line]=copy;
+ start_date=copy.end_date;
+ //get max height of slot
+ max[ev._sweek]=stack.length-1;
+ i--; continue; //repeat same step
+ }
+ }
+
+ return out;
+};
+scheduler._copy_dummy=function(){
+ this.start_date=new Date(this.start_date);
+ this.end_date=new Date(this.end_date);
+};
+scheduler._copy_event=function(ev){
+ this._copy_dummy.prototype = ev;
+ return new this._copy_dummy();
+ //return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}
+};
+scheduler._rendered=[];
+scheduler.clear_view=function(){
+ for (var i=0; i<this._rendered.length; i++){
+ var obj=this._rendered[i];
+ if (obj.parentNode) obj.parentNode.removeChild(obj);
+ }
+ this._rendered=[];
+};
+scheduler.updateEvent=function(id){
+ var ev=this.getEvent(id);
+ this.clear_event(id);
+ if (ev && this.is_visible_events(ev))
+ this.render_view_data([ev], true);
+};
+scheduler.clear_event=function(id){
+ this.for_rendered(id,function(node,i){
+ if (node.parentNode)
+ node.parentNode.removeChild(node);
+ scheduler._rendered.splice(i,1);
+ });
+};
+scheduler.render_event=function(ev){
+ var menu = scheduler.xy.menu_width;
+ if (ev._sday<0) return; //can occur in case of recurring event during time shift
+ var parent=scheduler.locate_holder(ev._sday);
+ if (!parent) return; //attempt to render non-visible event
+ var sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();
+ var em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);
+
+ var top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour
+ var height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour
+ //var height = Math.max(25,Math.round((ev.end_date.valueOf()-ev.start_date.valueOf())*(this.config.hour_size_px+(this._quirks?1:0))/(60*60*1000))); //42px/hour
+ var width=Math.floor((parent.clientWidth-menu)/ev._count);
+ var left=ev._sorder*width+1;
+ if (!ev._inner) width=width*(ev._count-ev._sorder);
+ if(this.config.cascade_event_display) {
+ var limit = this.config.cascade_event_count;
+ var margin = this.config.cascade_event_margin;
+ left = ev._sorder%limit*margin;
+ var right = (ev._inner)?(ev._count-ev._sorder-1)%limit*margin/2:0;
+ width=Math.floor(parent.clientWidth-menu-left-right);
+ }
+
+ var d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));
+
+ this._rendered.push(d);
+ parent.appendChild(d);
+
+ left=left+parseInt(parent.style.left,10)+menu;
+
+ if (this._edit_id==ev.id){
+
+ d.style.zIndex = 1; //fix overlapping issue
+ width=Math.max(width-4,scheduler.xy.editor_width);
+ d=document.createElement("DIV");
+ d.setAttribute("event_id",ev.id);
+ this.set_xy(d,width,height-20,left,top+14);
+ d.className="dhx_cal_editor";
+
+ var d2=document.createElement("DIV");
+ this.set_xy(d2,width-6,height-26);
+ d2.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;";
+
+ d.appendChild(d2);
+ this._els["dhx_cal_data"][0].appendChild(d);
+ this._rendered.push(d);
+
+ d2.innerHTML="<textarea class='dhx_cal_editor'>"+ev.text+"</textarea>";
+ if (this._quirks7) d2.firstChild.style.height=height-12+"px"; //IEFIX
+ this._editor=d2.firstChild;
+ this._editor.onkeypress=function(e){
+ if ((e||event).shiftKey) return true;
+ var code=(e||event).keyCode;
+ if (code==scheduler.keys.edit_save) scheduler.editStop(true);
+ if (code==scheduler.keys.edit_cancel) scheduler.editStop(false);
+ };
+ this._editor.onselectstart=function(e){ return (e||event).cancelBubble=true; };
+ d2.firstChild.focus();
+ //IE and opera can add x-scroll during focusing
+ this._els["dhx_cal_data"][0].scrollLeft=0;
+ d2.firstChild.select();
+
+ }
+ if (this._select_id==ev.id){
+ if(this.config.cascade_event_display && this._drag_mode)
+ d.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event
+ var icons=this.config["icons_"+((this._edit_id==ev.id)?"edit":"select")];
+ var icons_str="";
+ var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
+ var color = (ev.textColor?("color:"+ev.textColor+";"):"");
+ for (var i=0; i<icons.length; i++)
+ icons_str+="<div class='dhx_menu_icon "+icons[i]+"' style='"+bg_color+""+color+"' title='"+this.locale.labels[icons[i]]+"'></div>";
+ var obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,"","<div style='"+bg_color+""+color+"' class='dhx_menu_head'></div>",icons_str,true);
+ obj.style.left=left-menu+1;
+ this._els["dhx_cal_data"][0].appendChild(obj);
+ this._rendered.push(obj);
+ }
+};
+scheduler._render_v_bar=function(id,x,y,w,h,style,contentA,contentB,bottom){
+ var d=document.createElement("DIV");
+ var ev = this.getEvent(id);
+ var cs = "dhx_cal_event";
+ var cse = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
+ if (cse) cs=cs+" "+cse;
+
+ var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
+ var color = (ev.textColor?("color:"+ev.textColor+";"):"");
+
+ var html='<div event_id="'+id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(w-4)+'px; height:'+h+'px;'+(style||"")+'">';
+ html+='<div class="dhx_header" style=" width:'+(w-6)+'px;'+bg_color+'" >&nbsp;</div>';
+ html+='<div class="dhx_title" style="'+bg_color+''+color+'">'+contentA+'</div>';
+ html+='<div class="dhx_body" style=" width:'+(w-(this._quirks?4:14))+'px; height:'+(h-(this._quirks?20:30))+'px;'+bg_color+''+color+'">'+contentB+'</div>';
+ html+='<div class="dhx_footer" style=" width:'+(w-8)+'px;'+(bottom?' margin-top:-1px;':'')+''+bg_color+''+color+'" ></div></div>';
+
+ d.innerHTML=html;
+ return d.firstChild;
+};
+scheduler.locate_holder=function(day){
+ if (this._mode=="day") return this._els["dhx_cal_data"][0].firstChild; //dirty
+ return this._els["dhx_cal_data"][0].childNodes[day];
+};
+scheduler.locate_holder_day=function(date,past){
+ var day = Math.floor((this._correct_shift(date,1)-this._min_date)/(60*60*24*1000));
+ //when locating end data of event , we need to use next day if time part was defined
+ if (past && this.date.time_part(date)) day++;
+ return day;
+};
+scheduler.render_event_bar=function(ev){
+ var parent=this._rendered_location;
+
+ var x=this._colsS[ev._sday];
+ var x2=this._colsS[ev._eday];
+ if (x2==x) x2=this._colsS[ev._eday+1];
+ var hb = this.xy.bar_height;
+
+ var y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+(ev._sorder*hb);
+
+ var d=document.createElement("DIV");
+ var cs = ev._timed?"dhx_cal_event_clear":"dhx_cal_event_line";
+ var cse = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
+ if (cse) cs=cs+" "+cse;
+
+ var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
+ var color = (ev.textColor?("color:"+ev.textColor+";"):"");
+
+ var html='<div event_id="'+ev.id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(x2-x-15)+'px;'+color+''+bg_color+''+(ev._text_style||"")+'">';
+
+ if (ev._timed)
+ html+=scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);
+ html+=scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev)+'</div>';
+ html+='</div>';
+
+ d.innerHTML=html;
+
+ this._rendered.push(d.firstChild);
+ parent.appendChild(d.firstChild);
+};
+
+scheduler._locate_event=function(node){
+ var id=null;
+ while (node && !id && node.getAttribute){
+ id=node.getAttribute("event_id");
+ node=node.parentNode;
+ }
+ return id;
+};
+
+
+scheduler.edit=function(id){
+ if (this._edit_id==id) return;
+ this.editStop(false,id);
+ this._edit_id=id;
+ this.updateEvent(id);
+};
+scheduler.editStop=function(mode,id){
+ if (id && this._edit_id==id) return;
+ var ev=this.getEvent(this._edit_id);
+ if (ev){
+ if (mode) ev.text=this._editor.value;
+ this._edit_id=null;
+ this._editor=null;
+ this.updateEvent(ev.id);
+ this._edit_stop_event(ev,mode);
+ }
+};
+scheduler._edit_stop_event=function(ev,mode){
+ if (this._new_event){
+ if (!mode) this.deleteEvent(ev.id,true);
+ else this.callEvent("onEventAdded",[ev.id,ev]);
+ this._new_event=null;
+ } else
+ if (mode) this.callEvent("onEventChanged",[ev.id,ev]);
+};
+
+scheduler.getEvents = function(from,to){
+ var result = [];
+ for (var a in this._events){
+ var ev = this._events[a];
+ if (ev && ev.start_date<to && ev.end_date>from)
+ result.push(ev);
+ }
+ return result;
+};
+
+scheduler._loaded={};
+scheduler._load=function(url,from){
+ url=url||this._load_url;
+ url+=(url.indexOf("?")==-1?"?":"&")+"timeshift="+(new Date()).getTimezoneOffset();
+ if (this.config.prevent_cache) url+="&uid="+this.uid();
+ var to;
+ from=from||this._date;
+
+ if (this._load_mode){
+ var lf = this.templates.load_format;
+
+ from = this.date[this._load_mode+"_start"](new Date(from.valueOf()));
+ while (from>this._min_date) from=this.date.add(from,-1,this._load_mode);
+ to = from;
+
+ var cache_line = true;
+ while (to<this._max_date){
+ to=this.date.add(to,1,this._load_mode);
+ if (this._loaded[lf(from)] && cache_line)
+ from=this.date.add(from,1,this._load_mode);
+ else cache_line = false;
+ }
+
+ var temp_to=to;
+ do {
+ to = temp_to;
+ temp_to=this.date.add(to,-1,this._load_mode);
+ } while (temp_to>from && this._loaded[lf(temp_to)]);
+
+ if (to<=from)
+ return false; //already loaded
+ dhtmlxAjax.get(url+"&from="+lf(from)+"&to="+lf(to),function(l){scheduler.on_load(l);});
+ while(from<to){
+ this._loaded[lf(from)]=true;
+ from=this.date.add(from,1,this._load_mode);
+ }
+ } else
+ dhtmlxAjax.get(url,function(l){scheduler.on_load(l);});
+ this.callEvent("onXLS",[]);
+ return true;
+};
+scheduler.on_load=function(loader){
+ this._loading=true;
+ var evs;
+ if (this._process)
+ evs=this[this._process].parse(loader.xmlDoc.responseText);
+ else
+ evs=this._magic_parser(loader);
+
+ this._not_render=true;
+ for (var i=0; i<evs.length; i++){
+ if (!this.callEvent("onEventLoading",[evs[i]])) continue;
+ this.addEvent(evs[i]);
+ }
+ this._not_render=false;
+ if (this._render_wait) this.render_view_data();
+
+ this._loading=false;
+ if (this._after_call) this._after_call();
+ this._after_call=null;
+
+ this.callEvent("onXLE",[]);
+};
+scheduler.json={};
+scheduler.json.parse = function(data){
+ if (typeof data == "string"){
+ eval("scheduler._temp = "+data+";");
+ data = scheduler._temp;
+ }
+ var evs = [];
+ for (var i=0; i < data.length; i++){
+ data[i].start_date = scheduler.templates.xml_date(data[i].start_date);
+ data[i].end_date = scheduler.templates.xml_date(data[i].end_date);
+ evs.push(data[i]);
+ }
+ return evs;
+};
+scheduler.parse=function(data,type){
+ this._process=type;
+ this.on_load({xmlDoc:{responseText:data}});
+};
+scheduler.load=function(url,call){
+ if (typeof call == "string"){
+ this._process=call;
+ call = arguments[2];
+ }
+
+ this._load_url=url;
+ this._after_call=call;
+ this._load(url,this._date);
+};
+//possible values - day,week,month,year,all
+scheduler.setLoadMode=function(mode){
+ if (mode=="all") mode="";
+ this._load_mode=mode;
+};
+
+//current view by default, or all data if "true" as parameter provided
+scheduler.refresh=function(refresh_all){
+ alert("not implemented");
+ /*
+ this._loaded={};
+ this._load();
+ */
+};
+scheduler.serverList=function(name, array){
+ if(array) {
+ return this.serverList[name] = array.slice(0);
+ }
+ return this.serverList[name] = (this.serverList[name]||[]);
+};
+scheduler._userdata={};
+scheduler._magic_parser=function(loader){
+ var xml;
+ if (!loader.getXMLTopNode){ //from a string
+ var xml_string = loader.xmlDoc.responseText;
+ loader = new dtmlXMLLoaderObject(function(){});
+ loader.loadXMLString(xml_string);
+ }
+
+ xml=loader.getXMLTopNode("data");
+ if (xml.tagName!="data") return [];//not an xml
+
+ var opts = loader.doXPath("//coll_options");
+ for (var i=0; i < opts.length; i++) {
+ var bind = opts[i].getAttribute("for");
+ var arr = this.serverList[bind];
+ if (!arr) continue;
+ arr.splice(0,arr.length); //clear old options
+ var itms = loader.doXPath(".//item",opts[i]);
+ for (var j=0; j < itms.length; j++) {
+ var itm = itms[j];
+ var attrs = itm.attributes;
+ var obj = { key:itms[j].getAttribute("value"), label:itms[j].getAttribute("label")};
+ for (var k = 0; k < attrs.length; k++) {
+ var attr = attrs[k];
+ if(attr.nodeName == "value" || attr.nodeName == "label")
+ continue;
+ obj[attr.nodeName] = attr.nodeValue;
+ }
+ arr.push(obj);
+ }
+ }
+ if (opts.length)
+ scheduler.callEvent("onOptionsLoad",[]);
+
+ var ud=loader.doXPath("//userdata");
+ for (var i=0; i < ud.length; i++) {
+ var udx = this.xmlNodeToJSON(ud[i]);
+ this._userdata[udx.name]=udx.text;
+ }
+
+ var evs=[];
+ xml=loader.doXPath("//event");
+
+
+ for (var i=0; i < xml.length; i++) {
+ evs[i]=this.xmlNodeToJSON(xml[i]);
+
+ evs[i].text=evs[i].text||evs[i]._tagvalue;
+ evs[i].start_date=this.templates.xml_date(evs[i].start_date);
+ evs[i].end_date=this.templates.xml_date(evs[i].end_date);
+ }
+ return evs;
+};
+scheduler.xmlNodeToJSON = function(node){
+ var t={};
+ for (var i=0; i<node.attributes.length; i++)
+ t[node.attributes[i].name]=node.attributes[i].value;
+
+ for (var i=0; i<node.childNodes.length; i++){
+ var child=node.childNodes[i];
+ if (child.nodeType==1)
+ t[child.tagName]=child.firstChild?child.firstChild.nodeValue:"";
+ }
+
+ if (!t.text) t.text=node.firstChild?node.firstChild.nodeValue:"";
+
+ return t;
+};
+scheduler.attachEvent("onXLS",function(){
+ if (this.config.show_loading===true){
+ var t;
+ t=this.config.show_loading=document.createElement("DIV");
+ t.className='dhx_loading';
+ t.style.left = Math.round((this._x-128)/2)+"px";
+ t.style.top = Math.round((this._y-15)/2)+"px";
+ this._obj.appendChild(t);
+ }
+});
+scheduler.attachEvent("onXLE",function(){
+ var t;
+ if (t=this.config.show_loading)
+ if (typeof t == "object"){
+ this._obj.removeChild(t);
+ this.config.show_loading=true;
+ }
+});
+
+scheduler.ical={
+ parse:function(str){
+ var data = str.match(RegExp(this.c_start+"[^\f]*"+this.c_end,""));
+ if (!data.length) return;
+
+ //unfolding
+ data[0]=data[0].replace(/[\r\n]+(?=[a-z \t])/g," ");
+ //drop property
+ data[0]=data[0].replace(/\;[^:\r\n]*/g,"");
+
+
+ var incoming=[];
+ var match;
+ var event_r = RegExp("(?:"+this.e_start+")([^\f]*?)(?:"+this.e_end+")","g");
+ while (match=event_r.exec(data)){
+ var e={};
+ var param;
+ var param_r = /[^\r\n]+[\r\n]+/g;
+ while (param=param_r.exec(match[1]))
+ this.parse_param(param.toString(),e);
+ if (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined
+ incoming.push(e);
+ }
+ return incoming;
+ },
+ parse_param:function(str,obj){
+ var d = str.indexOf(":");
+ if (d==-1) return;
+
+ var name = str.substr(0,d).toLowerCase();
+ var value = str.substr(d+1).replace(/\\\,/g,",").replace(/[\r\n]+$/,"");
+ if (name=="summary")
+ name="text";
+ else if (name=="dtstart"){
+ name = "start_date";
+ value = this.parse_date(value,0,0);
+ }
+ else if (name=="dtend"){
+ name = "end_date";
+ if (obj.start_date && obj.start_date.getHours()==0)
+ value = this.parse_date(value,24,00);
+ else
+ value = this.parse_date(value,23,59);
+ }
+ obj[name]=value;
+ },
+ parse_date:function(value,dh,dm){
+ var t = value.split("T");
+ if (t[1]){
+ dh=t[1].substr(0,2);
+ dm=t[1].substr(2,2);
+ }
+ var dy = t[0].substr(0,4);
+ var dn = parseInt(t[0].substr(4,2),10)-1;
+ var dd = t[0].substr(6,2);
+ if (scheduler.config.server_utc && !t[1]) { // if no hours/minutes were specified == full day event
+ return new Date(Date.UTC(dy,dn,dd,dh,dm)) ;
+ }
+ return new Date(dy,dn,dd,dh,dm);
+ },
+ c_start:"BEGIN:VCALENDAR",
+ e_start:"BEGIN:VEVENT",
+ e_end:"END:VEVENT",
+ c_end:"END:VCALENDAR"
+};
+scheduler.formSection = function(name){
+ var config = this.config.lightbox.sections;
+ var i =0;
+ for (i; i < config.length; i++)
+ if (config[i].name == name)
+ break;
+ var section = config[i];
+ var node = document.getElementById(section.id).nextSibling;
+
+ return {
+ getValue:function(ev){
+ return scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);
+ },
+ setValue:function(value, ev){
+ return scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);
+ }
+ };
+};
+scheduler.form_blocks={
+ template:{
+ render: function(sns){
+ var height=(sns.height||"30")+"px";
+ return "<div class='dhx_cal_ltext dhx_cal_template' style='height:"+height+";'></div>";
+ },
+ set_value:function(node,value,ev,config){
+ node.innerHTML = value||"";
+ },
+ get_value:function(node,ev,config){
+ return node.innerHTML||"";
+ },
+ focus: function(node){
+ }
+ },
+ textarea:{
+ render:function(sns){
+ var height=(sns.height||"130")+"px";
+ return "<div class='dhx_cal_ltext' style='height:"+height+";'><textarea></textarea></div>";
+ },
+ set_value:function(node,value,ev){
+ node.firstChild.value=value||"";
+ },
+ get_value:function(node,ev){
+ return node.firstChild.value;
+ },
+ focus:function(node){
+ var a=node.firstChild; a.select(); a.focus();
+ }
+ },
+ select:{
+ render:function(sns){
+ var height=(sns.height||"23")+"px";
+ var html="<div class='dhx_cal_ltext' style='height:"+height+";'><select style='width:100%;'>";
+ for (var i=0; i < sns.options.length; i++)
+ html+="<option value='"+sns.options[i].key+"'>"+sns.options[i].label+"</option>";
+ html+="</select></div>";
+ return html;
+ },
+ set_value:function(node,value,ev){
+ if (typeof value == "undefined")
+ value = (node.firstChild.options[0]||{}).value;
+ node.firstChild.value=value||"";
+ },
+ get_value:function(node,ev){
+ return node.firstChild.value;
+ },
+ focus:function(node){
+ var a=node.firstChild; if (a.select) a.select(); a.focus();
+ }
+ },
+ time:{
+ render:function(){
+ //hours
+ var cfg = scheduler.config;
+ var dt = this.date.date_part(new Date());
+ var last = 24*60, first = 0;
+ if(scheduler.config.limit_time_select){
+ last = 60*cfg.last_hour+1;
+ first = 60*cfg.first_hour;
+ dt.setHours(cfg.first_hour);
+ }
+
+ var html="<select>";
+ var i = first;
+ var tdate = dt.getDate();
+
+ while(i<last){
+ var time=this.templates.time_picker(dt);
+ html+="<option value='"+i+"'>"+time+"</option>";
+
+ dt.setTime(dt.valueOf()+this.config.time_step*60*1000);
+ var diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day
+ i=diff*24*60+dt.getHours()*60+dt.getMinutes();
+ }
+
+ //days
+ html+="</select> <select>";
+ for (var i=1; i < 32; i++)
+ html+="<option value='"+i+"'>"+i+"</option>";
+
+ //month
+ html+="</select> <select>";
+ for (var i=0; i < 12; i++)
+ html+="<option value='"+i+"'>"+this.locale.date.month_full[i]+"</option>";
+
+ //year
+ html+="</select> <select>";
+ dt = dt.getFullYear()-5; //maybe take from config?
+ for (var i=0; i < 10; i++)
+ html+="<option value='"+(dt+i)+"'>"+(dt+i)+"</option>";
+ html+="</select> ";
+
+ return "<div style='height:30px;padding-top:0px;font-size:inherit;' class='dhx_section_time'>"+html+"<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>"+html+"</div>";
+
+ },
+ set_value:function(node,value,ev){
+
+
+ var s=node.getElementsByTagName("select");
+
+ if(scheduler.config.full_day) {
+ if (!node._full_day){
+ var html = "<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+"&nbsp;</label></input>";
+ if (!scheduler.config.wide_form)
+ html = node.previousSibling.innerHTML+html;
+ node.previousSibling.innerHTML=html;
+ node._full_day=true;
+ }
+ var input=node.previousSibling.getElementsByTagName("input")[0];
+ var isFulldayEvent = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0 && ev.end_date.valueOf()-ev.start_date.valueOf() < 2*24*60*60*1000);
+ input.checked = isFulldayEvent;
+
+ for(var k in s)
+ s[k].disabled=input.checked;
+
+ input.onclick = function(){
+ if(input.checked) {
+ var start_date = new Date(ev.start_date);
+ var end_date = new Date(ev.end_date);
+
+ scheduler.date.date_part(start_date);
+ end_date = scheduler.date.add(start_date, 1, "day");
+ }
+ for(var i in s)
+ s[i].disabled=input.checked;
+
+ _fill_lightbox_select(s,0,start_date||ev.start_date);
+ _fill_lightbox_select(s,4,end_date||ev.end_date);
+ };
+ }
+
+ if(scheduler.config.auto_end_date && scheduler.config.event_duration) {
+ function _update_lightbox_select() {
+ ev.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);
+ ev.end_date.setTime(ev.start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));
+ _fill_lightbox_select(s,4,ev.end_date);
+ }
+ for(var i=0; i<4; i++) {
+ s[i].onchange = _update_lightbox_select;
+ }
+ }
+
+ function _fill_lightbox_select(s,i,d){
+ s[i+0].value=Math.round((d.getHours()*60+d.getMinutes())/scheduler.config.time_step)*scheduler.config.time_step;
+ s[i+1].value=d.getDate();
+ s[i+2].value=d.getMonth();
+ s[i+3].value=d.getFullYear();
+ }
+
+ _fill_lightbox_select(s,0,ev.start_date);
+ _fill_lightbox_select(s,4,ev.end_date);
+ },
+ get_value:function(node,ev){
+ s=node.getElementsByTagName("select");
+ ev.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);
+ ev.end_date=new Date(s[7].value,s[6].value,s[5].value,0,s[4].value);
+ if (ev.end_date<=ev.start_date)
+ ev.end_date=scheduler.date.add(ev.start_date,scheduler.config.time_step,"minute");
+ },
+ focus:function(node){
+ node.getElementsByTagName("select")[0].focus();
+ }
+ }
+};
+scheduler.showCover=function(box){
+ if (box){
+ box.style.display="block";
+
+ var scroll_top = window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;
+ var scroll_left = window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft;
+
+ var view_height = window.innerHeight||document.documentElement.clientHeight;
+
+ if(scroll_top) // if vertical scroll on window
+ box.style.top=Math.round(scroll_top+Math.max((view_height-box.offsetHeight)/2, 0))+"px";
+ else // vertical scroll on body
+ box.style.top=Math.round(Math.max(((view_height-box.offsetHeight)/2), 0) + 9)+"px"; // +9 for compatibility with auto tests
+
+ // not quite accurate but used for compatibility reasons
+ if(document.documentElement.scrollWidth > document.body.offsetWidth) // if horizontal scroll on the window
+ box.style.left=Math.round(scroll_left+(document.body.offsetWidth-box.offsetWidth)/2)+"px";
+ else // horizontal scroll on the body
+ box.style.left=Math.round((document.body.offsetWidth-box.offsetWidth)/2)+"px";
+ }
+ this.show_cover();
+};
+scheduler.showLightbox=function(id){
+ if (!id) return;
+ if (!this.callEvent("onBeforeLightbox",[id])) return;
+ var box = this._get_lightbox();
+ this.showCover(box);
+ this._fill_lightbox(id,box);
+ this.callEvent("onLightbox",[id]);
+};
+scheduler._fill_lightbox=function(id,box){
+ var ev=this.getEvent(id);
+ var s=box.getElementsByTagName("span");
+ if (scheduler.templates.lightbox_header){
+ s[1].innerHTML="";
+ s[2].innerHTML=scheduler.templates.lightbox_header(ev.start_date,ev.end_date,ev);
+ } else {
+ s[1].innerHTML=this.templates.event_header(ev.start_date,ev.end_date,ev);
+ s[2].innerHTML=(this.templates.event_bar_text(ev.start_date,ev.end_date,ev)||"").substr(0,70); //IE6 fix
+ }
+
+
+ var sns = this.config.lightbox.sections;
+ for (var i=0; i < sns.length; i++) {
+ var node=document.getElementById(sns[i].id).nextSibling;
+ var block=this.form_blocks[sns[i].type];
+ block.set_value.call(this,node,ev[sns[i].map_to],ev, sns[i]);
+ if (sns[i].focus)
+ block.focus.call(this,node);
+ }
+
+ scheduler._lightbox_id=id;
+};
+scheduler._lightbox_out=function(ev){
+ var sns = this.config.lightbox.sections;
+ for (var i=0; i < sns.length; i++) {
+ var node = document.getElementById(sns[i].id);
+ node=(node?node.nextSibling:node);
+ var block=this.form_blocks[sns[i].type];
+ var res=block.get_value.call(this,node,ev, sns[i]);
+ if (sns[i].map_to!="auto")
+ ev[sns[i].map_to]=res;
+ }
+ return ev;
+};
+scheduler._empty_lightbox=function(){
+ var id=scheduler._lightbox_id;
+ var ev=this.getEvent(id);
+ var box=this._get_lightbox();
+
+ this._lightbox_out(ev);
+
+ ev._timed=this.is_one_day_event(ev);
+ this.setEvent(ev.id,ev);
+ this._edit_stop_event(ev,true);
+ this.render_view_data();
+};
+scheduler.hide_lightbox=function(id){
+ this.hideCover(this._get_lightbox());
+ this._lightbox_id=null;
+ this.callEvent("onAfterLightbox",[]);
+};
+scheduler.hideCover=function(box){
+ if (box) box.style.display="none";
+ this.hide_cover();
+};
+scheduler.hide_cover=function(){
+ if (this._cover)
+ this._cover.parentNode.removeChild(this._cover);
+ this._cover=null;
+};
+scheduler.show_cover=function(){
+ this._cover=document.createElement("DIV");
+ this._cover.className="dhx_cal_cover";
+ var _document_height = ((document.height !== undefined) ? document.height : document.body.offsetHeight);
+ var _scroll_height = ((document.documentElement) ? document.documentElement.scrollHeight : 0);
+ this._cover.style.height = Math.max(_document_height, _scroll_height) + 'px';
+ document.body.appendChild(this._cover);
+};
+scheduler.save_lightbox=function(){
+ if (this.checkEvent("onEventSave") && !this.callEvent("onEventSave",[this._lightbox_id,this._lightbox_out({ id: this._lightbox_id}), this._new_event]))
+ return;
+ this._empty_lightbox();
+ this.hide_lightbox();
+};
+scheduler.startLightbox = function(id, box){
+ this._lightbox_id=id;
+ this.showCover(box);
+};
+scheduler.endLightbox = function(mode, box){
+ this._edit_stop_event(scheduler.getEvent(this._lightbox_id),mode);
+ if (mode)
+ scheduler.render_view_data();
+ this.hideCover(box);
+};
+scheduler.resetLightbox = function(){
+ if (scheduler._lightbox)
+ scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);
+ scheduler._lightbox = null;
+};
+scheduler.cancel_lightbox=function(){
+ this.callEvent("onEventCancel",[this._lightbox_id, this._new_event]);
+ this.endLightbox(false);
+ this.hide_lightbox();
+};
+scheduler._init_lightbox_events=function(){
+ this._get_lightbox().onclick=function(e){
+ var src=e?e.target:event.srcElement;
+ if (!src.className) src=src.previousSibling;
+ if (src && src.className)
+ switch(src.className){
+ case "dhx_save_btn":
+ scheduler.save_lightbox();
+ break;
+ case "dhx_delete_btn":
+ var c=scheduler.locale.labels.confirm_deleting;
+ if (!c||confirm(c)) {
+ scheduler.deleteEvent(scheduler._lightbox_id);
+ scheduler._new_event = null; //clear flag, if it was unsaved event
+ scheduler.hide_lightbox();
+ }
+ break;
+ case "dhx_cancel_btn":
+ scheduler.cancel_lightbox();
+ break;
+
+ default:
+ if (src.getAttribute("dhx_button")){
+ scheduler.callEvent("onLightboxButton", [src.className, src, e]);
+ } else if (src.className.indexOf("dhx_custom_button_")!=-1){
+ var index = src.parentNode.getAttribute("index");
+ var block=scheduler.form_blocks[scheduler.config.lightbox.sections[index].type];
+ var sec = src.parentNode.parentNode;
+ block.button_click(index,src,sec,sec.nextSibling);
+ }
+ break;
+ }
+ };
+ this._get_lightbox().onkeydown=function(e){
+ switch((e||event).keyCode){
+ case scheduler.keys.edit_save:
+ if ((e||event).shiftKey) return;
+ scheduler.save_lightbox();
+ break;
+ case scheduler.keys.edit_cancel:
+ scheduler.cancel_lightbox();
+ break;
+ default:
+ break;
+ }
+ };
+};
+scheduler.setLightboxSize=function(){
+ var d = this._lightbox;
+ if (!d) return;
+
+ var con = d.childNodes[1];
+ con.style.height="0px";
+ con.style.height=con.scrollHeight+"px";
+ d.style.height=con.scrollHeight+50+"px";
+ con.style.height=con.scrollHeight+"px"; //it is incredible , how ugly IE can be
+};
+
+scheduler._init_dnd_events = function(){
+ dhtmlxEvent(document.body, "mousemove", scheduler._move_while_dnd);
+ dhtmlxEvent(document.body, "mouseup", scheduler._finish_dnd);
+ scheduler._init_dnd_events = function(){};
+};
+scheduler._move_while_dnd = function(e){
+ if (scheduler._dnd_start_lb){
+ if (!document.dhx_unselectable){
+ document.body.className += " dhx_unselectable";
+ document.dhx_unselectable = true;
+ }
+ var lb = scheduler._get_lightbox();
+ var now = (e&&e.target)?[e.pageX, e.pageY]:[event.clientX, event.clientY];
+ lb.style.top = scheduler._lb_start[1]+now[1]-scheduler._dnd_start_lb[1]+"px";
+ lb.style.left = scheduler._lb_start[0]+now[0]-scheduler._dnd_start_lb[0]+"px";
+ }
+};
+scheduler._ready_to_dnd = function(e){
+ var lb = scheduler._get_lightbox();
+ scheduler._lb_start = [parseInt(lb.style.left,10), parseInt(lb.style.top,10)];
+ scheduler._dnd_start_lb = (e&&e.target)?[e.pageX, e.pageY]:[event.clientX, event.clientY];
+};
+scheduler._finish_dnd = function(){
+ if (scheduler._lb_start){
+ scheduler._lb_start = scheduler._dnd_start_lb = false;
+ document.body.className = document.body.className.replace(" dhx_unselectable","");
+ document.dhx_unselectable = false;
+ }
+};
+scheduler._get_lightbox=function(){ //scheduler.config.wide_form=true;
+ if (!this._lightbox){
+ var d=document.createElement("DIV");
+ d.className="dhx_cal_light";
+ if (scheduler.config.wide_form)
+ d.className+=" dhx_cal_light_wide";
+ if (scheduler.form_blocks.recurring)
+ d.className+=" dhx_cal_light_rec";
+
+ if (/msie|MSIE 6/.test(navigator.userAgent))
+ d.className+=" dhx_ie6";
+ d.style.visibility="hidden";
+ var html = this._lightbox_template
+ var buttons = this.config.buttons_left;
+ scheduler.locale.labels["dhx_save_btn"] = scheduler.locale.labels.icon_save;
+ scheduler.locale.labels["dhx_cancel_btn"] = scheduler.locale.labels.icon_cancel;
+ scheduler.locale.labels["dhx_delete_btn"] = scheduler.locale.labels.icon_delete;
+ for (var i = 0; i < buttons.length; i++)
+ html+="<div class='dhx_btn_set'><div dhx_button='1' class='"+buttons[i]+"'></div><div>"+scheduler.locale.labels[buttons[i]]+"</div></div>";
+ buttons = this.config.buttons_right;
+ for (var i = 0; i < buttons.length; i++)
+ html+="<div class='dhx_btn_set' style='float:right;'><div dhx_button='1' class='"+buttons[i]+"'></div><div>"+scheduler.locale.labels[buttons[i]]+"</div></div>";
+
+ html+="</div>";
+ d.innerHTML=html;
+ if (scheduler.config.drag_lightbox){
+ d.firstChild.onmousedown = scheduler._ready_to_dnd;
+ d.firstChild.onselectstart = function(){ return false; };
+ d.firstChild.style.cursor = "pointer";
+ scheduler._init_dnd_events();
+
+ }
+ document.body.insertBefore(d,document.body.firstChild);
+ this._lightbox=d;
+
+ var sns=this.config.lightbox.sections;
+ html="";
+ for (var i=0; i < sns.length; i++) {
+ var block=this.form_blocks[sns[i].type];
+ if (!block) continue; //ignore incorrect blocks
+ sns[i].id="area_"+this.uid();
+ var button = "";
+ if (sns[i].button){
+ button = "<div class='dhx_custom_button' index='"+i+"'><div class='dhx_custom_button_"+sns[i].button+"'></div><div>"+this.locale.labels["button_"+sns[i].button]+"</div></div>";
+ }
+
+ if (this.config.wide_form){
+ html+="<div class='dhx_wrap_section'>";
+ }
+ html+="<div id='"+sns[i].id+"' class='dhx_cal_lsection'>"+button+this.locale.labels["section_"+sns[i].name]+"</div>"+block.render.call(this,sns[i]);
+ html+="</div>"
+ }
+
+ //localization
+ var ds=d.getElementsByTagName("div");
+ //sections
+ ds[1].innerHTML=html;
+ //sizes
+ this.setLightboxSize();
+
+ this._init_lightbox_events(this);
+ d.style.display="none";
+ d.style.visibility="visible";
+ }
+ return this._lightbox;
+};
+scheduler._lightbox_template="<div class='dhx_cal_ltitle'><span class='dhx_mark'>&nbsp;</span><span class='dhx_time'></span><span class='dhx_title'></span></div><div class='dhx_cal_larea'></div>";
+
+scheduler._dp_init=function(dp){
+ dp._methods=["setEventTextStyle","","changeEventId","deleteEvent"];
+
+ this.attachEvent("onEventAdded",function(id){
+ if (!this._loading && this.validId(id))
+ dp.setUpdated(id,true,"inserted");
+ });
+ this.attachEvent("onConfirmedBeforeEventDelete", function(id){
+ if (!this.validId(id)) return;
+ var z=dp.getState(id);
+
+ if (z=="inserted" || this._new_event) { dp.setUpdated(id,false); return true; }
+ if (z=="deleted") return false;
+ if (z=="true_deleted") return true;
+
+ dp.setUpdated(id,true,"deleted");
+ return false;
+ });
+ this.attachEvent("onEventChanged",function(id){
+ if (!this._loading && this.validId(id))
+ dp.setUpdated(id,true,"updated");
+ });
+
+ dp._getRowData=function(id,pref){
+ var ev=this.obj.getEvent(id);
+ var data = {};
+
+ for (var a in ev){
+ if (a.indexOf("_")==0) continue;
+ if (ev[a] && ev[a].getUTCFullYear) //not very good, but will work
+ data[a] = this.obj.templates.xml_format(ev[a]);
+ else
+ data[a] = ev[a];
+ }
+
+ return data;
+ };
+ dp._clearUpdateFlag=function(){};
+
+ dp.attachEvent("insertCallback", scheduler._update_callback);
+ dp.attachEvent("updateCallback", scheduler._update_callback);
+ dp.attachEvent("deleteCallback", function(upd, id) {
+ this.obj.setUserData(id, this.action_param, "true_deleted");
+ this.obj.deleteEvent(id);
+ });
+
+};
+
+
+scheduler.setUserData=function(id,name,value){
+ if (id)
+ this.getEvent(id)[name]=value;
+ else
+ this._userdata[name]=value;
+};
+scheduler.getUserData=function(id,name){
+ return id?this.getEvent(id)[name]:this._userdata[name];
+};
+scheduler.setEventTextStyle=function(id,style){
+ this.for_rendered(id,function(r){
+ r.style.cssText+=";"+style;
+ });
+ var ev = this.getEvent(id);
+ ev["_text_style"]=style;
+ this.event_updated(ev);
+};
+scheduler.validId=function(id){
+ return true;
+};
+
+scheduler._update_callback = function(upd,id){
+ var data = scheduler.xmlNodeToJSON(upd.firstChild);
+ data.text = data.text||data._tagvalue;
+ data.start_date = scheduler.templates.xml_date(data.start_date);
+ data.end_date = scheduler.templates.xml_date(data.end_date);
+
+ scheduler.addEvent(data);
+};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_glossy.css b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_glossy.css
new file mode 100644
index 00000000000..64cf1bc40c5
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_glossy.css
@@ -0,0 +1,5 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+.dhx_cal_container{background-color:#C2D5FC;font-family:Tahoma;font-size:8pt;position:relative;overflow:hidden;}.dhx_cal_container div{-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_navline{height:20px;position:absolute;z-index:3;width:750px;color:#2F3A48;}.dhx_cal_navline div{position:absolute;top:2px;white-space:nowrap;}.dhx_cal_navline .dhx_cal_date{font-weight:600;left:210px;}.dhx_cal_button .dhx_left_bg{width:1px;overflow:hidden;height:17px;z-index:20;top:0;}.dhx_cal_prev_button{background-image:url(imgs/buttons.png);background-position:0 0;width:29px;height:17px;left:50px;cursor:pointer;}.dhx_cal_next_button{background-image:url(imgs/buttons.png);background-position:-30px 0;width:29px;height:17px;left:80px;cursor:pointer;}.dhx_cal_today_button{background-image:url(imgs/buttons.png);background-position:-60px 0;width:75px;height:17px;left:112px;cursor:pointer;text-align:center;text-decoration:underline;}.dhx_cal_tab{width:59px;height:19px;text-align:center;text-decoration:underline;padding-top:2px;cursor:pointer;background-color:#D8E1EA;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;}.dhx_cal_tab.active{text-decoration:none;cursor:default;font-weight:bold;border:1px dotted #586A7E;border-bottom:0;background-color:#C2D5FC;}.dhx_cal_header{position:absolute;left:10px;top:23px;width:750px;border-top:1px dotted #8894A3;border-right:1px dotted #8894A3;z-index:2;overflow:hidden;color:#2F3A48;}.dhx_cal_data{border-top:1px dotted #8894A3;position:absolute;top:44px;width:600px;overflow-y:auto;overflow-x:hidden;}.dhx_scale_bar{position:absolute;text-align:center;background-color:#C2D5FC;padding-top:3px;border-left:1px dotted #586A7E;}.dhx_scale_holder{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg.png);}.dhx_scale_holder_now{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg_now.png);}.dhx_scale_hour{height:41px;width:50px;border-bottom:1px dotted #8894A3;background-color:#C2D5FC;text-align:center;line-height:40px;color:#586A7E;overflow:hidden;}.dhx_month_head{background-color:#EBEFF4;color:#2F3A48;border-right:1px dotted #586A7E;height:18px;padding-right:5px;padding-top:3px;text-align:right;}.dhx_month_body{border-right:1px dotted #586A7E;border-bottom:1px dotted #586A7E;background-color:#FFF;}.dhx_now .dhx_month_body{background-color:#E2EDFF;}.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:#ECECEC;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{background-color:#E2E3E6;color:#94A6BB;}.dhx_now .dhx_month_head{background-color:#D1DEF4;font-weight:bold;}.dhx_cal_drag{position:absolute;z-index:9999;background-color:#FFE763;border:1px solid #B7A543;opacity:.5;filter:alpha(opacity=50);}.dhx_loading{position:absolute;width:128px;height:15px;background-image:url(imgs/loading.gif);z-index:9999;}.dhx_multi_day_icon,.dhx_multi_day{background-color:#E1E6FF;background-repeat:no-repeat;border-right:1px dotted #8894A3;}.dhx_multi_day{position:absolute;border-top:1px dotted #8894A3;}.dhx_multi_day_icon{background-image:url(imgs/clock_big.gif);}.dhx_multi_day_icon_small{background-image:url(imgs/clock_small.gif);}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-position:center center;background-color:#E1E6FF;background-repeat:no-repeat;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container{background-color:#d0e5ff;}.dhx_cal_event div{background-color:#FFE763;border:1px solid #B7A543;color:#887A2E;overflow:hidden;width:100%;font-family:Tahoma;font-size:8pt;}.dhx_move_denied .dhx_cal_event .dhx_header,.dhx_move_denied .dhx_cal_event .dhx_title{cursor:default;}.dhx_cal_event .dhx_header{height:1px;margin-left:1px;border-width:1px 1px 0 1px;cursor:pointer;}.dhx_cal_event .dhx_title{height:12px;border-width:0 1px 1px 1px;border-bottom-style:dotted;font-size:7pt;font-weight:bold;text-align:center;background-position:right;background-repeat:no-repeat;cursor:pointer;}.dhx_cal_event .dhx_body{border-width:0 1px 1px 1px;padding:5px;}.dhx_resize_denied .dhx_cal_event .dhx_footer{cursor:default;}.dhx_cal_event .dhx_footer{height:1px;margin-left:2px;border-width:0 1px 1px 1px;cursor:s-resize;}.dhx_cal_event_line{background-color:#FFE763;border:1px solid #B7A543;border-radius:3px;font-family:Tahoma;font-size:8pt;height:13px;padding-left:10px;color:#887A2E;cursor:pointer;overflow:hidden;}.dhx_cal_event_clear{font-family:Tahoma;font-size:8pt;height:13px;padding-left:2px;color:#887A2E;white-space:nowrap;overflow:hidden;cursor:pointer;}.dhx_in_move{background-color:#FFFF80;}div.dhx_cal_editor{background-color:#FFE763;border:1px solid #B7A543;border-top-style:dotted;z-index:999;position:absolute;overflow:hidden;}textarea.dhx_cal_editor{width:100%;height:100%;border:0 solid black;margin:none;padding:none;overflow:auto;}div.dhx_menu_head{background-image:url(imgs/controls.gif);background-position:0 -43px;width:10px;height:10px;margin-left:5px;margin-top:1px;border:none;cursor:default;}div.dhx_menu_icon{background-image:url(imgs/controls.gif);width:20px;height:20px;margin-left:-5px;margin-top:0;border:none;cursor:pointer;}div.icon_details{background-position:0 0;}div.icon_edit{background-position:-22px 0;}div.icon_save{background-position:-84px -1px;}div.icon_cancel{background-position:-62px 0;}div.icon_delete{background-position:-42px 0;}div.dhx_now_time{position:absolute;width:100%;border-bottom:2px dotted red;z-index:1;}div.dhx_time_block{position:absolute;width:100%;background:silver;opacity:.4;filter:alpha(opacity=40);z-index:1;}.dhx_unselectable,.dhx_unselectable div{-webkit-user-select:none;-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_light{background-color:#FFE763;border-radius:5px;font-family:Tahoma;font-size:8pt;border:1px solid #B7A64B;color:#887A2E;position:absolute;z-index:10001;width:580px;height:300px;box-shadow:5px 5px 5px #888;}.dhx_cal_light_wide{width:650px;}.dhx_mark{position:relative;top:3px;background-image:url('./imgs/controls.gif');background-position:0 -43px;padding-left:10px;}.dhx_ie6 .dhx_mark{background-position:6px -41px;}.dhx_cal_light select{font-family:Tahoma;font-size:8pt;color:#887A2E;padding:2px;margin:0;}.dhx_cal_ltitle{padding:2px 0 2px 5px;overflow:hidden;white-space:nowrap;}.dhx_cal_ltitle span{white-space:nowrap;}.dhx_cal_lsection{background-color:#DBCF8C;color:#FFF4B5;font-weight:bold;padding:5px 0 3px 10px;}.dhx_section_time{background-color:#DBCF8C;}.dhx_cal_lsection .dhx_fullday{float:right;margin-right:5px;color:#887A2E;font-size:12px;font-weight:normal;line-height:20px;vertical-align:top;cursor:pointer;}.dhx_cal_lsection{font-size:18px;font-family:Arial;}.dhx_cal_ltext{padding:2px 0 2px 10px;overflow:hidden;}.dhx_cal_ltext textarea{background-color:#FFF4B5;overflow:auto;border:none;color:#887A2E;height:100%;width:100%;outline:none!important;}.dhx_time{font-weight:bold;}.dhx_cal_light .dhx_title{padding-left:10px;}.dhx_cal_larea{border:1px solid #DCC43E;background-color:#FFF4B5;overflow:hidden;margin-left:3px;width:572px;height:1px;}.dhx_btn_set{padding:5px 10px 0 10px;float:left;}.dhx_btn_set div{float:left;height:21px;line-height:21px;vertical-align:middle;cursor:pointer;}.dhx_save_btn{background-image:url('./imgs/controls.gif');background-position:-84px 0;width:21px;}.dhx_cancel_btn{background-image:url('./imgs/controls.gif');background-position:-63px 0;width:20px;}.dhx_delete_btn{background-image:url('./imgs/controls.gif');background-position:-42px 0;width:20px;}.dhx_cal_cover{width:100%;height:100%;position:absolute;z-index:10000;top:0;left:0;background-color:black;opacity:.1;filter:alpha(opacity=10);}.dhx_custom_button{padding:0 3px 0 3px;color:#887A2E;font-family:Tahoma;font-size:8pt;background-color:#FFE763;font-weight:normal;margin-right:5px;margin-top:0;cursor:pointer;}.dhx_custom_button div{cursor:pointer;float:left;height:21px;line-height:21px;vertical-align:middle;}.dhx_cal_light_wide .dhx_cal_larea{border-top-width:0;}.dhx_cal_light_wide .dhx_cal_lsection{border:0;float:left;text-align:right;width:100px;height:20px;font-size:16px;padding:5px 0 0 10px;}.dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #DBCF8C;position:relative;background-color:#DBCF8C;overflow:hidden;}.dhx_cal_light_wide .dhx_section_time{padding-top:2px!important;height:20px!important;}.dhx_section_time{text-align:center;}.dhx_cal_light_wide .dhx_cal_larea{width:730px;}.dhx_cal_light_wide{width:738px;}.dhx_cal_light_wide .dhx_section_time{background:transparent;}.dhx_cal_light_wide .dhx_cal_checkbox label{padding-left:0;}.dhx_cal_wide_checkbox input{margin-top:8px;margin-left:14px;}.dhx_cal_light input{font-family:Tahoma;font-size:8pt;color:#887A2E;}.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{float:none;margin-right:0;color:#FFF4B5;font-weight:bold;font-size:16px;font-family:Arial;cursor:pointer;}.dhx_custom_button{float:right;height:21px;width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_cal_light_wide .dhx_custom_button{position:absolute;top:0;right:0;margin-top:2px;}.dhx_cal_light_wide .dhx_repeat_right{margin-right:55px;}.dhx_scale_bar_header{position:absolute;border-bottom:1px dotted #8894A3;width:100%;}.dhx_expand_icon{position:absolute;top:0;right:0;background-image:url(./imgs/colapce-expand-icon.gif);width:18px;height:18px;cursor:pointer;background-position:0 18px;z-index:16;}.dhx_agenda_area{width:100%;height:100%;overflow-y:auto;background-image:url(./imgs/databg.png);}.dhx_agenda_line{height:21px;clear:both;overflow:hidden;}.dhx_agenda_line div{float:left;width:188px;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_agenda_area .dhx_agenda_line div{border-right:0 dotted #8894A3;}.dhx_v_border{position:absolute;left:186px;top:0;border-right:1px dotted #8894A3;width:1px;height:100%;}.dhx_agenda_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_agenda_line span{padding-left:5px;line-height:21px;}.dhx_year_body{border-left:1px dotted #586A7E;}.dhx_year_week{position:relative;}.dhx_scale_bar_last{border-right:1px dotted #586A7E;}.dhx_year_month{height:18px;padding-top:3px;border:1px dotted #586A7E;text-align:center;vertical-align:middle;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#E2E3E6!important;}.dhx_year_body .dhx_month_body{height:0;overflow:hidden;}.dhx_month_head.dhx_year_event{background-color:#FFE763;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head{cursor:default;}.dhx_tooltip{border:1px solid #BBB;background-image:url(./imgs/databg.png);position:absolute;z-index:9998;width:300px;height:auto;font-family:Tahoma;font-size:8pt;overflow:hidden;}.dhx_tooltip_line{line-height:20px;height:20px;overflow:hidden;}.dhx_tooltip_line .dhx_event_icon{width:20px;height:20px;padding-right:10px;float:left;border-width:0;position:relative;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_tooltip_date{float:left;width:auto;padding-left:5px;text-align:center;}.dhx_text_disabled{color:#887A2E;font-family:Tahoma;font-size:8pt;}.dhx_mini_calendar{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;}.dhx_mini_calendar .dhx_month_head{cursor:pointer;}.dhx_mini_calendar .dhx_calendar_click{background-color:#C2D5FC;}.dhx_cal_navline div.dhx_minical_icon{width:18px;height:18px;left:190px;top:1px;cursor:pointer;background-image:url(./imgs/calendar.gif);}.dhx_matrix_scell{height:100%;}.dhx_matrix_cell,.dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_matrix_cell{background-color:white;}.dhx_matrix_line{overflow:hidden;}.dhx_matrix_cell div,.dhx_matrix_scell div{overflow:hidden;text-align:center;height:auto;}.dhx_cal_lsection .dhx_readonly{font-size:9pt;font-size:8pt;padding:2px;color:#887A2E;}.dhx_matrix_scell.folder,.dhx_data_table.folder .dhx_matrix_cell{background-color:#969394;cursor:pointer;}.dhx_matrix_scell .dhx_scell_level0{padding-left:5px;}.dhx_matrix_scell .dhx_scell_level1{padding-left:20px;}.dhx_matrix_scell .dhx_scell_level2{padding-left:35px;}.dhx_matrix_scell .dhx_scell_level3{padding-left:50px;}.dhx_matrix_scell .dhx_scell_level4{padding-left:65px;}.dhx_matrix_scell.folder{font-weight:bold;text-align:left;}.dhx_matrix_scell.folder .dhx_scell_expand{float:left;width:10px;padding-right:3px;}.dhx_matrix_scell.folder .dhx_scell_name{float:left;width:auto;}.dhx_matrix_scell.item .dhx_scell_name{padding-left:15px;text-align:left;}.dhx_data_table.folder .dhx_matrix_cell{border-right:0;}.dhx_section_timeline{overflow:hidden;padding:4px 0 2px 10px;}.dhx_section_timeline select{width:552px;}.dhx_map_area{width:100%;height:100%;overflow-y:auto;overflow-x:hidden;background-image:url(./imgs/databg.png);}.dhx_map_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_map_line{height:21px;clear:both;overflow:hidden;}.dhx_map{position:absolute;}.dhx_map_line div{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_description{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .dhx_map_description{float:left;border-right:0 dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .line_description{float:left;border-right:1px dotted #8894A3;text-align:left;padding-left:5px;line-height:21px;overflow:hidden;}.dhx_map_line.highlight{background-color:#C4C5CC;}.dhx_map_area .dhx_map_line div{border-right:0 dotted #8894A3;}.dhtmlXTooltip.tooltip{-moz-box-shadow:3px 3px 3px #888;-webkit-box-shadow:3px 3px 3px #888;-o-box-shadow:3px 3px 3px #888;box-shadow:3px 3px 3px #888;filter:progid:DXImageTransform.Microsoft.Shadow(color='#888888',Direction=135,Strength=5);background-color:white;border-left:1px dotted #887A2E;border-top:1px dotted #887A2E;color:#887A2E;cursor:default;padding:10px;position:absolute;z-index:500;}.dhx_cal_checkbox label{padding-left:5px;}.dhx_cal_light .radio{padding:2px 0 2px 10px;}.dhx_cal_light .radio input,.dhx_cal_light .radio label{line-height:15px;}.dhx_cal_light .radio input{vertical-align:middle;margin:0;padding:0;}.dhx_cal_light .radio label{vertical-align:middle;padding-right:10px;}.dhx_cal_light .combo{padding:4px;}.dhx_wa_column{float:left;}.dhx_wa_column_last .dhx_wa_day_cont{border-left:1px dotted #8894A3;}.dhx_wa_scale_bar{font-family:Tahoma;padding-left:10px;font-size:11px;border-top:1px dotted #8894A3;border-bottom:1px dotted #8894A3;}.dhx_wa_day_data{background-color:#FCFEFC;overflow-y:auto;}.dhx_wa_ev_body{border-bottom:1px dotted #789;font-size:12px;padding:5px 0 5px 7px;}.dhx_wa_dnd{font-family:Tahoma;position:absolute;padding-right:7px;color:#887AE2!important;background-color:#FFE763!important;border:1px solid #B7A543;}.dhx_cal_event_selected{background-color:#9cc1db;color:white;}.dhx_second_scale_bar{border-bottom:1px dotted #586A7E;padding-top:2px;}div.dhx_form_repeat input.radio{margin:-4px 0 0 -4px!ie;}div.dhx_form_repeat input.checkbox{margin:0 0 0 -4px!ie;}.dhx_form_repeat,.dhx_form_repeat input{padding:0;margin:0;padding-left:5px;font-family:Tahoma,Verdana;font-size:11px;line-height:24px;}.dhx_form_repeat{overflow:hidden;height:0;background-color:#FFF4B5;}.dhx_cal_light_wide .dhx_form_repeat{background-color:transparent;}.dhx_repeat_center,.dhx_repeat_left{height:115px;padding:10px 0 10px 10px;float:left;}.dhx_repeat_left{width:95px;}.dhx_repeat_center{width:335px;margin-top:12px;}.dhx_repeat_divider{float:left;height:115px;border-left:1px dotted #DCC43E;width:1px;}.dhx_repeat_right{float:right;height:115px;width:160px;padding:10px 3px 10px 10px;margin-top:7px;}input.dhx_repeat_text{height:16px;width:27px;margin:0 4px 0 4px;line-height:18px;padding:0 0 0 2px;}.dhx_form_repeat select{height:20px;width:87px;padding:0 0 0 2px;margin:0 4px 0 4px;}input.dhx_repeat_date{height:18px;width:80px;padding:0 0 0 2px;margin:0 4px 0 4px;background-repeat:no-repeat;background-position:64px 0;border:1px #7f9db9 solid;line-height:18px;}input.dhx_repeat_radio{margin-right:4px;}input.dhx_repeat_checkbox{margin:4px 4px 0 0;}.dhx_repeat_days td{padding-right:5px;}.dhx_repeat_days label{font-size:10px;}.dhx_custom_button{width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_custom_button_recurring{background-image:url(./imgs/but_repeat.gif);background-position:-5px 20px;width:20px;margin-right:10px;}.dhx_cal_light_rec{width:640px;}.dhx_cal_light_rec .dhx_cal_larea{width:632px;}.dhx_cal_light_rec.dhx_cal_light_wide{width:816px;}.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{width:808px;}.dhx_cal_tab.active{border:none;}.dhx_multi_day{border:none;border-top:1px solid #A4BED4;}.dhx_multi_day_icon,.dhx_multi_day_icon_small{border-right:none;}.dhx_cal_container{background-image:url(imgs_glossy/top-days-bg.png);background-position:0 24px;background-repeat:repeat-x;background-color:#EBEBEB;}.dhx_cal_navline{background-color:#EBEBEB;height:23px!important;}.dhx_cal_prev_button{background-image:url(imgs_glossy/buttons.gif);width:30px;height:20px;}.dhx_cal_next_button{background-image:url(imgs_glossy/buttons.gif);width:30px;height:20px;}.dhx_cal_today_button{padding-top:3px;background-image:url(imgs_glossy/buttons.gif);width:67px;left:110px;text-decoration:none;}.dhx_cal_navline .dhx_cal_date{padding-top:4px;left:230px;}.dhx_cal_tab{background-image:url(imgs_glossy/white_tab.png);width:60px;height:15px;text-decoration:none;padding-top:4px;margin-top:4px;}.dhx_cal_tab.active{background-image:url(imgs_glossy/blue_tab.png);height:18px;width:60px;padding-top:4px;margin-top:2px;}.dhx_cal_data{border-top:1px solid #A4BED4;}.dhx_cal_header{background-image:url(imgs_glossy/top-days-bg.png);background-repeat:repeat-x;border-top:0;border-right:0;}.dhx_scale_bar{background-image:url(imgs_glossy/top-separator.gif);background-position:0 0;background-repeat:no-repeat;background-color:transparent;padding-top:3px;border-left:0;}.dhx_scale_holder{border-right:1px solid #A4BED4;}.dhx_scale_holder_now{border-right:1px solid #A4BED4;}.dhx_scale_hour{background-image:url(imgs_glossy/left-time-bg.png);border-bottom:1px solid #A4BED4;color:#2F3A48;}.dhx_multi_day{background-image:url(imgs_glossy/multi-days-bg.png);background-repeat:repeat;border-bottom:1px solid #A4BED4;border-left:0;}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-image:url(imgs_glossy/multi-days-bg.png);border-bottom:1px solid #A4BED4;border-left:1px solid #fff;background-position:0 0;background-repeat:repeat;}.dhx_month_head{background-color:#FFF;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{background-color:#EFEDE2;}.dhx_now .dhx_month_head{background-color:#E4EFFF;}.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:#EFEDE2;}.dhx_cal_event div{border:1px solid #FFBD51;background-color:#FFE4AB;color:#000;}.dhx_cal_event_clear{color:#000;}.dhx_cal_event_line{background-image:url(imgs_glossy/event-bg.png);border:1px solid #FFBD51;color:#000;}.dhx_in_move{background-image:url(imgs_glossy/move.png);}.dhx_cal_event .dhx_body{background-color:#FFE4AB;}.dhx_cal_event .dhx_title{background-color:#FFE4AB;}.dhx_cal_light{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;background-color:#EBEBEB;border:2px solid #A4BED4;color:#000;}.dhx_cal_larea{border:1px solid #A4BED4;border-width:0 1px 1px;background-color:#FFF;}.dhx_cal_lsection{background-image:url(imgs_glossy/lightbox.png);font-size:14px;padding:5px 0 5px 10px;color:#000;}.dhx_cal_light_wide .dhx_cal_lsection{background-image:url(imgs_glossy/multi-days-bg.png);}.dhx_cal_ltext textarea{background-color:#fff;color:#000;}.dhx_cal_light select,.dhx_cal_light input{color:#000;}.dhx_save_btn{background-image:url(imgs_glossy/controlls5.png);}.dhx_cancel_btn{background-image:url(imgs_glossy/controlls5.png);}.dhx_delete_btn{background-image:url(imgs_glossy/controlls5.png);}div.dhx_menu_head{background-image:url(imgs_glossy/controlls5.png);border:1px solid #FFE4AB;}div.dhx_menu_icon{background-image:url(imgs_glossy/controlls5.png);border:medium none;}.dhx_section_time{height:20px!important;padding:7px 0!important;text-align:center;background:white;}div.dhx_cal_editor{background-color:#FFE4AB;}.dhx_year_month{background-image:url(imgs_glossy/top-days-bg.png);border:0;}.dhx_year_week{background-image:url(imgs_glossy/top-days-bg.png);}.dhx_month_head{border-right:1px solid #A4BED4;}.dhx_month_body{border-right:1px solid #A4BED4;border-bottom:1px solid #A4BED4;}.dhx_year_body{border-left:1px solid #A4BED4;}.dhx_scale_bar_last{border-right:none;}.dhx_month_head.dhx_year_event{background-color:#FFE4AB;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#EFEDE2!important;}.dhx_cal_lsection .dhx_readonly{color:#000;}.dhx_tooltip{-moz-box-shadow:2px 2px 2px #888;-khtml-box-shadow:2px 2px 2px #888;}.dhx_custom_button{margin-top:-2px;}.dhx_cal_lsection .dhx_fullday{color:#000;}.dhx_cal_lsection.dhx_cal_checkbox{height:16px;line-height:18px;}.dhx_cal_light_wide .dhx_cal_lsection.dhx_cal_checkbox{height:20px;}.dhx_cal_checkbox label{vertical-align:top;}.dhx_cal_light_wide .dhx_cal_lsection{color:black;}.dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #A4BED4;background-image:url(imgs_glossy/multi-days-bg.png);}.dhx_cal_light_wide .dhx_cal_ltext{border-left:1px solid #A4BED4;}.dhx_cal_light_wide .dhx_cal_ltext{background-color:white;}.dhx_custom_button{background:white;color:black;}.dhx_form_repeat{background:white;}.dhx_repeat_divider{border-left:1px solid #A4BED4;}.dhx_cal_header.dhx_second_cal_header{background-image:url("imgs_glossy/second-top-days-bg.png");padding-right:20px;}.dhx_scale_bar{padding-top:4px;}.dhx_second_scale_bar{border-bottom:0;padding-top:4px;}.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday,.dhx_cal_lsection .dhx_fullday{color:#000;font-size:14px;}.dhx_cal_light_wide .dhx_cal_lsection{font-size:14px;padding-right:10px;} \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_mobile.css b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_mobile.css
new file mode 100644
index 00000000000..04fd2dd62b1
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_mobile.css
@@ -0,0 +1,5 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+html,body{height:100%;padding:0;margin:0;overflow:auto;}.dhx_view{overflow:hidden;vertical-align:top;background-color:#FFF;}.dhx_layout_wide,.dhx_layout_space,.dhx_layout_head{background-color:#c3dbe3;}.dhx_border_space,.dhx_border_vspace{background-color:#adadad;overflow:hidden;}.dhx_border_space{height:1px;width:100%;}.dhx_border_vspace{width:1px;height:100%;display:table-cell;}.dhx_border_vspace.dhx_border_wide{width:10px;background-color:#c3dbe3;border-left:1px solid #adadad;border-right:1px solid #adadad;}.dhx_border_space.dhx_border_wide{height:10px;background-color:#c3dbe3;border-top:1px solid #adadad;border-bottom:1px solid #adadad;}.dhx_border_vspace.dhx_border_clean{width:10px;background-color:#c3dbe3;}.dhx_border_space.dhx_border_clean{height:4px;border-bottom:1px solid #adadad;}.dhx_loading_overlay{width:100%;height:100%;background-color:#D6D6D6;opacity:.5;background-image:url(./imgs/loading.png);background-repeat:no-repeat;background-position:center;}.dhx_multiview{background-color:#a0a0a0;}.dhx_el_icon div{background-image:url(./imgs/bar_icons_sprite.png);width:22px;height:22px;margin:10px;background-repeat:no-repeat;}.dhx_el_icon_refresh{background-position:0 0;}.dhx_el_icon_save{background-position:-22px 0;}.dhx_el_icon_add{background-position:-44px 0;}.dhx_el_icon_delete{background-position:-66px 0;}.dhx_el_icon_open{background-position:-88px 0;}.dhx_el_icon_run{background-position:-110px 0;}.dhx_el_icon_help{background-position:-132px 0;}.dhx_el_icon_new{background-position:-154px 0;}.dhx_el_icon_edit{background-position:-176px 0;}.dhx_el_icon_search{background-position:-198px 0;}.dhx_el_icon_close{background-position:-220px 0;}.dhx_el_label{text-shadow:0 1px 0 #FFF;height:43px;font-family:"Helvetica World","HelveticaNeue","Helvetica Neue","HelveticaNeueRoman","Helvetica","Tahoma","Geneva","Arial",sans-serif;font-weight:bold;font-size:22px;color:#616161;}.dhx_el_label,.dhx_el_button,.dhx_el_segmented,.dhx_el_roundbutton,.dhx_el_nextbutton,.dhx_el_prevbutton,.dhx_el_defaultbutton{padding:5px 5px 0;box-sizing:border-box;-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;}.dhx_el_label{padding-top:8px;}.dhx_el_defaultbutton input{font-size:15px;}.dhx_el_button input,.dhx_el_prevbutton input,.dhx_el_nextbutton input,.dhx_el_bigbutton input{height:32px;font-size:15px;font-weight:bold;text-decoration:none;color:#6e6e6e;text-shadow:$inputs_buttons_text_shadow;border:1px solid #93b0ba;-webkit-border-radius:8px;-webkit-border-bottom-right-radius:9px;-webkit-border-bottom-left-radius:9px;-moz-border-radius:8px;-moz-border-radius-bottomright:9px;-moz-border-radius-bottomleft:9px;border-radius:8px;border-bottom-right-radius:9px;border-bottom-left-radius:9px;padding:1px 15px 1px;background:#ebebeb;background:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#dfdfdf));background:-moz-linear-gradient(top,#fdfdfd,#dfdfdf);-moz-box-shadow:inset 0 1px 1px #FFF,0px 1px #ebebeb;-webkit-box-shadow:inset 0 1px 1px #FFF,0px 1px #ebebeb;box-shadow:inset 0 1px 1px #FFF,0px 1px #ebebeb;}.dhx_el_prevbutton input,.dhx_el_nextbutton input{-moz-box-shadow:inset 0 1px 0 #FFF,0px 1px darken(#FFF(15%));-webkit-box-shadow:inset 0 1px 0 #FFF,0px 1px darken(#FFF(15%));box-shadow:inset 0 1px 0 #FFF,0px 1px darken(#FFF(15%));}.dhx_touch .dhx_el_button input,.dhx_touch .dhx_el_prevbutton input,.dhx_touch .dhx_el_nextbutton input{background:#e5e5e5;background:-webkit-gradient(linear,left top,left bottom,from(#e5e5e5),to(#dfdfdf));background:-moz-linear-gradient(top,#e5e5e5,#dfdfdf);color:#6e6e6e;text-shadow:$inputs_touch_text_shadow;}.dhx_el_prevbutton input{-webkit-border-top-left-radius:0;-webkit-border-bottom-left-radius:0;-moz-border-radius-topleft:26px;-moz-border-radius-bottomleft:26px;text-align:center;padding-right:12px;padding-left:0;border-left-width:0;}.dhx_el_nextbutton input{-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:0;-moz-border-radius-topright:26px;-moz-border-radius-bottomright:26px;border-right-width:0;padding-left:12px;padding-right:0;}.dhx_el_prevbutton,.dhx_el_nextbutton{height:32px;}.dhx_el_prevbutton_input_cont,.dhx_el_nextbutton_input_cont{float:left;}.dhx_el_prevbutton .dhx_el_prevbutton_arrow,.dhx_el_nextbutton .dhx_el_nextbutton_arrow{float:left;height:32px;}.dhx_el_prevbutton .dhx_el_prevbutton_arrow{width:18px;background:-webkit-canvas(dhxArrowLeft) no-repeat top left;}.dhx_el_nextbutton .dhx_el_nextbutton_arrow{width:18px;background:-webkit-canvas(dhxArrowRight) no-repeat top left;}.dhx_touch .dhx_el_prevbutton .dhx_el_prevbutton_arrow{background:-webkit-canvas(dhxArrowLeftT) no-repeat top left;}.dhx_touch .dhx_el_nextbutton .dhx_el_nextbutton_arrow{background:-webkit-canvas(dhxArrowRightT) no-repeat top left;}.dhx_el_segmented{margin:5px;padding:0;border-radius:16px;-moz-border-radius:16px;-webkit-border-radius:16px;border-radius:16px;border:1px solid #598b9b;-moz-box-shadow:0 1px #ebebeb;-webkit-box-shadow:0 1px #ebebeb;box-shadow:0 1px #ebebeb;width:auto;display:inline-block;overflow:hidden;height:34px;}.dhx_el_segmented .segment_0,.dhx_el_segmented .segment_1,.dhx_el_segmented .segment_N{background:#ebebeb;background:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#dfdfdf));background:-moz-linear-gradient(top,#fdfdfd,#dfdfdf);}.dhx_el_segmented .selected.segment_0,.dhx_el_segmented .selected.segment_1,.dhx_el_segmented .selected.segment_N{background:#74c1da;background:-webkit-gradient(linear,left top,left bottom,from(#74c1da),to(#118ab3));background:-moz-linear-gradient(top,#74c1da,#118ab3);-moz-box-shadow:inset 0 1px 1px #bee2ee;-webkit-box-shadow:inset 0 1px 1px #bee2ee;box-shadow:inset 0 1px 1px #bee2ee;}.dhx_el_segmented div,.dhx_el_segmented div.selected{padding:0 12px;text-shadow:0 1px 0 #FFF;color:#747474;border:0;display:inline-block;color:#616161;font-weight:bold;font-size:15px;text-decoration:none;text-align:center;height:32px;line-height:32px;cursor:pointer;}.dhx_el_segmented div.selected{text-shadow:0 -1px 0 rgba(0,0,0,0.6);color:#FFF;}.dhx_el_segmented .segment_0,.dhx_el_segmented .selected.segment_0{-webkit-border-top-left-radius:16px;-webkit-border-bottom-left-radius:17px;-moz-border-radius-topleft:16px;-moz-border-radius-bottomleft:17px;border-top-left-radius:16px;border-bottom-left-radius:17px;padding-left:16px;}.dhx_el_segmented .segment_1,.dhx_el_segmented .selected.segment_1{border-left:1px solid #ababab;}.dhx_el_segmented .segment_N,.dhx_el_segmented .selected.segment_N{-webkit-border-top-right-radius:16px;-webkit-border-bottom-right-radius:17px;-moz-border-radius-topright:16px;-moz-border-radius-bottomright:17px;border-top-right-radius:16px;border-bottom-right-radius:17px;padding-right:15px;border-left:1px solid #ababab;}.dhx_el_roundbutton input,.dhx_el_bigroundbutton input{height:32px;font-weight:bold;font-size:15px;text-decoration:none;color:#FFF;text-shadow:0 -1px 0 rgba(0,0,0,0.6);margin:0;padding:1px 18px 1px;border:1px solid #598b9b;border-bottom:1px solid #0a5f7c;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px;background:#74c1da;background:-webkit-gradient(linear,left top,left bottom,from(#74c1da),to(#118ab3));background:-moz-linear-gradient(top,#74c1da,#118ab3);-moz-box-shadow:inset 0 1px 1px #bee2ee,0px 1px #ebebeb;-webkit-box-shadow:inset 0 1px 1px #bee2ee,0px 1px #ebebeb;box-shadow:inset 0 1px 1px #bee2ee,0px 1px #ebebeb;}.dhx_touch .dhx_el_roundbutton input{margin:0 -1px;background:-webkit-gradient(linear,left top,left bottom,from(#3ba1c3),to(#118ab3));background:-moz-linear-gradient(top,#3ba1c3,#118ab3);}.dhx_el_imagebutton{margin-left:5px;}.dhx_el_imagebutton span{line-height:42px;font-size:20px;}.dhx_el_imagebutton img{vertical-align:middle;margin-top:-4px;}.dhx_el_bigbutton input,.dhx_el_bigroundbutton input{height:46px;line-height:46px;font-size:20px;-webkit-border-radius:22px 22px 22px 22px;-moz-border-radius:22px 22px 22px 22px;-o-border-radiues:22px 22px 22px 22px;border-radius:22px 22px 22px 22px;border-color:#b1b1b0 #b1b1b0 #878787 #b1b1b0;}.dhx_el_bigbutton input{text-shadow:0 1px 0 #FFF;background:#ebebeb;background:-webkit-gradient(linear,left top,left bottom,from(#fcfcfc),color-stop(0.4,#eee),color-stop(0.6,#e0e0e0),to(#c3c3c3));background:-moz-linear-gradient(top,#fcfcfc 0,#eee 40%,#e0e0e0 60%,#c3c3c3 100%);}.dhx_el_select{padding:5px 5px 0;font-size:15px;}.dhx_el_select select{font-size:15px;}.dhx_el_tabbar{height:49px;vertical-align:top;}.dhx_el_tabbar div{display:inline-block;text-align:center;cursor:pointer;height:46px;margin:1px 2px;}.dhx_el_tabbar .selected{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#6c8e99),to(#395a65));background-image:-moz-linear-gradient(top,#6c8e99,#395a65);background-repeat:repeat-x;}.dhx_el_tabbar img{vertical-align:middle;}.dhx_el_tabbar span{margin-top:1px;line-height:12px;padding:0 10px 2px;color:#FFF;font-size:8px;font-weight:bold;text-shadow:0 -1px 0 rgba(0,0,0,0.6);display:block;}.dhx_el_datepicker,.dhx_el_text,.dhx_el_datepicker,.dhx_el_checkbox,.dhx_el_richselect,.dhx_el_combo,.dhx_el_counter,.dhx_el_toggle{padding:5px 5px 0;font-size:18px;display:inline-block;}.dhx_el_radio{padding:5px 5px 0;font-size:18px;}.dhx_el_toggle input,.dhx_el_combo input{font-size:18px;}.dhx_el_toggle input{padding-top:0;}.dhx_inp_text_border,.dhx_el_input input{height:31px;line-height:31px;width:auto;padding:0 8px;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;background:-moz-linear-gradient(center bottom,#FFF,#f2f2f2);background:-webkit-linear-gradient(#f2f2f2,#FFF);border:1px solid #adadad;}.dhx_el_input{margin-top:5px;padding:0 5px 0;}.dhx_el_input input{line-height:0;font-size:20px;}.dhx_inp_text_label{float:left;overflow:hidden;font-size:18px;color:#616161;}.dhx_inp_list,.dhx_inp_text,.dhx_inp_combo{display:block;float:left;height:31px;line-height:31px;color:#000;background:#f7f7f7;background-image:-webkit-gradient(linear,left top,left bottom,from(#f7f7f7),to(#fefefe));background-image:-moz-linear-gradient(top,#f7f7f7,#fefefe);border:medium none;padding:0;}.dhx_inp_textarea{border:1px solid #adadad;padding:0 8px;margin:5px 5px 0;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;font-size:18px;color:#000;background:#f7f7f7;background-image:-webkit-gradient(linear,left top,left bottom,from(#f7f7f7),to(#fefefe));background-image:-moz-linear-gradient(top,#f7f7f7,#fefefe);background-image:-webkit-gradient(linear,left top,left bottom,from(#f7f7f7),to(#fefefe));}::-webkit-input-placeholder{font-size:16px;font-weight:bold;color:#bcbcbc;}.dhx_inp_counter_prev,.dhx_inp_counter_next{width:37px;height:33px;background-repeat:no-repeat;background-color:transparent;cursor:pointer;border:none;float:left;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;background:#74c1da;background:-webkit-gradient(linear,left top,left bottom,from(#74c1da),to(#118ab3));background:-moz-linear-gradient(top,#74c1da,#118ab3);border:1px solid #598b9b;text-shadow:0 -1px 0 rgba(0,0,0,0.6);color:#FFF;font-size:30px;padding-left:10px;line-height:15px;}.dhx_inp_counter_prev{font-size:14px;line-height:10px;}.dhx_inp_counter_prev{border-top-left-radius:16px;border-bottom-left-radius:16px;-moz-border-radius-topleft:16px;-moz-border-radius-bottomleft:16px;-webkit-border-top-left-radius:16px;-webkit-border-bottom-left-radius:16px;}.dhx_inp_counter_next{border-top-right-radius:16px;border-bottom-right-radius:16px;-moz-border-radius-topright:16px;-moz-border-radius-bottomright:16px;-webkit-border-top-right-radius:16px;-webkit-border-bottom-right-radius:16px;}.dhx_inp_counter_value{width:20px;height:23px;background-color:#FFF;border-top:1px solid #598b9b;float:left;text-align:center;padding:4px 8px;overflow:hidden;line-height:24px;}.dhx_inp_counter_prev,.dhx_inp_counter_next,.dhx_inp_counter_value{-moz-box-shadow:inset 0 1px 1px #bee2ee,0px 1px #ebebeb;-webkit-box-shadow:inset 0 1px 1px #bee2ee,0px 1px #ebebeb;box-shadow:inset 0 1px 1px #bee2ee,0px 1px #ebebeb;border-bottom:1px solid #0a5f7c;}.dhx_inp_counter_label,.dhx_inp_toggle_label{float:left;padding:6px 10px;color:#9d9d9d;line-height:24px;}.dhx_el_formbutton{margin:4px 5px;}.dhx_inp_form_button{height:34px;padding-left:14px;padding-right:14px;background:#72a53b;background:-webkit-gradient(linear,left top,left bottom,from(#a0c07c),to(#579418));background:-moz-linear-gradient(top,#a0c07c,#579418);cursor:pointer;outline-style:none;-webkit-appearance:none;-moz-border-radius:17px;-webkit-border-radius:17px;border-radius:17px;border:1px solid #6b8352;border-bottom:1px solid #3a640d;font-weight:bold;font-size:15px;-moz-box-shadow:inset 0 1px 1px #cfdfbd,0px 1px #ebebeb;-webkit-box-shadow:inset 0 1px 1px #cfdfbd,0px 1px #ebebeb;box-shadow:inset 0 1px 1px #cfdfbd,0px 1px #ebebeb;color:#FFF;text-shadow:0 -1px 0 rgba(0,0,0,0.6);}.dhx_touch .dhx_el_formbutton input{background:#579418;background-image:-moz-linear-gradient(linear,left top,left bottom,color-stop(0%,#72a53b),color-stop(100%,#579418));background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#72a53b),color-stop(100%,#579418));margin-left:-1px;margin-right:-1px;border:1px solid #3a640d;color:#f4f4f4;}.dhx_el_toggle{display:inline-block;}.dhx_inp_toggle_left_on,.dhx_inp_toggle_left_off,.dhx_inp_toggle_right_on,.dhx_inp_toggle_right_off{height:31px;line-height:31px;background-color:transparent;border:none;cursor:pointer;display:block;float:left;margin:0;text-align:center;outline:none;background:#ebebeb;background:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#dfdfdf));background:-moz-linear-gradient(top,#fdfdfd,#dfdfdf);padding:0 14px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.dhx_inp_toggle_left_on,.dhx_inp_toggle_right_on{color:#FFF;text-shadow:0 -1px 0 rgba(0,0,0,0.6);background:#74c1da;background:-webkit-gradient(linear,left top,left bottom,from(#74c1da),to(#118ab3));background:-moz-linear-gradient(top,#74c1da,#118ab3);-moz-box-shadow:inset 0 1px 1px #bee2ee,0px 1px #ebebeb;-webkit-box-shadow:inset 0 1px 1px #bee2ee;box-shadow:inset 0 1px 1px #bee2ee;border:1px solid #598b9b;border-bottom:1px solid #0a5f7c;}.dhx_inp_toggle_left_off,.dhx_inp_toggle_right_off{color:#6e6e6e;background:#ebebeb;background:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#dfdfdf));background:-moz-linear-gradient(top,#fdfdfd,#dfdfdf);border:1px solid #93b0ba;border-bottom:1px solid #93b0ba;-moz-box-shadow:0 1px #ebebeb;-webkit-box-shadow:0 1px #ebebeb;box-shadow:0 1px #ebebeb;}.dhx_inp_toggle_left_on,.dhx_inp_toggle_left_off{border-top-left-radius:15px;border-bottom-left-radius:15px;-moz-border-radius-topleft:15px;-moz-border-radius-bottomleft:15px;-webkit-border-top-left-radius:15px;-webkit-border-bottom-left-radius:15px;}.dhx_inp_toggle_right_on,.dhx_inp_toggle_right_off{border-top-right-radius:15px;border-bottom-right-radius:15px;-moz-border-radius-topright:15px;-moz-border-radius-bottomright:15px;-webkit-border-top-right-radius:15px;-webkit-border-bottom-right-radius:15px;}.dhx_inp_toggle_left_off{border-right:0;}.dhx_inp_toggle_right_off{border-left:0;}.dhx_inp_checkbox_border{width:24px;height:24px;padding:0;margin-top:5px;border:1px solid #adadad;background-color:#FFF;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;text-align:center;cursor:pointer;float:left;}.dhx_inp_checkbox_on{display:block;width:18px;height:18px;border:none;background-color:transparent;background-image:url(./imgs/images.png);background-position:0 -847px;background-repeat:no-repeat;cursor:pointer;margin:3px 0 0 3px;padding:0;font-size:0!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.dhx_inp_checkbox_label,.dhx_inp_radio_label{float:left;padding:0 10px;cursor:pointer;height:35px;line-height:35px;}.dhx_inp_radio_border{width:22px;height:22px;margin-top:6px;border:1px solid #adadad;background-color:#FFF;-webkit-border-radius:20px;-moz-border-radius:20px;border-radius:20px;text-align:center;cursor:pointer;float:left;}.dhx_inp_radio_on{width:12px;height:12px;border:none;background-color:transparent;background-image:url(./imgs/images.png);background-position:0 -937px;background-repeat:no-repeat;cursor:pointer;margin:5px 0 0 5px;display:block;font-size:0!important;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;}.hidden{display:none;}.dhx_inp_toggle_left_on:focus,.dhx_inp_toggle_left_off:focus,.dhx_inp_toggle_right_on:focus,.dhx_inp_toggle_right_off:focus,.dhx_inp_form_button:focus,.dhx_inp_counter_prev:focus,.dhx_inp_counter_next:focus,.dhx_inp_checkbox_on:focus,.dhx_inp_radio_on:focus,.dhx_el_button input:focus,.dhx_el_roundbutton input:focus,.dhx_el_nextbutton:focus,.dhx_el_prevbutton input:focus{outline:none 0;}.dhx_inp_toggle_left_on::-moz-focus-inner,.dhx_inp_toggle_left_off::-moz-focus-inner,.dhx_inp_toggle_right_on::-moz-focus-inner,.dhx_inp_toggle_right_off::-moz-focus-inner,.dhx_inp_form_button::-moz-focus-inner,.dhx_inp_counter_prev::-moz-focus-inner,.dhx_inp_counter_next::-moz-focus-inner,.dhx_inp_checkbox_on::-moz-focus-inner,.dhx_inp_radio_on::-moz-focus-inner,.dhx_el_button input::-moz-focus-inner,.dhx_el_roundbutton input::-moz-focus-inner,.dhx_el_prevbutton input::-moz-focus-inner,.dhx_el_nextbutton input::-moz-focus-inner{border:0;}.invalid,.invalid input,.invalid textarea{color:#F00;}div,input,textarea{font-family:"Helvetica World","HelveticaNeue","Helvetica Neue","HelveticaNeueRoman","Helvetica","Tahoma","Geneva","Arial",sans-serif;}.dhx_form_float,.dhx_form_clear{float:left;width:300px;font-size:18px;padding:5px 0 5px 10px;height:35px;}.dhx_form_float{text-align:center;}.dhx_form_row_delimiter,.dhx_form_clear{clear:both;}.dhx_el_text input{font-size:18px;line-height:28px;}.dhx_toolbar{text-align:center;margin:auto;height:42px;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#9ecfe0),to(#73bbd4),color-stop(50%,#76a6b7));background-image:-moz-linear-gradient(top,#9ecfe0,#76a6b7,#73bbd4);line-height:normal;}.dhx_toolbar .dhx_view{background-color:transparent;}.dhx_mainbar{background-image:-moz-linear-gradient(top,#FFF,#e1ebee,#cbdce2);background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#FFF),to(#cbdce2),color-stop(50%,#e1ebee));}.dhx_transparentbar{background:transparent!important;font-weight:bold;}.dhx_subbar{background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#FFF),to(#c2c2c2),color-stop(50%,#e8e8e8));background-image:-moz-linear-gradient(top,#FFF,#e8e8e8,#c2c2c2);background-repeat:repeat-x;}.dhx_list_item{cursor:pointer;line-height:22px;font-family:"Helvetica World","HelveticaNeue","Helvetica Neue","HelveticaNeueRoman","Helvetica","Tahoma","Geneva","Arial",sans-serif;font-weight:bold;font-size:16px;text-decoration:none;color:#303030;border-bottom:1px solid #d4d4d4;vertical-align:middle;white-space:nowrap;background:;background:;background:;-moz-user-select:none;-moz-user-select:-moz-none;-webkit-user-select:none;}.dhx_list__item_selected,.dhx_list_item_selected{color:#FFF;text-shadow:0 -1px 0 #2d6072;background:#0986b0;background:-moz-linear-gradient(top,#8dcee3 4%,#0986b0 85%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0.85,#0986b0),color-stop(0.04,#8dcee3));}.dhx_list_group,.dhx_list_group_selected{position:relative;border-bottom:1px solid #d4d4d4;}.dhx_list_group_back,.dhx_list_group_back_selected{position:relative;background-color:#aeaeae;background-image:url(./imgs/arr_top.png),-webkit-gradient(linear,left bottom,left top,color-stop(0.02,#ccc),color-stop(0.06,#e0e0e0),color-stop(0.90,#fdfdfd));background-image:url(./imgs/arr_top.png),-moz-linear-gradient(center bottom,#ccc 2%,#e0e0e0 6%,#fdfdfd 90%,#FFF 95%);background-repeat:no-repeat,repeat-x;background-position:center 37px,0;border-bottom:1px solid transparent;}.dhx_arrow_icon{position:absolute;top:50%;bottom:50%;margin-top:-6px;right:29px;width:7px;height:11px;background-image:url(./imgs/images.png);background-repeat:no-repeat;}.dhx_list_group .dhx_arrow_icon,.dhx_list_group_selected .dhx_arrow_icon{background-position:0 -677px;}.dhx_list_group_back .dhx_arrow_icon,.dhx_list_group_back_selected .dhx_arrow_icon{background-position:0 -664px;}.dhx_arrow_top_icon{position:absolute;bottom:0;left:50%;width:13px;height:7px;margin-left:-7px;margin-bottom:-1px;background-image:url(./imgs/images.png);background-repeat:no-repeat;}.dhx_list_group_back .dhx_arrow_top_icon{background-position:0 -729px;}.dhx_list_count{float:right;width:25px;font-size:14px;text-align:center;margin-right:45px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;background-color:#929292;color:#FFF;-webkit-box-shadow:0 1px 0 #000;-moz-box-shadow:0 1px 0 #000;box-shadow:0 1px 0 #000;-webkit-text-shadow:0 -1px 0 rgba(0,0,0,0.6);-moz-text-shadow:0 -1px 0 rgba(0,0,0,0.6);text-shadow:0 -1px 0 rgba(0,0,0,0.6);}.dhx_pagelist{position:relative;}.dhx_pagelist.hidden_scroll .dhx_scroll_x{background-color:transparent!important;}.dhx_pagelist.hidden_scroll .dhx_scroll_y{background-color:transparent!important;}.dhx_mini_calendar{background-color:#ebebeb;cursor:default;color:#616161;font-family:"Helvetica World","HelveticaNeue","Helvetica Neue","HelveticaNeueRoman","Helvetica","Tahoma","Geneva","Arial",sans-serif;font-size:18px;font-weight:bold;text-shadow:0 1px 0 #FFF;overflow:hidden;position:relative;}.dhx_cal_month{border-bottom:1px solid #d4d4d4;height:39px;line-height:39px;text-align:center;vertical-align:middle;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0.05,#c7c7c7),color-stop(0.60,#f5f5f5),color-stop(0.84,#FFF));background-image:-moz-linear-gradient(center bottom,#c7c7c7 5%,#f5f5f5 60%,#FFF 84%);position:relative;}.dhx_cal_header{position:relative;}.dhx_cal_week_header,.dhx_cal_day_name,.dhx_cal_day_num,.dhx_next_month,.dhx_prev_month,.dhx_cal_week_num{border-color:#fcfcfc #fcfcfc #ccc #cccccc;border-width:1px;border-style:solid;text-align:center;}.dhx_cal_week_header,.dhx_cal_day_name{line-height:18px;font-size:12px;position:absolute;background-color:#e3e3e3;}.dhx_cal_day_num,.dhx_next_month,.dhx_prev_month,.dhx_cal_week_num{background-color:#ededed;color:#6a6a6a;font-size:16px;}.dhx_week_numbers .dhx_cal_week_num{font-size:12px;font-weight:bold;color:#303030;background-color:#E4E4E4;}.dhx_cal_day_num{cursor:pointer;}.dhx_cal_day_num.dhx_cal_current_day{background:#539300;color:#FFF;text-shadow:0 -1px 0 rgba(0,0,0,0.6);border-color:#828282;}.dhx_cal_day_num.dhx_cal_selected_day{background-image:;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#9dcedf),to(#0986b0),color-stop(34%,#53aac8),color-stop(85%,#0986b0));background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#9dcedf),to(#0986b0),color-stop(34%,#53aac8),color-stop(85%,#0986b0));background-color:#4169e1;color:#FFF;text-shadow:0 -1px 0 rgba(0,0,0,0.6);border-color:#6c838a;}.dhx_cal_day_num_bborder{border-bottom:0;}.dhx_cal_day_num_rborder{border-right:0;}.dhx_cal_day_name_last{border-right:0;}.dhx_cal_time_select{border-top:1px solid #ccc;height:28px;padding-top:3px;text-align:center;vertical-align:middle;}.dhx_cal_header,.dhx_cal_body{margin-left:-1px;}.dhx_cal_prev_button,.dhx_cal_next_button{cursor:pointer;position:absolute;top:0;width:30px;height:39px;font-size:0;line-height:39px;vertical-align:middle;}.dhx_cal_prev_button{left:10px;}.dhx_cal_next_button{right:10px;}.dhx_cal_prev_button div,.dhx_cal_next_button div{width:7px;height:11px;position:absolute;top:15px;}.dhx_cal_prev_button div{background-image:url(./imgs/images.png);background-repeat:no-repeat;background-position:0 -664px;left:5px;}.dhx_cal_next_button div{background-image:url(./imgs/images.png);background-position:0 -677px;background-repeat:no-repeat;right:5px;}.dhx_window{position:absolute;width:298px;-moz-box-shadow:0 0 20px #878787;-khtml-box-shadow:0 0 20px #878787;}.dhx_win_content{height:auto;width:auto;overflow:hidden;}.dhx_win_body{color:#616161;background-color:#FFF;overflow:hidden;text-align:center;}.dhx_window,.dhx_win_content,.dhx_win_body{-webkit-border-radius:6px;-moz-border-radius:6px;-o-border-radius:6px;border-radius:6px;}.dhx_alert_text{color:#616161;padding:10px;}.dhx_alert_template,.dhx_win_head{line-height:43px;color:#FFF;font-size:16pt;text-align:center;border-bottom:1px solid #adadad;cursor:pointer;}.dhx_alert_template{text-shadow:0 -1px 0 #000;background:#616161;font-weight:bold;background:-webkit-gradient(linear,left top,left bottom,from(#696969),to(#575757));background:-moz-linear-gradient(top,#696969,#575757);}.dhx_modal,.dhx_modal_rich{width:100%;height:100%;position:absolute;top:0;left:0;}.dhx_modal{background-color:#000;opacity:.2;filter:alpha(opacity= 20);}.dhx_modal_rich{background-image:url(./imgs/window/bg.png);background-size:cover;}.dhx_point_top,.dhx_point_right,.dhx_point_bottom,.dhx_point_left{position:absolute;}.dhx_point_top,.dhx_point_bottom{width:13px;height:7px;}.dhx_point_left,.dhx_point_right{width:7px;height:13px;}.dhx_point_top{background-image:url(./imgs/images.png);background-position:0 -729px;}.dhx_point_bottom{background-image:url(./imgs/images.png);background-position:0 -690px;}.dhx_point_right{background-image:url(./imgs/images.png);background-position:0 -714px;}.dhx_point_left{background-image:url(./imgs/images.png);background-position:0 -699px;}.dhx_confirm_message,.dhx_alert_message,.dhx_prompt_message{font-size:18px;padding:14px;}body{-moz-user-select:none;-moz-user-select:-moz-none;-webkit-user-select:none;}.dhx_scroll_x{width:50px;height:4px!important;padding:0!important;margin:0!important;background:rgba(0,0,0,0.4);position:absolute;left:1px;bottom:3px;border:1px solid transparent;-webkit-border-radius:4px;-webkit-transition:-webkit-transform;}.dhx_scroll_y{width:4px!important;padding:0!important;margin:0!important;height:50px;background:rgba(0,0,0,0.4);position:absolute;top:1px;right:3px;border:1px solid transparent;-webkit-border-radius:4px;-webkit-transition:-webkit-transform;}.dhx_scroll_cont{width:100%;height:auto;overflow:hidden;clear:both;}html,body{-webkit-tap-highlight-color:rgba(0,0,0,0);-moz-user-select:none;-moz-user-select:-moz-none;-khtml-select:none;}.dhx_schedulerbar{background:-webkit-gradient(linear,left top,left bottom,from(#d7d7d7),to(#b7b7b7));background:-moz-linear-gradient(top,#d7d7d7,#b7b7b7);}.dhx_el_button input{border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;background:-webkit-gradient(linear,left top,left bottom,from(#9dbcc7),color-stop(0.4,#80a9b8),color-stop(0.6,#6799aa),to(#4f899d));background:-moz-linear-gradient(top,#9dbcc7,#518a9e);text-shadow:0 -1px 0 rgba(0,0,0,0.6);font-size:14px;color:#fff;padding:0 10px;border:1px solid #636363;-moz-box-shadow:0 1px #fff;-webkit-box-shadow:0 1px #fff;box-shadow:0 1px #fff;}.add .dhx_el_button input{background-image:url(./imgs_mobile/add.png),-webkit-gradient(linear,left top,left bottom,from(#9dbcc7),color-stop(0.4,#80a9b8),color-stop(0.6,#6799aa),to(#4f899d));background-image:url(./imgs_mobile/add.png),-moz-linear-gradient(top,#9dbcc7,#518a9e);background-position:center center;background-repeat:no-repeat;width:34px;}.dhx_schedulerbar .dhx_el_segmented{border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;float:none!important;border:1px solid #636363;-moz-box-shadow:0 1px #fff;-webkit-box-shadow:0 1px #fff;height:32px;}.dhx_schedulerbar .dhx_el_segmented .segment_0,.dhx_schedulerbar .dhx_el_segmented .segment_1,.dhx_schedulerbar .dhx_el_segmented .segment_N{background:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),color-stop(0.3,#eee),color-stop(0.6,#dcdcdc),to(#d5d5d5));background:-moz-linear-gradient(top,#f8f8f8,#d5d5d5);}.dhx_schedulerbar .dhx_el_segmented .selected.segment_0,.dhx_schedulerbar .dhx_el_segmented .selected.segment_1,.dhx_schedulerbar .dhx_el_segmented .selected.segment_N{background:-webkit-gradient(linear,left top,left bottom,from(#9dbcc7),color-stop(0.4,#80a9b8),color-stop(0.6,#6799aa),to(#4f899d));background:-moz-linear-gradient(top,#9dbcc7,#518a9e);}.dhx_el_segmented .segment_N,.dhx_el_segmented .selected.segment_N{border-left:0;}.dhx_schedulerbar .dhx_el_segmented div{text-shadow:0 1px 0 #fff;font-size:14px;color:#757575;border:0;height:30px;}.dhx_schedulerbar .dhx_el_segmented div.selected{text-shadow:0 -1px 0 rgba(0,0,0,0.6);color:#fff;height:30px;}.dhx_schedulerbar .dhx_el_segmented .segment_0{-webkit-border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-bottomleft:4px;border-top-left-radius:4px;border-bottom-left-radius:4px;padding:0 11px 0 14px;}.dhx_schedulerbar .dhx_el_segmented .segment_1{border-left:1px solid #ababab;border-right:1px solid #ababab;padding:0 11px;}.dhx_schedulerbar .dhx_el_segmented .segment_N{-webkit-border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;padding:0 14px 0 11px;}.dhx_dayevents_scale_item{-moz-user-select:-moz-none;border-bottom:1px solid #D4D4D4;color:#303030;font-family:"Helvetica World","HelveticaNeue","Helvetica Neue","HelveticaNeueRoman","Helvetica","Tahoma","Geneva","Arial",sans-serif;white-space:nowrap;}.dhx_dayevents_scale_hour{float:left;text-align:center;font-size:16px;vertical-align:middle;font-weight:bold;}.dhx_dayevents_scale_top,.dhx_dayevents_scale_bottom{font-size:10px;float:left;text-align:center;}.dhx_dayevents_scale_top{border-bottom:1px dotted #D4D4D4;}.dhx_dayevents_scale_minute{background-color:#EEE;border-right:1px dotted #D4D4D4;float:left;}.dhx_dayevents_scale_event{float:left;}.dhx_dayevents_event_item{position:absolute;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;font-size:12px;background-color:#e6f8ff;border:1px solid #78a5b4;font-family:"Helvetica World","HelveticaNeue","Helvetica Neue","HelveticaNeueRoman","Helvetica","Tahoma","Geneva","Arial",sans-serif;}.dhx_topbar{font-size:18px;background:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),color-stop(0.5,#ededed),to(#c8c8c8))!important;background:-moz-linear-gradient(top,#fdfdfd,#c8c8c8)!important;}.dhx_list_events_item{position:relative;background-color:#fff;}.dhx_list_events_item .dhx_day_title{height:16px;line-height:16px;width:75px;position:absolute;left:1px;top:0;background:#518A9E;border-radius:2px;text-align:center;-moz-border-radius:2px;-moz-box-shadow:1px 1px 1px #1c2329;-webkit-box-shadow:1px 1px 1px #1c2329;box-shadow:1px 1px 1px #1c2329;-webkit-border-radius:2px;text-shadow:0 -1px 0 rgba(0,0,0,0.6);font-size:14px;color:#fff;}.dhx_list_events_item .dhx_event_marker{display:inline-block;margin-left:5px;margin-top:5px;height:10px;width:10px;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;background-color:#e6f8ff;border:1px solid #78a5b4;vertical-align:top;}.dhx_list_events_item .dhx_event_time{display:inline-block;width:70px;font-size:16px;padding-top:8px;}.dhx_list_events_item .dhx_event_text{display:inline-block;padding-left:4px;overflow:hidden;height:22px;vertical-align:top;white-space:nowrap;}.dhx_cal_day_num.dhx_cal_selected_day,.dhx_cal_day_num.dhx_cal_current_day.dhx_cal_selected_day{background:-webkit-gradient(linear,left top,left bottom,from(#a0bfc9),to(#4f899d))!important;background:-moz-linear-gradient(top,#a0bfc9,#4f899d);text-shadow:0 1px 0 rgba(0,0,0,0.6);}.dhx_cal_day_num.dhx_cal_current_day{background:-webkit-gradient(linear,left top,left bottom,from(#bababa),to(#eee))!important;background:-moz-linear-gradient(top,#bababa,#eee);border-color:#636363;text-shadow:0 1px 0 rgba(0,0,0,0.6);}.dhx_cal_day_num.dhx_cal_selected_day span{color:#fff;}.dhx_cal_day_num{position:relative;}.dhx_cal_day_num .day_with_events{position:absolute;bottom:0;right:0;background-image:url(./imgs_mobile/event.png);background-repeat:no-repeat;width:12px;height:12px;}.dhx_cal_day_num.dhx_cal_selected_day .day_with_events{background-image:url(./imgs_mobile/event_focus.png);}.dhx_cal_prev_button div{background-image:url("./imgs_mobile/arrow_left.png");background-position:0 0;width:28px;height:29px;top:6px;}.dhx_cal_next_button div{background-image:url("./imgs_mobile/arrow_right.png");background-position:0 0;width:28px;height:29px;top:6px;}.dhx_list_day_events_item{background-color:#fff;}.dhx_list_day_events_item .dhx_event_marker{display:inline-block;margin-top:16px;margin-left:5px;height:10px;width:10px;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;background-color:#e6f8ff;border:1px solid #78a5b4;}.dhx_list_day_events_item .dhx_event_time{display:inline-block;width:auto;height:42px;line-height:42px;padding-left:5px;}.dhx_list_day_events_item .dhx_event_text{display:inline-block;padding-left:10px;line-height:42px;}.no_events{background-image:url(./imgs_mobile/noevents.png);background-repeat:no-repeat;}.selected_event{width:290px;margin:5px;background-color:#e6f8ff;border:1px solid #78a5b4;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;padding:3px 6px;}.selected_event .event_title{font-weight:bold;}.selected_event .event_text{font-size:12px;}.dhx_el_formbutton.delete .dhx_inp_form_button{background:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#d4d4d4));background:-moz-linear-gradient(top,#f8f8f8,#d4d4d4);border-top:1px solid #888;font-size:18px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:1px solid #8f8f8f;color:#606060;text-shadow:0 1px 0 #fff;height:40px;}.dhx_el_button.cancel input{background:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),color-stop(0.3,#eee),color-stop(0.6,#dcdcdc),to(#d5d5d5));background:-moz-linear-gradient(top,#f8f8f8,#d5d5d5);color:#6E6E6E;text-shadow:0 1px 0 #FFF;}.invalid .dhx_inp_text_border{border-color:#c00;}.invalid .dhx_inp_list{color:#c00;}.dhx_win_body{font-weight:bold;color:#3f2317;text-shadow:0 1px #e2d3b6;background:url(../images/confirm_main_bgr.png);}.dhx_win_body .dhx_view{background:transparent;}.dhx_el_bigbutton input,.dhx_el_bigroundbutton input{height:40px;line-height:40px;}.dhx_el_bigroundbutton input,.alert .dhx_el_bigbutton input{background:#83a41f;background:-webkit-gradient(linear,left top,left bottom,from(#9dbcc7),color-stop(0.4,#80a9b8),color-stop(0.6,#6799aa),to(#4f899d));background:-moz-linear-gradient(top,#9dbcc7,#518a9e);}.dhx_el_bigroundbutton{padding-top:0;} \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_mobile.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_mobile.js
new file mode 100644
index 00000000000..9ec9bb0dbfa
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_mobile.js
@@ -0,0 +1,318 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+window.dhx||(dhx={});dhx.version="3.0";dhx.codebase="./";dhx.name="Core";dhx.copy=function(a){var b=dhx.copy.Sd;b.prototype=a;return new b};dhx.copy.Sd=function(){};dhx.extend=function(a,b,c){a.Ya&&(a=a.Ya[0]);for(var d in b)if(!a[d]||c)a[d]=b[d];b.defaults&&dhx.extend(a.defaults,b.defaults);b.$init&&b.$init.call(a);return a};
+dhx.fullCopy=function(a){var b=a.length?[]:{};arguments.length>1&&(b=arguments[0],a=arguments[1]);for(var c in a)typeof a[c]=="object"?(b[c]=a[c].length?[]:{},dhx.fullCopy(b[c],a[c])):b[c]=a[c];return b};dhx.single=function(a){var b=null,c=function(c){b||(b=new a({}));b.Yc&&b.Yc.apply(b,arguments);return b};return c};
+dhx.protoUI=function(){var a=arguments,b=a[0].name,c=function(d){if(a){for(var e=[a[0]],f=1;f<a.length;f++)e[f]=a[f],e[f].Ya&&(e[f]=e[f].call(dhx)),e[f].prototype&&e[f].prototype.name&&(dhx.ui[e[f].prototype.name]=e[f]);dhx.ui[b]=dhx.proto.apply(dhx,e);if(c.Ga)for(f=0;f<c.Ga.length;f++)dhx.Type(dhx.ui[b],c.Ga[f]);c=a=null}return this!=dhx?new dhx.ui[b](d):dhx.ui[b]};c.Ya=arguments;return dhx.ui[b]=c};
+dhx.proto=function(){for(var a=arguments,b=a[0],c=!!b.$init,d=[],e=a.length-1;e>0;e--){if(typeof a[e]=="function")a[e]=a[e].prototype;a[e].$init&&d.push(a[e].$init);if(a[e].defaults){var f=a[e].defaults;if(!b.defaults)b.defaults={};for(var g in f)dhx.isNotDefined(b.defaults[g])&&(b.defaults[g]=f[g])}if(a[e].type&&b.type)for(g in a[e].type)b.type[g]||(b.type[g]=a[e].type[g]);for(var h in a[e])b[h]||(b[h]=a[e][h])}c&&d.push(b.$init);b.$init=function(){for(var a=0;a<d.length;a++)d[a].apply(this,arguments)};
+var i=function(a){this.$ready=[];this.$init(a);this.Rb&&this.Rb(a,this.defaults);for(var b=0;b<this.$ready.length;b++)this.$ready[b].call(this)};i.prototype=b;b=a=null;return i};dhx.bind=function(a,b){return function(){return a.apply(b,arguments)}};dhx.require=function(a){dhx.Mc[a]||(dhx.exec(dhx.ajax().sync().get(dhx.codebase+a).responseText),dhx.Mc[a]=!0)};dhx.Mc={};dhx.exec=function(a){window.execScript?window.execScript(a):window.eval(a)};
+dhx.wrap=function(a,b){return!a?b:function(){var c=a.apply(this,arguments);b.apply(this,arguments);return c}};dhx.methodPush=function(a,b){return function(){var c=!1;return c=a[b].apply(a,arguments)}};dhx.isNotDefined=function(a){return typeof a=="undefined"};dhx.delay=function(a,b,c,d){return window.setTimeout(function(){var d=a.apply(b,c||[]);a=b=c=null;return d},d||1)};dhx.uid=function(){if(!this.bc)this.bc=(new Date).valueOf();this.bc++;return this.bc};
+dhx.toNode=function(a){return typeof a=="string"?document.getElementById(a):a};dhx.toArray=function(a){return dhx.extend(a||[],dhx.PowerArray,!0)};dhx.toFunctor=function(a){return typeof a=="string"?eval(a):a};dhx.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"};dhx.o={};dhx.event=function(a,b,c,d){var a=dhx.toNode(a),e=dhx.uid();d&&(c=dhx.bind(c,d));dhx.o[e]=[a,b,c];a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c);return e};
+dhx.eventRemove=function(a){if(a){var b=dhx.o[a];b[0].removeEventListener?b[0].removeEventListener(b[1],b[2],!1):b[0].detachEvent&&b[0].detachEvent("on"+b[1],b[2]);delete this.o[a]}};
+dhx.EventSystem={$init:function(){this.o={};this.ka={};this.Mb={}},blockEvent:function(){this.o.oc=!0},unblockEvent:function(){this.o.oc=!1},mapEvent:function(a){dhx.extend(this.Mb,a,!0)},on_setter:function(a){if(a)for(var b in a)typeof a[b]=="function"&&this.attachEvent(b,a[b])},callEvent:function(a,b){if(this.o.oc)return!0;var a=a.toLowerCase(),c=this.o[a.toLowerCase()],d=!0;if(c)for(var e=0;e<c.length;e++)if(c[e].apply(this,b||[])===!1)d=!1;this.Mb[a]&&!this.Mb[a].callEvent(a,b)&&(d=!1);return d},
+attachEvent:function(a,b,c){var a=a.toLowerCase(),c=c||dhx.uid(),b=dhx.toFunctor(b),d=this.o[a]||dhx.toArray();d.push(b);this.o[a]=d;this.ka[c]={f:b,t:a};return c},detachEvent:function(a){if(this.ka[a]){var b=this.ka[a].t,c=this.ka[a].f,d=this.o[b];d.remove(c);delete this.ka[a]}},hasEvent:function(a){a=a.toLowerCase();return this.o[a]?!0:!1}};dhx.extend(dhx,dhx.EventSystem);
+dhx.PowerArray={removeAt:function(a,b){a>=0&&this.splice(a,b||1)},remove:function(a){this.removeAt(this.find(a))},insertAt:function(a,b){if(!b&&b!==0)this.push(a);else{var c=this.splice(b,this.length-b);this[b]=a;this.push.apply(this,c)}},find:function(a){for(var b=0;b<this.length;b++)if(a==this[b])return b;return-1},each:function(a,b){for(var c=0;c<this.length;c++)a.call(b||this,this[c])},map:function(a,b){for(var c=0;c<this.length;c++)this[c]=a.call(b||this,this[c]);return this}};dhx.env={};
+(function(){if(navigator.userAgent.indexOf("Mobile")!=-1)dhx.env.mobile=!0;if(dhx.env.mobile||navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("Android")!=-1)dhx.env.touch=!0;navigator.userAgent.indexOf("Opera")!=-1?dhx.env.isOpera=!0:(dhx.env.isIE=!!document.all,dhx.env.isFF=!document.all,dhx.env.isWebKit=navigator.userAgent.indexOf("KHTML")!=-1,dhx.env.isSafari=dhx.env.isWebKit&&navigator.userAgent.indexOf("Mac")!=-1);if(navigator.userAgent.toLowerCase().indexOf("android")!=
+-1)dhx.env.isAndroid=!0;dhx.env.transform=!1;dhx.env.transition=!1;for(var a={names:["transform","transition"],transform:["transform","WebkitTransform","MozTransform","oTransform","msTransform"],transition:["transition","WebkitTransition","MozTransition","oTransition","msTransition"]},b=document.createElement("DIV"),c=0;c<a.names.length;c++)for(var d=a[a.names[c]],e=0;e<d.length;e++)if(typeof b.style[d[e]]!="undefined"){dhx.env[a.names[c]]=d[e];break}b.style[dhx.env.transform]="translate3d(0,0,0)";
+dhx.env.translate=b.style[dhx.env.transform]?"translate3d":"translate";dhx.env.transformCSSPrefix=function(){var a;dhx.env.isOpera?a="-o-":(a="",dhx.env.isFF&&(a="-Moz-"),dhx.env.isWebKit&&(a="-webkit-"),dhx.env.isIE&&(a="-ms-"));return a}();dhx.env.transformPrefix=dhx.env.transformCSSPrefix.replace(/-/gi,"");dhx.env.transitionEnd=dhx.env.transformCSSPrefix=="-Moz-"?"transitionend":dhx.env.transformPrefix+"TransitionEnd"})();
+dhx.env.svg=function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}();
+dhx.html={create:function(a,b,c){var b=b||{},d=document.createElement(a),e;for(e in b)d.setAttribute(e,b[e]);if(b.style)d.style.cssText=b.style;if(b["class"])d.className=b["class"];if(c)d.innerHTML=c;return d},getValue:function(a){a=dhx.toNode(a);return!a?"":dhx.isNotDefined(a.value)?a.innerHTML:a.value},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else a&&a.parentNode&&a.parentNode.removeChild(a)},insertBefore:function(a,b,c){a&&(b&&b.parentNode?b.parentNode.insertBefore(a,
+b):c.appendChild(a))},locate:function(a,b){if(a.tagName)var c=a;else a=a||event,c=a.target||a.srcElement;for(;c;){if(c.getAttribute){var d=c.getAttribute(b);if(d)return d}c=c.parentNode}return null},offset:function(a){if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-
+h;return{y:Math.round(i),x:Math.round(j)}}else{for(j=i=0;a;)i+=parseInt(a.offsetTop,10),j+=parseInt(a.offsetLeft,10),a=a.offsetParent;return{y:i,x:j}}},pos:function(a){a=a||event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};var b=dhx.env.isIE&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:a.clientX+b.scrollLeft-b.clientLeft,y:a.clientY+b.scrollTop-b.clientTop}},preventEvent:function(a){a&&a.preventDefault&&a.preventDefault();return dhx.html.stopEvent(a)},stopEvent:function(a){(a||
+event).cancelBubble=!0;return!1},addCss:function(a,b){a.className+=" "+b},removeCss:function(a,b){a.className=a.className.replace(RegExp(" "+b,"g"),"")}};dhx.ready=function(a){this.ze?a.call():this.ob.push(a)};dhx.ob=[];
+(function(){var a=document.getElementsByTagName("SCRIPT");if(a.length)a=(a[a.length-1].getAttribute("src")||"").split("/"),a.splice(a.length-1,1),dhx.codebase=a.slice(0,a.length).join("/")+"/";dhx.event(window,"load",function(){dhx.callEvent("onReady",[]);dhx.delay(function(){dhx.ze=!0;for(var a=0;a<dhx.ob.length;a++)dhx.ob[a].call();dhx.ob=[]})})})();dhx.ui={};dhx.ui.zIndex=function(){return dhx.ui.hc++};dhx.ui.hc=1;
+dhx.ready(function(){dhx.event(document.body,"click",function(a){dhx.callEvent("onClick",[a||event])})});
+(function(){var a={};dhx.Template=function(b){if(typeof b=="function")return b;if(a[b])return a[b];b=(b||"").toString();if(b.indexOf("->")!=-1)switch(b=b.split("->"),b[0]){case "html":b=dhx.html.getValue(b[1]);break;case "http":b=(new dhx.ajax).sync().get(b[1],{uid:dhx.uid()}).responseText}b=(b||"").toString();b=b.replace(/(\r\n|\n)/g,"\\n");b=b.replace(/(\")/g,'\\"');b=b.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');b=b.replace(/\{common\.([^}\(]*)\}/g,"\"+(common.$1||'')+\"");
+b=b.replace(/\{common\.([^\}\(]*)\(\)\}/g,'"+(common.$1?common.$1(obj,common):"")+"');b=b.replace(/\{obj\.([^}]*)\}/g,"\"+(obj.$1||'')+\"");b=b.replace(/#([$a-z0-9_\[\]]+)#/gi,"\"+(obj.$1||'')+\"");b=b.replace(/\{obj\}/g,'"+obj+"');b=b.replace(/\{-obj/g,"{obj");b=b.replace(/\{-common/g,"{common");b='return "'+b+'";';try{Function("obj","common",b)}catch(c){}return a[b]=Function("obj","common",b)};dhx.Template.empty=function(){return""};dhx.Template.bind=function(a){return dhx.bind(dhx.Template(a),
+this)};dhx.Type=function(a,c){if(a.Ya){if(!a.Ga)a.Ga=[];a.Ga.push(c)}else{if(typeof a=="function")a=a.prototype;if(!a.types)a.types={"default":a.type},a.type.name="default";var d=c.name,e=a.type;d&&(e=a.types[d]=dhx.copy(a.type));for(var f in c)e[f]=f.indexOf("template")===0?dhx.Template(c[f]):c[f];return d}}})();
+dhx.AtomRender={xa:function(a){return this.a.template(a,this)},render:function(){if(this.isVisible(this.a.id)){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data)this.d.innerHTML=this.xa(this.data);this.callEvent&&this.callEvent("onAfterRender",[])}return!0}return!1},template_setter:dhx.Template};
+dhx.SingleRender=dhx.proto({xa:function(a){return this.type.templateStart(a,this.type)+this.type.template(a,this.type)+this.type.templateEnd(a,this.type)},customize:function(a){dhx.Type(this,a)}},dhx.AtomRender);
+dhx.Destruction={$init:function(){dhx.destructors.push(this)},destructor:function(){this.destructor=function(){};if(this.c)for(var a=0;a<this.c.length;a++)this.c[a].destructor();delete dhx.ui.views[this.a.id];this.af=this.B=null;this.F&&document.body.appendChild(this.F);this.F=null;if(this.g)this.g.innerHTML="",this.g.B=null;this.g=this.d=null;this.a.container&&this.b.parentNode?this.b.parentNode.parentNode.removeChild(this.b.parentNode):this.b&&this.b.parentNode&&this.b.parentNode.removeChild(this.b);
+this.data=null;this.o=this.ka={}}};dhx.destructors=[];dhx.event(window,"unload",function(){for(var a=0;a<dhx.destructors.length;a++)dhx.destructors[a].destructor();dhx.destructors=[];for(var b in dhx.o){var c=dhx.o[b];c[0].removeEventListener?c[0].removeEventListener(c[1],c[2],!1):c[0].detachEvent&&c[0].detachEvent("on"+c[1],c[2]);delete dhx.o[b]}});
+dhx.Settings={$init:function(){this.a=this.config={}},define:function(a,b){return typeof a=="object"?this.Uc(a):this.xc(a,b)},xc:function(a,b){var c=this[a+"_setter"];return this.a[a]=c?c.call(this,b,a):b},Uc:function(a){if(a)for(var b in a)this.xc(b,a[b])},Rb:function(a,b){var c={};b&&(c=dhx.extend(c,b));typeof a=="object"&&!a.tagName&&dhx.extend(c,a,!0);this.Uc(c)},Ia:function(a,b){for(var c in b)switch(typeof a[c]){case "object":a[c]=this.Ia(a[c]||{},b[c]);break;case "undefined":a[c]=b[c]}return a}};
+dhx.ajax=function(a,b,c){if(arguments.length!==0){var d=new dhx.ajax;if(c)d.master=c;d.get(a,null,b)}return!this.getXHR?new dhx.ajax:this};
+dhx.ajax.prototype={getXHR:function(){return dhx.env.isIE?new ActiveXObject("Microsoft.xmlHTTP"):new XMLHttpRequest},send:function(a,b,c){var d=this.getXHR();typeof c=="function"&&(c=[c]);if(typeof b=="object"){var e=[],f;for(f in b){var g=b[f];if(g===null||g===dhx.undefined)g="";e.push(f+"="+encodeURIComponent(g))}b=e.join("&")}b&&!this.post&&(a=a+(a.indexOf("?")!=-1?"&":"?")+b,b=null);d.open(this.post?"POST":"GET",a,!this.Te);this.post&&d.setRequestHeader("Content-type","application/x-www-form-urlencoded");
+var h=this;d.onreadystatechange=function(){if(!d.readyState||d.readyState==4){if(c&&h)for(var a=0;a<c.length;a++)c[a]&&c[a].call(h.master||h,d.responseText,d.responseXML,d);c=h=h.master=null}};d.send(b||null);return d},get:function(a,b,c){this.post=!1;return this.send(a,b,c)},post:function(a,b,c){this.post=!0;return this.send(a,b,c)},sync:function(){this.Te=!0;return this}};
+dhx.AtomDataLoader={$init:function(a){this.data={};if(a)this.a.datatype=a.datatype||"json",this.$ready.push(this.fe)},fe:function(){this.Xc=!0;this.a.url&&this.url_setter(this.a.url);this.a.data&&this.data_setter(this.a.data)},url_setter:function(a){if(!this.Xc)return a;this.load(a,this.a.datatype);return a},data_setter:function(a){if(!this.Xc)return a;this.parse(a,this.a.datatype);return!0},load:function(a,b,c){this.callEvent("onXLS",[]);typeof b=="string"?(this.data.driver=dhx.DataDriver[b],b=c):
+this.data.driver=dhx.DataDriver.json;dhx.ajax(a,[this.mb,b],this)},parse:function(a,b){this.callEvent("onXLS",[]);this.data.driver=dhx.DataDriver[b||"json"];this.mb(a,null)},mb:function(a,b){var c=this.data.driver,d=c.getRecords(c.toObject(a,b))[0];this.data=c?c.getDetails(d):a;this.callEvent("onXLE",[])},sc:function(a){if(!this.a.dataFeed||this.Gc||!a)return!0;var b=this.a.dataFeed,b=b+(b.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(a.id||a);this.callEvent("onXLS",[]);dhx.ajax(b,
+function(a){this.Gc=!0;this.setValues(dhx.DataDriver.json.toObject(a)[0]);this.Gc=!1;this.callEvent("onXLE",[])},this);return!1}};dhx.DataDriver={};dhx.DataDriver.json={toObject:function(a){a||(a="[]");if(typeof a=="string")eval("dhx.temp="+a),a=dhx.temp;if(a.data){var b=a.data;b.pos=a.pos;b.total_count=a.total_count;a=b}return a},getRecords:function(a){return a&&!dhx.isArray(a)?[a]:a},getDetails:function(a){return a},getInfo:function(a){return{da:a.total_count||0,ia:a.pos||0}}};
+dhx.DataDriver.json_ext={toObject:function(a){a||(a="[]");if(typeof a=="string"){var b;eval("temp="+a);dhx.temp=[];for(var c=b.header,d=0;d<b.data.length;d++){for(var e={},f=0;f<c.length;f++)typeof b.data[d][f]!="undefined"&&(e[c[f]]=b.data[d][f]);dhx.temp.push(e)}return dhx.temp}return a},getRecords:function(a){return a&&!dhx.isArray(a)?[a]:a},getDetails:function(a){return a},getInfo:function(a){return{da:a.total_count||0,ia:a.pos||0}}};
+dhx.DataDriver.html={toObject:function(a){if(typeof a=="string"){var b=null;a.indexOf("<")==-1&&(b=dhx.toNode(a));if(!b)b=document.createElement("DIV"),b.innerHTML=a;return b.getElementsByTagName(this.tag)}return a},getRecords:function(a){return a.tagName?a.childNodes:a},getDetails:function(a){return dhx.DataDriver.xml.tagToObject(a)},getInfo:function(){return{da:0,ia:0}},tag:"LI"};
+dhx.DataDriver.jsarray={toObject:function(a){return typeof a=="string"?(eval("dhx.temp="+a),dhx.temp):a},getRecords:function(a){return a},getDetails:function(a){for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{da:0,ia:0}}};
+dhx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(a){for(var a=this.stringToArray(a),b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{da:0,ia:0}},stringToArray:function(a){for(var a=a.split(this.cell),b=0;b<a.length;b++)a[b]=a[b].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"");return a},row:"\n",cell:","};
+dhx.DataDriver.xml={toObject:function(a,b){return b&&(b=this.checkResponse(a,b))?b:typeof a=="string"?this.fromString(a):a},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",getDetails:function(a){return this.tagToObject(a,{})},getInfo:function(a){return{da:a.documentElement.getAttribute("total_count")||0,ia:a.documentElement.getAttribute("pos")||0}},xpath:function(a,b){if(window.XPathResult){var c=a;if(a.nodeName.indexOf("document")==-1)a=a.ownerDocument;for(var d=[],e=
+a.evaluate(b,c,null,XPathResult.ANY_TYPE,null),f=e.iterateNext();f;)d.push(f),f=e.iterateNext();return d}else{var g=!0;try{typeof a.selectNodes=="undefined"&&(g=!1)}catch(h){}if(g)return a.selectNodes(b);else{var i=b.split("/").pop();return a.getElementsByTagName(i)}}},tagToObject:function(a,b){var b=b||{},c=!1,d=a.attributes;if(d&&d.length){for(var e=0;e<d.length;e++)b[d[e].name]=d[e].value;c=!0}for(var f=a.childNodes,g={},e=0;e<f.length;e++)if(f[e].nodeType==1){var h=f[e].tagName;typeof b[h]!="undefined"?
+(dhx.isArray(b[h])||(b[h]=[b[h]]),b[h].push(this.tagToObject(f[e],{}))):b[f[e].tagName]=this.tagToObject(f[e],{});c=!0}if(!c)return this.nodeValue(a);b.value=this.nodeValue(a);return b},nodeValue:function(a){return a.firstChild?a.firstChild.data:""},fromString:function(a){if(window.DOMParser)return(new DOMParser).parseFromString(a,"text/xml");if(window.ActiveXObject){var b=new ActiveXObject("Microsoft.xmlDOM");b.loadXML(a);return b}},checkResponse:function(a,b){if(b&&b.firstChild&&b.firstChild.tagName!=
+"parsererror")return b;var c=this.fromString(a.replace(/^[\s]+/,""));if(c)return c}};
+dhx.DataLoader=dhx.proto({$init:function(a){a=a||"";name="DataStore";this.data=a.datastore||new dhx.DataStore;this.Ub=this.data.attachEvent("onStoreLoad",dhx.bind(this.Ed,this))},load:function(a,b){dhx.AtomDataLoader.load.apply(this,arguments);if(!this.data.feed)this.data.url=a,this.data.feed=function(b,d){if(this.ib)return this.ib=[b,d];else this.ib=!0;this.load(a+(a.indexOf("?")==-1?"?":"&")+"start="+b+"&count="+d,function(){var a=this.ib;this.ib=!1;typeof a=="object"?this.data.feed.apply(this,
+a):this.showItem&&this.dataCount()>b+1&&this.showItem(this.idByIndex(b+1))})}},loadNext:function(a,b){this.data.feed&&this.data.feed.call(this,b||this.dataCount(),a)},mb:function(a,b){this.data.ue(this.data.driver.toObject(a,b));this.callEvent("onXLE",[]);if(this.Ub)this.data.detachEvent(this.Ub),this.Ub=null},scheme_setter:function(a){this.data.scheme(a)},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhx.bind(function(a,c){if(this.a.dataFeed){var d={};if(a||d){if(typeof a=="function"){if(!c)return;
+a(c,d)}else d={text:c};this.clearAll();var e=this.a.dataFeed,f=[],g;for(g in d)f.push("dhx_filter["+g+"]="+encodeURIComponent(d[g]));this.load(e+(e.indexOf("?")<0?"?":"&")+f.join("&"),this.a.datatype);return!1}}},this));return a},Ed:function(){if(this.a.ready){var a=dhx.toFunctor(this.a.ready);a&&a.call&&a.apply(this,arguments)}}},dhx.AtomDataLoader).prototype;dhx.DataStore=function(){this.name="DataStore";dhx.extend(this,dhx.EventSystem);this.setDriver("xml");this.pull={};this.order=dhx.toArray()};
+dhx.DataStore.prototype={setDriver:function(a){this.driver=dhx.DataDriver[a]},ue:function(a){this.callEvent("onParse",[this.driver,a]);this.p&&this.filter();var b=this.driver.getInfo(a),c=this.driver.getRecords(a),d=(b.ia||0)*1;if(d===0&&this.order[0])d=this.order.length;for(var e=0,f=0;f<c.length;f++){var g=this.driver.getDetails(c[f]),h=this.id(g);this.pull[h]||(this.order[e+d]=h,e++);this.pull[h]=g;this.extraParser&&this.extraParser(g);this.sb&&(this.tb?this.tb(g):this.ta&&this.ta(g))}if(!this.order[b.da-
+1])this.order[b.da-1]=dhx.undefined;this.callEvent("onStoreLoad",[this.driver,a]);this.refresh()},id:function(a){return a.id||(a.id=dhx.uid())},changeId:function(a,b){this.pull[b]=this.pull[a];this.pull[b].id=b;this.order[this.order.find(a)]=b;this.p&&(this.p[this.p.find(a)]=b);this.callEvent("onIdChange",[a,b]);this.Zb&&this.Zb(a,b);delete this.pull[a]},item:function(a){return this.pull[a]},update:function(a,b){this.ta&&this.ta(b);if(this.callEvent("onBeforeUpdate",[a,b])===!1)return!1;this.pull[a]=
+b;this.refresh(a)},refresh:function(a){this.hd||(a?this.callEvent("onStoreUpdated",[a,this.pull[a],"update"]):this.callEvent("onStoreUpdated",[null,null,null]))},silent:function(a,b){this.hd=!0;a.call(b||this);this.hd=!1},getRange:function(a,b){a=a?this.indexById(a):this.startOffset||0;b?b=this.indexById(b):(b=Math.min(this.endOffset||Infinity,this.dataCount()-1),b<0&&(b=0));if(a>b)var c=b,b=a,a=c;return this.getIndexRange(a,b)},getIndexRange:function(a,b){for(var b=Math.min(b||Infinity,this.dataCount()-
+1),c=dhx.toArray(),d=a||0;d<=b;d++)c.push(this.item(this.order[d]));return c},dataCount:function(){return this.order.length},exists:function(a){return!!this.pull[a]},move:function(a,b){if(!(a<0||b<0)){var c=this.idByIndex(a),d=this.item(c);this.order.removeAt(a);this.order.insertAt(c,Math.min(this.order.length,b));this.callEvent("onStoreUpdated",[c,d,"move"])}},scheme:function(a){this.sb=a;this.tb=a.$init;this.ta=a.$update;this.ad=a.$serialize;delete a.$init;delete a.$update;delete a.$serialize},
+sync:function(a,b,c){typeof b!="function"&&(c=b,b=null);if(dhx.debug_bind)this.debug_sync_master=a;if(a.name!="DataStore")a=a.data;var d=dhx.bind(function(){this.order=dhx.toArray([].concat(a.order));this.p=null;this.pull=a.pull;b&&this.silent(b);this.Tc&&this.Tc();c?c=!1:this.refresh()},this);a.attachEvent("onStoreUpdated",d);d()},add:function(a,b){if(this.sb){var a=a||{},c;for(c in this.sb)a[c]=a[c]||this.sb[c];this.tb?this.tb(a):this.ta&&this.ta(a)}var d=this.id(a),e=this.dataCount();if(dhx.isNotDefined(b)||
+b<0)b=e;b>e&&(b=Math.min(this.order.length,b));if(this.callEvent("onBeforeAdd",[d,a,b])===!1)return!1;if(this.exists(d))return null;this.pull[d]=a;this.order.insertAt(d,b);if(this.p){var f=this.p.length;!b&&this.order.length&&(f=0);this.p.insertAt(d,f)}this.callEvent("onafterAdd",[d,b]);this.callEvent("onStoreUpdated",[d,a,"add"]);return d},remove:function(a){if(dhx.isArray(a))for(var b=0;b<a.length;b++)this.remove(a[b]);else{if(this.callEvent("onBeforeDelete",[a])===!1)return!1;if(!this.exists(a))return null;
+var c=this.item(a);this.order.remove(a);this.p&&this.p.remove(a);delete this.pull[a];this.callEvent("onafterdelete",[a]);this.callEvent("onStoreUpdated",[a,c,"delete"])}},clearAll:function(){this.pull={};this.order=dhx.toArray();this.p=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){return this.order[a]},indexById:function(a){var b=this.order.find(a);return b},next:function(a,b){return this.order[this.indexById(a)+(b||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-
+1]},previous:function(a,b){return this.order[this.indexById(a)-(b||1)]},sort:function(a,b,c){var d=a;typeof a=="function"?d={as:a,dir:b}:typeof a=="string"&&(d={by:a,dir:b,as:c});var e=[d.by,d.dir,d.as];if(this.callEvent("onbeforesort",e)){if(this.order.length){var f=dhx.sort.create(d),g=this.getRange(this.first(),this.last());g.sort(f);this.order=g.map(function(a){return this.id(a)},this)}this.refresh();this.callEvent("onaftersort",e)}},filter:function(a,b,c){if(this.callEvent("onBeforeFilter",[a,
+b])){if(this.p&&!c)this.order=this.p,delete this.p;if(this.order.length){if(a){var d=a,b=b||"";typeof a=="string"&&(a=dhx.Template(a),b=b.toString().toLowerCase(),d=function(b,c){return a(b).toLowerCase().indexOf(c)!=-1});for(var e=dhx.toArray(),f=0;f<this.order.length;f++){var g=this.order[f];d(this.item(g),b)&&e.push(g)}if(!c)this.p=this.order;this.order=e}this.refresh();this.callEvent("onAfterFilter",[])}}},each:function(a,b){for(var c=0;c<this.order.length;c++)a.call(b||this,this.item(this.order[c]))},
+provideApi:function(a,b){this.debug_bind_master=a;b&&this.mapEvent({onbeforesort:a,onaftersort:a,onbeforeadd:a,onafteradd:a,onbeforedelete:a,onafterdelete:a,onbeforeupdate:a});for(var c="sort,add,remove,exists,idByIndex,indexById,item,update,refresh,dataCount,filter,next,previous,clearAll,first,last,serialize,sync".split(","),d=0;d<c.length;d++)a[c[d]]=dhx.methodPush(this,c[d])},serialize:function(){for(var a=this.order,b=[],c=0;c<a.length;c++){var d=this.pull[a[c]];if(this.ad&&(d=this.ad(d),d===
+!1))continue;b.push(d)}return b}};
+dhx.sort={create:function(a){return dhx.sort.dir(a.dir,dhx.sort.by(a.by,a.as))},as:{"int":function(a,b){a*=1;b*=1;return a>b?1:a<b?-1:0},string_strict:function(a,b){a=a.toString();b=b.toString();return a>b?1:a<b?-1:0},string:function(a,b){a=a.toString().toLowerCase();b=b.toString().toLowerCase();return a>b?1:a<b?-1:0}},by:function(a,b){if(!a)return b;typeof b!="function"&&(b=dhx.sort.as[b||"string"]);a=dhx.Template(a);return function(c,d){return b(a(c),a(d))}},dir:function(a,b){return a=="asc"?b:
+function(a,d){return b(a,d)*-1}}};
+dhx.BaseBind={bind:function(a,b,c){typeof a=="string"&&(a=dhx.ui.get(a));a.Lb&&a.Lb();this.Lb&&this.Lb();a.getBindData||dhx.extend(a,dhx.BindSource);if(!this.zd){var d=this.render;if(this.filter){var e=this.a.id;this.data.Tc=function(){a.Va[e]=!1}}this.render=function(){if(!this.Hc)return this.Hc=!0,this.callEvent("onBindRequest"),this.Hc=!1,d.call(this)};if(this.getValue||this.getValues)this.save=function(){if(!this.validate||this.validate())a.setBindData(this.getValue?this.getValue:this.getValues(),
+this.a.id)};this.zd=!0}a.addBind(this.a.id,b,c);this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){a.getBindData(this.a.id)});this.isVisible(this.a.id)&&this.refresh()}};
+dhx.BindSource={$init:function(){this.Ua={};this.Va={};this.Kb={};this.Ad(this)},setBindData:function(a,b){b&&(this.Kb[b]=!0);if(this.setValue)this.setValue(a);else if(this.setValues)this.setValues(a);else{var c=this.getCursor();c&&(a=dhx.extend(this.item(c),a,!0),this.update(c,a))}this.callEvent("onBindUpdate",[a,b]);this.save&&this.save();b&&(this.Kb[b]=!1)},getBindData:function(a,b){if(!this.Va[a]){var c=dhx.ui.get(a);c.isVisible(c.a.id)&&(this.Va[a]=!0,this.Ab(c,this.Ua[a][0],this.Ua[a][1]),b&&
+c.filter&&c.refresh())}},addBind:function(a,b,c){this.Ua[a]=[b,c]},Ad:function(a){a.filter?dhx.extend(this,dhx.CollectionBind):a.setValue?dhx.extend(this,dhx.ValueBind):dhx.extend(this,dhx.RecordBind)},vb:function(){for(var a in this.Ua)this.Kb[a]||(this.Va[a]=!1,this.getBindData(a,!0))},nc:function(a,b,c){a.setValue?a.setValue(c?c[b]:c):a.filter?a.data.silent(function(){this.filter(b,c)}):!c&&a.clear?a.clear():a.sc(c)&&a.setValues(dhx.copy(c))}};
+dhx.DataValue=dhx.proto({name:"DataValue",isVisible:function(){return!0},$init:function(a){var b=(this.data=a)&&a.id?a.id:dhx.uid();this.a={id:b};dhx.ui.views[b]=this},setValue:function(a){this.data=a;this.callEvent("onChange",[a])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind);
+dhx.DataRecord=dhx.proto({name:"DataRecord",isVisible:function(){return!0},$init:function(a){this.data=a||{};var b=a&&a.id?a.id:dhx.uid();this.a={id:b};dhx.ui.views[b]=this},getValues:function(){return this.data},setValues:function(a){this.data=a;this.callEvent("onChange",[a])},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind);
+dhx.DataCollection=dhx.proto({name:"DataCollection",isVisible:function(){return!this.data.order.length&&!this.data.p&&!this.a.dataFeed?!1:!0},$init:function(a){this.data.provideApi(this,!0);var b=a&&a.id?a.id:dhx.uid();this.a.id=b;dhx.ui.views[b]=this;this.data.attachEvent("onStoreLoad",dhx.bind(function(){this.callEvent("onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},dhx.EventSystem,dhx.DataLoader,dhx.BaseBind,dhx.Settings);
+dhx.ValueBind={$init:function(){this.attachEvent("onChange",this.vb)},Ab:function(a,b,c){var d=this.getValue()||"";c&&(d=c(d));if(a.setValue)a.setValue(d);else if(a.filter)a.data.silent(function(){this.filter(b,d)});else{var e={};e[b]=d;a.sc(d)&&a.setValues(e)}}};dhx.RecordBind={$init:function(){this.attachEvent("onChange",this.vb)},Ab:function(a,b){var c=this.getValues()||null;this.nc(a,b,c)}};
+dhx.CollectionBind={$init:function(){this.X=null;this.attachEvent("onSelectChange",function(){this.setCursor(this.getSelected())});this.attachEvent("onAfterCursorChange",this.vb);this.data.attachEvent("onStoreUpdated",dhx.bind(function(a){a&&a==this.getCursor()&&this.vb()},this));this.data.attachEvent("onClearAll",dhx.bind(function(){this.X=null},this));this.data.attachEvent("onIdChange",dhx.bind(function(a,b){if(this.X==a)this.X=b},this))},setCursor:function(a){if(!(a==this.X||a!==null&&!this.item(a)))this.callEvent("onBeforeCursorChange",
+[this.X]),this.X=a,this.callEvent("onAfterCursorChange",[a])},getCursor:function(){return this.X},Ab:function(a,b){var c=this.item(this.getCursor())||null;this.nc(a,b,c)}};
+dhx.DragControl={N:dhx.toArray(["dummy"]),addDrop:function(a,b,c){a=dhx.toNode(a);a.dhx_drop=this.zc(b);if(c)a.dhx_master=!0},zc:function(a){var a=a||dhx.DragControl,b=this.N.find(a);if(b<0)b=this.N.length,this.N.push(a);return b},addDrag:function(a,b){a=dhx.toNode(a);a.dhx_drag=this.zc(b);dhx.event(a,"mousedown",this.ve,a)},ve:function(a){dhx.DragControl.O&&(dhx.DragControl.Sb(),dhx.DragControl.destroyDrag());dhx.DragControl.O=this;dhx.DragControl.jd={x:a.pageX,y:a.pageY};dhx.DragControl.$c=a;dhx.DragControl.Ea=
+dhx.event(document.body,"mousemove",dhx.DragControl.Pe);dhx.DragControl.Fa=dhx.event(document.body,"mouseup",dhx.DragControl.Sb);a.cancelBubble=!0;return!1},Sb:function(){dhx.DragControl.Ea=dhx.eventRemove(dhx.DragControl.Ea);dhx.DragControl.Fa=dhx.eventRemove(dhx.DragControl.Fa)},Pe:function(a){var b={x:a.pageX,y:a.pageY};if(!(Math.abs(b.x-dhx.DragControl.jd.x)<5&&Math.abs(b.y-dhx.DragControl.jd.y)<5)&&(dhx.DragControl.Sb(),dhx.DragControl.createDrag(dhx.DragControl.$c)))dhx.DragControl.sendSignal("start"),
+dhx.DragControl.Ea=dhx.event(document.body,"mousemove",dhx.DragControl.Oc),dhx.DragControl.Fa=dhx.event(document.body,"mouseup",dhx.DragControl.Qe),dhx.DragControl.Oc(a)},Qe:function(a){dhx.DragControl.Ea=dhx.eventRemove(dhx.DragControl.Ea);dhx.DragControl.Fa=dhx.eventRemove(dhx.DragControl.Fa);dhx.DragControl.$c=null;dhx.DragControl.C&&(dhx.DragControl.onDrop(dhx.DragControl.O,dhx.DragControl.C,this.gb,a),dhx.DragControl.onDragOut(dhx.DragControl.O,dhx.DragControl.C,null,a));dhx.DragControl.destroyDrag();
+dhx.DragControl.sendSignal("stop")},Oc:function(a){var b=dhx.html.pos(a);dhx.DragControl.F.style.top=b.y+dhx.DragControl.top+"px";dhx.DragControl.F.style.left=b.x+dhx.DragControl.left+"px";dhx.DragControl.gd?dhx.DragControl.gd=!1:dhx.DragControl.Fd(a.srcElement||a.target,a);a.cancelBubble=!0;return!1},Fd:function(a,b){for(;a&&a.tagName!="BODY";){if(a.dhx_drop){if(this.C&&(this.C!=a||a.dhx_master))this.onDragOut(this.O,this.C,a,b);if(!this.C||this.C!=a||a.dhx_master)if(this.C=null,this.gb=this.onDragIn(dhx.DragControl.O,
+a,b))this.C=a;return}a=a.parentNode}if(this.C)this.C=this.gb=this.onDragOut(this.O,this.C,null,b)},sendSignal:function(a){dhx.DragControl.active=a=="start"},getMaster:function(a){return this.N[a.dhx_drag||a.dhx_drop]},getContext:function(){return this.Za},getNode:function(){return this.F},createDrag:function(a){var b=dhx.DragControl.O;dhx.DragControl.Za={};var c=this.N[b.dhx_drag],d;if(c.onDragCreate){d=c.onDragCreate(b,a);if(!d)return!1;d.style.position="absolute";d.style.zIndex=dhx.ui.zIndex()}else{var e=
+dhx.DragControl.onDrag(b,a);if(!e)return!1;d=document.createElement("DIV");d.innerHTML=e;d.className="dhx_drag_zone";document.body.appendChild(d)}d.onmousemove=dhx.DragControl.Ne;if(!dhx.DragControl.Za.from)dhx.DragControl.Za={source:b,from:b};dhx.DragControl.F=d;return!0},Ne:function(){dhx.DragControl.gd=!0},destroyDrag:function(){var a=dhx.DragControl.O,b=this.N[a.dhx_drag];if(b&&b.onDragDestroy)b.onDragDestroy(a,dhx.DragControl.F);else dhx.html.remove(dhx.DragControl.F);dhx.DragControl.gb=dhx.DragControl.O=
+dhx.DragControl.C=dhx.DragControl.F=null},top:5,left:5,onDragIn:function(a,b,c){var d=this.N[b.dhx_drop];if(d.onDragIn&&d!=this)return d.onDragIn(a,b,c);b.className+=" dhx_drop_zone";return b},onDragOut:function(a,b,c,d){var e=this.N[b.dhx_drop];if(e.onDragOut&&e!=this)return e.onDragOut(a,b,c,d);b.className=b.className.replace("dhx_drop_zone","");return null},onDrop:function(a,b,c,d){var e=this.N[b.dhx_drop];dhx.DragControl.Za.from=dhx.DragControl.getMaster(a);if(e.onDrop&&e!=this)return e.onDrop(a,
+b,c,d);b.appendChild(a)},onDrag:function(a,b){var c=this.N[a.dhx_drag];return c.onDrag&&c!=this?c.onDrag(a,b):"<div style='"+a.style.cssText+"'>"+a.innerHTML+"</div>"}};
+dhx.DataMove={$init:function(){},copy:function(a,b,c,d){var e=this.item(a);if(e)return c&&(e=c.externalData(e)),c=c||this,c.add(c.externalData(e,d),b)},move:function(a,b,c,d){if(dhx.isArray(a))for(var e=0;e<a.length;e++){var f=(c||this).indexById(this.move(a[e],b,c,d?d[e]:null));a[e+1]&&(b=f+(this.indexById(a[e+1])<f?0:1))}else{var g=a;if(!(b<0)){var h=this.item(a);if(h){if(!c||c==this)this.data.move(this.indexById(a),b);else{if(!d||c.item(d))d=dhx.uid();g=c.add(c.externalData(h,d),b);this.remove(a)}return g}}}},
+moveUp:function(a,b){return this.move(a,this.indexById(a)-(b||1))},moveDown:function(a,b){return this.moveUp(a,(b||1)*-1)},moveTop:function(a){return this.move(a,0)},moveBottom:function(a){return this.move(a,this.data.dataCount()-1)},externalData:function(a,b){var c=dhx.extend({},a);c.id=b||dhx.uid();c.$selected=c.$template=null;return c}};
+dhx.Movable={move_setter:function(a){if(a)this.kb=dhx.copy(this.kb),this.kb.master=this,dhx.DragControl.addDrag(this.eb,this.kb)},kb:{onDragCreate:function(a,b){var c=dhx.html.offset(a),d=dhx.html.pos(b);dhx.DragControl.top=c.y-d.y;dhx.DragControl.left=c.x-d.x;return dhx.toNode(this.master.b)},onDragDestroy:function(){dhx.DragControl.top=dhx.DragControl.left=5}}};
+dhx.Scrollable={$init:function(a){if(a&&!a.scroll&&this.se)return this.d=this.d||this.g;(this.d||this.g).appendChild(dhx.html.create("DIV",{"class":"dhx_scroll_cont"},""));this.d=(this.d||this.g).firstChild},scrollSize:dhx.Touch?0:18,scroll_setter:function(a){if(!a)return!1;dhx.Touch?(a=a=="x"?"x":a=="xy"?"xy":"y",this.d.setAttribute("touch_scroll",a),this.attachEvent&&this.attachEvent("onAfterRender",dhx.bind(this.Ae,this)),this.a.touch_scroll=!0):this.d.parentNode.style.overflowY=a?"scroll":"";
+return a},scrollState:function(){if(dhx.Touch){var a=dhx.Touch.Hb(this.d);return{x:-a.e,y:-a.f}}else return{x:this.d.parentNode.scrollLeft,y:this.d.parentNode.scrollTop}},scrollTo:function(a,b){dhx.Touch?(b=Math.max(0,Math.min(b,this.d.offsetHeight-this.m)),a=Math.max(0,Math.min(a,this.d.offsetWidth-this.j)),dhx.Touch.wa(this.d,-a,-b,this.a.scrollSpeed||"100ms")):(this.d.parentNode.scrollLeft=a,this.d.parentNode.scrollTop=b)},Ae:function(){if(this.a.scroll.indexOf("x")!=-1&&!this.Yd)this.d.style.width=
+this.j+"px",this.d.style.width=this.d.scrollWidth+"px";dhx.Touch&&this.a.touch_scroll&&(dhx.Touch.Ca(),dhx.Touch.ua(),dhx.Touch.wa(this.d,0,0,0))}};
+dhx.ActiveContent={$init:function(a){if(a.activeContent){this.$ready.push(this.be);this.Qa={};this.Ra={};this.za={};this.yb={};for(var b in a.activeContent)if(this[b]=this.yd(b),a.activeContent[b].earlyInit){var c=dhx.D;dhx.D=null;this[b].call(this,{},this,a.activeContent);dhx.D=c}}},be:function(){if(this.filter){for(var a in this.a.activeContent)this.type[a]=this[a],this[a]=this.ge(a);this.type.masterUI=this}},ge:function(a){return function(b){for(var c=this.yb[a],d=c.a.id,e=this.pa(b).getElementsByTagName("DIV"),
+f=0;f<e.length;f++)if(e[f].getAttribute("view_id")==d){c.b=c.d=e[f];break}return c}},Vd:function(a,b,c){return function(d){if(d)for(var e=d.target||d.srcElement;e;){if(e.getAttribute&&e.getAttribute("view_id")){a.d=a.b=e;if(c.locate){var f=c.locate(e.parentNode),g=c.za[b][f];a.a.value=g}return e}e=e.parentNode}return a.b}},Ke:function(a,b){return function(c){var d=b.data;if(b.filter){var e=b.locate(this.b.parentNode),d=b.item(e);b.Ra[a][e]=this.b.outerHTML||(new XMLSerializer).serializeToString(this.b);
+b.za[a][e]=c}d[a]=c}},yd:function(a){return function(b,c,d){var e=c.Qa?c:c.masterUI;if(!e.Qa[a]){var f=document.createElement("DIV"),d=d||e.a.activeContent,g=dhx.ui(d[a],f);g.getNode=e.Vd(g,a,e);g.attachEvent("onChange",e.Ke(a,e));e.yb[a]=g;e.Qa[a]=f.innerHTML;e.Ra[a]={};e.za[a]={}}e.filter&&b[a]!=e.za[a]&&!dhx.isNotDefined(b[a])&&(g=e.yb[a],g.blockEvent(),g.setValue(b[a]),g.unblockEvent(),e.za[a][b.id]=b[a],e.Ra[a][b.id]=g.b.outerHTML||(new XMLSerializer).serializeToString(g.b));return e.Ra[a][b.id]||
+e.Qa[a]}}};dhx.IdSpace={$init:function(){var a=dhx.ja;this.elements={};dhx.ja=this;this.od={};this.getTopParent=dhx.bind(function(){return this},this);this.$ready.push(function(){dhx.ja=a;for(var b in this.elements)this.elements[b].mapEvent&&!this.elements[b].touchable&&this.elements[b].mapEvent({onbeforetabclick:this,onaftertabclick:this,onitemclick:this}),this.elements[b].getTopParent=this.getTopParent})},$$:function(a){return this.elements[a]},innerId:function(a){return this.od[a]}};
+(function(){var a=[],b=dhx.ui=function(c,d,e){dhx.qd=!0;var f=c,f=dhx.toNode(c.container||d||document.body),g=c.a||f.c&&!e?c:b.Oa(c);f.appendChild?(f.appendChild(g.b),!g.setPosition&&f==document.body&&a.push(g),c.skipResize||g.resize()):f.ac&&(g.getParent&&g.getParent()&&g.getParent().Zc(g),f.ac(g,e));dhx.qd=!1;return g};dhx.ui.rd=function(a){return a+(this.Pc[a]=(this.Pc[a]||0)+1)};dhx.ui.Pc={};dhx.ui.resize=function(){if(!dhx.ui.yc)for(var b=0;b<a.length;b++)a[b].resize()};dhx.event(window,"resize",
+dhx.ui.resize);b.Eb={};b.delay=function(a){dhx.ui.Eb[a.id]=a};dhx.ui.zIndex=function(){return dhx.ui.hc++};dhx.ui.hc=1;b.Oa=function(a){if(a.view){var d=a.view;delete a.view;return new b[d](a)}else return a.rows||a.cols?new b.layout(a):a.cells?new b.multiview(a):new b.template(a)};b.views={};b.get=function(a){if(!a)return null;if(b.views[a])return b.views[a];if(b.Eb[a])return dhx.ui(b.Eb[a]);var d=a;if(typeof a=="object"){if(a.a)return a;d=a.target||a.srcElement||a}return b.views[dhx.html.locate({target:dhx.toNode(d)},
+"view_id")]};if(dhx.isNotDefined(window.$$))$$=b.get;dhx.protoUI({name:"baseview",$init:function(a){if(!a.id)a.id=dhx.ui.rd(this.name);this.D=dhx.D;dhx.D=null;this.$view=this.g=this.b=dhx.html.create("DIV",{"class":"dhx_view"})},defaults:{width:-1,height:-1,gravity:1},getNode:function(){return this.b},getParent:function(){return this.D||null},isVisible:function(a){if(this.a.hidden&&a){if(!this.la)this.la=[],this.Jb={};this.Jb[a]||(this.Jb[a]=!0,this.la.push(a));return!1}var b=this.getParent();return b?
+b.isVisible(a,this.a.id):!0},container_setter:function(){return!0},css_setter:function(a){this.b.className+=" "+a;return a},id_setter:function(a){if(dhx.ja&&dhx.ja!=this){var b=a;dhx.ja.elements[a]=this;a=dhx.ui.rd(this.name);dhx.ja.od[a]=b}dhx.ui.views[a]=this;this.b.setAttribute("view_id",a);return a},$setSize:function(a,b){if(this.$&&this.$[0]==a&&this.$[1]==b)return!1;this.$=[a,b];this.j=a;this.j=a-(this.a.scroll?dhx.Scrollable.scrollSize:0);this.m=b;this.$width=this.j;this.$height=this.m;this.b.style.width=
+a+"px";this.b.style.height=b+"px";return!0},$getSize:function(){var a=this.a.width,b=this.a.height,e,f;e=f=this.a.gravity;a==-1?a=0:(e=0,a+=this.a.scroll?dhx.Scrollable.scrollSize:0);b==-1?b=0:f=0;return[e,a,f,b]},show:function(a){if(this.getParent()){var b=this.getParent();!a&&this.a.animate&&b.a.animate&&(a=dhx.extend(b.a.animate?dhx.extend({},b.a.animate):{},this.a.animate,!0));var e=arguments.length<2;if(e?b.Ma:b.Ha)(e?b.Ma:b.Ha).call(b,this,a)}},hidden_setter:function(a){a&&this.hide();return this.a.hidden},
+hide:function(){this.show(null,!0)},resize:function(){var a=this.b;if(!this.D)a=a.parentNode;if(!this.b.parentNode)return!1;var b=this.b.parentNode.offsetWidth,e=this.b.parentNode.offsetHeight,f=this.$getSize(),b=f[0]?Math.max(b,f[1]):Math.max(f[1],b),e=f[2]?Math.max(e,f[3]):Math.max(f[3],e);this.$setSize(b,e)}},dhx.Settings,dhx.Destruction,dhx.BaseBind);dhx.protoUI({name:"view",$init:function(){this.g.style.border="1px solid #AEAEAE"},$getSize:function(){var a=this.a.k,b=dhx.ui.baseview.prototype.$getSize.call(this);
+if(!a)return b;var e=(a.left?0:1)+(a.right?0:1),f=(a.top?0:1)+(a.bottom?0:1);b[1]&&e&&(b[1]+=e);b[3]&&f&&(b[3]+=f);return b},$setSize:function(a,b){var e=this.a.k;e?(a-=(e.left?0:1)+(e.right?0:1),b-=(e.top?0:1)+(e.bottom?0:1)):this.g.style.border="0px solid #AEAEAE";return dhx.ui.baseview.prototype.$setSize.call(this,a,b)}},dhx.ui.baseview)})();dhx.ui.view.call(dhx);
+dhx.protoUI({name:"baselayout",$init:function(){this.$ready.push(this.T);this.d=this.g},rows_setter:function(a){this.r=1;this.wc="";this.Q=a},cols_setter:function(a){this.r=0;this.wc="left";this.Q=a},Zc:function(a){dhx.PowerArray.removeAt.call(this.c,dhx.PowerArray.find.call(this.c,a));this.resizeChildren(!0)},ac:function(a,b){if(dhx.isNotDefined(b)){for(var c=0;c<this.c.length;c++)this.c[c].destructor();this.Q=a;this.T()}else{if(typeof b=="number"){if(b<0||b>this.c.length)b=this.c.length;var d=(this.c[b]||
+{}).b;dhx.PowerArray.insertAt.call(this.c,a,b);dhx.html.insertBefore(a.b,d,this.d)}else{var e=dhx.ui.get(b),b=dhx.PowerArray.find.call(this.c,e);e.b.parentNode.insertBefore(a.b,e.b);e.destructor();this.c[b]=a}a.b.style.cssFloat=a.b.style.styleFloat=this.wc;this.c[b].D=this}this.resizeChildren()},reconstruct:function(){for(var a=0;a<this.c.length;a++)dhx.html.remove(this.c[a].b);this.T();this.$setSize(this.$[0],this.$[1])},Ha:function(a,b,c){if(!a.a.hidden)a.a.hidden=!0,dhx.html.remove(a.b),this.fb++,
+!c&&!dhx.qd&&this.resizeChildren(!0)},resizeChildren:function(){if(this.hb){var a=this.$getSize(),b=this.hb[0],c=this.hb[1];this.va(b,c)}},index:function(a){if(a.a)a=a.a.id;for(var b=0;b<this.c.length;b++)if(this.c[b].a.id==a)return b;return-1},Ma:function(a,b,c){if(a.a.hidden)a.a.hidden=!1,dhx.html.insertBefore(a.b,(this.c[this.index(a)+1]||{}).b,this.d||this.b),this.fb--,c||this.resizeChildren(!0)},showBatch:function(a){if(this.a.visibleBatch!=a){this.a.visibleBatch=a;for(var b=[],c=0;c<this.c.length;c++)this.c[c].a.batch||
+b.push(this.c[c]),this.c[c].a.batch==a?b.push(this.c[c]):this.Ha(this.c[c],null,!0);for(c=0;c<b.length;c++)this.Ma(b[c],null,!0);this.resizeChildren()}},T:function(a){a=this.Q||a;this.Q=null;this.c=[];this.b.style.verticalAlign="top";for(var b=0;b<a.length;b++){dhx.D=this;this.c[b]=dhx.ui.Oa(a[b],this);if(!this.r)this.c[b].b.style.cssFloat=this.c[b].b.style.styleFloat="left";if(this.a.visibleBatch&&this.a.visibleBatch!=this.c[b].a.batch&&this.c[b].a.batch)this.c[b].a.hidden=!0;this.c[b].a.hidden||
+(this.d||this.g).appendChild(this.c[b].b)}},$getSize:function(){var a=0,b=0,c=0,d=0;this.U=[];for(var e=0;e<this.c.length;e++)if(!this.c[e].a.hidden){var f=this.U[e]=this.c[e].$getSize();this.r?(a=Math.max(a,f[1]),c=Math.max(c,f[0]),b+=f[3],d+=f[2]):(b=Math.max(b,f[3]),d=Math.max(d,f[2]),a+=f[1],c+=f[0])}this.jb=[c,a,d,b];if(this.a.height>-1)b=this.a.height,d=0;if(this.a.width>-1)a=this.a.width,c=0;this.r?(a&&(c=0),d&&(b=0)):(b&&(d=0),c&&(a=0));return[c,a,d,b]},$setSize:function(a,b){this.hb=[a,b];
+dhx.ui.baseview.prototype.$setSize.call(this,a,b);this.va(a,b)},va:function(a,b){for(var c=a-this.jb[1],d=b-this.jb[3],e=this.jb[0],f=this.jb[2],g=this.c.length-1,h=0;h<this.c.length;h++)if(!this.c[h].a.hidden){if(this.r){var i=a,j;this.U[h][2]?(j=Math.round(this.U[h][2]*d/f),d-=j,f-=this.U[h][2]):(j=this.U[h][3],h==g&&d>0&&(j+=d))}else j=b,this.U[h][0]?(i=Math.round(this.U[h][0]*c/e),c-=i,e-=this.U[h][0]):(i=this.U[h][1],h==g&&c>0&&(i+=c));this.c[h].$setSize(i,j)}},ef:function(a,b){var c=this.index(a);
+return c==-1?null:this.c[c+b]},first:function(){return this.c[0]}},dhx.ui.baseview);
+dhx.protoUI({name:"layout",$init:function(){this.fb=0},T:function(){this.b.className+=" dhx_layout_"+(this.a.type||"");if(this.a.margin)this.S=this.a.margin;if(this.a.padding)this.u=this.a.padding;var a=this.Q;if(!this.a.k)this.a.k={top:!0,left:!0,right:!0,bottom:!0};this.mc(a);dhx.ui.baselayout.prototype.T.call(this,a);this.kc(a)},$getSize:function(){var a=dhx.ui.baselayout.prototype.$getSize.call(this),b=this.S*(this.c.length-this.fb-1);this.r?a[3]&&(a[3]+=b):a[1]&&(a[1]+=b);if(this.u&&(a[1]&&(a[1]+=
+this.u*2),a[3]&&(a[3]+=this.u*2),this.S>-1)){var c=this.a.k;if(c){var d=(c.left?0:1)+(c.right?0:1),e=(c.top?0:1)+(c.bottom?0:1);a[1]&&d&&(a[1]+=d);a[3]&&e&&(a[3]+=e)}}return a},$setSize:function(a,b){this.hb=[a,b];this.u&&this.S>0?dhx.ui.view.prototype.$setSize.call(this,a,b):dhx.ui.baseview.prototype.$setSize.call(this,a,b);this.va(this.j,this.m)},va:function(a,b){var c=this.S*(this.c.length-this.fb-1);this.r?(b-=c+this.u*2,a-=this.u*2):(a-=c+this.u*2,b-=this.u*2);return dhx.ui.baselayout.prototype.va.call(this,
+a,b)},resizeChildren:function(a){if(a&&this.type!="clean"){for(var b=[],c=0;c<this.c.length;c++){var d=this.c[c];b[c]=d.a;d.b.style.borderTopWidth=d.b.style.borderBottomWidth=d.b.style.borderLeftWidth=d.b.style.borderRightWidth="1px"}this.mc(b);this.kc(this.c)}dhx.ui.baselayout.prototype.resizeChildren.call(this)},mc:function(a){if(this.u&&this.S)for(var b=0;b<a.length;b++)a[b].k={top:!1,left:!1,right:!1,bottom:!1};else{for(b=0;b<a.length;b++)a[b].k=dhx.copy(this.a.k);var c=!1;this.a.type=="clean"&&
+(c=!0);if(this.r){for(b=1;b<a.length-1;b++)a[b].k.top=a[b].k.bottom=c;if(a.length>1){if(this.a.type!="head")a[0].k.bottom=c;a[a.length-1].k.top=c}}else{for(b=1;b<a.length-1;b++)a[b].k.left=a[b].k.right=c;if(a.length>1){if(this.a.type!="head")a[0].k.right=c;a[a.length-1].k.left=c}}}},kc:function(a){for(var b=1,c=0;c<a.length;c++){var d=this.c[c];if(d.a.hidden&&this.c[c+1])this.c[c+1].a.k=d.a.k,c<b&&b++;var e=d.a.k;if(e.top)d.b.style.borderTopWidth="0px";if(e.left)d.b.style.borderLeftWidth="0px";if(e.right)d.b.style.borderRightWidth=
+"0px";if(e.bottom)d.b.style.borderBottomWidth="0px"}if(this.u){for(var f=this.r?"marginLeft":"marginTop",g=this.r?"marginTop":"marginLeft",c=0;c<a.length;c++)this.c[c].b.style[f]=this.u+"px";this.c[0].b.style[g]=this.u+"px"}for(var f=this.r?"marginTop":"marginLeft",h=0;h<b;h++)this.c[h].b.style[f]="0px";for(;h<a.length;h++)this.c[h].b.style[f]=this.S+"px"},type_setter:function(a){this.S=this.je[a];if((this.u=this.te[a])&&this.S>0)this.g.style.border="1px solid #AEAEAE";return a},je:{space:10,wide:4,
+clean:0,head:4,line:-1},te:{space:10,wide:0,clean:0,head:0,line:0},S:-1,u:0},dhx.ui.baselayout);dhx.ui.layout.call(dhx);
+dhx.protoUI({name:"template",$init:function(){this.attachEvent("onXLE",this.render)},setValues:function(a){this.data=a;this.render()},defaults:{template:dhx.Template.empty,loading:!0},Wc:function(){this.Pb||this.render()},src_setter:function(a){this.Pb=!0;this.callEvent("onXLS",[]);dhx.ajax(a,dhx.bind(function(a){this.a.template=dhx.Template(a);this.Pb=!1;this.Wc();this.callEvent("onXLE",[])},this));return a},content_setter:function(a){if(a)this.Pb=!0,this.d.appendChild(dhx.toNode(a))},refresh:function(){this.render()},
+waitMessage_setter:function(a){dhx.extend(this,dhx.ui.overlay);return a},$setSize:function(a,b){dhx.ui.view.prototype.$setSize.call(this,a,b)&&this.Wc()},se:!0},dhx.Scrollable,dhx.AtomDataLoader,dhx.AtomRender,dhx.EventSystem,dhx.ui.view);
+dhx.protoUI({name:"iframe",defaults:{loading:!0},$init:function(){this.d=this.g;this.g.innerHTML="<iframe style='width:100%; height:100%' frameborder='0' src='about:blank'></iframe>"},load:function(a){this.src_setter(a)},src_setter:function(a){this.g.childNodes[0].src=a;this.callEvent("onXLS",[]);dhx.delay(this.Je,this);return a},Je:function(){try{dhx.event(this.getWindow(),"load",dhx.bind(function(){this.callEvent("onXLS",[])},this))}catch(a){this.callEvent("onXLE",[])}},getWindow:function(){return this.g.childNodes[0].contentWindow},
+waitMessage_setter:function(a){dhx.extend(this,dhx.ui.overlay);return a}},dhx.ui.view,dhx.EventSystem);
+dhx.ui.overlay={$init:function(){if(dhx.isNotDefined(this.ba)&&this.attachEvent)this.attachEvent("onXLS",this.showOverlay),this.attachEvent("onXLE",this.hideOverlay),this.ba=null},showOverlay:function(){if(!this.ba)this.ba=dhx.html.create("DIV",{"class":"dhx_loading_overlay"},""),dhx.html.insertBefore(this.ba,this.b.firstChild,this.b)},hideOverlay:function(){if(this.ba)dhx.html.remove(this.ba),this.ba=null}};
+dhx.protoUI({name:"scrollview",defaults:{scroll:"x",scrollSpeed:"0ms"},$init:function(){this.b.className+=" dhx_scrollview"},content_setter:function(a){this.ha=dhx.ui.Oa(a);this.ha.D=this;this.d.appendChild(this.ha.b)},body_setter:function(a){return this.content_setter(a)},$getSize:function(){this.ga=this.ha.$getSize();if(this.a.scroll=="x"&&this.ga[3]>0)this.a.height=this.ga[3];else if(this.a.scroll=="y"&&this.ga[1]>0)this.a.width=this.ga[1];return dhx.ui.view.prototype.$getSize.call(this)},$setSize:function(a,
+b){if(dhx.ui.view.prototype.$setSize.call(this,a,b))this.ha.$setSize(Math.max(this.ga[1],this.j),Math.max(this.ga[3],this.m)),this.d.style.width=this.ha.j+"px",this.d.style.height=this.ha.m+"px"}},dhx.Scrollable,dhx.ui.view);dhx.CanvasMgr=function(a){var b=dhx.CanvasMgr.prototype.qc;!b[a]&&document.getCSSCanvasContext&&(b[a]=!0,dhx.CanvasMgr.prototype[a](b))};
+dhx.CanvasMgr.prototype={buttonGrd:["#fefefe","#e0e0e0","#e5e5e5","#e0e0e0",32],qc:[],Pa:function(a,b,c,d,e){var f=document.getCSSCanvasContext("2d",d,18,c),g=f.createLinearGradient(0,0,0,c);g.addColorStop(0,a);g.addColorStop(1,b);f.fillStyle=g;f.strokeStyle="#93B0BA";f.lineWidth=2;e?(f.moveTo(0,0.5),f.lineTo(17.5,c/2+0.5),f.lineTo(0,c-0.5),f.lineTo(0,0.5)):(f.moveTo(18,0.5),f.lineTo(0.5,c/2+0.5),f.lineTo(18,c-0.5),f.lineTo(18,0.5));f.stroke();f.fill()},dhxArrowLeftT:function(){this.Pa(this.buttonGrd[2],
+this.buttonGrd[3],this.buttonGrd[4],"dhxArrowLeftT")},dhxArrowRightT:function(){this.Pa(this.buttonGrd[2],this.buttonGrd[3],this.buttonGrd[4],"dhxArrowRightT",!0)},dhxArrowLeft:function(){this.Pa(this.buttonGrd[0],this.buttonGrd[1],this.buttonGrd[4],"dhxArrowLeft");dhx.CanvasMgr("dhxArrowLeftT")},dhxArrowRight:function(){this.Pa(this.buttonGrd[0],this.buttonGrd[1],this.buttonGrd[4],"dhxArrowRight",!0);dhx.CanvasMgr("dhxArrowRightT")}};
+dhx.attachEvent("onClick",function(a){var b=dhx.ui.get(a);if(b&&b.touchable){b.getNode(a);var c=a.target||a.srcElement,d="",e=null,f=!1;if(!(c.className&&c.className.indexOf("dhx_view")===0)){for(;c&&c.parentNode;){if(c.getAttribute){if(c.getAttribute("view_id"))break;if(d=c.className)if(d=d.split(" "),d=d[0]||d[1],b.on_click[d]){var g=b.on_click[d].call(b,a,b.a.id,c);if(g===!1)return}}c=c.parentNode}if(b.a.click){var h=dhx.toFunctor(b.a.click);h&&h.call&&h.call(b,b.a.id,a)}if(b.a.multiview){var i=
+dhx.ui.get(b.a.multiview);i&&i.show&&i.show()}if(b.a.popup){var j=dhx.ui.get(b.a.popup);j.a.master=b.a.id;j.show(b.getInput()||b.getNode(),j.h.a.align||"bottom",!0)}b.callEvent("onItemClick",[b.a.id,a])}}});
+dhx.protoUI({name:"button",touchable:!0,defaults:{template:"<div class='dhx_el_button'><input type='button' style='width:100%;' value='#label#'></div>",height:42,label:"label",s:10},$init:function(a){this.data=this.a;this.d=this.b;dhx.sa&&(dhx.sa.elements[a.name||a.id]=this,this.mapEvent({onbeforetabclick:dhx.sa,onaftertabclick:dhx.sa,onitemclick:dhx.sa}));a.type=="prev"&&dhx.CanvasMgr("dhxArrowLeft");a.type=="next"&&dhx.CanvasMgr("dhxArrowRight")},type_setter:function(a){this.a.template=dhx.Template(this.pd[a][0]);
+var b=this.pd[a][1];if(b)this.a.s=b},pd:{round:["<div class='dhx_el_roundbutton'><input type='button' style='width:100%;' value='#label#'></div>"],"default":["<div class='dhx_el_defaultbutton'><input type='button' style='width:100%;' value='#label#'></div>"],form:[function(a){return"<div class='dhx_el_formbutton'><div style='width:100%;text-align:"+a.align+"'><input type='button' class='dhx_inp_form_button' style='text-align: "+a.inputAlign+"; width: "+(a.inputWidth?a.inputWidth+"px":"100%")+";' value='"+
+(a.label||a.value)+"' /></div></div>"}],prev:["<div class='dhx_el_prevbutton'><div class='dhx_el_prevbutton_arrow'></div><div class='dhx_el_prevbutton_input_cont'><input type='button' value='#label#' /></div></div>",28],next:["<div class='dhx_el_nextbutton'><div class='dhx_el_nextbutton_input_cont'><input type='button' value='#label#' /></div><div class='dhx_el_nextbutton_arrow'></div></div>",28],big:["<div class='dhx_el_bigbutton'><input type='button' value='#label#'></div>",28],biground:["<div class='dhx_el_bigroundbutton'><input type='button' value='#label#'></div>",
+28]},$setSize:function(a,b){dhx.ui.view.prototype.$setSize.call(this,a,b)&&this.render()},K:function(a){this.a.label=a;this.getInput().value=a},getValue:function(){return this.d.childNodes.length>0?this.ab():this.a.value},setValue:function(a){var b=this.a.value;this.a.value=a;if(this.d.childNodes.length>0)this.Md=a,this.K(a),this.callEvent("onChange",[a,b])},focus:function(){this.getInput().focus()},ab:function(){return this.a.label||""},getInput:function(){return this.d.getElementsByTagName("input")[0]},
+J:function(){return this.getInput()},Z:function(){this.a.inputWidth?this.J().style.width=this.a.inputWidth-this.a.s+"px":this.J().style.width=this.j-this.a.s+"px"},render:function(){if(dhx.AtomRender.render.call(this)){this.Z();if(this.a.align)switch(this.a.align){case "right":this.d.firstChild.style.cssFloat=this.d.firstChild.style.styleFloat="right";break;case "center":this.d.firstChild.style.display="inline-block";this.d.firstChild.parentNode.style.textAlign="center";break;case "middle":this.d.firstChild.style.marginTop=
+Math.round((this.m-40)/2)+"px";break;case "bottom":this.d.firstChild.style.marginTop=this.m-40+"px";break;case "left":this.d.firstChild.parentNode.style.textAlign="left"}this.Aa&&this.Aa(this.data);this.Md!=this.a.value&&this.setValue(this.a.value)}},refresh:function(){this.render()},on_click:{Ib:function(a,b){var c=dhx.html.locate(a,"button_id");if(c&&this.callEvent("onBeforeTabClick",[b,c])){this.a.selected=c;this.refresh();if(this.a.multiview){var d=dhx.ui.get(c);d&&d.show&&d.show()}this.callEvent("onAfterTabClick",
+[b,c])}},dhx_el_segmented:function(a,b){this.on_click.Ib.call(this,a,b)},dhx_el_tabbar:function(a,b){this.on_click.Ib.call(this,a,b)},dhx_inp_counter_next:function(){this.next(this.a.step,this.a.min,this.a.max)},dhx_inp_counter_prev:function(){this.prev(this.a.step,this.a.min,this.a.max)},dhx_inp_toggle_left_off:function(){var a=this.a.options;this.setValue(a[0].value)},dhx_inp_toggle_right_off:function(){var a=this.a.options;this.setValue(a[1].value)},dhx_inp_combo:function(a,b,c){c.focus()},dhx_inp_checkbox_border:function(){this.toggle()},
+dhx_inp_checkbox_label:function(){this.toggle()},dhx_inp_radio_border:function(a){var b=dhx.html.locate(a,"radio_id");this.setValue(b)},dhx_inp_radio_label:function(a,b,c){c=c.parentNode.getElementsByTagName("input")[0];return this.on_click.dhx_inp_radio_border.call(this,c,b,c)}},Ba:function(a){for(var b=0;b<a.length;b++)if(typeof a[b]=="string")a[b]={value:a[b],label:a[b]};else if(a[b].value){if(!a[b].label)a[b].label=a[b].value}else a[b].value=a[b].label}},dhx.ui.view,dhx.AtomRender,dhx.Settings,
+dhx.EventSystem);dhx.protoUI({name:"imagebutton",defaults:{template:"<div class='dhx_el_imagebutton'><span><img src='#src#'/>&nbsp;#label#</span></div>",label:""},Z:function(){}},dhx.ui.button);dhx.protoUI({name:"label",defaults:{template:"<div class='dhx_el_label'>#label#</div>"},focus:function(){return!1},J:function(){return this.d.firstChild},K:function(a){this.a.label=a;this.d.firstChild.innerHTML=a}},dhx.ui.button);
+dhx.protoUI({name:"icon",defaults:{template:"<div class='dhx_el_icon'><div class='dhx_el_icon_#icon#'></div></div>",width:42},Z:function(){}},dhx.ui.button);
+dhx.protoUI({name:"segmented",defaults:{template:function(a,b){var c=a.options,d="",e;b.Ba(c);if(!a.selected)a.selected=c[0].value;for(var f=0;f<c.length;f++)e=c[f].width||a.inputWidth?"width: "+((c[f].width||Math.round(a.inputWidth/c.length))-b.a.s)+"px;":"",d+="<div style='"+e+"' class='"+(a.selected==c[f].value?"selected ":"")+"segment_"+(f==c.length-1?"N":f>0?1:0)+"' button_id='"+c[f].value+"'>"+c[f].label+"</div>";return"<div class='dhx_el_segmented'>"+d+"</div>"},s:28,nb:0},K:function(a){if(this.d&&
+this.d.firstChild)for(var b=this.d.firstChild.childNodes,c=0;c<b.length;c++)if(dhx.html.locate(b[c],"button_id")==a)return this.on_click.Ib.call(this,b[c],this.a.options[c]),!0},getValue:function(){return this.a.selected},Z:function(){}},dhx.ui.button);
+dhx.protoUI({name:"tabbar",defaults:{height:49,template:function(a,b){var c=a.options;b.Ba(c);for(var d="",e,f=0;f<c.length;f++){var g="",h=c[f].src;c[f].value==a.selected&&(g="selected",h=c[f].srcSelected||c[f].src);c[f].css&&(g+=" "+c[f].css);e=a.optionWidth||c[f].width||a.inputWidth?"width: "+(c[f].width||Math.ceil(a.inputWidth/c.length)-b.a.s)+"px;":"";d+="<div class='"+g+"' button_id='"+c[f].value+"' style='"+e+"'>";d+=h?"<img src='"+h+"'/><span>"+c[f].label+"</span>":"<div style='height:26px'></div><span>"+
+c[f].label+"</span>";d+="</div>"}return"<div class='dhx_el_tabbar'>"+d+"</div>"},s:4}},dhx.ui.segmented);
+dhx.protoUI({name:"text",wd:!0,$b:function(a,b,c){c.labelPosition=="left"?a+=b:a=b+a;return"<div class='dhx_el_"+this.name+"'>"+a+"</div>"},pb:function(a,b,c,d){var e=a.inputAlign||"left",f=a.labelAlign||"left",g=dhx.uid(),h="<div class='dhx_inp_text_border'>";h+="<div class='dhx_inp_text_label' style='width: "+this.a.labelWidth+"px; text-align: "+f+";'><label onclick='' for='"+g+"' class='dhx_inp_label_for_text'>"+(a.label||"")+"</label></div>";var i=this.a.inputWidth-this.a.labelWidth-18;i<0&&(i=
+0);h+=d?"<div class='dhx_inp_"+b+"' onclick='' style='width: "+i+"px; text-align: "+e+";' >"+(a.text||a.value||"")+"</div>":"<input id='"+g+"' type='"+(a.type||this.name)+"' value='"+(a.text||a.value||"")+"' "+(c||a.readonly?"readonly='true' ":"")+(a.maxlength?"maxlength='"+a.maxlength+"' ":"")+(a.placeholder?"placeholder='"+a.placeholder+"' ":"")+" class='dhx_inp_"+b+"' style='width: "+i+"px; text-align: "+e+";' />";h+="</div>";return"<div class='dhx_el_"+this.name+"'>"+h+"</div>"},qb:function(a,
+b){if(!a.label)return"";var c=a.labelAlign||"left";return"<div class='dhx_inp_"+b+"_label' style='width: "+a.labelWidth+"px; text-align: "+c+";'>"+a.label+"</div>"},defaults:{template:function(a,b){return b.pb(a,"text")},labelWidth:80,s:28,nb:0},type_setter:function(a){return a},Z:function(){this.a.inputWidth?this.J().style.width=this.a.inputWidth-this.a.labelWidth-this.a.s+"px":this.J().style.width=this.j-this.a.labelWidth-this.a.s-this.a.nb+"px"},focus:function(){var a=this.d.getElementsByTagName("input")[0];
+a&&a.focus()},K:function(a){this.getInput().value=a},ab:function(){return this.getInput().value}},dhx.ui.button);
+dhx.protoUI({name:"toggle",defaults:{template:function(a,b){var c=a.options;b.Ba(c);var d=b.a.inputWidth/2||"auto",e=[c[0].width||d,c[1].width||d],f=b.qb(a,"toggle"),g="<input type='button' style='width: "+e[0]+"px;' value='"+a.options[0].label+"' />";g+="<input type='button' style='width: "+e[1]+"px;' value='"+a.options[1].label+"' />";return b.$b(f,g,a)},label:"",labelWidth:0,s:20},Z:function(){},Aa:function(a){this.setValue(a.value)},$a:function(){return this.d.getElementsByTagName("input")},
+K:function(a){var b=this.$a(),c=this.a.options;a==c[1].value?(b[0].className="dhx_inp_toggle_left_off",b[1].className="dhx_inp_toggle_right_on"):(b[0].className="dhx_inp_toggle_left_on",b[1].className="dhx_inp_toggle_right_off")},ab:function(){var a=this.$a(),b=this.a.options;return a[0].className=="dhx_inp_toggle_left_on"?b[0].value:b[1].value}},dhx.ui.text);
+dhx.protoUI({name:"input",defaults:{attributes:["maxlength","disabled","placeholder"],template:function(a,b){for(var c="<input",d=b.a.attributes,e=0;e<d.length;e++)a[d[e]]&&(c+=" "+d[e]+"='"+a[d[e]]+"'");c+=" type='"+(a.type||"text")+"'";c+="/>";return"<div class='dhx_el_input'>"+c+"</div>"},s:28,labelWidth:0}},dhx.ui.text);
+dhx.protoUI({name:"select",defaults:{template:function(a,b){var c=a.options;b.Ba(c);var d="<select";a.disabled&&(d+=" disabled='true'");d+=">";for(var e=0;e<c.length;e++)d+="<option"+(c[e].selected?" selected='true'":"")+(c[e].value?" value='"+c[e].value+"'":"")+">"+c[e].label+"</option>";d+="</select>";return"<div class='dhx_el_select'>"+d+"</div>"},labelWidth:0,nb:0,s:10},getInput:function(){return this.d.firstChild.firstChild}},dhx.ui.text);
+dhx.protoUI({name:"textarea",defaults:{template:function(a){return"<div class='dhx_el_textarea'><textarea class='dhx_inp_textarea' placeholder='"+(a.label||"")+"' style=''>"+(a.value||"")+"</textarea></div>"},cssContant:28},Z:function(){this.a.inputWidth?this.J().style.width=this.a.inputWidth-this.a.cssContant+"px":this.J().style.width=this.j-this.a.nb-this.a.cssContant+"px";this.a.inputHeight?this.J().style.height=this.a.inputHeight+"px":this.J().style.height=this.m-9+"px"},getInput:function(){return this.d.firstChild.firstChild},
+K:function(a){this.getInput().value=a},ab:function(){return this.getInput().value}},dhx.ui.text);
+dhx.protoUI({name:"counter",defaults:{template:function(a,b){var c=a.value||0,d=b.qb(a,"counter"),e="<input type='button' class='dhx_inp_counter_prev' value='\u25ac' />";e+="<div class='dhx_inp_counter_value' >"+c+"</div>";e+="<input type='button' class='dhx_inp_counter_next' value='+' />";return b.$b(d,e,a)},min:1,step:1,labelWidth:0,label:"",s:145},J:function(){return this.getInput().parentNode},getLabel:function(){return this.getInput().previousSibling||this.getInput().parentNode.lastChild},Z:function(){if(this.a.label&&
+!this.a.labelWidth){var a=this.getLabel();if(a)a.style.width=(this.a.inputWidth||this.j)-this.a.s+"px"}},K:function(a){this.getInput().nextSibling.innerHTML=a},getValue:function(){return(this.a.value||0)*1},next:function(a,b,c){a=a||1;this.kd(a,b,c)},prev:function(a,b,c){a=-1*(a||1);this.kd(a,b,c)},kd:function(a,b,c){var b=typeof b=="undefined"?-Infinity:b,c=typeof c=="undefined"?Infinity:c,d=this.getValue()+a;d>=b&&d<=c&&this.setValue(d)}},dhx.ui.text);
+dhx.protoUI({name:"checkbox",defaults:{template:function(a,b){var c=a.value?"dhx_inp_checkbox_on":"dhx_inp_checkbox_on hidden",d="<div class='dhx_inp_checkbox_border'><input type='button' class='"+c+"' value='' /></div>",e=b.qb(a,"checkbox");return b.$b(e,d,a)}},K:function(a){var b=this.getInput();b.className=a?"dhx_inp_checkbox_on":"dhx_inp_checkbox_on hidden"},toggle:function(){this.setValue(!this.getValue())},getLabel:function(){var a=this.getInput().parentNode;return a.nextSibling||a.previousSibling},
+getValue:function(){return this.a.value?1:0},J:function(){return this.getInput().parentNode.parentNode}},dhx.ui.counter);
+dhx.protoUI({name:"radio",defaults:{template:function(a,b){b.Ba(a.options);for(var c=[],d=0;d<a.options.length;d++){a.options[d].newline&&c.push("<div style='clear:both;'></div>");var e="<div radio_id='"+a.options[d].value+"' class='dhx_inp_radio_border'><input type='button' class='"+(a.options[d].value==a.value?"dhx_inp_radio_on":"dhx_inp_radio_on hidden")+"' value='' /></div>";a.label=a.options[d].label;var f=b.qb(a,"radio");a.labelPosition=="left"?c.push(f+e):c.push(e+f)}return"<div class='dhx_el_radio'><div>"+
+c.join("</div><div>")+"</div></div>"}},$getSize:function(){var a=dhx.ui.button.prototype.$getSize.call(this);if(this.a.options){for(var b=1,c=0;c<this.a.options.length;c++)this.a.options[c].newline&&b++;a[3]=Math.max(a[3],this.defaults.height*b)}return a},$a:function(){return this.d.getElementsByTagName("input")},K:function(a){for(var b=this.$a(),c=0;c<b.length;c++)b[c].className=b[c].parentNode.getAttribute("radio_id")==a?"dhx_inp_radio_on":"dhx_inp_radio_on hidden"},getValue:function(){return this.a.value}},
+dhx.ui.text);
+dhx.protoUI({name:"richselect",defaults:{template:function(a,b){return b.pb(a,"list",!0,!0)}},Y:function(a){a.popup||this.Cb("list",a);this.dc();this.Y=function(){}},options_setter:function(a){for(var b=this.a.data=[],c=0;c<a.length;c++){var d=a[c].value||a[c].label||a[c],e=a[c].label||a[c].value||a[c];b.push({id:d,value:e})}return a},Aa:function(a){this.Y(a);if(!dhx.isNotDefined(a.value)){this.setValue(a.value,{},a);var b=dhx.ui.get(a.popup.toString()),c=b.h,d=this;c.attachEvent("onXLE",dhx.bind(function(){this.setValue(this.a.value,
+{},a)},this))}},Cb:function(a,b){var c=dhx.extend({},b);delete c.align;delete c.height;delete c.width;delete c.template;c.view=a;c.id=(b.id||b.name)+"_"+a;c.width=c.popupWidth||290;var d=dhx.uid(),e={id:d,view:"popup",body:c};dhx.ui(e).hide();b.popup=d;this.dc()},dc:function(){var a=dhx.ui.get(this.a.popup);a.h.attachEvent("onItemClick",function(a){var c=dhx.ui.get(this.getParent().a.master);this.getParent().hide();c.setValue(a)})},getInput:function(){return this.d.firstChild.childNodes[0].childNodes[1]},
+K:function(a){var b=dhx.ui.get(this.a.popup).h,c=b.type?b.type.template(b.item(a)||a,b.type):a;this.a.value=a;this.a.text=c;this.name=="combo"?this.getInput().value=c.replace(/<[^>]*>/g,""):this.getInput().innerHTML=c},getValue:function(){return this.a.value}},dhx.ui.text);
+dhx.protoUI({name:"combo",defaults:{template:function(a,b){return b.pb(a,"combo")},filter:function(a,b){return a.value.toString().toLowerCase().indexOf(b.toLowerCase())===0?!0:!1}},Y:function(a){a.popup||this.Cb("list",a);this.dc();dhx.event(this.d,"keydown",function(b){var b=b||event,c=b.target||b.srcElement,d=dhx.ui.get(a.popup);window.clearTimeout(d.key_timer);var e=this;d.key_timer=window.setTimeout(function(){d.h.filter(function(a){return e.a.filter.apply(e,[a,c.value])});var a=dhx.ui.get(d.a.master);
+a.a.value=d.h.dataCount()==1&&d.h.type.template(d.h.item(d.h.first()))==c.value?d.h.first():""},200);d.show(c,d.h.a.align||"bottom",!0)},this);this.Y=function(){}},Aa:function(a){this.Y(a);dhx.isNotDefined(a.value)||this.setValue(a.value)}},dhx.ui.richselect);
+dhx.protoUI({name:"datepicker",defaults:{template:function(a,b){return b.pb(a,"list",!0,!0)}},Y:function(a){a.popup||this.Cb("calendar",a);var b=dhx.ui.get(a.popup);b.h.attachEvent("onDateSelect",function(a){var b=dhx.ui.get(this.getParent().a.master);this.getParent().hide();b.setValue(a)});this.Y=function(){}},Aa:function(a){this.Y(a);dhx.isNotDefined(a.value)||this.setValue(a.value)},K:function(a){var b=dhx.ui.get(this.a.popup.toString()),c=b.h;typeof a=="string"&&a&&(a=(this.a.dateFormat||dhx.i18n.dateFormatDate)(a));
+c.selectDate(a,!0);this.a.value=a?c.config.date:"";this.getInput().innerHTML=a?(this.a.dateFormatStr||dhx.i18n.dateFormatStr)(this.a.value):""},dateFormat_setter:function(a){this.a.dateFormatStr=dhx.Date.dateToStr(a);return dhx.Date.strToDate(a)},getValue:function(){return this.a.value||null}},dhx.ui.richselect);
+dhx.ValidateData={validate:function(a){var b=!0,c=this.a.rules;if(c){var d=c.$obj;!a&&this.getValues&&(a=this.getValues());if(d&&!d.call(this,a))return!1;var e=c.$all,f;for(f in c)f.indexOf("$")!==0&&(c[f].call(this,a[f],a,f)&&(!e||e.call(this,a[f],a,f))?this.callEvent("onValidationSuccess",[f,a])&&this.tc&&this.tc(f,a):(b=!1,this.callEvent("onValidationError",[f,a])&&this.Lc&&this.Lc(f,a)))}return b}};
+dhx.rules={isNumber:function(a){return parseFloat(a)==a},isNotEmpty:function(a){return a=="0"||a}};
+dhx.RenderStack={$init:function(){this.F=document.createElement("DIV");this.data.attachEvent("onIdChange",dhx.bind(this.Zb,this));this.attachEvent("onItemClick",this.Dd);if(!this.types)this.types={"default":this.type},this.type.name="default";this.type=dhx.copy(this.types[this.type.name])},customize:function(a){dhx.Type(this,a)},type_setter:function(a){this.types[a]?(this.type=dhx.copy(this.types[a]),this.type.css&&(this.g.className+=" "+this.type.css)):this.customize(a);return a},template_setter:function(a){this.type.template=
+dhx.Template(a)},xa:function(a){this.callEvent("onItemRender",[a]);return this.type.templateStart(a,this.type)+(a.$template?this.type["template"+a.$template]:this.type.template)(a,this.type)+this.type.templateEnd(a,this.type)},ld:function(a){this.F.innerHTML=this.xa(a);return this.F.firstChild},Zb:function(a,b){var c=this.pa(a);c&&(c.setAttribute(this.ma,b),this.B[b]=this.B[a],delete this.B[a])},Dd:function(){if(this.a.click){var a=dhx.toFunctor(this.a.click);a&&a.call&&a.apply(this,arguments)}},
+pa:function(a){if(this.B)return this.B[a];this.B={};for(var b=this.d.childNodes,c=0;c<b.length;c++){var d=b[c].getAttribute(this.ma);d&&(this.B[d]=b[c])}return this.pa(a)},locate:function(a){return dhx.html.locate(a,this.ma)},showItem:function(a){var b=this.pa(a);if(b&&this.scrollTo){var c=Math.max(0,b.offsetLeft-this.d.offsetLeft),d=Math.max(0,b.offsetTop-this.d.offsetTop);this.scrollTo(c,d);this.bd&&this.bd(a)}},render:function(a,b,c){if(this.isVisible(this.a.id))if(a){var d=this.pa(a);switch(c){case "update":if(!d)break;
+var e=this.B[a]=this.ld(b);dhx.html.insertBefore(e,d);dhx.html.remove(d);break;case "delete":if(!d)break;dhx.html.remove(d);delete this.B[a];break;case "add":e=this.B[a]=this.ld(b);dhx.html.insertBefore(e,this.pa(this.data.next(a)),this.d);break;case "move":this.render(a,b,"delete"),this.render(a,b,"add")}}else if(this.callEvent("onBeforeRender",[this.data]))(this.De||this.d).innerHTML=this.data.getRange().map(this.xa,this).join(""),this.B=null,this.callEvent("onAfterRender",[])}};
+dhx.protoUI({name:"proto",$init:function(){this.data.provideApi(this,!0);this.d=this.g;this.data.attachEvent("onStoreUpdated",dhx.bind(function(){this.render.apply(this,arguments)},this))},$setSize:function(){dhx.ui.view.prototype.$setSize.apply(this,arguments)&&this.render()}},dhx.RenderStack,dhx.DataLoader,dhx.ui.view,dhx.EventSystem,dhx.Settings);
+dhx.Values={$init:function(){this.elements={}},focus:function(a){a?this.elements[a].focus():this.first().focus()},setValues:function(a){if(this.isVisible(this.a.id)){this.sd=dhx.copy(a);for(var b in this.elements)this.elements[b]&&!dhx.isNotDefined(a[b])&&this.elements[b].setValue(a[b]);this.callEvent("onChange",[])}else this.fc=a},getValues:function(){var a=this.sd?dhx.copy(this.sd):{},b;for(b in this.elements)a[b]=this.elements[b].getValue();return a},clear:function(){var a={},b;for(b in this.elements)this.elements[b].wd&&
+(a[b]=this.elements[b].a.defaultValue||"");this.setValues(a)},mb:function(a,b){var c=this.data.driver,d=c.getRecords(c.toObject(a,b))[0];this.setValues(c?c.getDetails(d):a);this.callEvent("onXLE",[])},Lc:function(a){dhx.html.addCss(this.elements[a].d.firstChild,"invalid")},tc:function(a){dhx.html.removeCss(this.elements[a].d.firstChild,"invalid")}};
+dhx.protoUI({name:"toolbar",defaults:{type:"MainBar"},Ce:!0,Db:44,$init:function(a){this.g.style.border="1px solid #AEAEAE";this.Vc(a)},Vc:function(a){this.g.className+=" dhx_toolbar";if(a.elements)this.Q=a.elements,this.r=!1;delete a.elements;dhx.sa=this},$getSize:function(){var a=dhx.ui.baselayout.prototype.$getSize.call(this);if(a[3]>0&&(!this.r||!this.a.scroll))this.a.height=a[3];if(a[1]>0&&(this.r||!this.a.scroll))this.a.width=a[1];a=dhx.ui.view.prototype.$getSize.call(this);if(a[3]<=0&&this.Db>
+0)a[3]=this.Db,a[2]=0;return a},$setSize:function(a,b){dhx.ui.view.prototype.$setSize.apply(this,arguments);dhx.ui.baselayout.prototype.$setSize.call(this,this.j,this.m)},render:function(){if(this.isVisible(this.a.id)&&this.fc)this.setValues(this.fc),this.fc=null},refresh:function(){this.render()},type_setter:function(a){this.g.className+=" dhx_"+a.toLowerCase()}},dhx.Scrollable,dhx.AtomDataLoader,dhx.Values,dhx.ui.baselayout,dhx.EventSystem,dhx.ValidateData);
+dhx.protoUI({name:"form",defaults:{scroll:!0},Db:-1,Vc:function(a){this.g.className+=" dhx_form";if(a.elements)this.Q=a.elements,this.r=!0;delete a.elements;dhx.sa=this},type_setter:function(){}},dhx.ui.toolbar);
+dhx.MouseEvents={$init:function(){this.on_click&&dhx.event(this.g,"click",this.me,this);this.on_context&&dhx.event(this.g,"contextmenu",this.ne,this);this.on_dblclick&&dhx.event(this.g,"dblclick",this.oe,this);this.on_mouse_move&&(dhx.event(this.g,"mousemove",this.Rc,this),dhx.event(this.g,dhx.env.isIE?"mouseleave":"mouseout",this.Rc,this))},me:function(a){return this.Ja(a,this.on_click,"ItemClick")},oe:function(a){return this.Ja(a,this.on_dblclick,"ItemDblClick")},ne:function(a){if(this.Ja(a,this.on_context,
+"BeforeContextMenu"))return this.Ja(a,{},"AfterContextMenu"),dhx.html.preventEvent(a)},Rc:function(a){dhx.env.isIE&&(a=document.createEventObject(event));this.Nc&&window.clearTimeout(this.Nc);this.callEvent("onMouseMoving",[a]);this.Nc=window.setTimeout(dhx.bind(function(){a.type=="mousemove"?this.pe(a):this.qe(a)},this),500)},pe:function(a){this.Ja(a,this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[a||event])},qe:function(a){this.callEvent("onMouseOut",[a||event])},Ja:function(a,b,c){for(var a=
+a||event,d=a.target||a.srcElement,e="",f=null,g=!1;d&&d.parentNode;){if(!g&&d.getAttribute&&(f=d.getAttribute(this.ma))){d.getAttribute("userdata")&&this.callEvent("onLocateData",[f,d]);if(!this.callEvent("on"+c,[f,a,d]))return;g=!0}if(e=d.className)if(e=e.split(" "),e=e[0]||e[1],b[e]){var h=b[e].call(this,a,f||dhx.html.locate(a,this.ma),d);if(typeof h!="undefined"&&h!==!0)return}d=d.parentNode}return g}};
+dhx.SelectionModel={$init:function(){this.i=dhx.toArray();this.data.attachEvent("onStoreUpdated",dhx.bind(this.Pd,this));this.data.attachEvent("onStoreLoad",dhx.bind(this.Od,this));this.data.attachEvent("onAfterFilter",dhx.bind(this.Nd,this));this.data.attachEvent("onChangeId",dhx.bind(this.Zd,this))},Zd:function(a,b){for(var c=this.i.length-1;c>=0;c--)this.i[c]==a&&(this.i[c]=b)},Nd:function(){for(var a=this.i.length-1;a>=0;a--){if(this.data.indexById(this.i[a])<0)var b=this.i[a];var c=this.item(b);
+c&&delete c.$selected;this.i.splice(a,1);this.callEvent("onSelectChange",[b])}},Pd:function(a,b,c){if(c=="delete")this.i.remove(a);else if(!this.data.dataCount()&&!this.data.p)this.i=dhx.toArray()},Od:function(){this.a.select&&this.data.each(function(a){a.$selected&&this.select(a.id)},this)},ub:function(a,b,c){if(!c&&!this.callEvent("onBeforeSelect",[a,b]))return!1;this.data.item(a).$selected=b;c?c.push(a):(b?this.i.push(a):this.i.remove(a),this.Vb(a));return!0},select:function(a,b,c){if(!a)return this.selectAll();
+if(dhx.isArray(a))for(var d=0;d<a.length;d++)this.select(a[d],b,c);else if(this.data.exists(a)){if(c&&this.i.length)return this.selectAll(this.i[this.i.length-1],a);if(!b&&(this.i.length!=1||this.i[0]!=a))this.fd=!0,this.unselectAll(),this.fd=!1;this.isSelected(a)?b&&this.unselect(a):this.ub(a,!0)&&this.callEvent("onAfterSelect",[a])}},unselect:function(a){if(!a)return this.unselectAll();this.isSelected(a)&&this.ub(a,!1)},selectAll:function(a,b){var c,d=[];c=a||b?this.data.getRange(a||null,b||null):
+this.data.getRange();c.each(function(a){var b=this.data.item(a.id);b.$selected||(this.i.push(a.id),this.ub(a.id,!0,d));return a.id},this);this.Vb(d)},unselectAll:function(){var a=[];this.i.each(function(b){this.ub(b,!1,a)},this);this.i=dhx.toArray();this.Vb(a)},isSelected:function(a){return this.i.find(a)!=-1},getSelected:function(a){switch(this.i.length){case 0:return a?[]:"";case 1:return a?[this.i[0]]:this.i[0];default:return[].concat(this.i)}},ee:function(a){return a.length>100||a.length>this.data.dataCount/
+2},Vb:function(a){typeof a!="object"&&(a=[a]);if(a.length){if(this.ee(a))this.data.refresh();else for(var b=0;b<a.length;b++)this.render(a[b],this.data.item(a[b]),"update");this.fd||this.callEvent("onSelectChange",[a])}}};
+dhx.TreeStore={$init:function(){this.branch={0:[]}},clearAll:function(){this.branch={0:[]};dhx.DataStore.prototype.clearAll.call(this)},prevSibling:function(a){var b=this.branch[this.item(a).$parent],c=dhx.PowerArray.find.call(b,a)-1;return c>=0?b[c]:null},nextSibling:function(a){var b=this.branch[this.item(a).$parent],c=dhx.PowerArray.find.call(b,a)+1;return c<b.length?b[c]:null},parent:function(a){return this.item(a).$parent},firstChild:function(a){var b=this.branch[a];return b&&b.length?b[0]:null},
+hasChild:function(a,b){var c=this.branch[a];if(c&&c.length)for(var d=0;d<c.length;d++){if(c[d]==b)return!0;if(this.hasChild(c[d],b))return!0}return!1},branchIndex:function(a,b){var c=this.branch[a];return dhx.PowerArray.find.call(c,b)},extraParser:function(a,b,c){a.$parent=b||0;a.$level=c||1;this.branch[a.$parent]||(this.branch[a.$parent]=[]);this.branch[a.$parent].push(a.id);if(!a.item)return a.$count=0;dhx.isArray(a.item)?a.$count=a.item.length:(a.item=[a.item],a.$count=1);for(var d=0;d<a.item.length;d++){var e=
+a.item[d];this.pull[this.id(e)]=e;this.extraParser(e,a.id,a.$level+1)}delete a.item},provideApi:function(a,b){for(var c="prevSibling,nextSibling,parent,firstChild,hasChild,branchIndex".split(","),d=0;d<c.length;d++)a[c[d]]=dhx.methodPush(this,c[d]);dhx.DataStore.prototype.provideApi.call(this,a,b)},getTopRange:function(){return dhx.toArray([].concat(this.branch[0])).map(function(a){return this.item(a)},this)},eachChild:function(a,b){if(this.branch[a])return dhx.PowerArray.each.call(this.branch[a],
+b)},add:function(a,b,c){this.branch[c||0]=this.order=dhx.toArray(this.branch[c||0]);(c=this.item(c||0))&&c.$count++;a.$count=0;a.$level=c?c.$level+1:1;a.$parent=c?c.id:0;return dhx.DataStore.prototype.add.call(this,a,b)},remove:function(a){var b=this.item(a),c=b.$parent||0;this.branch[c]=this.order=dhx.toArray(this.branch[c]);c&&this.item(c).$count--;return dhx.DataStore.prototype.remove.call(this,a)},serialize:function(a){for(var b=this.branch[a||0],c=[],d=0;d<b.length;d++){var e=this.pull[b[d]];
+if(e.$count)e=dhx.copy(e),e.item=this.serialize(b[d]);c.push(e)}return c},groupBy:function(a,b,c,d,e){if(c===!0){var f={},g=dhx.copy(a),h=g.pop(),i={},j;for(j in b){var k=b[j],o=k[h];if(typeof i[o]==="undefined"){j=dhx.uid();var m={id:j,text:o,$count:0,$level:e,$parent:d};i[o]=j;f[j]=[];this.pull[j]=m;this.branch[d].push(j);this.branch[j]=[]}else j=i[o];f[j].push(k);g.length===0&&this.branch[j].push(k.id)}for(var l in f)this.pull[l].$count=f[l].length,g.length>0&&this.groupBy(g,f[l],!0,l,e+1)}else{var n=
+arguments,g=[];this.branch={0:[]};for(l=n.length-1;l>=0;l--)g.push(n[l]);this.groupBy(g,this.pull,!0,"0",0);this.refresh()}}};dhx.animate=function(a,b){if(dhx.isArray(a))for(var c=0;c<a.length;c++){if(b.type=="slide"){if(b.subtype=="out"&&c===0)continue;if(b.subtype=="in"&&c==1)continue}if(b.type=="flip"){var d=dhx.copy(b);if(c===0)d.type="flipback";if(c==1)d.callback=null;dhx.animate(a[c],d)}else dhx.animate(a[c],b)}else{var e=dhx.toNode(a);e.cb?dhx.animate.end(e,b):dhx.animate.start(e,b)}};
+dhx.animate.end=function(a,b){a.style[dhx.env.transformPrefix+"TransitionDuration"]="1ms";a.cb=null;dhx.td&&window.clearTimeout(dhx.td);dhx.td=dhx.delay(dhx.animate,dhx,[a,b],10)};dhx.animate.isSupported=function(){return dhx.env.transform&&dhx.env.transition};
+dhx.animate.formLine=function(a,b,c){var d=c.direction;b.parentNode.style.position="relative";b.style.position="absolute";a.style.position="absolute";d=="top"||d=="bottom"?(a.style.left="0px",a.style.top=(d=="top"?1:-1)*b.offsetHeight+"px"):(a.style.top="0px",a.style.left=(d=="left"?1:-1)*b.offsetWidth+"px");b.parentNode.appendChild(a);if(c.type=="slide"&&c.subtype=="out")a.style.left=0,a.style.top=0,b.parentNode.removeChild(b),a.parentNode.appendChild(b);return[a,b]};
+dhx.animate.breakLine=function(a){dhx.html.remove(a[1]);dhx.animate.clear(a[0]);dhx.animate.clear(a[1]);a[0].style.position=""};dhx.animate.clear=function(a){a.style[dhx.env.transformPrefix+"Transform"]="";a.style[dhx.env.transformPrefix+"Transition"]="";a.style.top=a.style.left=""};
+dhx.animate.start=function(a,b){typeof b=="string"&&(b={type:b});var b=dhx.Settings.Ia(b,{type:"slide",delay:"0",duration:"500",timing:"ease-in-out",x:0,y:0}),c=dhx.env.transformPrefix,d=a.cb=b;switch(d.type=="slide"&&d.direction){case "right":d.x=a.offsetWidth;break;case "left":d.x=-a.offsetWidth;break;case "top":d.y=-a.offsetHeight;break;default:d.y=a.offsetHeight}if(d.type=="flip"||d.type=="flipback"){var e=[0,0],f="scaleX";d.subtype=="vertical"?(e[0]=20,f="scaleY"):e[1]=20;if(d.direction=="right"||
+d.direction=="bottom")e[0]*=-1,e[1]*=-1}var g=d.duration+"ms "+d.timing+" "+d.delay+"ms",h=c+"TransformStyle: preserve-3d;",i="",j="";switch(d.type){case "fade":i="opacity "+g;h="opacity: 0;";break;case "show":i="opacity "+g;h="opacity: 1;";break;case "flip":g=d.duration/2+"ms "+d.timing+" "+d.delay+"ms";j="skew("+e[0]+"deg, "+e[1]+"deg) "+f+"(0.00001)";i="all "+g;break;case "flipback":d.delay+=d.duration/2;g=d.duration/2+"ms "+d.timing+" "+d.delay+"ms";a.style[c+"Transform"]="skew("+-1*e[0]+"deg, "+
+-1*e[1]+"deg) "+f+"(0.00001)";a.style.left="0";j="skew(0deg, 0deg) "+f+"(1)";i="all "+g;break;case "slide":var k=d.x+"px",o=d.y+"px",j=dhx.env.translate+"("+k+", "+o+(dhx.env.translate=="translate3d"?", 0":"")+")",i=dhx.env.transformCSSPrefix+"transform "+g}dhx.delay(function(){a.style[c+"Transition"]=i;dhx.delay(function(){h&&(a.style.cssText+=h);j&&(a.style[c+"Transform"]=j);var b=!1,e=dhx.event(a,dhx.env.transitionEnd,function(c){a.cb=null;d.callback&&d.callback.call(d.master||window,a,d,c);b=
+!0;dhx.eventRemove(e)});window.setTimeout(function(){if(!b)a.cb=null,d.callback&&d.callback.call(d.master||window,a,d),b=!0,dhx.eventRemove(e)},(d.duration*1+d.delay*1)*1.3)})})};
+dhx.CarouselPanel={Wb:function(){var a,b,c,d;a=this.a.panel;dhx.html.remove(this.P);b="z-index:"+dhx.ui.zIndex()+";";if(a.align=="bottom"||a.align=="top")b+="height:"+a.size+"px; left:0px;",c=0,a.align=="bottom"&&(c=this.m-this.a.panel.size),b+="top:"+c+"px";else if(a.align=="right"||a.align=="left")b+="width:"+a.size+"px;top:0px;",d=0,a.align=="right"&&(d=this.j-this.a.panel.size),b+="left:"+d+"px";this.P=dhx.html.create("DIV",{"class":"dhx_carousel_panel",style:b},"");this.b.appendChild(this.P);
+this.Xb()},Xb:function(){var a,b;b=this.a.panel;this.P?this.Hd():this.Wb();var c=this.c?this.c.length:this.data.order.length;if(c>1){for(var d=0;d<c;d++)a=dhx.html.create("DIV",{"class":"dhx_item dhx_carousel_"+(d==this.l?"active":"inactive"),style:b.align=="left"||b.align=="right"?"float:none;":""},""),this.P.appendChild(a);var e=c*this.a.panel.itemSize;b.align=="bottom"||b.align=="top"?(this.P.style.left=(this.j-e)/2+this.b.scrollLeft+"px",this.P.style.width=e+"px"):this.P.style.top=(this.m-e)/
+2+this.b.scrollTop+"px"}},Hd:function(){if(this.P)for(var a=this.P.childNodes,b=a.length-1;b>=0;b--)dhx.html.remove(a[b])}};
+dhx.protoUI({name:"list",$init:function(){this.data.provideApi(this,!0)},defaults:{select:!1,scroll:!0},ma:"dhx_l_id",on_click:{dhx_list_item:function(a,b){if(this.a.select)this.ra=!0,this.a.select=="multiselect"?this.select(b,a.ctrlKey,a.shiftKey):this.select(b),this.ra=!1}},$getSize:function(){if(this.type.width!="auto")this.a.width=this.type.width+(this.type.padding+this.type.margin)*2;if(this.a.yCount)this.a.height=(this.type.height+(this.type.padding+this.type.margin)*2+1)*(this.a.yCount=="auto"?
+this.dataCount():this.a.yCount);return dhx.ui.view.prototype.$getSize.call(this)},$setSize:function(){dhx.ui.view.prototype.$setSize.apply(this,arguments)},type:{css:"",widthSize:function(a,b){return b.width+(b.width>-1?"px":"")},heightSize:function(a,b){return b.height+(b.height>-1?"px":"")},template:dhx.Template("#value#"),width:"auto",height:22,margin:0,padding:10,border:1,templateStart:dhx.Template("<div dhx_l_id='#id#' class='dhx_list_item dhx_list_{common.css}_item{obj.$selected?_selected:}' style='width:{common.widthSize()}; height:{common.heightSize()}; padding:{common.padding}px; margin:{common.margin}px; overflow:hidden;'>"),
+templateEnd:dhx.Template("</div>")}},dhx.MouseEvents,dhx.SelectionModel,dhx.Scrollable,dhx.ui.proto);
+dhx.protoUI({name:"grouplist",defaults:{animate:{}},$init:function(){dhx.extend(this.data,dhx.TreeStore,!0);this.data.provideApi(this,!0);this.data.attachEvent("onClearAll",dhx.bind(this.Qc,this));this.b.className+=" dhx_grouplist";this.Qc()},Qc:function(){this.aa=[];this.z=[]},on_click:{dhx_list_item:function(a,b){if(this.oa)return!1;for(var c=0;c<this.z.length;c++)if(this.z[c]==b){for(var d=c;d<this.z.length;d++)this.data.item(this.z[d]).$template="";c?(this.aa=this.data.branch[this.z[c-1]],this.z.splice(c)):
+(this.aa=this.data.branch[0],this.z=[]);this.Ic=!1;return this.render()}var e=this.item(b);if(e.$count)return this.Ic=!0,this.z.push(b),e.$template="Back",this.aa=this.data.branch[e.id],this.render();else if(this.a.select)this.ra=!0,this.a.select=="multiselect"?this.select(b,a.ctrlKey,a.shiftKey):this.select(b),this.ra=!1}},render:function(a,b,c,d){if(this.oa)return dhx.delay(this.render,this,arguments,100);for(var e=0;e<this.aa.length;e++)this.data.item(this.aa[e]).$template="";this.data.order=this.z.length?
+dhx.toArray([].concat(this.z).concat(this.aa)):dhx.toArray([].concat(this.data.branch[0]));if(this.callEvent("onBeforeRender",[this.data])){if(this.ra||!this.d.innerHTML||!dhx.animate.isSupported()||!this.a.animate||this.xe==this.z.length)dhx.RenderStack.render.apply(this,arguments);else{var f=this.d.cloneNode(!1);f.innerHTML=this.data.getRange().map(this.xa,this).join("");var g=dhx.extend({},this.a.animate);g.direction=this.Ic?"left":"right";var h=dhx.animate.formLine(f,this.d,g);g.master=this;g.callback=
+function(){this.d=f;dhx.animate.breakLine(h);this.B=g.master=g.callback=null;this.oa=!1;this.callEvent("onAfterRender",[])};this.oa=!0;dhx.animate(h,g)}this.xe=this.z.length}},templateBack_setter:function(a){this.type.templateBack=dhx.Template(a)},templateItem_setter:function(a){this.type.templateItem=dhx.Template(a)},templateGroup_setter:function(a){this.type.templateGroup=dhx.Template(a)},type:{template:function(a,b){return a.$count?b.templateGroup(a,b):b.templateItem(a,b)},css:"group",templateStart:dhx.Template("<div dhx_l_id='#id#' class='dhx_list_item dhx_list{obj.$count?_group:_item}{obj.$template?_back:}{obj.$selected?_selected:}' style='width:{common.width}px; height:{common.height}px; padding:{common.padding}px; margin:{common.margin}px; overflow:hidden;'>"),
+templateBack:dhx.Template("&lt; #value#"),templateItem:dhx.Template("#value#"),templateGroup:dhx.Template("#value#"),templateEnd:function(a){var b="";a.$count&&(b+="<div class='dhx_arrow_icon'></div>");b+="</div>";return b}},showItem:function(a){var b,c;if(a&&(b=this.item(a),c=b.$parent,b.$count))c=b.id;this.aa=this.data.branch[c||0];for(this.z=[];c;)this.item(c).$template="Back",this.z.unshift(c),c=this.item(c).$parent;this.ra=!0;this.render();this.ra=!1;dhx.RenderStack.showItem.call(this,a)}},dhx.ui.list);
+dhx.Type(dhx.ui.grouplist,{});
+dhx.protoUI({name:"pagelist",defaults:{scroll:"x",panel:!1,scrollOffset:0},Yd:!0,$init:function(a){this.b.className+=" dhx_pagelist";a.scroll=a.scroll=="y"?"y":"x";this.type.layout=a.scroll;this.attachEvent("onAfterRender",this.Ie);this.$ready.push(this.zb);this.l=0},zb:function(){if(this.a.scroll=="x")this.d.style.height="100%";this.type.layout=this.a.scroll;this.attachEvent("onAfterScroll",this.Ld)},Ie:function(){if(this.a.scroll=="x")this.d.style.width=(this.type.width+(this.type.padding+this.type.margin)*
+2+this.type.border)*this.dataCount()+"px";this.a.panel&&this.Wb()},panel_setter:function(a){a&&(this.b.className+=" hidden_scroll",a===!0&&(a={}),this.Ia(a,{size:16,itemSize:16,align:"bottom"}));return a},bd:function(a){var b=this.indexById(a);if(typeof b!="undefined"&&this.a.panel)this.l=b,this.Xb()},getActive:function(){return this.l?this.data.order[this.l]:this.first()},Ld:function(a){var b=(this.a.scroll=="y"?this.type.height:this.type.width)+(this.type.padding+this.type.margin)*2+this.type.border,
+c=this.a.scroll=="y"?this.d.scrollHeight-this.m:this.d.scrollWidth-this.j,d;this.a.scroll=="y"?(d=Math.round(a.f/b),a.f=d*b,a.f=this.uc(a.f,c)):(d=Math.round(a.e/b),a.e=d*b,a.e=this.uc(a.e,c));this.l=-d;this.a.panel&&this.Xb();return!0},uc:function(a,b){var c=this.a.scrollOffset;if(c&&Math.abs(a)>c){var d=dhx.Touch.A[dhx.Touch.H]>dhx.Touch.w[dhx.Touch.H];a+=d?c:1-c}Math.abs(a)>b&&(a=-b);return a},$getSize:function(){if(this.a.scroll=="y"){if(this.type.width!="auto")this.a.width=this.type.width+(this.type.padding+
+this.type.margin)*2+this.type.border;if(this.a.yCount)this.a.height=(this.type.height+(this.type.padding+this.type.margin)*2+this.type.border)*(this.a.yCount=="auto"?this.dataCount():this.a.yCount)}else if(this.type.height!="auto")this.a.height=this.type.height+(this.type.padding+this.type.margin)*2+this.type.border;return dhx.ui.view.prototype.$getSize.call(this)},$setSize:function(a,b){if(dhx.ui.view.prototype.$setSize.apply(this,arguments)){if(this.type.fullScreen)this.type.width=this.j,this.type.height=
+this.m,this.type.padding=0,this.render();this.a.panel&&this.Wb()}},type:{templateStart:function(a,b){var c="dhx_list_item dhx_list_"+b.css+"_item"+(a.$selected?"_selected":""),d="width:"+b.width+"px; height:"+b.height+"px; padding:"+b.padding+"px; margin:"+b.margin+"px; overflow:hidden;"+(b.layout&&b.layout=="x"?"float:left;":"");return"<div dhx_l_id='"+a.id+"' class='"+c+"' style='"+d+"'>"}}},dhx.ui.list,dhx.CarouselPanel);
+dhx.protoUI({name:"multiview",defaults:{animate:{}},$init:function(){this.l=0;this.r=1;this.b.style.position="relative";this.b.className+=" dhx_multiview";this.M=[]},xd:function(a,b){var c=dhx.ui.get(a);if(!c.La)c.rb=[],c.La={};c.La[b]||(c.La[b]=!0,c.rb.push(b))},Yb:function(a){var b=dhx.ui.get(a);this.M[this.M.length-2]!=a?(this.M.length==10&&this.M.splice(0,1),this.M.push(a)):this.M.splice(this.M.length-1,1);if(b.La){for(var c=0;c<b.rb.length;c++)dhx.ui.get(b.rb[c]).render();b.rb=[];b.La={}}},T:function(a){for(var a=
+a||this.Q,b=0;b<a.length;b++)a[b].k=this.a.k||{top:1,bottom:1,left:1,right:1};dhx.ui.baselayout.prototype.T.call(this,a);for(b=1;b<this.c.length;b++)dhx.html.remove(this.c[b].b);for(b=0;b<a.length;b++){var c=this.c[b];if(!c.c||c.Ce){var d=c.a.k;if(d.top)c.b.style.borderTopWidth="0px";if(d.left)c.b.style.borderLeftWidth="0px";if(d.right)c.b.style.borderRightWidth="0px";if(d.bottom)c.b.style.borderBottomWidth="0px"}}this.Yb(this.getActive())},cells_setter:function(a){this.Q=a},Ud:function(a,b){return a<
+b?"right":"left"},Ma:function(a,b){if(this.oa)return dhx.delay(this.Ma,this,[a],100);for(var c=-1,d=0;d<this.c.length;d++)if(this.c[d]==a){c=d;break}if(!(c<0||c==this.l)){var e=this.c[this.l]?this.c[this.l].config.id:null,f=this.c[c]?this.c[c].config.id:null;if((b||typeof b=="undefined")&&dhx.animate.isSupported()&&this.a.animate){var g=dhx.extend({},this.a.animate);g.direction=this.Ud(c,this.l);var g=dhx.Settings.Ia(b||{},g),h=dhx.animate.formLine(this.c[c].b,this.c[this.l].b,g);this.c[c].$getSize();
+this.c[c].$setSize(this.j,this.m);g.callback=function(){dhx.animate.breakLine(h);this.oa=!1;g.master=g.callback=null};g.master=this;this.l=c;this.Yb(this.getActive());dhx.animate(h,g);this.oa=!0}else dhx.html.remove(this.c[this.l].b),this.l=c,this.c[this.l].$getSize(),this.c[this.l].$setSize(this.j,this.m),this.Yb(this.getActive()),this.b.appendChild(this.c[d].b);this.callEvent("onViewChange",[e,f])}},$getSize:function(){var a=this.c[this.l].$getSize();if(this.a.height>-1)a[3]=this.a.height,a[2]=
+0;if(this.a.width>-1)a[1]=this.a.width,a[0]=0;a[0]&&(a[1]=0);a[2]&&(a[3]=0);return a},$setSize:function(a,b){dhx.ui.baseview.prototype.$setSize.call(this,a,b);this.c[this.l].$setSize(a,b)},isVisible:function(a,b){return b&&b!=this.getActive()?(a&&this.xd(b,a),!1):dhx.ui.view.prototype.isVisible.call(this,a,this.a.id)},getActive:function(){return this.c.length?this.c[this.l].a.id:null},back:function(a){a=a||1;if(this.callEvent("onBeforeBack",[this.getActive(),a])&&this.M.length>a){var b=this.M[this.M.length-
+a-1];dhx.ui.get(b).show();return b}return null}},dhx.ui.baselayout,dhx.EventSystem);dhx.html.addMeta=function(a,b){document.getElementsByTagName("head").item(0).appendChild(dhx.html.create("meta",{name:a,content:b}))};
+(function(){var a=function(){var a=!!(window.orientation%180);if(dhx.ui.orientation!==a)dhx.ui.orientation=a,dhx.callEvent("onRotate",[a])};dhx.ui.orientation=!!((dhx.isNotDefined(window.orientation)?90:window.orientation)%180);dhx.event(window,"onorientationchange"in window?"orientationchange":"resize",a);dhx.ui.fullScreen=function(){dhx.html.addMeta("apple-mobile-web-app-capable","yes");dhx.html.addMeta("viewport","initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no");if(dhx.env.touch){var b=
+document.body.offsetHeight,c=navigator.userAgent.indexOf("iPhone")!=-1,d=c&&(b==356||b==208||b==306||b==158),e=function(){if(c)dhx.ui.orientation?(b=480,e=d?268:300):(b=320,e=d?416:460);else{document.body.style.width=document.body.style.height="1px";document.body.style.overflow="hidden";var a=window.outerWidth/window.innerWidth,b=window.outerWidth/a,e=window.outerHeight/a}document.body.style.height=e+"px";document.body.style.width=b+"px";dhx.ui.yc=!1;dhx.ui.resize();dhx.delay(function(){window.scrollTo(0,
+1)})},f=function(){dhx.ui.yc=!0;dhx.env.isSafari?e():dhx.delay(e,null,[],500)};dhx.attachEvent("onClick",function(a){a.target.tagName=="INPUT"||a.target.tagName=="TEXTAREA"||a.target.tagName=="SELECT"||(d&&window.innerHeight<416||!d&&window.innerHeight<window.outerHeight)&&window.scrollTo(0,1)});dhx.attachEvent("onRotate",f);a();dhx.delay(f)}}})();dhx.math={};dhx.math.Ve="0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F".split(",");
+dhx.math.toHex=function(a,b){for(var a=parseInt(a,10),c="";a>0;)c=this.Ve[a%16]+c,a=Math.floor(a/16);for(;c.length<b;)c="0"+c;return c};dhx.math.toFixed=function(a){return a<10?"0"+a:a};
+dhx.i18n={dateFormat:"%d.%m.%Y",timeFormat:"%H:%i",longDateFormat:"%l, %d %F %Y",fullDateFormat:"%d-%m-%Y %H:%i",groupDelimiter:".",groupSize:3,decimalDelimeter:",",decimalSize:2,setLocale:function(){for(var a=["fullDateFormat","timeFormat","dateFormat","longDateFormat"],b=0;b<a.length;b++){var c=a[b];dhx.i18n[c+"Str"]=dhx.Date.dateToStr(dhx.i18n[c]);dhx.i18n[c+"Date"]=dhx.Date.strToDate(dhx.i18n[c])}}};
+dhx.Number={format:function(a,b){var b=b||dhx.i18n,a=parseFloat(a),c=a.toFixed(b.decimalSize).toString(),c=c.split("."),d="",e=b.groupSize,f=c[0].length;do{f-=e;var g=f>0?c[0].substr(f,e):c[0].substr(0,e+f),d=g+(d?b.groupDelimiter+d:"")}while(f>0);return d+b.decimalDelimeter+c[1]},numToStr:function(a){return function(b){return dhx.Number.format(b,a)}}};
+dhx.Date={Locale:{month_full:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),month_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),day_full:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},weekStart:function(a){var b=a.getDay();this.config.start_on_monday&&(b===0?b=6:b--);return this.date_part(this.add(a,-1*b,"day"))},monthStart:function(a){a.setDate(1);return this.date_part(a)},
+yearStart:function(a){a.setMonth(0);return this.month_start(a)},dayStart:function(a){return this.date_part(a)},dateToStr:function(a,b){a=a.replace(/%[a-zA-Z]/g,function(a){switch(a){case "%d":return'"+dhx.math.toFixed(date.getDate())+"';case "%m":return'"+dhx.math.toFixed((date.getMonth()+1))+"';case "%j":return'"+date.getDate()+"';case "%n":return'"+(date.getMonth()+1)+"';case "%y":return'"+dhx.math.toFixed(date.getFullYear()%100)+"';case "%Y":return'"+date.getFullYear()+"';case "%D":return'"+dhx.Date.Locale.day_short[date.getDay()]+"';
+case "%l":return'"+dhx.Date.Locale.day_full[date.getDay()]+"';case "%M":return'"+dhx.Date.Locale.month_short[date.getMonth()]+"';case "%F":return'"+dhx.Date.Locale.month_full[date.getMonth()]+"';case "%h":return'"+dhx.math.toFixed((date.getHours()+11)%12+1)+"';case "%g":return'"+((date.getHours()+11)%12+1)+"';case "%G":return'"+date.getHours()+"';case "%H":return'"+dhx.math.toFixed(date.getHours())+"';case "%i":return'"+dhx.math.toFixed(date.getMinutes())+"';case "%a":return'"+(date.getHours()>11?"pm":"am")+"';
+case "%A":return'"+(date.getHours()>11?"PM":"AM")+"';case "%s":return'"+dhx.math.toFixed(date.getSeconds())+"';case "%W":return'"+dhx.math.toFixed(dhx.Date.getISOWeek(date))+"';default:return a}});b===!0&&(a=a.replace(/date\.get/g,"date.getUTC"));return new Function("date",'return "'+a+'";')},strToDate:function(a,b){for(var c="var temp=date.split(/[^0-9a-zA-Z]+/g);",d=a.match(/%[a-zA-Z]/g),e=0;e<d.length;e++)switch(d[e]){case "%j":case "%d":c+="set[2]=temp["+e+"]||1;";break;case "%n":case "%m":c+=
+"set[1]=(temp["+e+"]||1)-1;";break;case "%y":c+="set[0]=temp["+e+"]*1+(temp["+e+"]>50?1900:2000);";break;case "%g":case "%G":case "%h":case "%H":c+="set[3]=temp["+e+"]||0;";break;case "%i":c+="set[4]=temp["+e+"]||0;";break;case "%Y":c+="set[0]=temp["+e+"]||0;";break;case "%a":case "%A":c+="set[3]=set[3]%12+((temp["+e+"]||'').toLowerCase()=='am'?0:12);";break;case "%s":c+="set[5]=temp["+e+"]||0;"}var f="set[0],set[1],set[2],set[3],set[4],set[5]";b&&(f=" Date.UTC("+f+")");return new Function("date",
+"var set=[0,0,1,0,0,0]; "+c+" return new Date("+f+");")},getISOWeek:function(a){if(!a)return!1;var b=a.getDay();b===0&&(b=7);var c=new Date(a.valueOf());c.setDate(a.getDate()+(4-b));var d=c.getFullYear(),e=Math.floor((c.getTime()-(new Date(d,0,1)).getTime())/864E5),f=1+Math.floor(e/7);return f},getUTCISOWeek:function(a){return this.getISOWeek(a)},add:function(a,b,c){var d=new Date(a.valueOf());switch(c){case "day":d.setDate(d.getDate()+b);break;case "week":d.setDate(d.getDate()+7*b);break;case "month":d.setMonth(d.getMonth()+
+b);break;case "year":d.setYear(d.getFullYear()+b);break;case "hour":d.setHours(d.getHours()+b);break;case "minute":d.setMinutes(d.getMinutes()+b)}return d},datePart:function(a){var b=this.copy(a);b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0);return b},timePart:function(a){var b=this.copy(a);return(b.valueOf()/1E3-b.getTimezoneOffset()*60)%86400},copy:function(a){return new Date(a.valueOf())}};dhx.i18n.setLocale("en");dhx.format=function(a){a=a||{};this.$init(a)};
+dhx.format.prototype={$init:function(a){this.a={};this.a.groupDelimiter=a.groupDelimiter||" ";this.a.groupNumber=a.groupNumber||3;this.a.decimalPoint=a.decimalPoint||",";this.a.fractNumber=a.fractNumber||5;this.a.dateFormat=a.dateFormat||"%Y/%m/%d";this.a.stringTemplate=a.stringTemplate||"{value}";this.ff=dhx.Date.str_to_date(this.a.dateFormat);this.Qd=dhx.Date.date_to_str(this.a.dateFormat)},define:function(a,b){this.a[a]=b},format:function(a,b){b=b||this.formatAutoDefine(a);return this["format__"+
+b]?this["format__"+b](a):a},formatAutoDefine:function(a){return typeof a=="number"||a instanceof Number?"number":a instanceof Date?"date":typeof a=="string"||a instanceof String?isNaN(parseFloat(a))?"string":"number":!1},format__number:function(a){var b="";typeof a=="number"||a instanceof Number||(a=parseFloat(a));var c=a.toFixed(this.a.fractNumber).toString(),c=c.split("."),d=this.add_delimiter_to_int(c[0]),e=this.str_reverse(this.add_delimiter_to_int(this.str_reverse(c[1])));return b=d+this.a.decimalPoint+
+e},add_delimiter_to_int:function(a){for(var b=0,c="",d=a.length-1;d>=0;d--)c=a[d]+c,b++,b==this.a.groupNumber&&(c=this.a.groupDelimiter+c,b=0);return c},str_reverse:function(a){for(var b="",c=a.length-1;c>=0;c--)b+=a[c];return b},format__date:function(a){var b=this.Qd(a);return b},attachFormat:function(a,b){this["format__"+a]=b},format__string:function(a){var b=this.a.stringTemplate.replace("{value}",a);return b},format__bold:function(a){return typeof a=="string"||a instanceof String?a.bold():a}};
+dhx.i18n.setLocale();
+dhx.protoUI({name:"calendar",defaults:{date:null,startOnMonday:!0,navigation:!0,weekHeader:!1,weekNumber:!1,timeSelect:!1,skipEmptyWeeks:!0,cellHeight:36,minuteStep:15,hourStart:6,hourEnd:24,hourFormat:"%H",calendarHeader:"%F %Y",calendarDay:"%d",calendarWeekHeader:"W#",calendarWeek:"%W",width:300,height:300,selectedCss:"dhx_cal_selected_day"},skin:{monthHeaderHeight:40,weekHeaderHeight:20,timeSelectHeight:32},hourFormat_setter:dhx.Date.dateToStr,calendarHeader_setter:dhx.Date.dateToStr,calendarDay_setter:dhx.Date.dateToStr,
+calendarWeekHeader_setter:dhx.Date.dateToStr,calendarWeek_setter:dhx.Date.dateToStr,date_setter:function(a){typeof a=="string"&&(a=dhx.i18n.fullDateFormatDate(a));this.L=this.L||a;return a},$init:function(){this.fa={};this.ec=[];var a="%Y-%m-%d";this.rc=dhx.Date.dateToStr(a);this.Cd=dhx.Date.strToDate(a)},$getSize:function(){var a=this.a;if(a.cellHeight>0)a.height=this.Xd();return dhx.ui.view.prototype.$getSize.call(this)},cellHeight_setter:function(a){return a=="auto"?0:a},$setSize:function(a,b){dhx.ui.view.prototype.$setSize.call(this,
+a,b)&&this.render()},Ac:function(){var a=this.a;if(!this.L)this.L=new Date;var b=new Date(this.L);b.setDate(1);var c=b.getDay();this.ke=new Date(b);this.vd=a.startOnMonday?1:0;this.lb=(c-this.vd+7)%7;this.Nb=32-(new Date(b.getFullYear(),b.getMonth(),32)).getDate();var d=42-this.lb-this.Nb;this.df=new Date(b.setDate(this.Nb));this.G=a.skipEmptyWeeks?6-Math.floor(d/7):6;this.Ob=this.G*7-this.lb-this.Nb;this.cf=new Date(b.setDate(b.getDate()+d));this.Dc=this.skin.monthHeaderHeight+(a.weekHeader?this.skin.weekHeaderHeight:
+0)+(a.timeSelect?this.skin.timeSelectHeight:0)},Xd:function(){this.Ac();return this.Dc+this.G*this.a.cellHeight},Td:function(){this.Ac();var a=this.a;this.Da=[];this.W=[];var b=this.j;b+=1;for(var c=this.m,d=a.weekNumber?8:7,e=0;e<d;e++)this.W[e]=Math.ceil(b/(d-e)),b-=this.W[e];if(a.cellHeight<=0)for(var f=0;f<this.G;f++)this.Da[f]=Math.ceil((c-this.Dc)/(this.G-f)),c-=this.Da[f];else for(var g=0;g<this.G;g++)this.Da[g]=a.cellHeight},selectDate:function(a,b){this.define("date",a);var c=this.a;b&&this.showCalendar(c.date);
+var d=c.selectedCss;if(this.fa[this.i])dhx.html.removeCss(this.fa[this.i],d),this.i=null;var e=this.rc(c.date);if(this.fa[e])dhx.html.addCss(this.fa[e],d),this.i=e;c.timeSelect&&this.Ee(a)},Ee:function(a){var b=this.a,c=this.ec,a=a||b.date;c[0].value=Math.min(b.hourEnd,Math.max(a.getHours(),b.hourStart));c[1].value=Math.floor(a.getMinutes()/b.minuteStep)*b.minuteStep},getSelectedDate:function(){var a=this.a;return a.date?new Date(a.date):null},getVisibleDate:function(){return new Date(this.L)},setValue:function(a){this.selectDate(a,
+!0)},getValue:function(){return this.getSelectedDate()},showCalendar:function(a){typeof a=="string"&&(a=dhx.i18m.fullDateFormatDate(a));if(!a||!(a.getFullYear()==this.L.getFullYear()&&a.getMonth()==this.L.getMonth())){this.L=a||this.L;this.render();var b=this.getParent();b&&b.resize()}},refresh:function(){this.render()},render:function(){var a=this.a;if(this.isVisible(a.id)){this.callEvent("onBeforeRender",[]);this.Td();var b="<div class='dhx_mini_calendar'><div class='dhx_cal_month'>"+a.calendarHeader(this.L);
+a.navigation&&(b+=this.le());b+="</div>";a.weekHeader&&(b+="<div class='dhx_cal_header' style='height:"+this.skin.weekHeaderHeight+"px'>"+this.Xe()+"</div>");b+="<div class='dhx_cal_body'>"+this.Bd()+"</div>";a.timeSelect&&(b+="<div class='dhx_cal_time_select'>"+this.Ue()+"</div>");b+="</div></div>";this.g.innerHTML=b;if(a.timeSelect){for(var c=this.g.getElementsByTagName("select"),d=this.ec,e=0;e<c.length;e++)d[e]=c[e];d[0].onchange=function(){a.date.setHours(this.value)};d[1].onchange=function(){a.date.setMinutes(this.value)}}this.fa=
+{};for(var f=this.g.getElementsByTagName("table"),g=f[f.length-1].getElementsByTagName("div"),e=0;e<g.length;e++)this.fa[g[e].getAttribute("date")]=g[e];a.date&&this.selectDate(a.date,!1);this.callEvent("onAfterRender",[])}},Xe:function(){var a=this.a,b="",c=a.startOnMonday?1:0,d=0,e=0;if(a.weekNumber){var e=1,f=a.calendarWeekHeader();b+="<div class='dhx_cal_week_header' style='width: "+(this.W[0]-1)+"px; left: "+d+"px;' >"+f+"</div>";d+=this.W[0]}for(var g=0;g<7;g++){var h=(c+g)%7,i=dhx.Date.Locale.day_short[h],
+j="dhx_cal_day_name",k=this.W[g+e]-1;g==6&&(j+=" dhx_cal_day_name_last",k+=1);h===0&&(j+=" dhx_sunday");h==6&&(j+=" dhx_saturday");b+="<div class='"+j+"' style='width: "+k+"px; left: "+d+"px;' >"+i+"</div>";d+=this.W[g+e]}return b},Bd:function(){var a=this.a,b=0,c=dhx.Date.add(this.ke,-this.lb,"day"),c=dhx.Date.datePart(c),d=0,e="";if(a.weekNumber){var d=1,f=dhx.Date.add(c,(this.vd+1)%2,"day");e+='<table class="dhx_week_numbers" cellspacing="0" cellpadding="0" style="float: left;"><tbody>';for(var g=
+0;g<this.G;g++){var h=this.Da[g]-2,i=this.W[0]-2,j=a.calendarWeek(f),k="dhx_cal_week_num";if(!a.skipEmptyWeeks&&(g==this.G-1&&this.Ob>=7||g==this.G-2&&this.Ob==14))k="dhx_next_month",j="";g==this.G-1&&(k+=" dhx_cal_day_num_bborder",h+=1);e+="<tr><td>";e+="<div class='"+k+"' style='width:"+i+"px; height:"+h+"px; line-height:"+h+"px;' >"+j+"</div>";e+="</td></tr>";f=dhx.Date.add(f,7,"day")}e+="</tbody></table>"}var o=dhx.Date.datePart(new Date);e+='<table cellspacing="0" cellpadding="0"><tbody>';for(var m=
+this.G*7-1,g=0;g<this.G;g++){e+="<tr>";for(var l=0;l<7;l++){var n=a.calendarDay(c),p=this.rc(c),k="dhx_cal_day_num";b<this.lb&&(k="dhx_prev_month",p=n="");b>m-this.Ob&&(k="dhx_next_month",p=n="");h=this.Da[g]-2;i=this.W[l+d]-2;l==6&&(k+=" dhx_cal_day_num_rborder",i+=1);g==this.G-1&&(k+=" dhx_cal_day_num_bborder",h+=1);e+="<td>";o.valueOf()==c.valueOf()&&(k+=" dhx_cal_current_day");e+="<div class='"+k+"' style='width:"+i+"px; height:"+h+"px; line-height:"+h+"px;' date='"+p+"'>"+n+"</div>";e+="</td>";
+c=dhx.Date.add(c,1,"day");b++}e+="</tr>"}e+="</tbody></table>";return e},Ue:function(){for(var a=this.a,b="<select class='dhx_hour_select' onclick=''>",c=a.hourStart,d=a.hourEnd,e=dhx.Date.datePart(new Date),f=c;f<d;f++)e.setHours(f),b+="<option value='"+f+"'>"+a.hourFormat(e)+"</option>";b+="</select>";b+="<select class='dhx_minute_select' onclick=''>";for(var g=0;g<60;g+=a.minuteStep)b+="<option value='"+g+"'>"+dhx.math.toFixed(g)+"</option>";b+="</select>";return b},le:function(){var a="<div class='dhx_cal_arrow dhx_cal_",
+b="_button'><div></div></div>";return a+"prev"+b+a+"next"+b},on_click:{dhx_cal_arrow:function(a,b,c){var d=c.className.match(/prev/i)?-1:1,e=new Date(this.L),f=new Date(e);f.setDate(1);f=dhx.Date.add(f,d,"month");this.callEvent("onBeforeMonthChange",[e,f])&&(this.showCalendar(f),this.selectDate(this.a.date,!1),this.callEvent("onAfterMonthChange",[f,e]))},dhx_cal_day_num:function(a,b,c){var d=c.getAttribute("date"),e=this.Cd(d);if(this.a.timeSelect){var f=this.ec;e.setMinutes(f[0].value*60+f[1].value*
+1)}this.selectDate(e);this.callEvent("onDateSelect",[e]);this.callEvent("onChange",[e])}}},dhx.MouseEvents,dhx.Settings,dhx.EventSystem,dhx.Movable,dhx.ui.view);dhx.Modality={modal_setter:function(a){if(a){if(!this.qa)this.qa=dhx.html.create("div",{"class":a=="rich"?"dhx_modal_rich":"dhx_modal"}),this.qa.style.zIndex=dhx.ui.zIndex(),this.b.style.zIndex=dhx.ui.zIndex(),document.body.appendChild(this.qa)}else this.qa&&dhx.html.remove(this.qa),this.qa=null;return a}};
+dhx.protoUI({name:"window",$init:function(a){this.b.innerHTML="<div class='dhx_win_content'><div class='dhx_win_head'></div><div class='dhx_win_body'></div></div>";this.g=this.b.firstChild;this.eb=this.g.childNodes[0];this.pc=this.g.childNodes[1];this.b.className+=" dhx_window";this.R=this.h=null;this.a.k={top:!1,left:!1,right:!1,bottom:!1};if(!a.id)a.id=dhx.uid()},Zc:function(){this.h={destructor:function(){}}},ac:function(a){this.h.destructor();this.h=a;this.h.D=this;this.pc.appendChild(this.h.b);
+this.resize()},show:function(a,b,c){this.a.hidden=!1;this.b.style.zIndex=dhx.ui.zIndex();this.a.modal&&this.modal_setter(!0);var d,e,f;if(a){typeof a=="object"&&!a.tagName?(d={x:a.clientX-this.$[0]/2,y:a.clientY},e=document.body.offsetWidth,f=1):a=dhx.toNode(a);var g=document.body.offsetWidth,h=document.body.offsetHeight;e=e||a.offsetWidth;f=f||a.offsetHeight;var i=this.$;d=d||dhx.html.offset(a);var j=6,k=6,o=6,c="top",m=0,l=0,n=0,p=0;b=="right"?(p=d.x+j+e,k=-f,c="left",m=Math.round(d.y+f/2),l=p-
+o):b=="left"?(p=d.x-j-i[0]-1,k=-f,c="right",m=Math.round(d.y+f/2),l=p+i[0]+1):(p=g-d.x>i[0]?d.x:g-j-i[0],l=Math.round(d.x+e/2),l>p+i[0]&&(l=p+i[0]/2));h-f-d.y-k>i[1]?(n=f+d.y+k,m||(c="top",m=n-o)):(n=d.y-k-i[1],n<0?(n=0,c=!1):m||(c="bottom",n--,m=n+i[1]+1));this.setPosition(p,n);c&&this.cd&&this.cd(c,l,m)}this.Le=new Date;this.b.style.display="block";if(this.la){for(var q=0;q<this.la.length;q++)dhx.ui.get(this.la[q]).render();this.la=[];this.Jb={}}this.callEvent("onShow",[])},hidden_setter:function(a){a?
+this.hide():this.show();return!!a},hide:function(){!this.a.hidden&&!(new Date-this.Le<100)&&(this.a.modal&&this.modal_setter(!1),this.a.position=="top"?dhx.animate(this.b,{type:"slide",x:0,y:0,duration:300,callback:this.Ec,master:this}):this.Ec())},Ec:function(){this.b.style.display="none";this.a.hidden=!0;this.callEvent("onHide",[])},close:function(){this.define("modal",!1);dhx.html.remove(this.b);this.destructor()},body_setter:function(a){typeof a!="object"&&(a={template:a});this.h=dhx.ui.Oa(a);
+this.h.D=this;this.pc.appendChild(this.h.b);return a},head_setter:function(a){if(a===!1)return a;typeof a!="object"&&(a={template:a,css:"dhx_alert_template"});this.R=dhx.ui.Oa(a);this.R.D=this;this.eb.appendChild(this.R.b);return a},getBody:function(){return this.h},getHead:function(){return this.R},resize:function(){var a=this.$getSize();this.$setSize(a[1]||this.a.width,a[3]||this.a.height);this.cc(this.a.left,this.a.top)},cc:function(a,b){if(this.a.position){var c=Math.round((document.body.offsetWidth-
+this.a.width)/2),d=Math.round((document.body.offsetHeight-this.a.height)/2);this.a.position=="top"&&(d=dhx.animate.isSupported()?-1*this.a.height:10);this.setPosition(c,d);this.a.position=="top"&&dhx.animate(this.b,{type:"slide",x:0,y:this.a.height,duration:300})}else this.setPosition(a,b)},setPosition:function(a,b){this.b.style.top=b+"px";this.b.style.left=a+"px";this.a.left=a;this.a.top=b},$getSize:function(){var a=this.h.$getSize();if(this.R){var b=this.R.$getSize();if(b[3])this.a.headHeight=b[3]}if(a[3])a[3]+=
+this.a.head!==!1?this.a.headHeight:0,this.a.height=a[3];if(a[1])this.a.width=a[1];if(a[0]||a[2])this.a.gravity=Math.max(a[0],a[2]);return dhx.ui.view.prototype.$getSize.call(this)},$setSize:function(a,b){if(dhx.ui.view.prototype.$setSize.call(this,a,b))a=this.j,b=this.m,this.a.head===!1?(this.eb.style.display="none",this.h.$setSize(a,b)):(this.R.$setSize(a,this.a.headHeight),this.h.$setSize(a,b-this.a.headHeight))},defaults:{headHeight:43,width:300,height:200,top:100,left:100,body:"",head:""}},dhx.ui.view,
+dhx.Movable,dhx.Modality,dhx.EventSystem);
+dhx.protoUI({name:"popup",$init:function(){this.a.head=!1;dhx.event(this.g,"click",dhx.bind(this.Id,this));dhx.attachEvent("onClick",dhx.bind(this.Ha,this));this.attachEvent("onHide",this.Fc)},Id:function(){this.Me=new Date},Ha:function(){new Date-(this.Me||0)>250&&this.hide()},$getSize:function(){var a=this.h.$getSize();if(a[3])this.a.height=a[3]+this.a.padding*2;if(a[1])this.a.width=a[1]+this.a.padding*2;if(a[0]||a[2])this.a.gravity=Math.max(a[0],a[2]);return dhx.ui.view.prototype.$getSize.call(this)},
+$setSize:function(a,b){if(dhx.ui.view.prototype.$setSize.call(this,a,b))a=this.j-this.a.padding*2,b=this.m-this.a.padding*2,this.g.style.padding=this.a.padding+"px",this.eb.style.display="none",this.h.$setSize(a,b)},body_setter:function(a){a=dhx.ui.window.prototype.body_setter.call(this,a);this.h.a.k={top:!1,left:!1,right:!1,bottom:!1};return a},defaults:{padding:8},head_setter:null,cd:function(a,b,c){this.Fc();document.body.appendChild(this.Ka=dhx.html.create("DIV",{"class":"dhx_point_"+a},""));
+this.Ka.style.zIndex=dhx.ui.zIndex();this.Ka.style.top=c+"px";this.Ka.style.left=b+"px"},Fc:function(){this.Ka=dhx.html.remove(this.Ka)}},dhx.ui.window);
+dhx.protoUI({name:"alert",defaults:{position:"center",head:{template:"Info",css:"dhx_alert_template"},height:170,modal:!0,callback:null,body:{type:"clean",rows:[{template:"<div class='dhx_alert_text'>#text#</div>",data:{text:"You have forgot to define the text :) "}},{view:"button",height:60,id:"dhx_alert_ok",type:"big",label:"Ok",click:function(){this.getParent().getParent().Bb(!0)}}]}},$init:function(){(!this.b.parentNode||!this.b.parentNode.tagName)&&document.body.appendChild(this.b);this.$ready.push(this.resize)},
+Yc:function(a){typeof a=="string"&&(a={title:this.defaults.head.template,message:a});dhx.extend(a,this.defaults);delete a.head;delete a.body;this.Rb(a,{});this.resize();this.show()},title_setter:function(a){this.R.define("template",a);this.R.render()},message_setter:function(a){var b=this.h.c[0];b.data={text:a};b.render()},labelOk_setter:function(a){var b=this.h.c[1];b.config.label=a;b.render()},labelCancel_setter:function(a){var b=this.h.c[2];b.config.label=a;b.render()},Bb:function(a){this.hide();
+this.a.callback&&dhx.toFunctor(this.a.callback).call(this,a,this.a.details)}},dhx.ui.window);dhx.alert=dhx.single(dhx.ui.alert);
+dhx.protoUI({name:"confirm",defaults:{height:210,body:{type:"clean",rows:[{id:"dhx_confirm_message",template:"<div class='dhx_alert_text'>#text#</div>",data:{text:"You have forgot to define the text :) "}},{height:53,view:"button",type:"big",id:"dhx_confirm_ok",label:"Ok",click:function(){this.getParent().getParent().Bb(!0)}},{height:55,view:"button",type:"biground",id:"dhx_confirm_cancel",label:"Cancel",click:function(){this.getParent().getParent().Bb(!1)}}]}}},dhx.ui.alert);dhx.confirm=dhx.single(dhx.ui.confirm);
+dhx.dp=function(a){if(typeof a=="object"&&a.a)a=a.a.id;if(dhx.dp.Tb[a])return dhx.dp.Tb[a];if(typeof a=="string"||typeof a=="number")a={master:dhx.ui.get(a)};var b=new dhx.DataProcessor(a);return dhx.dp.Tb[b.a.master.a.id]=b};dhx.dp.Tb={};
+dhx.DataProcessor=dhx.proto({defaults:{autoupdate:!0,mode:"post"},$init:function(){this.V=[];this.bf=[];this.X=null;this.na=!1;this.name="DataProcessor";this.$ready.push(this.zb)},master_setter:function(a){var b=a;if(a.name!="DataStore")b=a.data;this.a.store=b;return a},zb:function(){this.a.store.attachEvent("onStoreUpdated",dhx.bind(this.Sc,this))},ignore:function(a,b){var c=this.na;this.na=!0;a.call(b||this);this.na=c},off:function(){this.na=!0},on:function(){this.na=!1},Kd:function(a){var b={},
+c;for(c in a)c.indexOf("$")!==0&&(b[c]=a[c]);return b},save:function(a,b){b=b||"update";this.Sc(a,this.a.store.item(a),b)},Sc:function(a,b,c){if(this.na===!0||!c)return!0;var d={id:a,data:this.Kd(b)};switch(c){case "update":d.operation="update";break;case "add":d.operation="insert";break;case "delete":d.operation="delete";break;default:return!0}if(d.operation!="delete"&&!this.validate(d.data))return!1;this.Gd(d)&&this.V.push(d);this.a.autoupdate&&this.send();return!0},Gd:function(a){for(var b=0;b<
+this.V.length;b++){var c=this.V[b];if(c.id==a.id){if(a.operation=="delete")c.operation=="insert"?this.V.splice(b,1):c.operation="delete";c.data=a.data;return!1}}return!0},send:function(){this.Ge()},Ge:function(){if(this.a.url){for(var a=this.V,b=[],c=0;c<a.length;c++){var d=a[c].id,e=a[c].operation;if(this.a.store.exists(d))a[c].data=this.a.store.item(d);this.callEvent("onBefore"+e,[d,a[c].data])&&b.push(a[c])}b.length&&this.callEvent("onBeforeDataSend",[b])&&this.Fe(this.a.url,this.We(b),this.a.mode)}},
+We:function(a){for(var b={},c=[],d=0;d<a.length;d++){var e=a[d];c.push(e.id);b[e.id+"_!nativeeditor_status"]=e.operation;for(var f in e.data)f.indexOf("$")!==0&&(b[e.id+"_"+f]=e.data[f])}b.ids=c.join(",");return b},Fe:function(a,b,c){if(typeof a=="function")return a(b);a+=a.indexOf("?")==-1?"?":"&";a+="editing=true";dhx.ajax()[c](a,b,dhx.bind(this.ye,this))},ye:function(a,b,c){this.callEvent("onBeforeSync",[f,a,b,c]);for(var d=dhx.DataDriver.xml,b=d.toObject(a,d),e=d.xpath(b,"//action"),f=[],g=0;g<
+e.length;g++){var h=d.tagToObject(e[g]);f.push(h);for(var i=-1,j=0;j<this.V.length;){this.V[j].id==h.sid&&(i=j);break}if(!(h.type=="error"||h.type=="invalid")||this.callEvent("onDBError",[h,this.V[i]]))i>=0&&this.V.splice(i,1),h.tid!=h.sid&&this.a.store.changeId(h.sid,h.tid),this.callEvent("onAfter"+h.type,[h])}this.callEvent("onAfterSync",[f,a,b,c])},escape:function(a){return this.a.escape?this.a.escape(a):encodeURIComponent(a)}},dhx.Settings,dhx.EventSystem,dhx.ValidateData);
+(function(){var a=dhx.Touch={config:{longTouchDelay:1E3,scrollDelay:150,gravity:500,deltaStep:30,speed:"0ms",finish:1500},disable:function(){a.Fb=!0},enable:function(){a.Fb=!1},$init:function(){dhx.env.touch?(dhx.event(document.body,"touchstart",a.nd),dhx.event(document.body,"touchmove",a.gc),dhx.event(document.body,"touchend",a.md)):(a.bb=a.Wd,dhx.event(document.body,"mousedown",a.nd),dhx.event(document.body,"mousemove",a.gc),dhx.event(document.body,"mouseup",a.md),document.body.style.overflowX=
+document.body.style.overflowY="hidden");dhx.event(document.body,"dragstart",function(a){return dhx.html.preventEvent(a)});dhx.event(document.body,"touchstart",function(b){if(!a.Fb&&dhx.env.isSafari)return b.srcElement.tagName=="SELECT"?!0:dhx.html.preventEvent(b)});a.Ca()},Ca:function(){a.A=a.w=a.ca=null;a.H=a.v=a.n=null;a.I={wb:0,xb:0,Na:0};if(a.Xa)dhx.html.removeCss(a.Xa,"dhx_touch"),a.Xa=null;window.clearTimeout(a.Kc);a.ud=!0;a.Sa=!0;a.Ta=!0;a.ic||a.ua()},md:function(b){if(a.A){if(a.H){var c=a.Hb(a.v),
+d=c.e,e=c.f,f=a.config.finish,g=a.Bc(b,!0);if(g.Na){var h=d+a.config.gravity*g.wb/g.Na,i=e+a.config.gravity*g.xb/g.Na,j=a.q[0]?a.Wa(h,!1,!1,a.n.dx,a.n.px):d,k=a.q[1]?a.Wa(i,!1,!1,a.n.dy,a.n.py):e,o=Math.max(Math.abs(j-d),Math.abs(k-e));o<150&&(f=f*o/150);if(j!=d||k!=e)f=Math.round(f*Math.max((j-d)/(h-d),(k-e)/(i-e)));var m={e:j,f:k},l=dhx.ui.get(a.v);l&&l.callEvent&&l.callEvent("onAfterScroll",[m]);f=Math.max(100,f);d!=m.e||e!=m.f?(a.wa(a.v,m.e,m.f,f+"ms"),a.dd(m.e,m.f,f+"ms")):a.ua()}else a.ua()}else if(a.Ta&&
+!a.Sa)a.ya("onSwipeX");else if(a.Sa&&!a.Ta)a.ya("onSwipeY");else if(dhx.env.isSafari){var n=a.A.target;dhx.delay(function(){var a=document.createEvent("MouseEvents");a.initEvent("click",!0,!0);n.dispatchEvent(a)})}a.ya("onTouchEnd");a.Ca()}},gc:function(b){if(a.A){var c=a.Bc(b);a.ya("onTouchMove");if(a.H)a.ed(c);else if(a.Sa=a.lc(c.Ye,"x",a.Sa),a.Ta=a.lc(c.Ze,"y",a.Ta),a.H){var d=a.Cc("onBeforeScroll");if(d){var e={};d.callEvent("onBeforeScroll",[e]);if(e.update)a.config.speed=e.speed,a.config.scale=
+e.scale}a.ce(c)}return dhx.html.preventEvent(b)}},ed:function(){if(a.v){var b=a.Hb(a.v),c=b.e,d=b.f,e=a.ca||a.A;if(a.q[0])b.e=a.Wa(b.e-e.x+a.w.x,!0,b.e,a.n.dx,a.n.px);if(a.q[1])b.f=a.Wa(b.f-e.y+a.w.y,!0,b.f,a.n.dy,a.n.py);a.wa(a.v,b.e,b.f,"0ms");a.dd(b.e,b.f,"0ms")}},dd:function(b,c,d){var e=a.n.px/a.n.dx*-b,f=a.n.py/a.n.dy*-c;a.q[0]&&a.wa(a.q[0],e,0,d);a.q[1]&&a.wa(a.q[1],0,f,d)},wa:function(b,c,d,e){a.ic=!0;b.style[dhx.env.transformPrefix+"Transform"]=dhx.env.translate+"("+Math.round(c)+"px, "+
+Math.round(d)+"px"+(dhx.env.translate=="translate3d"?", 0":"")+")";b.style[dhx.env.transformPrefix+"TransitionDuration"]=e},Hb:function(a){var c=window.getComputedStyle(a)[dhx.env.transformPrefix+"Transform"];if(c=="none")return{e:0,f:0};else{if(window.WebKitCSSMatrix)return new WebKitCSSMatrix(c);for(var d=c.replace(/(matrix\()(.*)(\))/gi,"$2"),d=d.replace(/\s/gi,""),d=d.split(","),e={},f="a,b,c,d,e,f".split(","),g=0;g<f.length;g++)e[f[g]]=parseInt(d[g],10);return e}},Wa:function(a,c,d,e,f){if(a===
+d)return a;var g=Math.abs(a-d),h=g/(a-d);if(a>0)return c?d+h*Math.sqrt(g):0;var i=e-f;return i+a<0?c?d-Math.sqrt(-(a-d)):-i:a},ce:function(){a.H.indexOf("x")!=-1&&(a.q[0]=a.vc("x",a.n.dx,a.n.px,"width"));a.H.indexOf("y")!=-1&&(a.q[1]=a.vc("y",a.n.dy,a.n.py,"height"));if(!a.v.scroll_enabled){a.v.scroll_enabled=!0;a.v.parentNode.style.position="relative";var b=dhx.env.transformCSSPrefix;a.v.style.cssText+=b+"transition: "+b+"transform; "+b+"user-select:none; "+b+"transform-style:flat;";a.v.addEventListener(dhx.env.transitionEnd,
+a.ua,!1)}window.setTimeout(a.ed,1)},vc:function(b,c,d,e){if(c-d<2)return a.H="";var f=dhx.html.create("DIV",{"class":"dhx_scroll_"+b},"");f.style[e]=d*d/c-7+"px";a.v.parentNode.appendChild(f);return f},lc:function(b,c,d){if(b>a.config.deltaStep){if(a.ud&&(a.he(c),(a.H||"").indexOf(c)==-1))a.H="";return!1}return d},ua:function(){if(!a.H)dhx.html.remove(a.q),a.q=[null,null];a.ic=!1},he:function(b){window.clearTimeout(a.Kc);a.ud=!1;a.Jc(b)},nd:function(b){if(!a.Fb){a.A=a.bb(b);a.ya("onTouchStart");a.q[0]||
+a.q[1]?a.Re(b,a.q[0]?"x":"y"):a.Kc=window.setTimeout(a.ie,a.config.longTouchDelay);var c=dhx.ui.get(b);if(c&&c.touchable&&(!b.target.className||b.target.className.indexOf("dhx_view")!==0))a.Xa=c.getNode(b),dhx.html.addCss(a.Xa,"dhx_touch")}},ie:function(){a.ya("onLongTouch");dhx.callEvent("onClick",[a.A]);a.Ca()},Re:function(b,c){a.Jc(c);var d=a.q[0]||a.q[1];if(d&&(!a.v||d.parentNode!=a.v.parentNode))a.Ca(),a.ua(),a.A=a.bb(b);a.gc(b)},Bc:function(b){a.ca=a.w;a.w=a.bb(b);a.I.Ye=Math.abs(a.A.x-a.w.x);
+a.I.Ze=Math.abs(a.A.y-a.w.y);if(a.ca)a.w.time-a.ca.time<a.config.scrollDelay?(a.I.wb=a.I.wb/1.3+a.w.x-a.ca.x,a.I.xb=a.I.xb/1.3+a.w.y-a.ca.y):a.I.xb=a.I.wb=0,a.I.Na=a.I.Na/1.3+(a.w.time-a.ca.time);return a.I},Jc:function(b){var c=a.A.target;if(dhx.env.touch||dhx.env.transition||dhx.env.transform)for(;c&&c.tagName!="BODY";){if(c.getAttribute){var d=c.getAttribute("touch_scroll");if(d&&(!b||d.indexOf(b)!=-1)){a.H=d;a.v=c;a.n={dx:c.offsetWidth,dy:c.offsetHeight,px:c.parentNode.offsetWidth,py:c.parentNode.offsetHeight};
+break}}c=c.parentNode}},ya:function(b){dhx.callEvent(b,[a.A,a.w]);var c=a.Cc(b);c&&c.callEvent(b,[a.A,a.w])},Cc:function(b){var c=dhx.ui.get(a.A);if(!c)return null;for(;c;){if(c.hasEvent&&c.hasEvent(b))return c;c=c.getParent()}return null},bb:function(b){if(!b.touches[0]){var c=a.w;c.time=new Date;return c}return{target:b.target,x:b.touches[0].pageX,y:b.touches[0].pageY,time:new Date}},Wd:function(a){return{target:a.target,x:a.pageX,y:a.pageY,time:new Date}}};dhx.TouchEvents={$init:function(){this.attachEvent("onSwipeX",
+this.Se);this.attachEvent("onBeforeSelect",this.unSwipe);this.attachEvent("onAfterDelete",this.unSwipe)},Se:function(a){var c=this.locate(a);c&&c!=this.ea&&(this.unSwipe(),this.swipe(c))},swipe:function(a){this.ea=a;this.item(this.ea).$template="Swipe";this.refresh(this.ea)},unSwipe:function(){if(this.ea){var a=this.item(this.ea);if(a)a.$template="",this.refresh(this.ea);this.ea=null}}};dhx.ready(function(){a.$init()})})();
+dhx.protoUI({name:"googlemap",$init:function(a){if(!a.id)a.id=dhx.uid();this.b.innerHTML="<div class='dhx_map_content' style='width:100%;height:100%'></div>";this.g=this.b.firstChild;this.map=null;this.$ready.push(this.render)},render:function(){var a=this.a,b={zoom:a.zoom,center:a.center,mapTypeId:a.mapType};this.map=new google.maps.Map(this.g,b)},center_setter:function(a){typeof a!="object"&&(a={});this.Ia(a,{x:48.724,y:8.215});a=new google.maps.LatLng(a.x,a.y);this.map&&this.map.setCenter(a);return a},
+mapType_setter:function(a){a=google.maps.MapTypeId[a];this.map&&this.map.setMapTypeId(a);return a},zoom_setter:function(a){this.map&&this.map.setZoom(a);return a},defaults:{zoom:5,center:{},mapType:"ROADMAP"},$setSize:function(){dhx.ui.view.prototype.$setSize.apply(this,arguments);google.maps.event.trigger(this.map,"resize")}},dhx.ui.view);if(!window.scheduler)window.scheduler={config:{},templates:{},xy:{},locale:{}};if(!scheduler.locale)scheduler.locale={};
+scheduler.locale.labels={list_tab:"List",day_tab:"Day",month_tab:"Month",icon_today:"Today",icon_save:"Save",icon_delete:"Delete event",icon_cancel:"Cancel",icon_edit:"Edit",icon_back:"Back",icon_close:"Close form",icon_yes:"Yes",icon_no:"No",confirm_closing:"Your changes will be lost, are your sure ?",confirm_deleting:"Event will be deleted permanently, are you sure?",label_event:"Event",label_start:"Start",label_end:"End",label_details:"Notes",label_from:"from",label_to:"to"};
+scheduler.config={init_date:new Date,form_date:"%d-%m-%Y %H:%i",xml_date:"%Y-%m-%d %H:%i",item_date:"%d.%m.%Y",header_date:"%d.%m.%Y",hour_date:"%H:%i",scale_hour:"%H",calendar_date:"%F %Y"};scheduler.config.form_rules={end_date:function(a,b){return b.start_date.valueOf()<a.valueOf()}};scheduler.xy={confirm_height:231,confirm_width:250,scale_width:45,scale_height:15,list_tab:54,day_tab:54,month_tab:68,icon_today:72,icon_save:100,icon_cancel:100,icon_edit:100,icon_back:100,list_height:42,month_list_height:42};
+scheduler.templates={selected_event:function(a){var b="";if(!a.start_date)return b;b+="<div class='selected_event'>";b+="<div class='event_title'>"+a.text+"</div>";if(dhx.Date.datePart(a.start_date).valueOf()==dhx.Date.datePart(a.end_date).valueOf()){var c=dhx.i18n.dateFormatStr(a.start_date),d=dhx.i18n.timeFormatStr(a.start_date),e=dhx.i18n.timeFormatStr(a.end_date);b+="<div class='event_text'>"+c+"</div>";b+="<div class='event_text'>"+scheduler.locale.labels.label_from+" "+d+" "+scheduler.locale.labels.label_to+
+" "+e+"</div>"}else{var f=dhx.i18n.longDateFormatStr(a.start_date),g=dhx.i18n.longDateFormatStr(a.end_date),d=dhx.i18n.timeFormatStr(a.start_date),e=dhx.i18n.timeFormatStr(a.end_date);b+="<div class='event_text'>"+scheduler.locale.labels.label_from+" "+d+" "+f+"</div>";b+="<div class='event_text'>"+scheduler.locale.labels.label_to+" "+e+" "+g+"</div>"}a.details&&a.details!==""&&(b+="<div class='event_title'>"+scheduler.locale.labels.label_details+"</div>",b+="<div class='event_text'>"+a.details+"</div>");
+b+="</div>";return b},calendar_event:function(a){return a+"<div class='day_with_events'></div>"},event_date:function(a){return dhx.i18n.dateFormatStr(a)},event_long_date:function(a){return dhx.i18n.longDateFormatStr(a)},event_time:function(a){return dhx.i18n.timeFormatStr(a)},event_color:function(a){return a.color?"background-color:"+a.color:""},event_marker:function(a,b){return"<div class='dhx_event_marker' style='"+b.color(a)+"'></div>"},event_title:function(a,b){return"<div class='dhx_day_title'>"+
+b.dateStart(a.start_date)+"</div><div style='margin:10px'><div class='dhx_event_time'>"+b.timeStart(a.start_date)+"</div>"+b.marker(a,b)+"<div class='dhx_event_text'>"+a.text+"</div></div>"},month_event_title:function(a,b){return b.marker(a,b)+"<div class='dhx_event_time'>"+b.timeStart(a.start_date)+"</div><div class='dhx_event_text'>"+a.text+"</div>"},day_event:function(a){return a.text}};scheduler.config.views=[];
+dhx.ready(function(){if(scheduler.locale&&scheduler.locale.date)dhx.Date.Locale=scheduler.locale.date;if(!scheduler.config.form)scheduler.config.form=[{view:"text",label:scheduler.locale.labels.label_event,name:"text"},{view:"datepicker",label:scheduler.locale.labels.label_start,name:"start_date",timeSelect:1,dateFormat:scheduler.config.form_date},{view:"datepicker",label:scheduler.locale.labels.label_end,name:"end_date",timeSelect:1,dateFormat:scheduler.config.form_date},{view:"textarea",label:scheduler.locale.labels.label_details,
+name:"details",width:300,height:150},{view:"button",label:scheduler.locale.labels.icon_delete,id:"delete",type:"form",css:"delete"}];if(!scheduler.config.bottom_toolbar)scheduler.config.bottom_toolbar=[{view:"button",id:"today",label:scheduler.locale.labels.icon_today,inputWidth:scheduler.xy.icon_today,align:"left",width:scheduler.xy.icon_today+6},{view:"segmented",id:"buttons",selected:"list",align:"center",multiview:!0,options:[{value:"list",label:scheduler.locale.labels.list_tab,width:scheduler.xy.list_tab},
+{value:"day",label:scheduler.locale.labels.day_tab,width:scheduler.xy.day_tab},{value:"month",label:scheduler.locale.labels.month_tab,width:scheduler.xy.month_tab}]},{view:"button",css:"add",id:"add",align:"right",label:"",inputWidth:42,width:50},{view:"label",label:"",inputWidth:42,width:50,batch:"readonly"}];if(!scheduler.config.day_toolbar)scheduler.config.day_toolbar=[{view:"label",id:"prev",align:"left",label:"<div class='dhx_cal_prev_button'><div></div></div>"},{view:"label",id:"date",align:"center",
+width:200},{view:"label",id:"next",align:"right",label:"<div class='dhx_cal_next_button'><div></div></div>"}];if(!scheduler.config.selected_toolbar)scheduler.config.selected_toolbar=[{view:"button",inputWidth:scheduler.xy.icon_back,type:"prev",id:"back",align:"left",label:scheduler.locale.labels.icon_back},{view:"button",inputWidth:scheduler.xy.icon_edit,id:"edit",align:"right",label:scheduler.locale.labels.icon_edit}];if(!scheduler.config.form_toolbar)scheduler.config.form_toolbar=[{view:"button",
+inputWidth:scheduler.xy.icon_cancel,id:"cancel",css:"cancel",align:"left",label:scheduler.locale.labels.icon_cancel},{view:"button",inputWidth:scheduler.xy.icon_save,id:"save",align:"right",label:scheduler.locale.labels.icon_save}];scheduler.types={event_list:{name:"EventsList",css:"events",cssNoEvents:"no_events",padding:0,height:scheduler.xy.list_height,width:"auto",dateStart:scheduler.templates.event_date,timeStart:scheduler.templates.event_time,color:scheduler.templates.event_color,marker:scheduler.templates.event_marker,
+template:scheduler.templates.event_title},day_event_list:{name:"DayEventsList",css:"day_events",cssNoEvents:"no_events",padding:0,height:scheduler.xy.month_list_height,width:"auto",timeStart:scheduler.templates.event_time,color:scheduler.templates.event_color,marker:scheduler.templates.event_marker,template:scheduler.templates.month_event_title}};dhx.Type(dhx.ui.list,scheduler.types.event_list);dhx.Type(dhx.ui.list,scheduler.types.day_event_list);dhx.DataDriver.scheduler={records:"/*/event"};dhx.extend(dhx.DataDriver.scheduler,
+dhx.DataDriver.xml);var a=[{id:"list",view:"list",type:"EventsList",startDate:new Date},{id:"day",rows:[{id:"dayBar",view:"toolbar",css:"dhx_topbar",elements:scheduler.config.day_toolbar},{id:"dayList",view:"dayevents"}]},{id:"month",rows:[{id:"calendar",view:"calendar",dayWithEvents:scheduler.templates.calendar_event,calendarHeader:scheduler.config.calendar_date},{id:"calendarDayEvents",view:"list",type:"DayEventsList"}]},{id:"event",animate:{type:"slide",subtype:"in",direction:"top"},rows:[{id:"eventBar",
+view:"toolbar",type:"TopBar",css:"single_event",elements:scheduler.config.selected_toolbar},{id:"eventTemplate",view:"template",template:scheduler.templates.selected_event}]},{id:"form",rows:[{id:"editBar",view:"toolbar",type:"TopBar",elements:scheduler.config.form_toolbar},{id:"editForm",view:"form",elements:scheduler.config.form,rules:scheduler.config.form_rules}]}].concat(scheduler.config.views);dhx.protoUI({name:"scheduler",defaults:{rows:[{view:"multiview",id:"views",cells:a},{view:"toolbar",
+id:"bottomBar",type:"SchedulerBar",visibleBatch:"default",elements:scheduler.config.bottom_toolbar}],color:"#color#",textColor:"#textColor#"},$init:function(){this.name="Scheduler";this.b.className+=" dhx_scheduler";dhx.i18n.dateFormat=scheduler.config.item_date;dhx.i18n.timeFormat=scheduler.config.hour_date;dhx.i18n.fullDateFormat=scheduler.config.xml_date;dhx.i18n.headerFormatStr=dhx.Date.dateToStr(scheduler.config.header_date);dhx.i18n.setLocale();this.data.provideApi(this);this.data.extraParser=
+dhx.bind(function(a){a.start_date=dhx.i18n.fullDateFormatDate(a.start_date);a.end_date=dhx.i18n.fullDateFormatDate(a.end_date)},this);this.$ready.push(this.$d);this.data.attachEvent("onStoreUpdated",dhx.bind(this.Oe,this))},$d:function(){this.ae();this.de();this.coreData=new dhx.DataValue;this.coreData.setValue(scheduler.config.init_date);this.$$("dayList").define("date",this.coreData);this.selectedEvent=new dhx.DataRecord;this.config.readonly?this.define("readonly",this.config.readonly):scheduler.config.readonly&&
+this.define("readonly",!0);if(this.config.save){var a=new dhx.DataProcessor({master:this,url:this.config.save});a.attachEvent("onBeforeDataSend",this.re)}this.$$("date")&&this.$$("date").bind(this.coreData,null,dhx.i18n.headerFormatStr);this.$$("list").sync(this);this.$$("list").bind(this.coreData,function(a,b){return b<a.end_date});this.$$("dayList").sync(this,!0);this.$$("dayList").bind(this.coreData,function(a,b){var e=dhx.Date.datePart(b);return e<a.end_date&&dhx.Date.add(e,1,"day")>a.start_date});
+this.$$("calendar").bind(this.coreData);this.$$("calendarDayEvents").sync(this,!0);this.$$("calendarDayEvents").bind(this.coreData,function(a,b){var e=dhx.Date.datePart(b);return e<a.end_date&&dhx.Date.add(e,1,"day")>a.start_date});this.$$("eventTemplate").bind(this);this.$$("editForm").bind(this);this.$$("list").attachEvent("onItemClick",dhx.bind(this.Qb,this));this.$$("dayList").attachEvent("onItemClick",dhx.bind(this.Qb,this));this.$$("calendarDayEvents").attachEvent("onItemClick",dhx.bind(this.Qb,
+this))},Qb:function(a){this.setCursor(a);this.$$("event").show()},Oe:function(){this.data.blockEvent();this.data.sort(function(a,b){return a.start_date<b.start_date?1:-1});this.data.unblockEvent();this.Gb={};for(var a=this.data.getRange(),c=0;c<a.length;c++)this.He(a[c])},He:function(a){var c=dhx.Date.datePart(a.start_date),d=dhx.Date.datePart(a.end_date);for(a.end_date.valueOf()!=d.valueOf()&&(d=dhx.Date.add(d,1,"day"));c<d;)this.Gb[c.valueOf()]=!0,c=dhx.Date.add(c,1,"day")},de:function(){this.$$("calendar").attachEvent("onDateSelect",
+dhx.bind(function(a){this.setDate(a)},this));this.$$("calendar").attachEvent("onAfterMonthChange",dhx.bind(function(a){var b=new Date;a.getMonth()===b.getMonth()&&a.getYear()===b.getYear()?a=b:a.setDate(1);this.setDate(a)},this));var a=this.$$("calendar").config.calendarDay;this.$$("calendar").config.calendarDay=dhx.bind(function(c){var d=a(c);return this.Gb&&this.Gb[c.valueOf()]?this.$$("calendar").config.dayWithEvents(d):d},this)},setDate:function(a,c,d){a||(a=this.coreData.getValue());c&&(a=dhx.Date.add(a,
+c,d));this.coreData.setValue(a)},ae:function(){this.attachEvent("onItemClick",function(a){var c=this.innerId(a);switch(c){case "today":this.setDate(new Date);break;case "add":if(this.innerId(this.$$("views").getActive())=="form"){var d=this;dhx.confirm({height:scheduler.xy.confirm_height,width:scheduler.xy.confirm_width,title:scheduler.locale.labels.icon_close,message:scheduler.locale.labels.confirm_closing,callback:function(a){a&&d.jc()},labelOk:scheduler.locale.labels.icon_yes,labelCancel:scheduler.locale.labels.icon_no,
+css:"confirm"})}else this.jc();break;case "prev":this.setDate(null,-1,"day");break;case "next":this.setDate(null,1,"day");break;case "edit":this.$$("delete")&&this.$$("delete").show();this.define("editEvent",!0);this.$$("form").show();break;case "back":this.$$("views").back();break;case "cancel":this.callEvent("onAfterCursorChange",[this.getCursor()]);this.$$("views").back();break;case "save":if(this.$$("editForm").validate()){if(this.a.editEvent)this.$$("editForm").save();else{var e=this.$$("editForm").getValues();
+e.id=dhx.uid();this.add(e);this.setCursor(e.id)}dhx.dp(this).save();this.setDate();this.$$("views").back()}break;case "delete":this.Rd()}});this.attachEvent("onAfterTabClick",function(a,c){this.$$(c).show()});this.attachEvent("onBeforeTabClick",function(a,c){return this.Jd(c)})},readonly_setter:function(a){this.$$("add")&&(a?(this.$$("bottomBar").showBatch("readonly"),this.$$("add").hide(),this.$$("edit").hide()):(this.$$("bottomBar").showBatch("default"),this.$$("add").show(),this.$$("edit").show()));
+return a},$e:function(){this.dataCount()?this.b.className=this.b.className.replace(RegExp(this.type.cssNoEvents,"g"),""):this.b.className+=" "+this.type.cssNoEvents},Rd:function(){var a=this;dhx.confirm({height:scheduler.xy.confirm_height,width:scheduler.xy.confirm_width,title:scheduler.locale.labels.icon_delete,message:scheduler.locale.labels.confirm_deleting,callback:function(c){c&&(a.remove(a.getCursor()),a.$$("views").back(2))},labelOk:scheduler.locale.labels.icon_yes,labelCancel:scheduler.locale.labels.icon_no,
+css:"confirm",header:!1})},jc:function(){this.$$("delete")&&this.$$("delete").hide();this.define("editEvent",!1);this.$$("form").show();var a=dhx.Date.add(new Date,1,"hour"),c=new Date(a.setMinutes(0)),d=dhx.Date.add(c,1,"hour");this.$$("editForm").clear();this.$$("editForm").setValues({start_date:c,end_date:d})},Jd:function(a){if(this.innerId(this.$$("views").getActive())=="form"){var c=this;a!="today"&&dhx.confirm({height:scheduler.xy.confirm_height,width:scheduler.xy.confirm_width,title:scheduler.locale.labels.icon_close,
+message:scheduler.locale.labels.confirm_closing,callback:function(d){d&&(c.$$(a).show(),c.$$("buttons").setValue(a))},labelOk:scheduler.locale.labels.icon_yes,labelCancel:scheduler.locale.labels.icon_no,css:"confirm"});return!1}return!0},re:function(a){var c=a[0].data=dhx.copy(a[0].data);c.start_date=dhx.i18n.fullDateFormatStr(c.start_date);c.end_date=dhx.i18n.fullDateFormatStr(c.end_date)}},dhx.IdSpace,dhx.DataLoader,dhx.ui.layout,dhx.EventSystem,dhx.Settings)});
+dhx.protoUI({name:"dayevents",defaults:{hourFormat:"%H",hourClock:12,firstHour:0,lastHour:24,timeScaleWidth:45,timeScaleHeight:30,scroll:!0,scaleBorder:1,eventOffset:5,width:"auto",date:new Date},$init:function(a){this.name="DayEvents";this.d.style.position="relative";this.data.provideApi(this,!0);this.data.attachEvent("onStoreUpdated",dhx.bind(this.render,this));this.attachEvent("onBeforeRender",function(){this.Be();this.type.color=this.config.color;this.type.textColor=this.config.textColor;this.De=
+this.d.firstChild;this.we();if(window.scheduler)this.type.template=scheduler.templates.day_event});if(window.scheduler)a.hourFormat=scheduler.config.scale_hour,a.timeScaleWidth=scheduler.xy.scale_width,a.timeScaleHeight=scheduler.xy.scale_height*2},Be:function(){for(var a="<div></div>",b=this.config.firstHour;b<this.config.lastHour;b++)a+=this.hourScaleItem(b);this.d.innerHTML=a},ma:"dhx_l_id",on_click:{},hourScaleItem:function(a){var b=scheduler.config.hour_date.toLowerCase().indexOf("a")!=-1,c=
+"00",d="30";b&&(a===0&&(c="AM"),a==12&&(c="PM"),a=(a+11)%12+1);this.config.hourFormat.indexOf("H")!=-1&&(a=dhx.math.toFixed(a));var e="",f=this.config.timeScaleWidth,g=this.config.timeScaleHeight,h=Math.floor(this.config.timeScaleWidth/2),i=Math.floor(g/2),j=i-this.config.scaleBorder,k=this.j-this.config.scaleBorder-this.config.timeScaleWidth;e+="<div style='width: 100%; height:"+g+"px;' class='dhx_dayevents_scale_item'>";e+="<div class='dhx_dayevents_scale_hour' style='width:"+h+"px; height:"+g+
+"px;line-height:"+g+"px;'>"+a+"</div>";e+="<div class='dhx_dayevents_scale_minute' style='width:"+h+"px'>";e+="<div class='dhx_dayevents_scale_top' style='width:"+h+"px;line-height:"+i+"px'>"+c+"</div>";e+="<div class='dhx_dayevents_scale_bottom' style='width:"+h+"px;line-height:"+j+"px'>"+d+"</div>";e+="</div>";e+="<div class='dhx_dayevents_scale_event' style='width:"+k+"px'>";e+="<div class='dhx_dayevents_scale_top' style='height:"+i+"px;width:"+k+"px'></div>";e+="<div class='dhx_dayevents_scale_bottom' style='width: "+
+k+"px;height:"+j+"px; '></div>";e+="</div>";e+="</div>";return e},type:{templateStart:dhx.Template("<div dhx_l_id='#id#' class='dhx_dayevents_event_item {common.templateCss()}' style='left:#$left#px;top:#$top#px;width:#$width#px;height:#$height#px;padding:{common.padding}px;overflow:hidden; background-color:{common.templateColor()} ;color:{common.templateTextColor()};'>"),template:scheduler.templates.day_event,templateEnd:dhx.Template("</div>"),templateCss:dhx.Template(""),templateColor:dhx.Template("#color#"),
+templateTextColor:dhx.Template("#textColor#"),padding:2},we:function(){var a=this.data.getRange(),b=[],c,d,e,f,g;for(d=0;d<a.length;d++){c=a[d];for(c.$inner=!1;b.length&&b[b.length-1].end_date.valueOf()<=c.start_date.valueOf();)b.splice(b.length-1,1);g=!1;for(e=0;e<b.length;e++)if(b[e].end_date.valueOf()<=c.start_date.valueOf()){g=!0;c.$sorder=b[e].$sorder;b.splice(e,1);c.$inner=!0;break}if(b.length)b[b.length-1].$inner=!0;if(!g)if(b.length)if(b.length<=b[b.length-1].$sorder){if(b[b.length-1].$sorder)for(e=
+0;e<b.length;e++){g=!1;for(f=0;f<b.length;f++)if(b[f].$sorder==e){g=!0;break}if(!g){c.$sorder=e;break}}else c.$sorder=0;c.$inner=!0}else{g=b[0].$sorder;for(e=1;e<b.length;e++)if(b[e].$sorder>g)g=b[e].$sorder;c.$sorder=g+1;c.$inner=!1}else c.$sorder=0;b.push(c);if(b.length>(b.max_count||0))b.max_count=b.length}for(d=0;d<a.length;d++)a[d].$count=b.max_count,this.cc(a[d])},cc:function(a){var b=this.config.date.getValue?this.config.date.getValue():this.config.date,c=dhx.Date.copy(a.start_date),d=dhx.Date.copy(a.end_date),
+e=c.getHours(),f=d.getHours();dhx.Date.datePart(c).valueOf()>dhx.Date.datePart(d).valueOf()&&(d=c);dhx.Date.datePart(c).valueOf()<dhx.Date.datePart(b).valueOf()&&(c=dhx.Date.datePart(b));dhx.Date.datePart(d).valueOf()>dhx.Date.datePart(b).valueOf()&&(d=dhx.Date.datePart(b),d.setMinutes(0),d.setHours(this.config.lastHour));if(e<this.config.firstHour||f>=this.config.lastHour)e<this.config.firstHour&&(d.setHours(this.config.firstHour),a.start_date.setMinutes(0)),f>=this.config.lastHour&&(d.setMinutes(0),
+d.setHours(this.config.lastHour));var g=Math.floor((this.j-this.config.timeScaleWidth-this.config.eventOffset-8)/a.$count);a.$left=a.$sorder*g+this.config.timeScaleWidth+this.config.eventOffset;a.$inner||(g*=a.$count-a.$sorder);a.$width=g-this.config.eventOffset-this.type.padding*2;var h=c.getHours()*60+c.getMinutes(),i=d.getHours()*60+d.getMinutes()||this.config.lastHour*60;a.$top=Math.round((h-this.config.firstHour/60)*(this.config.timeScaleHeight+1)/60);a.$height=Math.max(10,(i-h)*(this.config.timeScaleHeight+
+1)/60-2)-this.type.padding*2}},dhx.MouseEvents,dhx.SelectionModel,dhx.Scrollable,dhx.RenderStack,dhx.DataLoader,dhx.ui.view,dhx.EventSystem,dhx.Settings);
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_active_links.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_active_links.js
new file mode 100644
index 00000000000..6499338d09b
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_active_links.js
@@ -0,0 +1,6 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.attachEvent("onTemplatesReady",function(){var d=scheduler.date.str_to_date(scheduler.config.api_date),b=scheduler.date.date_to_str(scheduler.config.api_date),e=scheduler.templates.month_day;scheduler.templates.month_day=function(a){return"<a jump_to='"+b(a)+"' href='#'>"+e(a)+"</a>"};var f=scheduler.templates.week_scale_date;scheduler.templates.week_scale_date=function(a){return"<a jump_to='"+b(a)+"' href='#'>"+f(a)+"</a>"};dhtmlxEvent(this._obj,"click",function(a){var b=a.target||event.srcElement,
+c=b.getAttribute("jump_to");if(c)return scheduler.setCurrentView(d(c),"day"),a&&a.preventDefault&&a.preventDefault(),!1})});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_agenda_view.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_agenda_view.js
new file mode 100644
index 00000000000..c0eb363b8d5
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_agenda_view.js
@@ -0,0 +1,10 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.date.add_agenda=function(b){return new Date(b.valueOf())};scheduler.dblclick_dhx_agenda_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow()};scheduler.templates.agenda_time=function(b,d,a){return a._timed?this.day_date(a.start_date,a.end_date,a)+" "+this.event_date(b):scheduler.templates.day_date(b)+" &ndash; "+scheduler.templates.day_date(d)};scheduler.templates.agenda_text=function(b,d,a){return a.text};scheduler.date.agenda_start=function(b){return b};
+scheduler.attachEvent("onTemplatesReady",function(){function b(b){if(b){var a=scheduler.locale.labels;scheduler._els.dhx_cal_header[0].innerHTML="<div class='dhx_agenda_line'><div>"+a.date+"</div><span style='padding-left:25px'>"+a.description+"</span></div>";scheduler._table_view=!0;scheduler.set_sizes()}}function d(){var b=scheduler._date,a=scheduler.get_visible_events();a.sort(function(a,b){return a.start_date>b.start_date?1:-1});for(var d="<div class='dhx_agenda_area'>",e=0;e<a.length;e++){var c=
+a[e],f=c.color?"background-color:"+c.color+";":"",h=c.textColor?"color:"+c.textColor+";":"";d+="<div class='dhx_agenda_line' event_id='"+c.id+"' style='"+h+""+f+""+(c._text_style||"")+"'><div>"+scheduler.templates.agenda_time(c.start_date,c.end_date,c)+"</div>";d+="<div class='dhx_event_icon icon_details'>&nbsp</div>";d+="<span>"+scheduler.templates.agenda_text(c.start_date,c.end_date,c)+"</span></div>"}d+="<div class='dhx_v_border'></div></div>";scheduler._els.dhx_cal_data[0].innerHTML=d;scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop=
+scheduler._agendaScrollTop||0;var g=scheduler._els.dhx_cal_data[0].firstChild.childNodes;scheduler._els.dhx_cal_date[0].innerHTML="";scheduler._rendered=[];for(e=0;e<g.length-1;e++)scheduler._rendered[e]=g[e]}scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="agenda"?(this.agenda_view(!0),!1):!0});var a=scheduler.render_data;scheduler.render_data=function(b){if(this._mode=="agenda")d();else return a.apply(this,arguments)};var f=scheduler.render_view_data;scheduler.render_view_data=
+function(){this._mode=="agenda"?(scheduler._agendaScrollTop=scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop,scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop=0,scheduler._els.dhx_cal_data[0].style.overflowY="hidden"):scheduler._els.dhx_cal_data[0].style.overflowY="auto";return f.apply(this,arguments)};scheduler.agenda_view=function(a){scheduler._min_date=scheduler.config.agenda_start||new Date;scheduler._max_date=scheduler.config.agenda_end||new Date(9999,1,1);scheduler._table_view=!0;
+b(a);a&&d()}});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js
new file mode 100644
index 00000000000..d7aab4fddbe
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js
@@ -0,0 +1,8 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+(function(){function h(a){var b=scheduler._props?scheduler._props[scheduler._mode]:null,f=scheduler.matrix?scheduler.matrix[scheduler._mode]:null,c=b||f;if(b)var d=c.map_to;if(f)d=c.y_property;c&&a&&(n=scheduler.getEvent(a)[d])}function g(a){var b=[];if(a.rec_type){for(var f=scheduler.getRecDates(a),c=0;c<f.length;c++)for(var d=scheduler.getEvents(f[c].start_date,f[c].end_date),i=0;i<d.length;i++)(d[i].event_pid||d[i].id)!=a.id&&b.push(d[i]);b.push(a)}else b=scheduler.getEvents(a.start_date,a.end_date);
+var e=scheduler._props?scheduler._props[scheduler._mode]:null,g=scheduler.matrix?scheduler.matrix[scheduler._mode]:null,m=e||g;if(e)var j=m.map_to;if(g)j=m.y_property;var k=!0;if(m){for(var h=0,l=0;l<b.length;l++)b[l][j]==a[j]&&b[l].id!=a.id&&h++;h>=scheduler.config.collision_limit&&(a[j]=n,k=!1)}else b.length>scheduler.config.collision_limit&&(k=!1);return!k?!scheduler.callEvent("onEventCollision",[a,b]):k}var n,e;scheduler.config.collision_limit=1;scheduler.attachEvent("onBeforeDrag",function(a){h(a);
+return!0});scheduler.attachEvent("onBeforeLightbox",function(a){var b=scheduler.getEvent(a);e=[b.start_date,b.end_date];h(a);return!0});scheduler.attachEvent("onEventChanged",function(a){if(!a)return!0;var b=scheduler.getEvent(a);if(!g(b)){if(!e)return!1;b.start_date=e[0];b.end_date=e[1];b._timed=this.is_one_day_event(b)}return!0});scheduler.attachEvent("onBeforeEventChanged",function(a){return g(a)});scheduler.attachEvent("onEventSave",function(a,b){return b.rec_type?(scheduler._roll_back_dates(b),
+g(b)):!0})})();
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_cookie.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_cookie.js
new file mode 100644
index 00000000000..ef80ea8e8d0
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_cookie.js
@@ -0,0 +1,6 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+(function(){function g(e,b,a){var c=e+"="+a+(b?"; "+b:"");document.cookie=c}function h(e){var b=e+"=";if(document.cookie.length>0){var a=document.cookie.indexOf(b);if(a!=-1){a+=b.length;var c=document.cookie.indexOf(";",a);if(c==-1)c=document.cookie.length;return document.cookie.substring(a,c)}}return""}var f=!0;scheduler.attachEvent("onBeforeViewChange",function(e,b,a,c){if(f){f=!1;var d=h("scheduler_settings");if(d)return d=d.split("@"),d[0]=this.templates.xml_date(d[0]),this.setCurrentView(d[0],
+d[1]),!1}var i=this.templates.xml_format(c||b)+"@"+(a||e);g("scheduler_settings","expires=Sun, 31 Jan 9999 22:00:00 GMT",i);return!0})})();
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_editors.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_editors.js
new file mode 100644
index 00000000000..38ba960c470
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_editors.js
@@ -0,0 +1,10 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.form_blocks.combo={render:function(a){var d="";d+="<div class='"+a.type+"' style='height:"+(a.height||20)+"px;' ></div>";return d},set_value:function(a,d,c,b){a._combo&&a._combo.destructor();window.dhx_globalImgPath=b.image_path||"/";a._combo=new dhtmlXCombo(a,b.name,a.offsetWidth-8);a._combo.enableFilteringMode(!!b.filtering,b.script_path||null,!!b.cache);if(b.script_path)a._combo.setComboValue(c[b.map_to]||null);else{for(var f=[],e=0;e<b.options.length;e++){var g=[];g.push(b.options[e].key);
+g.push(b.options[e].label);f.push(g)}a._combo.addOption(f);if(c[b.map_to]){var h=a._combo.getIndexByValue(c[b.map_to]);a._combo.selectOption(h)}}},get_value:function(a){var d=a._combo.getSelectedValue();return d},focus:function(){}};
+scheduler.form_blocks.radio={render:function(a){var d="";d+="<div class='dhx_cal_ltext dhx_cal_radio' style='height:"+a.height+"px;' >";for(var c=0;c<a.options.length;c++){var b=scheduler.uid();d+="<input id='"+b+"' type='radio' name='"+a.name+"' value='"+a.options[c].key+"'><label for='"+b+"'> "+a.options[c].label+"</label>";a.vertical&&(d+="<br/>")}d+="</div>";return d},set_value:function(a,d,c,b){for(var f=a.getElementsByTagName("input"),e=0;e<f.length;e++)if(f[e].checked=!1,f[e].value==c[b.map_to])f[e].checked=
+!0},get_value:function(a){for(var d=a.getElementsByTagName("input"),c=0;c<d.length;c++)if(d[c].checked)return d[c].value},focus:function(){}};
+scheduler.form_blocks.checkbox={render:function(){return scheduler.config.wide_form?'<div class="dhx_cal_wide_checkbox"></div>':""},set_value:function(a,d,c,b){var a=document.getElementById(b.id),f=scheduler.uid(),e=!1;typeof b.checked_value!="undefined"&&c[b.map_to]==b.checked_value&&(e=!0);a.className+=" dhx_cal_checkbox";var g="<input id='"+f+"' type='checkbox' value='true' name='"+b.name+"'"+(e?"checked='true'":"")+"'>",h="<label for='"+f+"'>"+(scheduler.locale.labels["section_"+b.name]||b.name)+
+"</label>";scheduler.config.wide_form?(a.innerHTML=h,a.nextSibling.innerHTML=g):a.innerHTML=g+h},get_value:function(a,d,c){var a=document.getElementById(c.id),b=a.getElementsByTagName("input")[0];b||(b=a.nextSibling.getElementsByTagName("input")[0]);return b.checked?c.checked_value||!0:c.unchecked_value||!1},focus:function(){}};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_expand.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_expand.js
new file mode 100644
index 00000000000..06a1187a723
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_expand.js
@@ -0,0 +1,8 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.expand=function(){var a=scheduler._obj;do a._position=a.style.position||"",a.style.position="static";while((a=a.parentNode)&&a.style);a=scheduler._obj;a.style.position="absolute";a._width=a.style.width;a._height=a.style.height;a.style.width=a.style.height="100%";a.style.top=a.style.left="0px";var b=document.body;b.scrollTop=0;if(b=b.parentNode)b.scrollTop=0;document.body._overflow=document.body.style.overflow||"";document.body.style.overflow="hidden";scheduler._maximize()};
+scheduler.collapse=function(){var a=scheduler._obj;do a.style.position=a._position;while((a=a.parentNode)&&a.style);a=scheduler._obj;a.style.width=a._width;a.style.height=a._height;document.body.style.overflow=document.body._overflow;scheduler._maximize()};scheduler.attachEvent("onTemplatesReady",function(){var a=document.createElement("DIV");a.className="dhx_expand_icon";scheduler.toggleIcon=a;scheduler._obj.appendChild(a);a.onclick=function(){scheduler.expanded?scheduler.collapse():scheduler.expand()}});
+scheduler._maximize=function(){this.expanded=!this.expanded;this.toggleIcon.style.backgroundPosition="0px "+(this.expanded?"0":"18")+"px";for(var a=["left","top"],b=0;b<a.length;b++){var d=scheduler.xy["margin_"+a[b]],c=scheduler["_prev_margin_"+a[b]];scheduler.xy["margin_"+a[b]]?(scheduler["_prev_margin_"+a[b]]=scheduler.xy["margin_"+a[b]],scheduler.xy["margin_"+a[b]]=0):c&&(scheduler.xy["margin_"+a[b]]=scheduler["_prev_margin_"+a[b]],delete scheduler["_prev_margin_"+a[b]])}scheduler.callEvent("onSchedulerResize",
+[])&&scheduler.update_view()};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_html_templates.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_html_templates.js
new file mode 100644
index 00000000000..d882becfd64
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_html_templates.js
@@ -0,0 +1,5 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.attachEvent("onTemplatesReady",function(){for(var c=document.body.getElementsByTagName("DIV"),b=0;b<c.length;b++){var a=c[b].className||"",a=a.split(":");if(a.length==2&&a[0]=="template"){var d='return "'+(c[b].innerHTML||"").replace(/\"/g,'\\"').replace(/[\n\r]+/g,"")+'";',d=unescape(d).replace(/\{event\.([a-z]+)\}/g,function(b,a){return'"+ev.'+a+'+"'});scheduler.templates[a[1]]=Function("start","end","ev",d);c[b].style.display="none"}}});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_key_nav.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_key_nav.js
new file mode 100644
index 00000000000..609a374040f
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_key_nav.js
@@ -0,0 +1,6 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+(function(){var b=!1;scheduler.attachEvent("onBeforeLightbox",function(){return b=!0});scheduler.attachEvent("onAfterLightbox",function(){b=!1;return!0});dhtmlxEvent(document,_isOpera?"keypress":"keydown",function(a){a=a||event;if(!b)if(a.keyCode==37||a.keyCode==39){a.cancelBubble=!0;var e=scheduler.date.add(scheduler._date,a.keyCode==37?-1:1,scheduler._mode);scheduler.setCurrentView(e);return!0}else if(a.ctrlKey&&a.keyCode==67)scheduler._copy_id=scheduler._select_id;else if(a.ctrlKey&&a.keyCode==
+86){var c=scheduler.getEvent(scheduler._copy_id);if(c){var d=scheduler._copy_event(c);d.id=scheduler.uid();scheduler.addEvent(d)}}})})();
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js
new file mode 100644
index 00000000000..baf0be0041e
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js
@@ -0,0 +1,12 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.config.limit_start=new Date(-3999,0,0);scheduler.config.limit_end=new Date(3999,0,0);scheduler.config.limit_view=!1;
+(function(){var g=null,k={},l={},m=!1;scheduler.blockTime=function(b,a){var c=this.config.first_hour*60,d=this.config.last_hour*60;a=="fullday"&&(a=[c,d]);typeof b=="object"?k[this.date.date_part(b).valueOf()]=a:l[b]=a;for(var e=0;e<a.length;e+=2)a[e]<c&&(a[e]=c),a[e+1]>d&&(a[e+1]=d);m=!0};scheduler.attachEvent("onScaleAdd",function(b,a){var c=k[a.valueOf()]||l[a.getDay()];if(c)for(var d=0;d<c.length;d+=2){var e=c[d],f=c[d+1],h=document.createElement("DIV");h.className="dhx_time_block";var j;h.style.top=
+Math.round((e*6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+"px";h.style.height=Math.round((f-e-1)*6E4*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+"px";b.appendChild(h)}});scheduler.attachEvent("onBeforeViewChange",function(b,a,c,d){d=d||a;c=c||b;return scheduler.config.limit_view&&(d.valueOf()>scheduler.config.limit_end.valueOf()||this.date.add(d,1,c)<=scheduler.config.limit_start.valueOf())?(setTimeout(function(){scheduler.setCurrentView(scheduler._date,
+c)},1),!1):!0});var f=function(b){var a=scheduler.config,c=b.start_date.valueOf()>=a.limit_start.valueOf()&&b.end_date.valueOf()<=a.limit_end.valueOf();if(c&&m&&b._timed){var d=scheduler.date.date_part(new Date(b.start_date.valueOf())),e=k[d.valueOf()]||l[d.getDay()],f=b.start_date.getHours()*60+b.start_date.getMinutes(),h=b.end_date.getHours()*60+b.end_date.getMinutes();if(e)for(var j=0;j<e.length;j+=2){var g=e[j],i=e[j+1];if(g<h&&i>f){if(f<=i&&f>=g){if(i==1440||h<i){c=!1;break}if(scheduler._drag_id&&
+scheduler._drag_mode=="new-size")b.start_date.setHours(0),b.start_date.setMinutes(i);else{c=!1;break}}if(h>=g&&h<i)if(scheduler._drag_id&&scheduler._drag_mode=="new-size")b.end_date.setHours(0),b.end_date.setMinutes(g);else{c=!1;break}}}}if(!c)scheduler._drag_id=null,scheduler._drag_mode=null,scheduler.callEvent("onLimitViolation",[b.id,b]);return c};scheduler.attachEvent("onBeforeDrag",function(b){return!b?!0:f(scheduler.getEvent(b))});scheduler.attachEvent("onClick",function(b){return f(scheduler.getEvent(b))});
+scheduler.attachEvent("onBeforeLightbox",function(b){var a=scheduler.getEvent(b);g=[a.start_date,a.end_date];return f(a)});scheduler.attachEvent("onEventAdded",function(b){if(!b)return!0;var a=scheduler.getEvent(b);if(!f(a)){if(a.start_date<scheduler.config.limit_start)a.start_date=new Date(scheduler.config.limit_start);if(a.start_date.valueOf()>=scheduler.config.limit_end.valueOf())a.start_date=this.date.add(scheduler.config.limit_end,-1,"day");if(a.end_date<scheduler.config.limit_start)a.end_date=
+new Date(scheduler.config.limit_start);if(a.end_date.valueOf()>=scheduler.config.limit_end.valueOf())a.end_date=this.date.add(scheduler.config.limit_end,-1,"day");if(a.start_date.valueOf()>=a.end_date.valueOf())a.end_date=this.date.add(a.start_date,this.config.event_duration||this.config.time_step,"minute");a._timed=this.is_one_day_event(a)}return!0});scheduler.attachEvent("onEventChanged",function(b){if(!b)return!0;var a=scheduler.getEvent(b);if(!f(a)){if(!g)return!1;a.start_date=g[0];a.end_date=
+g[1];a._timed=this.is_one_day_event(a)}return!0});scheduler.attachEvent("onBeforeEventChanged",function(b){return f(b)})})();
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_map_view.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_map_view.js
new file mode 100644
index 00000000000..57735c07a0e
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_map_view.js
@@ -0,0 +1,29 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.xy.map_date_width=188;scheduler.xy.map_description_width=400;scheduler.config.map_resolve_event_location=!0;scheduler.config.map_resolve_user_location=!0;scheduler.config.map_initial_position=new google.maps.LatLng(48.724,8.215);scheduler.config.map_error_position=new google.maps.LatLng(15,15);scheduler.config.map_infowindow_max_width=300;scheduler.config.map_type=google.maps.MapTypeId.ROADMAP;scheduler.config.map_zoom_after_resolve=15;scheduler.locale.labels.marker_geo_success="It seems you are here.";
+scheduler.locale.labels.marker_geo_fail="Sorry, could not get your current position using geolocation.";scheduler.templates.marker_date=scheduler.date.date_to_str("%Y-%m-%d %H:%i");scheduler.templates.marker_text=function(f,g,e){return"<div><b>"+e.text+"</b><br/><br/>"+(e.event_location||"")+"<br/><br/>"+scheduler.templates.marker_date(f)+" - "+scheduler.templates.marker_date(g)+"</div>"};
+scheduler.dblclick_dhx_map_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow({start_date:scheduler._date,end_date:scheduler.date.add(scheduler._date,1,"hour")})};scheduler.templates.map_time=function(f,g,e){return e._timed?this.day_date(e.start_date,e.end_date,e)+" "+this.event_date(f):scheduler.templates.day_date(f)+" &ndash; "+scheduler.templates.day_date(g)};scheduler.templates.map_text=function(f,g,e){return e.text};scheduler.date.map_start=function(f){return f};
+scheduler.date.add_map=function(f){return new Date(f.valueOf())};scheduler.templates.map_date=function(){return""};scheduler._latLngUpdate=!1;
+scheduler.attachEvent("onSchedulerReady",function(){function f(a){if(a){var c=scheduler.locale.labels;scheduler._els.dhx_cal_header[0].innerHTML="<div class='dhx_map_line' style='width: "+(scheduler.xy.map_date_width+scheduler.xy.map_description_width+2)+"px;' ><div style='width: "+scheduler.xy.map_date_width+"px;'>"+c.date+"</div><div class='headline_description' style='width: "+scheduler.xy.map_description_width+"px;'>"+c.description+"</div></div>";scheduler._table_view=!0;scheduler.set_sizes()}}
+function g(){scheduler._selected_event_id=null;scheduler.map._infowindow.close();for(var a in scheduler.map._markers)scheduler.map._markers[a].setMap(null),delete scheduler.map._markers[a],scheduler.map._infowindows_content[a]&&delete scheduler.map._infowindows_content[a]}function e(){var a=scheduler.get_visible_events();a.sort(function(a,b){return a.start_date<b.start_date?-1:a.start_date.valueOf()==b.start_date.valueOf()?a.text<b.text?-1:a.text==b.text?0:1:1});for(var c="<div class='dhx_map_area'>",
+d=0;d<a.length;d++){var b=a[d],h=b.id==scheduler._selected_event_id?"dhx_map_line highlight":"dhx_map_line",e=b.color?"background-color:"+b.color+";":"",f=b.textColor?"color:"+b.textColor+";":"";c+="<div class='"+h+"' event_id='"+b.id+"' style='"+e+""+f+""+(b._text_style||"")+" width: "+(scheduler.xy.map_date_width+scheduler.xy.map_description_width+2)+"px;'><div style='width: "+scheduler.xy.map_date_width+"px;' >"+scheduler.templates.map_time(b.start_date,b.end_date,b)+"</div>";c+="<div class='dhx_event_icon icon_details'>&nbsp</div>";
+c+="<div class='line_description' style='width:"+(scheduler.xy.map_description_width-25)+"px;'>"+scheduler.templates.map_text(b.start_date,b.end_date,b)+"</div></div>"}c+="<div class='dhx_v_border' style='left: "+(scheduler.xy.map_date_width-2)+"px;'></div><div class='dhx_v_border_description'></div></div>";scheduler._els.dhx_cal_data[0].scrollTop=0;scheduler._els.dhx_cal_data[0].innerHTML=c;scheduler._els.dhx_cal_data[0].style.width=scheduler.xy.map_date_width+scheduler.xy.map_description_width+
+1+"px";var g=scheduler._els.dhx_cal_data[0].firstChild.childNodes;scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[scheduler._mode+"_date"](scheduler._min_date,scheduler._max_date,scheduler._mode);scheduler._rendered=[];for(d=0;d<g.length-2;d++)scheduler._rendered[d]=g[d]}function k(a){var c=document.getElementById(a),d=scheduler._y-scheduler.xy.nav_height;d<0&&(d=0);var b=scheduler._x-scheduler.xy.map_date_width-scheduler.xy.map_description_width-1;b<0&&(b=0);c.style.height=d+"px";c.style.width=
+b+"px";c.style.marginLeft=scheduler.xy.map_date_width+scheduler.xy.map_description_width+1+"px";c.style.marginTop=scheduler.xy.nav_height+2+"px"}(function(){scheduler._isMapPositionSet=!1;var a=document.createElement("div");a.className="dhx_map";a.id="dhx_gmap";a.style.dispay="none";var c=scheduler._obj;c.appendChild(a);scheduler._els.dhx_gmap=[];scheduler._els.dhx_gmap.push(a);k("dhx_gmap");var d={zoom:scheduler.config.map_inital_zoom||10,center:scheduler.config.map_initial_position,mapTypeId:scheduler.config.map_type||
+google.maps.MapTypeId.ROADMAP},b=new google.maps.Map(document.getElementById("dhx_gmap"),d);b.disableDefaultUI=!1;b.disableDoubleClickZoom=!scheduler.config.readonly;google.maps.event.addListener(b,"dblclick",function(a){if(!scheduler.config.readonly&&scheduler.config.dblclick_create){var b=a.latLng;geocoder.geocode({latLng:b},function(a,c){if(c==google.maps.GeocoderStatus.OK)b=a[0].geometry.location,scheduler.addEventNow({lat:b.lat(),lng:b.lng(),event_location:a[0].formatted_address,start_date:scheduler._date,
+end_date:scheduler.date.add(scheduler._date,1,"hour")})})}});var e={content:""};if(scheduler.config.map_infowindow_max_width)e.maxWidth=scheduler.config.map_infowindow_max_width;scheduler.map={_points:[],_markers:[],_infowindow:new google.maps.InfoWindow(e),_infowindows_content:[],_initialization_count:-1,_obj:b};geocoder=new google.maps.Geocoder;scheduler.config.map_resolve_user_location&&navigator.geolocation&&(scheduler._isMapPositionSet||navigator.geolocation.getCurrentPosition(function(a){var c=
+new google.maps.LatLng(a.coords.latitude,a.coords.longitude);b.setCenter(c);b.setZoom(scheduler.config.map_zoom_after_resolve||10);scheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_success);scheduler.map._infowindow.position=b.getCenter();scheduler.map._infowindow.open(b);scheduler._isMapPositionSet=!0},function(){scheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_fail);scheduler.map._infowindow.setPosition(b.getCenter());scheduler.map._infowindow.open(b);
+scheduler._isMapPositionSet=!0}));google.maps.event.addListener(b,"resize",function(){a.style.zIndex="5";b.setZoom(b.getZoom())});google.maps.event.addListener(b,"tilesloaded",function(){a.style.zIndex="5"});a.style.display="none"})();scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="map"?(this.map_view(!0),!1):!0});var l=scheduler.render_data;scheduler.render_data=function(a,c){if(this._mode=="map"){e();for(var d=scheduler.get_visible_events(),b=0;b<d.length;b++)scheduler.map._markers[d[b].id]||
+i(d[b],!1,!1)}else return l.apply(this,arguments)};scheduler.map_view=function(a){scheduler.map._initialization_count++;var c=scheduler._els.dhx_gmap[0];scheduler._els.dhx_cal_data[0].style.width=scheduler.xy.map_date_width+scheduler.xy.map_description_width+1+"px";scheduler._min_date=scheduler.config.map_start||new Date;scheduler._max_date=scheduler.config.map_end||new Date(9999,1,1);scheduler._table_view=!0;f(a);if(a){g();e();c.style.display="block";k("dhx_gmap");for(var d=scheduler.map._obj.getCenter(),
+b=scheduler.get_visible_events(),h=0;h<b.length;h++)scheduler.map._markers[b[h].id]||i(b[h])}else c.style.display="none";google.maps.event.trigger(scheduler.map._obj,"resize");scheduler.map._initialization_count===0&&d&&scheduler.map._obj.setCenter(d);scheduler._selected_event_id&&m(scheduler._selected_event_id)};var m=function(a){scheduler.map._obj.setCenter(scheduler.map._points[a]);scheduler.callEvent("onClick",[a])},i=function(a,c,d){var b=scheduler.config.map_error_position;a.lat&&a.lng&&(b=
+new google.maps.LatLng(a.lat,a.lng));var e=scheduler.templates.marker_text(a.start_date,a.end_date,a);scheduler._new_event||(scheduler.map._infowindows_content[a.id]=e,scheduler.map._markers[a.id]&&scheduler.map._markers[a.id].setMap(null),scheduler.map._markers[a.id]=new google.maps.Marker({position:b,map:scheduler.map._obj}),google.maps.event.addListener(scheduler.map._markers[a.id],"click",function(){scheduler.map._infowindow.setContent(scheduler.map._infowindows_content[a.id]);scheduler.map._infowindow.open(scheduler.map._obj,
+scheduler.map._markers[a.id]);scheduler._selected_event_id=a.id;scheduler.render_data()}),scheduler.map._points[a.id]=b,c&&scheduler.map._obj.setCenter(scheduler.map._points[a.id]),d&&scheduler.callEvent("onClick",[a.id]))};scheduler.attachEvent("onClick",function(a){if(this._mode=="map"){scheduler._selected_event_id=a;for(var c=0;c<scheduler._rendered.length;c++)scheduler._rendered[c].className="dhx_map_line",scheduler._rendered[c].getAttribute("event_id")==a&&(scheduler._rendered[c].className+=
+" highlight");scheduler.map._points[a]&&scheduler.map._markers[a]&&(scheduler.map._obj.setCenter(scheduler.map._points[a]),google.maps.event.trigger(scheduler.map._markers[a],"click"))}return!0});var j=function(a){a.event_location&&geocoder?geocoder.geocode({address:a.event_location,language:scheduler.uid().toString()},function(c,d){var b={};if(d!=google.maps.GeocoderStatus.OK){if(b=scheduler.callEvent("onLocationError",[a.id]),!b||b===!0)b=scheduler.config.map_error_position}else b=c[0].geometry.location;
+a.lat=b.lat();a.lng=b.lng();scheduler._selected_event_id=a.id;scheduler._latLngUpdate=!0;scheduler.callEvent("onEventChanged",[a.id,a]);i(a,!0,!0)}):i(a,!0,!0)},n=function(a){a.event_location&&geocoder&&geocoder.geocode({address:a.event_location,language:scheduler.uid().toString()},function(c,d){var b={};if(d!=google.maps.GeocoderStatus.OK){if(b=scheduler.callEvent("onLocationError",[a.id]),!b||b===!0)b=scheduler.config.map_error_position}else b=c[0].geometry.location;a.lat=b.lat();a.lng=b.lng();
+scheduler._latLngUpdate=!0;scheduler.callEvent("onEventChanged",[a.id,a])})},o=function(a,c,d,b){setTimeout(function(){var b=a.apply(c,d);a=obj=d=null;return b},b||1)};scheduler.attachEvent("onEventChanged",function(a){if(this._latLngUpdate)this._latLngUpdate=!1;else{var c=scheduler.getEvent(a);c.start_date<scheduler._min_date&&c.end_date>scheduler._min_date||c.start_date<scheduler._max_date&&c.end_date>scheduler._max_date||c.start_date.valueOf()>=scheduler._min_date&&c.end_date.valueOf()<=scheduler._max_date?
+(scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null),j(c)):(scheduler._selected_event_id=null,scheduler.map._infowindow.close(),scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null))}return!0});scheduler.attachEvent("onEventIdChange",function(a,c){var d=scheduler.getEvent(c);if(d.start_date<scheduler._min_date&&d.end_date>scheduler._min_date||d.start_date<scheduler._max_date&&d.end_date>scheduler._max_date||d.start_date.valueOf()>=scheduler._min_date&&d.end_date.valueOf()<=
+scheduler._max_date)scheduler.map._markers[a]&&(scheduler.map._markers[a].setMap(null),delete scheduler.map._markers[a]),scheduler.map._infowindows_content[a]&&delete scheduler.map._infowindows_content[a],j(d);return!0});scheduler.attachEvent("onEventAdded",function(a,c){if(!scheduler._dataprocessor&&(c.start_date<scheduler._min_date&&c.end_date>scheduler._min_date||c.start_date<scheduler._max_date&&c.end_date>scheduler._max_date||c.start_date.valueOf()>=scheduler._min_date&&c.end_date.valueOf()<=
+scheduler._max_date))scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null),j(c);return!0});scheduler.attachEvent("onBeforeEventDelete",function(a){scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null);scheduler._selected_event_id=null;scheduler.map._infowindow.close();return!0});scheduler._event_resolve_delay=1500;scheduler.attachEvent("onEventLoading",function(a){scheduler.config.map_resolve_event_location&&a.event_location&&!a.lat&&!a.lng&&(scheduler._event_resolve_delay+=
+1500,o(n,this,[a],scheduler._event_resolve_delay));return!0});scheduler.attachEvent("onEventCancel",function(a,c){c&&(scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null),scheduler.map._infowindow.close());return!0})});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js
new file mode 100644
index 00000000000..5bf564980f9
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js
@@ -0,0 +1,26 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.templates.calendar_month=scheduler.date.date_to_str("%F %Y");scheduler.templates.calendar_scale_date=scheduler.date.date_to_str("%D");scheduler.templates.calendar_date=scheduler.date.date_to_str("%d");
+scheduler.renderCalendar=function(b,c){var a=null,d=b.date||new Date;typeof d=="string"&&(d=this.templates.api_date(d));if(c)a=this._render_calendar(c.parentNode,d,b,c),scheduler.unmarkCalendar(a);else{var e=b.container,f=b.position;typeof e=="string"&&(e=document.getElementById(e));typeof f=="string"&&(f=document.getElementById(f));if(f&&typeof f.left=="undefined")var n=getOffset(f),f={top:n.top+f.offsetHeight,left:n.left};e||(e=scheduler._get_def_cont(f));a=this._render_calendar(e,d,b);a.onclick=
+function(a){var a=a||event,b=a.target||a.srcElement;if(b.className.indexOf("dhx_month_head")!=-1){var c=b.parentNode.className;if(c.indexOf("dhx_after")==-1&&c.indexOf("dhx_before")==-1){var d=scheduler.templates.xml_date(this.getAttribute("date"));d.setDate(parseInt(b.innerHTML,10));scheduler.unmarkCalendar(this);scheduler.markCalendar(this,d,"dhx_calendar_click");this._last_date=d;this.conf.handler&&this.conf.handler.call(scheduler,d,this)}}}}for(var m=scheduler.date.month_start(d),k=scheduler.date.add(m,
+1,"month"),p=this.getEvents(m,k),i=0;i<p.length;i++){var o=p[i],l=o.start_date;l.valueOf()<m.valueOf()&&(l=m);for(l=scheduler.date.date_part(new Date(l.valueOf()));l<o.end_date;)if(this.markCalendar(a,l,"dhx_year_event"),l=this.date.add(l,1,"day"),l.valueOf()>=k.valueOf())break}this._markCalendarCurrentDate(a);a.conf=b;return a};
+scheduler._get_def_cont=function(b){if(!this._def_count)this._def_count=document.createElement("DIV"),this._def_count.style.cssText="position:absolute;z-index:10100;width:251px; height:175px;",this._def_count.onclick=function(b){(b||event).cancelBubble=!0},document.body.appendChild(this._def_count);this._def_count.style.left=b.left+"px";this._def_count.style.top=b.top+"px";this._def_count._created=new Date;return this._def_count};
+scheduler._locateCalendar=function(b,c){var a=b.childNodes[2].childNodes[0];typeof c=="string"&&(c=scheduler.templates.api_date(c));var d=b.week_start+c.getDate()-1;return a.rows[Math.floor(d/7)].cells[d%7].firstChild};scheduler.markCalendar=function(b,c,a){this._locateCalendar(b,c).className+=" "+a};scheduler.unmarkCalendar=function(b,c,a){c=c||b._last_date;a=a||"dhx_calendar_click";if(c){var d=this._locateCalendar(b,c);d.className=(d.className||"").replace(RegExp(a,"g"))}};
+scheduler._week_template=function(b){for(var c=b||250,a=0,d=document.createElement("div"),e=this.date.week_start(new Date),f=0;f<7;f++)this._cols[f]=Math.floor(c/(7-f)),this._render_x_header(f,a,e,d),e=this.date.add(e,1,"day"),c-=this._cols[f],a+=this._cols[f];d.lastChild.className+=" dhx_scale_bar_last";return d};scheduler.updateCalendar=function(b,c){b.conf.date=c;this.renderCalendar(b.conf,b)};scheduler._mini_cal_arrows=["&nbsp","&nbsp"];
+scheduler._render_calendar=function(b,c,a,d){var e=scheduler.templates,f=this._cols;this._cols=[];var n=this._mode;this._mode="calendar";var m=this._colsS;this._colsS={height:0};var k=new Date(this._min_date),p=new Date(this._max_date),i=new Date(scheduler._date),o=e.month_day;e.month_day=e.calendar_date;var c=this.date.month_start(c),l=this._week_template(b.offsetWidth-1),g;d?g=d:(g=document.createElement("DIV"),g.className="dhx_cal_container dhx_mini_calendar");g.setAttribute("date",this.templates.xml_format(c));
+g.innerHTML="<div class='dhx_year_month'></div><div class='dhx_year_week'>"+l.innerHTML+"</div><div class='dhx_year_body'></div>";g.childNodes[0].innerHTML=this.templates.calendar_month(c);if(a.navigation){var h=document.createElement("DIV");h.className="dhx_cal_prev_button";h.style.cssText="left:1px;top:2px;position:absolute;";h.innerHTML=this._mini_cal_arrows[0];g.firstChild.appendChild(h);h.onclick=function(){scheduler.updateCalendar(g,scheduler.date.add(g._date,-1,"month"));scheduler._date.getMonth()==
+g._date.getMonth()&&scheduler._date.getFullYear()==g._date.getFullYear()&&scheduler._markCalendarCurrentDate(g)};h=document.createElement("DIV");h.className="dhx_cal_next_button";h.style.cssText="left:auto; right:1px;top:2px;position:absolute;";h.innerHTML=this._mini_cal_arrows[1];g.firstChild.appendChild(h);h.onclick=function(){scheduler.updateCalendar(g,scheduler.date.add(g._date,1,"month"));scheduler._date.getMonth()==g._date.getMonth()&&scheduler._date.getFullYear()==g._date.getFullYear()&&scheduler._markCalendarCurrentDate(g)}}g._date=
+new Date(c);g.week_start=(c.getDay()-(this.config.start_on_monday?1:0)+7)%7;var u=this.date.week_start(c);this._reset_month_scale(g.childNodes[2],c,u);for(var j=g.childNodes[2].firstChild.rows,q=j.length;q<6;q++){var t=j[j.length-1];j[0].parentNode.appendChild(t.cloneNode(!0));for(var r=parseInt(t.childNodes[t.childNodes.length-1].childNodes[0].innerHTML),r=r<10?r:0,s=0;s<j[q].childNodes.length;s++)j[q].childNodes[s].className="dhx_after",j[q].childNodes[s].childNodes[0].innerHTML=scheduler.date.to_fixed(++r)}d||
+b.appendChild(g);g.childNodes[1].style.height=g.childNodes[1].childNodes[0].offsetHeight-1+"px";this._cols=f;this._mode=n;this._colsS=m;this._min_date=k;this._max_date=p;scheduler._date=i;e.month_day=o;return g};
+scheduler.destroyCalendar=function(b,c){if(!b&&this._def_count&&this._def_count.firstChild&&(c||(new Date).valueOf()-this._def_count._created.valueOf()>500))b=this._def_count.firstChild;if(b&&(b.onclick=null,b.innerHTML="",b.parentNode&&b.parentNode.removeChild(b),this._def_count))this._def_count.style.top="-1000px"};scheduler.isCalendarVisible=function(){return this._def_count&&parseInt(this._def_count.style.top,10)>0?this._def_count:!1};
+scheduler.attachEvent("onTemplatesReady",function(){dhtmlxEvent(document.body,"click",function(){scheduler.destroyCalendar()})});scheduler.templates.calendar_time=scheduler.date.date_to_str("%d-%m-%Y");
+scheduler.form_blocks.calendar_time={render:function(){var b="<input class='dhx_readonly' type='text' readonly='true'>",c=scheduler.config,a=this.date.date_part(new Date);c.first_hour&&a.setHours(c.first_hour);b+=" <select>";for(var d=60*c.first_hour;d<60*c.last_hour;d+=this.config.time_step*1){var e=this.templates.time_picker(a);b+="<option value='"+d+"'>"+e+"</option>";a=this.date.add(a,this.config.time_step,"minute")}b+="</select>";var f=scheduler.config.full_day;return"<div style='height:30px;padding-top:0; font-size:inherit;' class='dhx_section_time'>"+
+b+"<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>"+b+"</div>"},set_value:function(b,c,a){function d(a,b,c){n(a,b,c);a.value=scheduler.templates.calendar_time(b);a._date=scheduler.date.date_part(new Date(b))}var e=b.getElementsByTagName("input"),f=b.getElementsByTagName("select"),n=function(a,b,c){a.onclick=function(){scheduler.destroyCalendar(null,!0);scheduler.renderCalendar({position:a,date:new Date(this._date),navigation:!0,handler:function(b){a.value=scheduler.templates.calendar_time(b);
+a._date=new Date(b);scheduler.destroyCalendar();scheduler.config.event_duration&&scheduler.config.auto_end_date&&c==0&&o()}})}};if(scheduler.config.full_day){if(!b._full_day){var m="<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+"&nbsp;</label></input>";scheduler.config.wide_form||(m=b.previousSibling.innerHTML+m);b.previousSibling.innerHTML=m;b._full_day=!0}var k=b.previousSibling.getElementsByTagName("input")[0],p=scheduler.date.time_part(a.start_date)==
+0&&scheduler.date.time_part(a.end_date)==0&&a.end_date.valueOf()-a.start_date.valueOf()<1728E5;k.checked=p;for(var i in f)f[i].disabled=k.checked;for(i=0;i<e.length;i++)e[i].disabled=k.checked;k.onclick=function(){if(k.checked==!0){var b=new Date(a.start_date),c=new Date(a.end_date);scheduler.date.date_part(b);c=scheduler.date.add(b,1,"day")}var h=b||a.start_date,i=c||a.end_date;d(e[0],h);d(e[1],i);f[0].value=h.getHours()*60+h.getMinutes();f[1].value=i.getHours()*60+i.getMinutes();for(var j in f)f[j].disabled=
+k.checked;for(j=0;j<e.length;j++)e[j].disabled=k.checked}}if(scheduler.config.event_duration&&scheduler.config.auto_end_date){var o=function(){a.start_date=scheduler.date.add(e[0]._date,f[0].value,"minute");a.end_date.setTime(a.start_date.getTime()+scheduler.config.event_duration*6E4);e[1].value=scheduler.templates.calendar_time(a.end_date);e[1]._date=scheduler.date.date_part(new Date(a.end_date));f[1].value=a.end_date.getHours()*60+a.end_date.getMinutes()};f[0].onchange=o}d(e[0],a.start_date,0);
+d(e[1],a.end_date,1);n=function(){};f[0].value=a.start_date.getHours()*60+a.start_date.getMinutes();f[1].value=a.end_date.getHours()*60+a.end_date.getMinutes()},get_value:function(b,c){var a=b.getElementsByTagName("input"),d=b.getElementsByTagName("select");c.start_date=scheduler.date.add(a[0]._date,d[0].value,"minute");c.end_date=scheduler.date.add(a[1]._date,d[1].value,"minute");if(c.end_date<=c.start_date)c.end_date=scheduler.date.add(c.start_date,scheduler.config.time_step,"minute")},focus:function(){}};
+scheduler.linkCalendar=function(b,c){var a=function(){var a=scheduler._date,e=new Date(a.valueOf());c&&(e=c(e));e.setDate(1);scheduler.updateCalendar(b,e);return!0};scheduler.attachEvent("onViewChange",a);scheduler.attachEvent("onXLE",a);scheduler.attachEvent("onEventAdded",a);scheduler.attachEvent("onEventChanged",a);scheduler.attachEvent("onAfterEventDelete",a);a()};
+scheduler._markCalendarCurrentDate=function(b){var c=scheduler._date,a=scheduler._mode;if(b._date.getMonth()==c.getMonth()&&b._date.getFullYear()==c.getFullYear())if(a=="day"||this._props&&this._props[a])scheduler.markCalendar(b,c,"dhx_calendar_click");else if(a=="week")for(var d=scheduler.date.week_start(new Date(c.valueOf())),e=0;e<7;e++){var f=d.getMonth()+d.getYear()*12-c.getMonth()-c.getYear()*12;f||scheduler.markCalendar(b,d,"dhx_calendar_click");d=scheduler.date.add(d,1,"day")}};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multiselect.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multiselect.js
new file mode 100644
index 00000000000..432bad25af0
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multiselect.js
@@ -0,0 +1,7 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.form_blocks.multiselect={render:function(d){for(var a="<div class='dhx_multi_select_"+d.name+"' style='overflow: auto; height: "+d.height+"px; position: relative;' >",b=0;b<d.options.length;b++)a+="<label><input type='checkbox' value='"+d.options[b].key+"'/>"+d.options[b].label+"</label>",convertStringToBoolean(d.vertical)&&(a+="<br/>");a+="</div>";return a},set_value:function(d,a,b,c){function h(b){for(var c=d.getElementsByTagName("input"),a=0;a<c.length;a++)c[a].checked=!!b[c[a].value]}
+for(var f=d.getElementsByTagName("input"),e=0;e<f.length;e++)f[e].checked=!1;if(!scheduler._new_event)if(f=[],b[c.map_to]){for(var i=b[c.map_to].split(","),e=0;e<i.length;e++)f[i[e]]=!0;h(f)}else{var g=document.createElement("div");g.className="dhx_loading";g.style.cssText="position: absolute; top: 40%; left: 40%;";d.appendChild(g);dhtmlxAjax.get(c.script_url+"?dhx_crosslink_"+c.map_to+"="+b.id+"&uid="+scheduler.uid(),function(b){for(var a=b.doXPath("//data/item"),e=[],f=0;f<a.length;f++)e[a[f].getAttribute(c.map_to)]=
+!0;h(e);d.removeChild(g)})}},get_value:function(d){for(var a=[],b=d.getElementsByTagName("input"),c=0;c<b.length;c++)b[c].checked&&a.push(b[c].value);return a.join(",")},focus:function(){}};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multisource.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multisource.js
new file mode 100644
index 00000000000..797ce06da4a
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multisource.js
@@ -0,0 +1,5 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+(function(){function e(a){var b=function(){};b.prototype=a;return b}var d=scheduler._load;scheduler._load=function(a,b){a=a||this._load_url;if(typeof a=="object")for(var f=e(this._loaded),c=0;c<a.length;c++)this._loaded=new f,d.call(this,a[c],b);else d.apply(this,arguments)}})();
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_offline.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_offline.js
new file mode 100644
index 00000000000..fc429dd5e2d
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_offline.js
@@ -0,0 +1,9 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler._extra_xle=!1;scheduler.attachEvent("onXLE",function(){if(!scheduler._extra_xle){var a=!1,c;for(c in scheduler._events)if(scheduler._events[c].text){a=!0;break}if((localStorage._updated_events||!a)&&localStorage._events){scheduler._extra_xle=!0;scheduler.parse(localStorage._events,"json");scheduler._extra_xle=!1;var b=scheduler._dataprocessor,e=JSON.parse(localStorage._updated_events);b.setUpdateMode("off");for(var d in e)b.setUpdated(d,!0,e[d]);b.sendData();b.setUpdateMode("cell")}}});
+scheduler.attachEvent("onBeforeEventDelete",function(a){var c=scheduler._dataprocessor.getState(a);if(c=="inserted"&&localStorage._updated_events){var b=JSON.parse(localStorage._updated_events);delete b[a];for(a in b){localStorage._updated_events=JSON.stringify(b);break}}return!0});var old_delete_event=scheduler.deleteEvent;scheduler.deleteEvent=function(a,c){old_delete_event.apply(this,arguments);localStorage._events=scheduler.toJSON()};scheduler._offline={};
+scheduler._offline._after_update_events=[];var old_dp_init=scheduler._dp_init;
+scheduler._dp_init=function(a){old_dp_init.apply(this,arguments);a.attachEvent("onAfterUpdate",function(c){scheduler._offline._after_update_events.push(c);return!0});a.attachEvent("onAfterUpdateFinish",function(){localStorage._events=scheduler.toJSON();for(var c=JSON.parse(localStorage._updated_events),b=0;b<scheduler._offline._after_update_events.length;b++)delete c[scheduler._offline._after_update_events[b]];var a=!1,d;for(d in c){a=!0;break}a?(localStorage._updated_events=JSON.stringify(c),scheduler._offline._after_update_event=
+[]):delete localStorage._updated_events;return!0});a.attachEvent("onBeforeDataSending",function(a,b,e){var d={};localStorage._updated_events&&(d=JSON.parse(localStorage._updated_events));for(var f in e){var g=scheduler._dataprocessor.action_param;if(d[f]&&(d[f][g]=="inserted"||e[f][g]=="deleted")||!d[f])d[f]=e[f][g]}localStorage._events=scheduler.toJSON();localStorage._updated_events=JSON.stringify(d);return!0});dhtmlxError.catchError("LoadXML",function(){for(var a in scheduler._dataprocessor._in_progress)delete scheduler._dataprocessor._in_progress[a]})};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_outerdrag.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_outerdrag.js
new file mode 100644
index 00000000000..b4ae32b1b60
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_outerdrag.js
@@ -0,0 +1,6 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.attachEvent("onTemplatesReady",function(){var a=new dhtmlDragAndDropObject,g=a.stopDrag,b;a.stopDrag=function(d){b=d||event;return g.apply(this,arguments)};a.addDragLanding(scheduler._els.dhx_cal_data[0],{_drag:function(d){var a=scheduler.attachEvent("onEventCreated",function(a,b){if(!scheduler.callEvent("onExternalDragIn",[a,d,b]))this._drag_mode=this._drag_id=null,this.deleteEvent(a)});if(scheduler.matrix&&scheduler.matrix[scheduler._mode])scheduler.dblclick_dhx_matrix_cell(b);else{var f=
+document.createElement("div");f.className="dhx_month_body";var c={},e;for(e in b)c[e]=b[e];c.target=c.srcElement=f;scheduler._on_dbl_click(c)}scheduler.detachEvent(a)},_dragIn:function(a){return a},_dragOut:function(){return this}})});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_pdf.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_pdf.js
new file mode 100644
index 00000000000..d8c34cffda4
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_pdf.js
@@ -0,0 +1,14 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.toPDF=function(x,f,m,n){function g(c){return c.replace(html_regexp,"")}function j(c){c=parseFloat(c);return isNaN(c)?"auto":100*c/(o+1)}function t(c){c=parseFloat(c);return isNaN(c)?"auto":100*c/k}function q(c){var a="";if(scheduler.matrix&&scheduler.matrix[scheduler._mode])c=c[0].childNodes;for(var b=0;b<c.length;b++)a+="\n<column><![CDATA["+g(c[b].innerHTML)+"]]\></column>";o=c[0].offsetWidth;return a}function y(c,a){for(var b=parseInt(c.style.left),d=0;d<scheduler._cols.length;d++)if(b-=
+scheduler._cols[d],b<0)return d;return a}function z(c,a){for(var b=parseInt(c.style.top),d=0;d<scheduler._colsS.heights.length;d++)if(scheduler._colsS.heights[d]>b)return d;return a}function w(c){for(var a="",b=c.firstChild.rows,d=0;d<b.length;d++){for(var e=[],h=0;h<b[d].cells.length;h++)e.push(b[d].cells[h].firstChild.innerHTML);a+="\n<row height='"+c.firstChild.rows[d].cells[0].offsetHeight+"'><![CDATA["+g(e.join("|"))+"]]\></row>";k=c.firstChild.rows[0].cells[0].offsetHeight}return a}function A(c){var a=
+"<data profile='"+c+"'";m&&(a+=" header='"+m+"'");n&&(a+=" footer='"+n+"'");a+=">";a+="<scale mode='"+scheduler._mode+"' today='"+scheduler._els.dhx_cal_date[0].innerHTML+"'>";if(scheduler._mode=="agenda"){var b=scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;a+="<column>"+g(b[0].innerHTML)+"</column><column>"+g(b[1].innerHTML)+"</column>"}else if(scheduler._mode=="year")for(var b=scheduler._els.dhx_cal_data[0].childNodes,d=0;d<b.length;d++)a+="<month label='"+g(b[d].childNodes[0].innerHTML)+
+"'>",a+=q(b[d].childNodes[1].childNodes),a+=w(b[d].childNodes[2]),a+="</month>";else{a+="<x>";b=scheduler._els.dhx_cal_header[0].childNodes;a+=q(b);a+="</x>";var e=scheduler._els.dhx_cal_data[0];if(scheduler.matrix&&scheduler.matrix[scheduler._mode]){a+="<y>";for(d=0;d<e.firstChild.rows.length;d++)a+="<row><![CDATA["+e.firstChild.rows[d].cells[0].innerHTML+"]]\></row>";a+="</y>";k=e.firstChild.rows[0].cells[0].offsetHeight}else if(e.firstChild.tagName=="TABLE")a+=w(e);else{for(e=e.childNodes[e.childNodes.length-
+1];e.className.indexOf("dhx_scale_holder")==-1;)e=e.previousSibling;e=e.childNodes;a+="<y>";for(d=0;d<e.length;d++)a+="\n<row><![CDATA["+g(e[d].innerHTML)+"]]\></row>";a+="</y>";k=e[0].offsetHeight}}a+="</scale>";return a}function r(c,a){return(window.getComputedStyle?window.getComputedStyle(c,null)[a]:c.currentStyle?c.currentStyle[a]:null)||""}function B(){var c="",a=scheduler._rendered;if(scheduler._mode=="agenda")for(var b=0;b<a.length;b++)c+="<event><head>"+g(a[b].childNodes[0].innerHTML)+"</head><body>"+
+g(a[b].childNodes[2].innerHTML)+"</body></event>";else if(scheduler._mode=="year"){a=scheduler.get_visible_events();for(b=0;b<a.length;b++){var d=a[b].start_date;if(d.valueOf()<scheduler._min_date.valueOf())d=scheduler._min_date;for(;d<a[b].end_date;){var e=d.getMonth()+12*(d.getFullYear()-scheduler._min_date.getFullYear())-scheduler.week_starts._month,h=scheduler.week_starts[e]+d.getDate()-1;c+="<event day='"+h%7+"' week='"+Math.floor(h/7)+"' month='"+e+"'></event>";d=scheduler.date.add(d,1,"day");
+if(d.valueOf()>=scheduler._max_date.valueOf())break}}}else for(b=0;b<a.length;b++){var f=j(a[b].style.left),i=j(a[b].style.width),l=t(a[b].style.top),m=t(a[b].style.height),n=a[b].className.split(" ")[0].replace("dhx_cal_",""),o=scheduler.getEvent(a[b].getAttribute("event_id")),h=o._sday,s=o._sweek;if(scheduler._mode!="month"){if(scheduler.matrix&&scheduler.matrix[scheduler._mode])h=0,s=a[b].parentNode.parentNode.parentNode.rowIndex,i+=j(10);else{i+=j(i*20/100);f-=j(20-f*20/100);if(a[b].parentNode==
+scheduler._els.dhx_cal_data[0])continue;f+=j(a[b].parentNode.style.left);f-=j(51)}if(scheduler._mode=="timeline"){var q=k;k=180;l=t(a[b].style.top);k=q}}else m=parseInt(a[b].offsetHeight),l=parseInt(a[b].style.top)-22,h=y(a[b],h),s=z(a[b],s);c+="\n<event week='"+s+"' day='"+h+"' type='"+n+"' x='"+f+"' y='"+l+"' width='"+i+"' height='"+m+"'>";if(n=="event"){c+="<header><![CDATA["+g(a[b].childNodes[1].innerHTML)+"]]\></header>";var u=p?r(a[b].childNodes[2],"color"):"",v=p?r(a[b].childNodes[2],"backgroundColor"):
+"";c+="<body backgroundColor='"+v+"' color='"+u+"'><![CDATA["+g(a[b].childNodes[2].innerHTML)+"]]\></body>"}else u=p?r(a[b],"color"):"",v=p?r(a[b],"backgroundColor"):"",c+="<body backgroundColor='"+v+"' color='"+u+"'><![CDATA["+g(a[b].innerHTML)+"]]\></body>";c+="</event>"}return c}function C(){var c="</data>";return c}var o=0,k=0,p=!1;f=="fullcolor"&&(p=!0,f="color");f=f||"color";html_regexp=RegExp("<[^>]*>","g");var l=(new Date).valueOf(),i=document.createElement("div");i.style.display="none";document.body.appendChild(i);
+i.innerHTML='<form id="'+l+'" method="post" target="_blank" action="'+x+'" accept-charset="utf-8" enctype="application/x-www-form-urlencoded"><input type="hidden" name="mycoolxmlbody"/> </form>';document.getElementById(l).firstChild.value=A(f).replace("\u2013","-")+B()+C();document.getElementById(l).submit();i.parentNode.removeChild(i);grid=null};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js
new file mode 100644
index 00000000000..066e5e5a57b
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js
@@ -0,0 +1,9 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.attachEvent("onTemplatesReady",function(){function h(d,b,c,f){for(var e=b.getElementsByTagName(d),a=c.getElementsByTagName(d),g=a.length-1;g>=0;g--)if(c=a[g],f){var i=document.createElement("SPAN");i.className="dhx_text_disabled";i.innerHTML=f(e[g]);c.parentNode.insertBefore(i,c);c.parentNode.removeChild(c)}else c.disabled=!0}scheduler.attachEvent("onBeforeLightbox",function(d){if(this.config.readonly_form||this.getEvent(d).readonly)this.config.readonly_active=!0;else return this.config.readonly_active=
+!1,!0;for(var b=0;b<this.config.lightbox.sections.length;b++)this.config.lightbox.sections[b].focus=!1;return!0});var k=scheduler._fill_lightbox;scheduler._fill_lightbox=function(){var d=this.config.lightbox.sections;if(this.config.readonly_active)for(var b=0;b<d.length;b++)if(d[b].type=="recurring"){var c=document.getElementById(d[b].id);c.style.display=c.nextSibling.style.display="none";d.splice(b,1);b--}var f=k.apply(this,arguments);if(this.config.readonly_active){var e=this._get_lightbox(),a=
+this._lightbox_r=e.cloneNode(!0);a.id=scheduler.uid();a.style.color="red";h("textarea",e,a,function(a){return a.value});h("input",e,a,!1);h("select",e,a,function(a){return a.options[Math.max(a.selectedIndex||0,0)].text});a.removeChild(a.childNodes[2]);a.removeChild(a.childNodes[3]);e.parentNode.insertBefore(a,e);j.call(this,a);scheduler._lightbox&&scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);this._lightbox=a;this.setLightboxSize();this._lightbox=null;a.onclick=function(a){var b=
+a?a.target:event.srcElement;if(!b.className)b=b.previousSibling;if(b&&b.className)switch(b.className){case "dhx_cancel_btn":scheduler.callEvent("onEventCancel",[scheduler._lightbox_id]),scheduler._edit_stop_event(scheduler.getEvent(scheduler._lightbox_id),!1),scheduler.hide_lightbox()}}}return f};var j=scheduler.showCover;scheduler.showCover=function(){this.config.readonly_active||j.apply(this,arguments)};var l=scheduler.hide_lightbox;scheduler.hide_lightbox=function(){if(this._lightbox_r)this._lightbox_r.parentNode.removeChild(this._lightbox_r),
+this._lightbox_r=null;return l.apply(this,arguments)}});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js
new file mode 100644
index 00000000000..b57b847683a
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js
@@ -0,0 +1,35 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.form_blocks.recurring={render:function(){return scheduler.__recurring_template},_ds:{},_init_set_value:function(a,b,c){function d(a){for(var b=0;b<a.length;b++){var c=a[b];c.type=="checkbox"||c.type=="radio"?(g[c.name]||(g[c.name]=[]),g[c.name].push(c)):g[c.name]=c}}function f(a){for(var b=g[a],c=0;c<b.length;c++)if(b[c].checked)return b[c].value}function e(){m("dhx_repeat_day").style.display="none";m("dhx_repeat_week").style.display="none";m("dhx_repeat_month").style.display="none";m("dhx_repeat_year").style.display=
+"none";m("dhx_repeat_"+this.value).style.display="block"}function h(a){var b=[f("repeat")];for(p[b[0]](b,a);b.length<5;)b.push("");var c="";if(g.end[0].checked)a.end=new Date(9999,1,1),c="no";else if(g.end[2].checked)a.end=i(g.date_of_end.value);else{scheduler.transpose_type(b.join("_"));var c=Math.max(1,g.occurences_count.value),e=b[0]=="week"&&b[4]&&b[4].toString().indexOf(scheduler.config.start_on_monday?1:0)==-1?1:0;a.end=scheduler.date.add(new Date(a.start),c+e,b.join("_"))}return b.join("_")+
+"#"+c}function j(a,b){var c=a.split("#"),a=c[0].split("_");q[a[0]](a,b);var e=g.repeat[{day:0,week:1,month:2,year:3}[a[0]]];switch(c[1]){case "no":g.end[0].checked=!0;break;case "":g.end[2].checked=!0;g.date_of_end.value=k(b.end);break;default:g.end[1].checked=!0,g.occurences_count.value=c[1]}e.checked=!0;e.onclick()}scheduler.form_blocks.recurring._ds={start:c.start_date,end:c._end_date};var i=scheduler.date.str_to_date(scheduler.config.repeat_date),k=scheduler.date.date_to_str(scheduler.config.repeat_date),
+l=a.getElementsByTagName("FORM")[0],g=[];d(l.getElementsByTagName("INPUT"));d(l.getElementsByTagName("SELECT"));var m=function(a){return document.getElementById(a)};scheduler.form_blocks.recurring._get_repeat_code=h;var p={month:function(a,b){f("month_type")=="d"?(a.push(Math.max(1,g.month_count.value)),b.start.setDate(g.month_day.value)):(a.push(Math.max(1,g.month_count2.value)),a.push(g.month_day2.value),a.push(Math.max(1,g.month_week2.value)),b.start.setDate(1));b._start=!0},week:function(a,b){a.push(Math.max(1,
+g.week_count.value));a.push("");a.push("");for(var c=[],e=g.week_day,d=0;d<e.length;d++)e[d].checked&&c.push(e[d].value);c.length||c.push(b.start.getDay());b.start=scheduler.date.week_start(b.start);b._start=!0;a.push(c.sort().join(","))},day:function(a){f("day_type")=="d"?a.push(Math.max(1,g.day_count.value)):(a.push("week"),a.push(1),a.push(""),a.push(""),a.push("1,2,3,4,5"),a.splice(0,1))},year:function(a,b){f("year_type")=="d"?(a.push("1"),b.start.setMonth(0),b.start.setDate(g.year_day.value),
+b.start.setMonth(g.year_month.value)):(a.push("1"),a.push(g.year_day2.value),a.push(g.year_week2.value),b.start.setDate(1),b.start.setMonth(g.year_month2.value));b._start=!0}},q={week:function(a){g.week_count.value=a[1];for(var b=g.week_day,c=a[4].split(","),e={},d=0;d<c.length;d++)e[c[d]]=!0;for(d=0;d<b.length;d++)b[d].checked=!!e[b[d].value]},month:function(a,b){a[2]==""?(g.month_type[0].checked=!0,g.month_count.value=a[1],g.month_day.value=b.start.getDate()):(g.month_type[1].checked=!0,g.month_count2.value=
+a[1],g.month_week2.value=a[3],g.month_day2.value=a[2])},day:function(a){g.day_type[0].checked=!0;g.day_count.value=a[1]},year:function(a,b){a[2]==""?(g.year_type[0].checked=!0,g.year_day.value=b.start.getDate(),g.year_month.value=b.start.getMonth()):(g.year_type[1].checked=!0,g.year_week2.value=a[3],g.year_day2.value=a[2],g.year_month2.value=b.start.getMonth())}};scheduler.form_blocks.recurring._set_repeat_code=j;for(var n=0;n<l.elements.length;n++){var o=l.elements[n];switch(o.name){case "repeat":o.onclick=
+e}}scheduler._lightbox._rec_init_done=!0},set_value:function(a,b,c){var d=scheduler.form_blocks.recurring;scheduler._lightbox._rec_init_done||d._init_set_value(a,b,c);a.open=!c.rec_type;a.blocked=c.event_pid&&c.event_pid!="0"?!0:!1;var f=d._ds;f.start=c.start_date;f.end=c._end_date;d.button_click(0,a.previousSibling.firstChild.firstChild,a,a);b&&d._set_repeat_code(b,f)},get_value:function(a,b){if(a.open){var c=scheduler.form_blocks.recurring._ds;b.rec_type=scheduler.form_blocks.recurring._get_repeat_code(c);
+c._start?(b.start_date=new Date(c.start),b._start_date=new Date(c.start),c._start=!1):b._start_date=null;b._end_date=b.end_date=c.end;b.rec_pattern=b.rec_type.split("#")[0]}else b.rec_type=b.rec_pattern="",b._end_date=b.end_date;return b.rec_type},focus:function(){},button_click:function(a,b,c,d){!d.open&&!d.blocked?(d.style.height="115px",b.style.backgroundPosition="-5px 0px",b.nextSibling.innerHTML=scheduler.locale.labels.button_recurring_open):(d.style.height="0px",b.style.backgroundPosition="-5px 20px",
+b.nextSibling.innerHTML=scheduler.locale.labels.button_recurring);d.open=!d.open;scheduler.setLightboxSize()}};scheduler._rec_markers={};scheduler._rec_markers_pull={};scheduler._add_rec_marker=function(a,b){a._pid_time=b;this._rec_markers[a.id]=a;this._rec_markers_pull[a.event_pid]||(this._rec_markers_pull[a.event_pid]={});this._rec_markers_pull[a.event_pid][b]=a};scheduler._get_rec_marker=function(a,b){var c=this._rec_markers_pull[b];return c?c[a]:null};
+scheduler._get_rec_markers=function(a){return this._rec_markers_pull[a]||[]};scheduler._rec_temp=[];scheduler.attachEvent("onEventLoading",function(a){a.event_pid!=0&&scheduler._add_rec_marker(a,a.event_length*1E3);if(a.rec_type)a.rec_pattern=a.rec_type.split("#")[0];return!0});
+scheduler.attachEvent("onEventIdChange",function(a,b){if(!this._ignore_call){this._ignore_call=!0;for(var c=0;c<this._rec_temp.length;c++){var d=this._rec_temp[c];if(d.event_pid==a)d.event_pid=b,this.changeEventId(d.id,b+"#"+d.id.split("#")[1])}delete this._ignore_call}});
+scheduler.attachEvent("onBeforeEventDelete",function(a){var b=this.getEvent(a);if(a.toString().indexOf("#")!=-1||b.event_pid&&b.event_pid!="0"&&b.rec_type!="none"){var a=a.split("#"),c=this.uid(),d=a[1]?a[1]:b._pid_time/1E3,f=this._copy_event(b);f.id=c;f.event_pid=b.event_pid||a[0];f.event_length=d;f.rec_type=f.rec_pattern="none";this.addEvent(f);this._add_rec_marker(f,d*1E3)}else{b.rec_type&&this._roll_back_dates(b);var e=this._get_rec_markers(a),h;for(h in e)if(e.hasOwnProperty(h))a=e[h].id,this.getEvent(a)&&
+this.deleteEvent(a,!0)}return!0});
+scheduler.attachEvent("onEventChanged",function(a){if(this._loading)return!0;var b=this.getEvent(a);if(a.toString().indexOf("#")!=-1){var a=a.split("#"),c=this.uid();this._not_render=!0;var d=this._copy_event(b);d.id=c;d.event_pid=a[0];d.event_length=a[1];d.rec_type=d.rec_pattern="";this.addEvent(d);this._not_render=!1;this._add_rec_marker(d,a[1]*1E3)}else{b.rec_type&&this._roll_back_dates(b);var f=this._get_rec_markers(a),e;for(e in f)f.hasOwnProperty(e)&&(delete this._rec_markers[f[e].id],this.deleteEvent(f[e].id,
+!0));delete this._rec_markers_pull[a];for(var h=!1,j=0;j<this._rendered.length;j++)this._rendered[j].getAttribute("event_id")==a&&(h=!0);if(!h)this._select_id=null}return!0});scheduler.attachEvent("onEventAdded",function(a){if(!this._loading){var b=this.getEvent(a);b.rec_type&&!b.event_length&&this._roll_back_dates(b)}return!0});scheduler.attachEvent("onEventSave",function(a,b){var c=this.getEvent(a);if(!c.rec_type&&b.rec_type&&(a+"").indexOf("#")==-1)this._select_id=null;return!0});
+scheduler.attachEvent("onEventCreated",function(a){var b=this.getEvent(a);if(!b.rec_type)b.rec_type=b.rec_pattern=b.event_length=b.event_pid="";return!0});scheduler.attachEvent("onEventCancel",function(a){var b=this.getEvent(a);b.rec_type&&(this._roll_back_dates(b),this.render_view_data())});
+scheduler._roll_back_dates=function(a){a.event_length=(a.end_date.valueOf()-a.start_date.valueOf())/1E3;a.end_date=a._end_date;a._start_date&&(a.start_date.setMonth(0),a.start_date.setDate(a._start_date.getDate()),a.start_date.setMonth(a._start_date.getMonth()),a.start_date.setFullYear(a._start_date.getFullYear()))};scheduler.validId=function(a){return a.toString().indexOf("#")==-1};scheduler.showLightbox_rec=scheduler.showLightbox;
+scheduler.showLightbox=function(a){var b=this.getEvent(a).event_pid;a.toString().indexOf("#")!=-1&&(b=a.split("#")[0]);if(!b||b==0||!this.locale.labels.confirm_recurring||!confirm(this.locale.labels.confirm_recurring))return this.showLightbox_rec(a);b=this.getEvent(b);b._end_date=b.end_date;b.end_date=new Date(b.start_date.valueOf()+b.event_length*1E3);return this.showLightbox_rec(b.id)};scheduler.get_visible_events_rec=scheduler.get_visible_events;
+scheduler.get_visible_events=function(){for(var a=0;a<this._rec_temp.length;a++)delete this._events[this._rec_temp[a].id];this._rec_temp=[];for(var b=this.get_visible_events_rec(),c=[],a=0;a<b.length;a++)b[a].rec_type?b[a].rec_pattern!="none"&&this.repeat_date(b[a],c):c.push(b[a]);return c};(function(){var a=scheduler.is_one_day_event;scheduler.is_one_day_event=function(b){return b.rec_type?!0:a.call(this,b)}})();scheduler.transponse_size={day:1,week:7,month:1,year:12};
+scheduler.date.day_week=function(a,b,c){a.setDate(1);var c=(c-1)*7,d=a.getDay(),f=b*1+c-d+1;a.setDate(f<=c?f+7:f)};scheduler.transpose_day_week=function(a,b,c,d,f){for(var e=(a.getDay()||(scheduler.config.start_on_monday?7:0))-c,h=0;h<b.length;h++)if(b[h]>e)return a.setDate(a.getDate()+b[h]*1-e-(d?c:f));this.transpose_day_week(a,b,c+d,null,c)};
+scheduler.transpose_type=function(a){var b="transpose_"+a;if(!this.date[b]){var c=a.split("_"),d=864E5,f="add_"+a,e=this.transponse_size[c[0]]*c[1];if(c[0]=="day"||c[0]=="week"){var h=null;if(c[4]&&(h=c[4].split(","),scheduler.config.start_on_monday)){for(var j=0;j<h.length;j++)h[j]=h[j]*1||7;h.sort()}this.date[b]=function(a,b){var c=Math.floor((b.valueOf()-a.valueOf())/(d*e));c>0&&a.setDate(a.getDate()+c*e);h&&scheduler.transpose_day_week(a,h,1,e)};this.date[f]=function(a,b){var c=new Date(a.valueOf());
+if(h)for(var d=0;d<b;d++)scheduler.transpose_day_week(c,h,0,e);else c.setDate(c.getDate()+b*e);return c}}else if(c[0]=="month"||c[0]=="year")this.date[b]=function(a,b){var d=Math.ceil((b.getFullYear()*12+b.getMonth()*1-(a.getFullYear()*12+a.getMonth()*1))/e);d>=0&&a.setMonth(a.getMonth()+d*e);c[3]&&scheduler.date.day_week(a,c[2],c[3])},this.date[f]=function(a,b){var d=new Date(a.valueOf());d.setMonth(d.getMonth()+b*e);c[3]&&scheduler.date.day_week(d,c[2],c[3]);return d}}};
+scheduler.repeat_date=function(a,b,c,d,f){var d=d||this._min_date,f=f||this._max_date,e=new Date(a.start_date.valueOf());if(!a.rec_pattern&&a.rec_type)a.rec_pattern=a.rec_type.split("#")[0];this.transpose_type(a.rec_pattern);for(scheduler.date["transpose_"+a.rec_pattern](e,d);e<a.start_date||e.valueOf()+a.event_length*1E3<=d.valueOf();)e=this.date.add(e,1,a.rec_pattern);for(;e<f&&e<a.end_date;){var h=this._get_rec_marker(e.valueOf(),a.id);if(h)c&&b.push(h);else{var j=new Date(e.valueOf()+a.event_length*
+1E3),i=this._copy_event(a);i.text=a.text;i.start_date=e;i.event_pid=a.id;i.id=a.id+"#"+Math.ceil(e.valueOf()/1E3);i.end_date=j;var k=i.start_date.getTimezoneOffset()-i.end_date.getTimezoneOffset();if(k)i.end_date=k>0?new Date(e.valueOf()+a.event_length*1E3-k*6E4):new Date(i.end_date.valueOf()+k*6E4);i._timed=this.is_one_day_event(i);if(!i._timed&&!this._table_view&&!this.config.multi_day)break;b.push(i);c||(this._events[i.id]=i,this._rec_temp.push(i))}e=this.date.add(e,1,a.rec_pattern)}};
+scheduler.getRecDates=function(a,b){var c=typeof a=="object"?a:scheduler.getEvent(a),d=0,f=[],b=b||1E3,e=new Date(c.start_date.valueOf()),h=new Date(e.valueOf());if(!c.rec_type)return[{start_date:c.start_date,end_date:c.end_date}];this.transpose_type(c.rec_pattern);for(scheduler.date["transpose_"+c.rec_pattern](e,h);e<c.start_date||e.valueOf()+c.event_length*1E3<=h.valueOf();)e=this.date.add(e,1,c.rec_pattern);for(;e<c.end_date;){var j=this._get_rec_marker(e.valueOf(),c.id),i=!0;if(j)j.rec_type==
+"none"?i=!1:f.push({start_date:j.start_date,end_date:j.end_date});else{var k=new Date(e.valueOf()+c.event_length*1E3),l=new Date(e);f.push({start_date:l,end_date:k})}e=this.date.add(e,1,c.rec_pattern);if(i&&(d++,d==b))break}return f};
+scheduler.getEvents=function(a,b){var c=[],d;for(d in this._events){var f=this._events[d];if(f&&f.start_date<b&&f.end_date>a)if(f.rec_pattern){if(f.rec_pattern!="none"){var e=[];this.repeat_date(f,e,!0,a,b);for(var h=0;h<e.length;h++)!e[h].rec_pattern&&e[h].start_date<b&&e[h].end_date>a&&!this._rec_markers[e[h].id]&&c.push(e[h])}}else f.id.toString().indexOf("#")==-1&&c.push(f)}return c};scheduler.config.repeat_date="%m.%d.%Y";
+scheduler.config.lightbox.sections=[{name:"description",height:130,map_to:"text",type:"textarea",focus:!0},{name:"recurring",type:"recurring",map_to:"rec_type",button:"recurring"},{name:"time",height:72,type:"time",map_to:"auto"}];scheduler._copy_dummy=function(){this.start_date=new Date(this.start_date);this.end_date=new Date(this.end_date);this.event_length=this.event_pid=this.rec_pattern=this.rec_type=this._timed=null};
+scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Daily</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Weekly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Monthly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Yearly</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />day<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Every workday</label> </div> <div style="display:none;" id="dhx_repeat_week"> Repeat every<input class="dhx_repeat_text" type="text" name="week_count" value="1" />week next days:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Monday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Thursday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Tuesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Friday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Wednesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Saturday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sunday</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Repeat</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />day every<input class="dhx_repeat_text" type="text" name="month_count" value="1" />month<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="0">Sunday</select>every<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />month<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />day<select name="year_month"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select>month<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="7">Sunday</select>of<select name="year_month2"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>No end date</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />After</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurrences<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />End by</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+
+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>';
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_serialize.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_serialize.js
new file mode 100644
index 00000000000..fd3b34913bb
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_serialize.js
@@ -0,0 +1,8 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.data_attributes=function(){var f=[],d=scheduler.templates.xml_format,c;for(c in this._events){var e=this._events[c],a;for(a in e)a.substr(0,1)!="_"&&f.push([a,a=="start_date"||a=="end_date"?d:null]);break}return f};
+scheduler.toXML=function(f){var d=[],c=this.data_attributes(),e;for(e in this._events){var a=this._events[e];if(a.id.toString().indexOf("#")==-1){d.push("<event>");for(var b=0;b<c.length;b++)d.push("<"+c[b][0]+"><![CDATA["+(c[b][1]?c[b][1](a[c[b][0]]):a[c[b][0]])+"]]\></"+c[b][0]+">");d.push("</event>")}}return(f||"")+"<data>"+d.join("\n")+"</data>"};
+scheduler.toJSON=function(){var f=[],d=this.data_attributes(),c;for(c in this._events){var e=this._events[c];if(e.id.toString().indexOf("#")==-1){for(var e=this._events[c],a=[],b=0;b<d.length;b++)a.push(" "+d[b][0]+':"'+((d[b][1]?d[b][1](e[d[b][0]]):e[d[b][0]])||"").toString().replace(/\n/g,"")+'" ');f.push("{"+a.join(",")+"}")}}return"["+f.join(",\n")+"]"};
+scheduler.toICal=function(f){var d="BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\nDESCRIPTION:",c="END:VCALENDAR",e=scheduler.date.date_to_str("%Y%m%dT%H%i%s"),a=[],b;for(b in this._events){var g=this._events[b];g.id.toString().indexOf("#")==-1&&(a.push("BEGIN:VEVENT"),a.push("DTSTART:"+e(g.start_date)),a.push("DTEND:"+e(g.end_date)),a.push("SUMMARY:"+g.text),a.push("END:VEVENT"))}return d+(f||"")+"\n"+a.join("\n")+"\n"+c};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_timeline.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_timeline.js
new file mode 100644
index 00000000000..00205d8394a
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_timeline.js
@@ -0,0 +1,34 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+(function(){function B(){for(var a=scheduler.get_visible_events(),b=[],c=0;c<this.y_unit.length;c++)b[c]=[];b[f]||(b[f]=[]);for(c=0;c<a.length;c++){for(var f=this.order[a[c][this.y_property]],d=0;this._trace_x[d+1]&&a[c].start_date>=this._trace_x[d+1];)d++;for(;this._trace_x[d]&&a[c].end_date>this._trace_x[d];)b[f][d]||(b[f][d]=[]),b[f][d].push(a[c]),d++}return b}function v(a,b,c){var f=0,d=b?a.end_date:a.start_date;if(d.valueOf()>scheduler._max_date.valueOf())d=scheduler._max_date;var i=d-scheduler._min_date_timeline;
+if(i<0)k=0;else{var g=Math.round(i/(c*scheduler._cols[0]));if(g>scheduler._cols.length)g=scheduler._cols.length;for(var e=0;e<g;e++)f+=scheduler._cols[e];var j=scheduler.date.add(scheduler._min_date_timeline,scheduler.matrix[scheduler._mode].x_step*g,scheduler.matrix[scheduler._mode].x_unit),i=d-j,k=Math.floor(i/c)}f+=b?k-14:k+1;return f}function C(a){var b="<table style='table-layout:fixed;' cellspacing='0' cellpadding='0'>",c=[];scheduler._load_mode&&scheduler._load();if(this.render=="cell")c=B.call(this);
+else for(var f=scheduler.get_visible_events(),d=0;d<f.length;d++){var i=this.order[f[d][this.y_property]];c[i]||(c[i]=[]);c[i].push(f[d])}for(var g=0,e=0;e<scheduler._cols.length;e++)g+=scheduler._cols[e];var j=new Date;this._step=j=(scheduler.date.add(j,this.x_step*this.x_size,this.x_unit)-j)/g;this._summ=g;var k=scheduler._colsS.heights=[];this._events_height={};for(e=0;e<this.y_unit.length;e++){var h=this._logic(this.render,this.y_unit[e],this);scheduler._merge(h,{height:this.dy});if(this.section_autoheight&&
+this.y_unit.length*h.height<a.offsetHeight)h.height=Math.max(h.height,Math.floor((a.offsetHeight-1)/this.y_unit.length));scheduler._merge(h,{tr_className:"",style_height:"height:"+h.height+"px;",style_width:"width:"+(this.dx-1)+"px;",td_className:"dhx_matrix_scell"+(scheduler.templates[this.name+"_scaley_class"](this.y_unit[e].key,this.y_unit[e].label,this)?" "+scheduler.templates[this.name+"_scaley_class"](this.y_unit[e].key,this.y_unit[e].label,this):""),td_content:scheduler.templates[this.name+
+"_scale_label"](this.y_unit[e].key,this.y_unit[e].label,this.y_unit[e]),summ_width:"width:"+g+"px;",table_className:""});var o="";if(c[e]&&this.render!="cell"){c[e].sort(function(a,d){return a.start_date>d.start_date?1:-1});for(var l=[],d=0;d<c[e].length;d++){for(var m=c[e][d],n=0;l[n]&&l[n].end_date>m.start_date;)n++;l[n]=m;o+=scheduler.render_timeline_event.call(this,m,n)}}if(this.fit_events){var w=this._events_height[this.y_unit[e].key]||0;h.height=w>h.height?w:h.height;h.style_height="height:"+
+h.height+"px;"}b+="<tr class='"+h.tr_className+"' style='"+h.style_height+"'><td class='"+h.td_className+"' style='"+h.style_width+" height:"+(h.height-1)+"px;'>"+h.td_content+"</td>";if(this.render=="cell")for(d=0;d<scheduler._cols.length;d++)b+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](c[e][d],this._trace_x[d],this.y_unit[e])+"' style='width:"+(scheduler._cols[d]-1)+"px'><div style='width:"+(scheduler._cols[d]-1)+"px'>"+scheduler.templates[this.name+"_cell_value"](c[e][d])+
+"</div></td>";else{b+="<td><div style='"+h.summ_width+" "+h.style_height+" position:relative;' class='dhx_matrix_line'>";b+=o;b+="<table class='"+h.table_className+"' cellpadding='0' cellspacing='0' style='"+h.summ_width+" "+h.style_height+"' >";for(d=0;d<scheduler._cols.length;d++)b+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](c[e],this._trace_x[d],this.y_unit[e])+"' style='width:"+(scheduler._cols[d]-1)+"px'><div style='width:"+(scheduler._cols[d]-1)+"px'></div></td>";
+b+="</table>";b+="</div></td>"}b+="</tr>"}b+="</table>";this._matrix=c;a.innerHTML=b;scheduler._rendered=[];for(var q=document.getElementsByTagName("DIV"),e=0;e<q.length;e++)q[e].getAttribute("event_id")&&scheduler._rendered.push(q[e]);for(e=0;e<a.firstChild.rows.length;e++)k.push(a.firstChild.rows[e].offsetHeight)}function D(a){var b=scheduler.xy.scale_height,c=this._header_resized||scheduler.xy.scale_height;scheduler._cols=[];scheduler._colsS={height:0};this._trace_x=[];var f=scheduler._x-this.dx-
+18,d=[this.dx],i=scheduler._els.dhx_cal_header[0];i.style.width=d[0]+f+"px";for(var g=scheduler._min_date_timeline=scheduler._min_date,e=0;e<this.x_size;e++)this._trace_x[e]=new Date(g),g=scheduler.date.add(g,this.x_step,this.x_unit),scheduler._cols[e]=Math.floor(f/(this.x_size-e)),f-=scheduler._cols[e],d[e+1]=d[e]+scheduler._cols[e];a.innerHTML="<div></div>";if(this.second_scale){for(var j=this.second_scale.x_unit,k=[this._trace_x[0]],h=[],o=[this.dx,this.dx],l=0,m=0;m<this._trace_x.length;m++){var n=
+this._trace_x[m],w=E(j,n,k[l]);w&&(++l,k[l]=n,o[l+1]=o[l]);var q=l+1;h[l]=scheduler._cols[m]+(h[l]||0);o[q]+=scheduler._cols[m]}a.innerHTML="<div></div><div></div>";var p=a.firstChild;p.style.height=c+"px";var v=a.lastChild;v.style.position="relative";for(var r=0;r<k.length;r++){var t=k[r],u=scheduler.templates[this.name+"_second_scalex_class"](t),x=document.createElement("DIV");x.className="dhx_scale_bar dhx_second_scale_bar"+(u?" "+u:"");scheduler.set_xy(x,h[r]-1,c-3,o[r],0);x.innerHTML=scheduler.templates[this.name+
+"_second_scale_date"](t);p.appendChild(x)}}scheduler.xy.scale_height=c;for(var a=a.lastChild,s=0;s<this._trace_x.length;s++){g=this._trace_x[s];scheduler._render_x_header(s,d[s],g,a);var y=scheduler.templates[this.name+"_scalex_class"](g);y&&(a.lastChild.className+=" "+y)}scheduler.xy.scale_height=b;var z=this._trace_x;a.onclick=function(a){var d=A(a);d&&scheduler.callEvent("onXScaleClick",[d.x,z[d.x],a||event])};a.ondblclick=function(a){var d=A(a);d&&scheduler.callEvent("onXScaleDblClick",[d.x,z[d.x],
+a||event])}}function E(a,b,c){switch(a){case "day":return!(b.getDate()==c.getDate()&&b.getMonth()==c.getMonth()&&b.getFullYear()==c.getFullYear());case "week":return!(scheduler.date.getISOWeek(b)==scheduler.date.getISOWeek(c)&&b.getFullYear()==c.getFullYear());case "month":return!(b.getMonth()==c.getMonth()&&b.getFullYear()==c.getFullYear());case "year":return b.getFullYear()!=c.getFullYear();default:return!1}}function p(a){if(a){scheduler.set_sizes();t();var b=scheduler._min_date;D.call(this,scheduler._els.dhx_cal_header[0]);
+C.call(this,scheduler._els.dhx_cal_data[0]);scheduler._min_date=b;scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[this.name+"_date"](scheduler._min_date,scheduler._max_date);scheduler._table_view=!0}}function u(){if(scheduler._tooltip)scheduler._tooltip.style.display="none",scheduler._tooltip.date=""}function F(a,b,c){if(a.render=="cell"){var f=b.x+"_"+b.y,d=a._matrix[b.y][b.x];if(!d)return u();d.sort(function(a,d){return a.start_date>d.start_date?1:-1});if(scheduler._tooltip){if(scheduler._tooltip.date==
+f)return;scheduler._tooltip.innerHTML=""}else{var i=scheduler._tooltip=document.createElement("DIV");i.className="dhx_tooltip";document.body.appendChild(i);i.onclick=scheduler._click.dhx_cal_data}for(var g="",e=0;e<d.length;e++){var j=d[e].color?"background-color:"+d[e].color+";":"",k=d[e].textColor?"color:"+d[e].textColor+";":"";g+="<div class='dhx_tooltip_line' event_id='"+d[e].id+"' style='"+j+""+k+"'>";g+="<div class='dhx_tooltip_date'>"+(d[e]._timed?scheduler.templates.event_date(d[e].start_date):
+"")+"</div>";g+="<div class='dhx_event_icon icon_details'>&nbsp;</div>";g+=scheduler.templates[a.name+"_tooltip"](d[e].start_date,d[e].end_date,d[e])+"</div>"}scheduler._tooltip.style.display="";scheduler._tooltip.style.top="0px";scheduler._tooltip.style.left=document.body.offsetWidth-c.left-scheduler._tooltip.offsetWidth<0?c.left-scheduler._tooltip.offsetWidth+"px":c.left+b.src.offsetWidth+"px";scheduler._tooltip.date=f;scheduler._tooltip.innerHTML=g;scheduler._tooltip.style.top=document.body.offsetHeight-
+c.top-scheduler._tooltip.offsetHeight<0?c.top-scheduler._tooltip.offsetHeight+b.src.offsetHeight+"px":c.top+"px"}}function t(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(a){var b=scheduler.matrix[scheduler._mode];if(b){var c=scheduler._locate_cell_timeline(a),a=a||event,f=a.target||a.srcElement;if(c)return F(b,c,getOffset(c.src))}u()});t=function(){}}function G(a){for(var b=a.parentNode.childNodes,c=0;c<b.length;c++)if(b[c]==a)return c;return-1}function A(a){for(var a=a||event,
+b=a.target?a.target:a.srcElement;b&&b.tagName!="DIV";)b=b.parentNode;if(b&&b.tagName=="DIV"){var c=b.className.split(" ")[0];if(c=="dhx_scale_bar")return{x:G(b),y:-1,src:b,scale:!0}}}scheduler.matrix={};scheduler._merge=function(a,b){for(var c in b)typeof a[c]=="undefined"&&(a[c]=b[c])};scheduler.createTimelineView=function(a){scheduler._merge(a,{section_autoheight:!0,name:"matrix",x:"time",y:"time",x_step:1,x_unit:"hour",y_unit:"day",y_step:1,x_start:0,x_size:24,y_start:0,y_size:7,render:"cell",
+dx:200,dy:50,fit_events:!0,second_scale:!1,_logic:function(a,b,c){var e={};scheduler.checkEvent("onBeforeViewRender")&&(e=scheduler.callEvent("onBeforeViewRender",[a,b,c]));return e}});scheduler.checkEvent("onTimelineCreated")&&scheduler.callEvent("onTimelineCreated",[a]);var b=scheduler.render_data;scheduler.render_data=function(d,c){if(this._mode==a.name)if(c)for(var f=0;f<d.length;f++)this.clear_event(d[f]),this.render_timeline_event.call(this.matrix[this._mode],d[f],0,!0);else p.call(a,!0);else return b.apply(this,
+arguments)};scheduler.matrix[a.name]=a;scheduler.templates[a.name+"_cell_value"]=function(a){return a?a.length:""};scheduler.templates[a.name+"_cell_class"]=function(){return""};scheduler.templates[a.name+"_scalex_class"]=function(){return""};scheduler.templates[a.name+"_second_scalex_class"]=function(){return""};scheduler.templates[a.name+"_scaley_class"]=function(){return""};scheduler.templates[a.name+"_scale_label"]=function(a,b){return b};scheduler.templates[a.name+"_tooltip"]=function(a,b,c){return c.text};
+scheduler.templates[a.name+"_date"]=function(a,b){return a.getDay()==b.getDay()&&b-a<864E5?scheduler.templates.day_date(a):scheduler.templates.week_date(a,b)};scheduler.templates[a.name+"_scale_date"]=scheduler.date.date_to_str(a.x_date||scheduler.config.hour_date);scheduler.templates[a.name+"_second_scale_date"]=scheduler.date.date_to_str(a.second_scale&&a.second_scale.x_date?a.second_scale.x_date:scheduler.config.hour_date);scheduler.date["add_"+a.name]=function(b,c){return scheduler.date.add(b,
+(a.x_length||a.x_size)*c*a.x_step,a.x_unit)};scheduler.date[a.name+"_start"]=scheduler.date[a.x_unit+"_start"]||scheduler.date.day_start;scheduler.attachEvent("onSchedulerResize",function(){return this._mode==a.name?(p.call(a,!0),!1):!0});scheduler.attachEvent("onOptionsLoad",function(){a.order={};scheduler.callEvent("onOptionsLoadStart",[]);for(var b=0;b<a.y_unit.length;b++)a.order[a.y_unit[b].key]=b;scheduler.callEvent("onOptionsLoadFinal",[]);scheduler._date&&a.name==scheduler._mode&&scheduler.setCurrentView(scheduler._date,
+scheduler._mode)});scheduler.callEvent("onOptionsLoad",[a]);scheduler[a.name+"_view"]=function(){scheduler.renderMatrix.apply(a,arguments)};if(a.render!="cell"){var c=new Date,f=scheduler.date.add(c,a.x_step,a.x_unit).valueOf()-c.valueOf();scheduler["mouse_"+a.name]=function(b){var c=this._drag_event;if(this._drag_id)c=this.getEvent(this._drag_id),this._drag_event._dhx_changed=!0;b.x-=a.dx;for(var g=0,e=0,j=0;e<this._cols.length-1;e++)if(g+=this._cols[e],g>b.x)break;for(g=0;j<this._colsS.heights.length;j++)if(g+=
+this._colsS.heights[j],g>b.y)break;b.fields={};a.y_unit[j]||(j=a.y_unit.length-1);b.fields[a.y_property]=c[a.y_property]=a.y_unit[j].key;b.x=0;this._drag_mode=="new-size"&&c.start_date*1==this._drag_start*1&&e++;var k=e>=a._trace_x.length?scheduler.date.add(a._trace_x[a._trace_x.length-1],a.x_step,a.x_unit):a._trace_x[e];b.y=Math.round((k-this._min_date)/(6E4*this.config.time_step));b.custom=!0;b.shift=f;return b}}};scheduler.render_timeline_event=function(a,b,c){var f=v(a,!1,this._step),d=v(a,!0,
+this._step),i=scheduler.xy.bar_height,g=2+b*i,e=i+g-2,j=a[this.y_property];if(!this._events_height[j]||this._events_height[j]<e)this._events_height[j]=e;var k=scheduler.templates.event_class(a.start_date,a.end_date,a),k="dhx_cal_event_line "+(k||""),h=a.color?"background-color:"+a.color+";":"",o=a.textColor?"color:"+a.textColor+";":"",l='<div event_id="'+a.id+'" class="'+k+'" style="'+h+""+o+"position:absolute; top:"+g+"px; left:"+f+"px; width:"+Math.max(0,d-f)+"px;"+(a._text_style||"")+'">'+scheduler.templates.event_bar_text(a.start_date,
+a.end_date,a)+"</div>";if(c){var m=document.createElement("DIV");m.innerHTML=l;var n=this.order[j],p=scheduler._els.dhx_cal_data[0].firstChild.rows[n].cells[1].firstChild;scheduler._rendered.push(m.firstChild);p.appendChild(m.firstChild)}else return l};scheduler.renderMatrix=function(a){scheduler._els.dhx_cal_data[0].scrollTop=0;var b=scheduler.date[this.name+"_start"](scheduler._date);scheduler._min_date=scheduler.date.add(b,this.x_start*this.x_step,this.x_unit);scheduler._max_date=scheduler.date.add(scheduler._min_date,
+this.x_size*this.x_step,this.x_unit);scheduler._table_view=!0;if(this.second_scale){if(a&&!this._header_resized)this._header_resized=scheduler.xy.scale_height,scheduler.xy.scale_height*=2,scheduler._els.dhx_cal_header[0].className+=" dhx_second_cal_header";if(!a&&this._header_resized){scheduler.xy.scale_height/=2;this._header_resized=!1;var c=scheduler._els.dhx_cal_header[0];c.className=c.className.replace(/ dhx_second_cal_header/gi,"")}}p.call(this,a)};scheduler._locate_cell_timeline=function(a){for(var a=
+a||event,b=a.target?a.target:a.srcElement;b&&b.tagName!="TD";)b=b.parentNode;if(b&&b.tagName=="TD"){var c=b.className.split(" ")[0];if(c=="dhx_matrix_cell")if(scheduler._isRender("cell"))return{x:b.cellIndex-1,y:b.parentNode.rowIndex,src:b};else{for(var f=b.parentNode;f&&f.tagName!="TD";)f=f.parentNode;return{x:b.cellIndex,y:f.parentNode.rowIndex,src:b}}else if(c=="dhx_matrix_scell")return{x:-1,y:b.parentNode.rowIndex,src:b,scale:!0}}return!1};var H=scheduler._click.dhx_cal_data;scheduler._click.dhx_cal_data=
+function(a){var b=H.apply(this,arguments),c=scheduler.matrix[scheduler._mode];if(c){var f=scheduler._locate_cell_timeline(a);f&&(f.scale?scheduler.callEvent("onYScaleClick",[f.y,c.y_unit[f.y],a||event]):scheduler.callEvent("onCellClick",[f.x,f.y,c._trace_x[f.x],(c._matrix[f.y]||{})[f.x]||[],a||event]))}return b};scheduler.dblclick_dhx_matrix_cell=function(a){var b=scheduler.matrix[scheduler._mode];if(b){var c=scheduler._locate_cell_timeline(a);c&&(c.scale?scheduler.callEvent("onYScaleDblClick",[c.y,
+b.y_unit[c.y],a||event]):scheduler.callEvent("onCellDblClick",[c.x,c.y,b._trace_x[c.x],(b._matrix[c.y]||{})[c.x]||[],a||event]))}};scheduler.dblclick_dhx_matrix_scell=function(a){return scheduler.dblclick_dhx_matrix_cell(a)};scheduler._isRender=function(a){return scheduler.matrix[scheduler._mode]&&scheduler.matrix[scheduler._mode].render==a};scheduler.attachEvent("onCellDblClick",function(a,b,c,f,d){if(!(this.config.readonly||d.type=="dblclick"&&!this.config.dblclick_create)){var i=scheduler.matrix[scheduler._mode],
+g={};g.start_date=i._trace_x[a];g.end_date=i._trace_x[a+1]?i._trace_x[a+1]:scheduler.date.add(i._trace_x[a],i.x_step,i.x_unit);g[scheduler.matrix[scheduler._mode].y_property]=i.y_unit[b].key;scheduler.addEventNow(g,null,d)}});scheduler.attachEvent("onBeforeDrag",function(){return scheduler._isRender("cell")?!1:!0})})();
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_tooltip.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_tooltip.js
new file mode 100644
index 00000000000..2458d37e841
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_tooltip.js
@@ -0,0 +1,11 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+window.dhtmlXTooltip={};dhtmlXTooltip.config={className:"dhtmlXTooltip tooltip",timeout_to_display:50,delta_x:15,delta_y:-20};dhtmlXTooltip.tooltip=document.createElement("div");dhtmlXTooltip.tooltip.className=dhtmlXTooltip.config.className;
+dhtmlXTooltip.show=function(b,d){var c=dhtmlXTooltip,f=this.tooltip,a=f.style;c.tooltip.className=c.config.className;var e=this.position(b),k=b.target||b.srcElement;if(!this.isTooltip(k)){var g=0,l=0,h=scheduler._obj;if(h.offsetParent){do g+=h.offsetLeft,l+=h.offsetTop;while(h=h.offsetParent)}var i=e.x+(c.config.delta_x||0)-g,j=e.y-(c.config.delta_y||0)-l;a.visibility="hidden";a.removeAttribute?(a.removeAttribute("right"),a.removeAttribute("bottom")):(a.removeProperty("right"),a.removeProperty("bottom"));
+a.left="0";a.top="0";this.tooltip.innerHTML=d;scheduler._obj.appendChild(this.tooltip);var m=this.tooltip.offsetWidth,n=this.tooltip.offsetHeight;scheduler._obj.offsetWidth-i-(scheduler.xy.margin_left||0)-m<0?(a.removeAttribute?a.removeAttribute("left"):a.removeProperty("left"),a.right=scheduler._obj.offsetWidth-i+2*(c.config.delta_x||0)+"px"):a.left=i<0?e.x+Math.abs(c.config.delta_x||0)+"px":i+"px";scheduler._obj.offsetHeight-j-(scheduler.xy.margin_top||0)-n<0?(a.removeAttribute?a.removeAttribute("top"):
+a.removeProperty("top"),a.bottom=scheduler._obj.offsetHeight-j-2*(c.config.delta_y||0)+"px"):a.top=j<0?e.y+Math.abs(c.config.delta_y||0)+"px":j+"px";a.visibility="visible"}};dhtmlXTooltip.hide=function(){this.tooltip.parentNode&&this.tooltip.parentNode.removeChild(this.tooltip)};dhtmlXTooltip.delay=function(b,d,c,f){this.tooltip._timeout_id&&window.clearTimeout(this.tooltip._timeout_id);this.tooltip._timeout_id=setTimeout(function(){var a=b.apply(d,c);b=d=c=null;return a},f||this.config.timeout_to_display)};
+dhtmlXTooltip.isTooltip=function(b){for(var d=!1;b&&!d;)d=b.className==this.tooltip.className,b=b.parentNode;return d};dhtmlXTooltip.position=function(b){b=b||window.event;if(b.pageX||b.pageY)return{x:b.pageX,y:b.pageY};var d=dhtmlx._isIE&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:b.clientX+d.scrollLeft-d.clientLeft,y:b.clientY+d.scrollTop-d.clientTop}};
+scheduler.attachEvent("onMouseMove",function(b,d){var c=window.event||d,f=c.target||c.srcElement,a=dhtmlXTooltip;if(b||a.isTooltip(f)){var e=scheduler.getEvent(b)||scheduler.getEvent(a.tooltip.event_id);if(e){a.tooltip.event_id=e.id;var k=scheduler.templates.tooltip_text(e.start_date,e.end_date,e),g=void 0;_isIE&&(g=document.createEventObject(c));a.delay(a.show,a,[g||c,k])}}else a.delay(a.hide,a,[])});scheduler.attachEvent("onBeforeDrag",function(){dhtmlXTooltip.hide();return!0});
+scheduler.templates.tooltip_date_format=scheduler.date.date_to_str("%Y-%m-%d %H:%i");scheduler.templates.tooltip_text=function(b,d,c){return"<b>Event:</b> "+c.text+"<br/><b>Start date:</b> "+scheduler.templates.tooltip_date_format(b)+"<br/><b>End date:</b> "+scheduler.templates.tooltip_date_format(d)};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.css b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.css
new file mode 100644
index 00000000000..212423da5d1
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.css
@@ -0,0 +1,5 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+.dhx_cal_prev_button,.dhx_cal_next_button,.dhx_cal_today_button,.dhx_cal_add_button{top:6px!important;left:10px;border:1px solid #575D65;border-top:1px solid #4E5052;color:#FFF;text-shadow:0 -1px 0 #65696E;background-image:-webkit-gradient(linear,left top,left bottom,from(#B2B6BC),to(#6B737E));background-color:#989B9F;background-position:0 1px;background-repeat:repeat-x;-webkit-border-radius:5px;padding:3px;text-align:center;text-decoration:none;}.dhx_cal_today_button{left:55px;}.dhx_cal_next_button{left:146px;}.dhx_cal_add_button{right:9px;left:auto;width:20px;font-size:20px;padding:1px 2px 2px 2px;}.dhx_cal_navline .dhx_cal_date{top:7px;left:160px;right:350px;padding-top:4px;width:auto;text-align:center;color:#4F5459;}.dhx_cal_navline{background:-webkit-gradient(linear,0% 0,0% 100%,color-stop(0,#F4F5F8),color-stop(0.3,#F1F2F4),color-stop(0.7,#C4C7D0),color-stop(1,#A6AAB7));border-bottom:1px solid #797F90;height:40px!important;font-family:Helvetica;font-weight:bold;font-size:13px;}.dhx_cal_tab{top:6px!important;color:#4F5459;text-align:center;padding:5px 10px;width:80px;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#F7F7F7),to(#B9BDC7));background-color:#CFD0D1;background-position:0 1px;background-repeat:repeat-x;text-decoration:none;border:1px solid #95989F;border-top:1px solid #686A6A;height:16px;}.dhx_cal_tab.active{background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#B0B2B6),to(#666D74));background-color:#949799;background-position:0 1px;background-repeat:repeat-x;border:1px solid #4C4D4F;border-top:1px solid #52585C;color:#F8F8F8;text-shadow:0 -1px 0 #5E6063;text-decoration:none;height:16px;padding:5px 10px;z-index:100;}.dhx_cal_light{-webkit-transition:-webkit-transform;-webkit-transform-style:preserve-3d;}.dhx_cal_cover{opacity:.5;}.dhx_cal_ltext{padding-top:0;padding-bottom:0;}.dhx_cal_ltext textarea{-webkit-background-size:0;-webkit-border-radius:0;height:94%;}.dhx_mini_calendar .dhx_month_head{height:35px;line-height:35px;text-align:center;padding-right:0;padding-left:0;}.dhx_mini_calendar .dhx_year_month{height:35px;line-height:30px;background:-webkit-gradient(linear,0% 0,0% 100%,from(#F4F5F8),to(#8A8E9A));font-family:Helvetica;font-weight:bold;font-size:13px;}.dhx_mini_calendar .dhx_year_month .dhx_cal_prev_button,.dhx_mini_calendar .dhx_year_month .dhx_cal_next_button{line-height:normal;} \ No newline at end of file
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.js
new file mode 100644
index 00000000000..70b4abeda7c
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.js
@@ -0,0 +1,26 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+TouchScroll=function(a,b,c,e){this.debug=!!b;this.compat=!!e;this.rough=!!c;this.axisX=this.axisY=!0;typeof a!="object"&&(a=document.getElementById(a));this._init();a.addEventListener("touchstart",this,!1);a.addEventListener("webkitTransitionEnd",this,!1);this.debug&&a.addEventListener("mousedown",this,!1);this.node=a;for(var d=0;d<a.childNodes.length;d++)if(a.childNodes[d].nodeType==1){this.area=a.childNodes[d];break}if(window.getComputedStyle(this.node).position=="static")this.node.style.position=
+"relative";this.area.style.cssText+="-webkit-transition: -webkit-transform; -webkit-user-select:none; -webkit-transform-style:preserve-3d;";this.scrolls={}};
+TouchScroll.prototype={refresh:function(){this.node.style.webkitTransformStyle="flat";this.node.style.webkitTransformStyle="preserve-3d"},scrollTo:function(a,b,c){this.set_matrix({e:a,f:b},c||0)},onscroll:function(){},handleEvent:function(a){return this["ev_"+a.type](a)},get_matrix:function(a){return new WebKitCSSMatrix(window.getComputedStyle(a||this.area).webkitTransform)},set_matrix:function(a,b,c){(c||this.area).style.webkitTransform="translate("+Math.round(a.e)+"px,"+Math.round(a.f)+"px)";(c||
+this.area).style.webkitTransitionDuration=b},ev_touchstart:function(a){this.ev_mousedown(a.touches[0]);a.preventDefault();return!1},ev_mousedown:function(a){var b=a;this.x=b.pageX;this.y=b.pageY;this.dx=this.node.offsetWidth;this.dy=this.node.offsetHeight;this.mx=this.area.scrollWidth;this.my=this.area.scrollHeight;this.target=b.target;if(!this.rough){var c=this.get_matrix();this.target_x=c.e;this.target_y=c.f;if(!this.scroll&&this.compat)c.e=this.node.scrollLeft*-1,c.f=this.node.scrollTop*-1,this.node.scrollTop=
+this.node.scrollLeft=0;this.set_matrix(c,0);this._correct_scroll(this.target_x,this.target_y)}this.scroll_x=this.scroll_y=this.scroll=!1;this._init_events()},ev_touchend:function(){return this.ev_mouseup()},ev_mouseup:function(){this._deinit_events();if(!this.scroll){this._remove_scroll();var a=document.createEvent("MouseEvent");a.initMouseEvent("click",!0,!0);this.target.dispatchEvent(a)}this.target=null},ev_webkitTransitionEnd:function(){if(!this.target&&this.scroll){this._remove_scroll();var a=
+this.get_matrix();this.node.firstChild._scrollTop=-1*a.f;if(this.compat&&(a.e||a.f)){var b=a.f,c=a.e;a.e=a.f=0;this.set_matrix(a,0);this.node.scrollTop=-1*b;this.node.scrollLeft=-1*c}this.scroll=!1}},ev_touchmove:function(a){return this.ev_mousemove(a.touches[0])},ev_mousemove:function(a){if(this.target){var b=a,c=(b.pageX-this.x)*(this.axisX?5:0),e=(b.pageY-this.y)*(this.axisY?5:0);if(!(Math.abs(c)<10&&Math.abs(e)<10)){if(Math.abs(c)>50)this.scroll_x=!0;if(Math.abs(e)>50)this.scroll_y=!0;if(this.scroll_x||
+this.scroll_y){this.x=b.pageX;this.y=b.pageY;this.scroll=!0;var d=this.get_matrix();c+=this.target_x-d.e;e+=this.target_y-d.f;var f="2000ms",g="500ms";this.target_x=c+d.e;this.target_y=e+d.f;if(this.target_x>0)this.target_x=0,f=g;if(this.target_y>0)this.target_y=0,f=g;if(this.mx-this.dx+this.target_x<0)this.target_x=-this.mx+this.dx,f=g;if(this.my-this.dy+this.target_y<0)this.target_y=-this.my+this.dy,f=g;this.set_matrix({e:this.target_x,f:this.target_y},f);this._add_scroll(d.e,d.f);this._correct_scroll(this.target_x,
+this.target_y,f);this.onscroll(this.target_x,this.target_y)}return!1}}},_correct_scroll:function(a,b,c){if(this.scrolls.x){var e=this.get_matrix(this.scrolls.x),d=this.dx*a/this.mx;this.set_matrix({e:-1*d,f:0},c,this.scrolls.x)}if(this.scrolls.y){var e=this.get_matrix(this.scrolls.y),f=this.dy*b/this.my;this.set_matrix({e:0,f:-1*f},c,this.scrolls.y)}},_remove_scroll:function(){this.scrolls.x&&this.scrolls.x.parentNode.removeChild(this.scrolls.x);this.scrolls.y&&this.scrolls.y.parentNode.removeChild(this.scrolls.y);
+this.scrolls={}},_add_scroll:function(){if(!this.scrolls.ready){var a;if(this.my>5&&this.axisY){var b=this.dy*this.dy/this.my-1;this.scrolls.y=a=document.createElement("DIV");a.className="dhx_scroll_y";a.style.height=b+"px";this.node.appendChild(a)}if(this.mx>5&&this.axisX)b=this.dx*this.dx/this.mx,this.scrolls.x=a=document.createElement("DIV"),a.className="dhx_scroll_x",a.style.width=b+"px",this.node.appendChild(a);var c=this.get_matrix();this._correct_scroll(c.e,c.f,0);this.scrolls.ready=!0}},_init_events:function(){document.addEventListener("touchmove",
+this,!1);document.addEventListener("touchend",this,!1);this.debug&&(document.addEventListener("mousemove",this,!1),document.addEventListener("mouseup",this,!1))},_deinit_events:function(){document.removeEventListener("touchmove",this,!1);document.removeEventListener("touchend",this,!1);this.debug&&(document.removeEventListener("mousemove",this,!1),document.removeEventListener("mouseup",this,!1))},_init:function(){document.styleSheets[0].insertRule(".dhx_scroll_x { width:50px;height:4px;background:rgba(0, 0, 0, 0.4);position:absolute; left:0px; bottom:3px; border:1px solid transparent; -webkit-border-radius:4px;-webkit-transition: -webkit-transform;}",
+0);document.styleSheets[0].insertRule(".dhx_scroll_y { width:4px;height:50px;background:rgba(0, 0, 0, 0.4);position:absolute; top:0px; right:3px; border:1px solid transparent; -webkit-border-radius:4px;-webkit-transition: -webkit-transform;}",0);this._init=function(){}}};
+scheduler._ipad_before_init=function(){scheduler._ipad_before_init=function(){};scheduler.xy.scroll_width=0;for(var a=scheduler._els.dhx_cal_tab,b=42,c=a.length-1;c>=0;c--)a[c].style.cssText+="top:4px;",a[c].style.left="auto",a[c].style.right=b+"px",c==0&&(a[c].style.cssText+=";-webkit-border-top-left-radius: 5px; -webkit-border-bottom-left-radius: 5px;"),c==a.length-1&&(a[c].style.cssText+=";-webkit-border-top-right-radius: 5px; -webkit-border-bottom-right-radius: 5px;"),b+=100;scheduler._els.dhx_cal_prev_button[0].innerHTML=
+"&lt;";scheduler._els.dhx_cal_next_button[0].innerHTML="&gt;";var e=document.createElement("div");e.className="dhx_cal_add_button";e.innerHTML="+ ";e.onclick=function(){var a=new Date;a>scheduler._min_date&&a<scheduler._max_date?scheduler.addEventNow():scheduler.addEventNow(scheduler._min_date.valueOf())};scheduler._els.dhx_cal_navline[0].appendChild(e);this._obj.onmousedown=this._obj.onmouseup=this._obj.onmousemove=function(){};var d=null,f=[];this._obj.ontouchmove=function(a){if(d){var b=Math.abs(a.touches[0].pageX-
+f[0]),c=Math.abs(a.touches[0].pageY-f[1]);if(b>50||c>50)d=window.clearTimeout(d)}scheduler.config.touch_actions&&scheduler._on_mouse_move(a.touches[0])};this._obj.ontouchstart=function(a){scheduler._lightbox_id||(d=window.setTimeout(function(){scheduler._on_dbl_click(a.touches[0],a.target.className?a.target:a.target.parentNode)},400),f=[a.touches[0].pageX,a.touches[0].pageY],scheduler.config.touch_actions&&scheduler._on_mouse_down(a.touches[0]))};this._obj.ontouchend=function(a){d&&(d=window.clearTimeout(d));
+scheduler.config.touch_actions&&scheduler._on_mouse_up(a.touches[0])}};
+scheduler._ipad_init=function(){var a=document.createElement("DIV"),b=scheduler._els.dhx_cal_data[0];a.appendChild(b);a.style.cssText="overflow:hidden; width:100%; overflow:hidden;position:relative;";this._obj.appendChild(a);b.style.overflowY="hidden";var c=new TouchScroll(a);c.axisX=!1;scheduler._ipad_init=function(){b.parentNode.style.height=b.style.height;b.parentNode.style.top=b.style.top;b.style.height=b.scrollHeight+"px";b.style.top="0px";Math.abs(b.parentNode.offsetHeight-b.offsetHeight)<5?
+(c.axisY=!1,c.scrollTo(0,0,0)):c.axisY=!0;c.refresh()};scheduler.attachEvent("onSchedulerResize",function(){setTimeout(function(){scheduler._ipad_init()});return!0});scheduler._ipad_init()};scheduler.attachEvent("onViewChange",function(){scheduler._ipad_init()});scheduler.attachEvent("onBeforeViewChange",function(){scheduler._ipad_before_init();return!0});
+scheduler.showCover=function(a){this.show_cover();if(a){a.style.display="block";var b=getOffset(this._obj);a.style.top=a.offsetHeight*-1+"px";a.style.left=Math.round(b.left+(this._obj.offsetWidth-a.offsetWidth)/2)+"px"}var c=this._get_lightbox(),e=c.addEventListener("webkitTransitionEnd",function(){c.style.top="41px";c.style.webkitTransform="";c.style.webkitTransition="";c.removeEventListener(e)},!1);c.style.webkitTransform="translate(0px,"+(a.offsetHeight+41)+"px)";c.style.webkitTransitionDuration=
+"500ms"};scheduler.hideCover=function(a){if(a){var b=a.addEventListener("webkitTransitionEnd",function(){a.style.top=(a.offsetHeight+41)*-1+"px";a.style.webkitTransform="";a.style.webkitTransition="";a.removeEventListener(b)},!1);a.style.webkitTransform="translate(0px,"+(a.offsetHeight+41)*-1+"px)";a.style.webkitTransitionDuration="500ms"}this.hide_cover()};scheduler.config.lightbox.sections[0].height=100;
+if(scheduler.form_blocks.calendar_time)scheduler.config.lightbox.sections[1].type="calendar_time",scheduler._mini_cal_arrows=["&lt;","&gt;"];scheduler.xy.menu_width=0;scheduler.attachEvent("onClick",function(){return!1});scheduler.locale.labels.new_event="";
+scheduler._mouse_coords=function(a){var b,c=document.body,e=document.documentElement;b=a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+(c.scrollLeft||e.scrollLeft||0)-c.clientLeft,y:a.clientY+(c.scrollTop||e.scrollTop||0)-c.clientTop};b.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);var d=b.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+this._dy_shift+this.xy.scale_height-(this._els.dhx_cal_data[0]._scrollTop||0);if(this._table_view){for(var f=0,f=1;f<this._colsS.heights.length;f++)if(this._colsS.heights[f]>
+b.y)break;b.y=(Math.max(0,Math.ceil(b.x/this._cols[0])-1)+Math.max(0,f-1)*7)*1440/this.config.time_step;b.x=0}else b.x=Math.max(0,Math.ceil(b.x/this._cols[0])-1),b.y=Math.max(0,Math.ceil(b.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);return b};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_treetimeline.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_treetimeline.js
new file mode 100644
index 00000000000..c131cb1eb13
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_treetimeline.js
@@ -0,0 +1,19 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.attachEvent("onTimelineCreated",function(a){if(a.render=="tree")a.y_unit_original=a.y_unit,a.y_unit=scheduler._getArrayToDisplay(a.y_unit_original),scheduler.attachEvent("onOptionsLoadStart",function(){a.y_unit=scheduler._getArrayToDisplay(a.y_unit_original)}),scheduler.form_blocks[a.name]={render:function(b){var c="<div class='dhx_section_timeline' style='overflow: hidden; height: "+b.height+"px'></div>";return c},set_value:function(b,c,g,e){var d=scheduler._getArrayForSelect(scheduler.matrix[e.type].y_unit_original,
+e.type);b.innerHTML="";var a=document.createElement("select");b.appendChild(a);for(var i=b.getElementsByTagName("select")[0],j=0;j<d.length;j++){var h=document.createElement("option");h.value=d[j].key;if(h.value==g[scheduler.matrix[e.type].y_property])h.selected=!0;h.innerHTML=d[j].label;i.appendChild(h)}},get_value:function(b){return b.firstChild.value},focus:function(){}}});
+scheduler.attachEvent("onBeforeViewRender",function(a,b,c){var g={};if(a=="tree"){var e,d,f,i,j,h;b.children?(e=c.folder_dy||c.dy,c.folder_dy&&!c.section_autoheight&&(f="height:"+c.folder_dy+"px;"),d="dhx_row_folder",i="dhx_matrix_scell folder",j="<div class='dhx_scell_expand'>"+(b.open?"-":"+")+"</div>",h=c.folder_events_available?"dhx_data_table folder_events":"dhx_data_table folder"):(e=c.dy,d="dhx_row_item",i="dhx_matrix_scell item",j="",h="dhx_data_table");td_content="<div class='dhx_scell_level"+
+b.level+"'>"+j+"<div class='dhx_scell_name'>"+(scheduler.templates[c.name+"_scale_label"](b.key,b.label,b)||b.label)+"</div></div>";g={height:e,style_height:f,tr_className:d,td_className:i,td_content:td_content,table_className:h}}return g});var section_id_before;
+scheduler.attachEvent("onBeforeEventChanged",function(a,b,c){if(scheduler._isRender("tree")){var g=scheduler.getSection(a[scheduler.matrix[scheduler._mode].y_property]);if(typeof g.children!="undefined"&&!scheduler.matrix[scheduler._mode].folder_events_available)return c||(a[scheduler.matrix[scheduler._mode].y_property]=section_id_before),!1}return!0});
+scheduler.attachEvent("onBeforeDrag",function(a,b,c){var g=scheduler._locate_cell_timeline(c);if(g){var e=scheduler.matrix[scheduler._mode].y_unit[g.y].key;if(typeof scheduler.matrix[scheduler._mode].y_unit[g.y].children!="undefined"&&!scheduler.matrix[scheduler._mode].folder_events_available)return!1}scheduler._isRender("tree")&&(ev=scheduler.getEvent(a),section_id_before=e||ev[scheduler.matrix[scheduler._mode].y_property]);return!0});
+scheduler._getArrayToDisplay=function(a){var b=[],c=function(a,e){for(var d=e||0,f=0;f<a.length;f++){a[f].level=d;if(typeof a[f].children!="undefined"&&typeof a[f].key=="undefined")a[f].key=scheduler.uid();b.push(a[f]);a[f].open&&a[f].children&&c(a[f].children,d+1)}};c(a);return b};
+scheduler._getArrayForSelect=function(a,b){var c=[],g=function(a){for(var d=0;d<a.length;d++)scheduler.matrix[b].folder_events_available?c.push(a[d]):typeof a[d].children=="undefined"&&c.push(a[d]),a[d].children&&g(a[d].children,b)};g(a);return c};
+scheduler._toggleFolderDisplay=function(a,b,c){var g,e=function(a,b,c,j){for(var h=0;h<b.length;h++){if((b[h].key==a||j)&&b[h].children)if(b[h].open=typeof c!="undefined"?c:!b[h].open,g=!0,!j&&g)break;b[h].children&&e(a,b[h].children,c,j)}};e(a,scheduler.matrix[scheduler._mode].y_unit_original,b,c);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[])};
+scheduler.attachEvent("onCellClick",function(a,b){scheduler._isRender("tree")&&(scheduler.matrix[scheduler._mode].folder_events_available||typeof scheduler.matrix[scheduler._mode].y_unit[b].children!="undefined"&&scheduler._toggleFolderDisplay(scheduler.matrix[scheduler._mode].y_unit[b].key))});scheduler.attachEvent("onYScaleClick",function(a,b){scheduler._isRender("tree")&&typeof b.children!="undefined"&&scheduler._toggleFolderDisplay(b.key)});
+scheduler.getSection=function(a){if(scheduler._isRender("tree")){var b,c=function(a,e){for(var d=0;d<e.length;d++)e[d].key==a&&(b=e[d]),e[d].children&&c(a,e[d].children)};c(a,scheduler.matrix[scheduler._mode].y_unit_original);return b||null}};
+scheduler.deleteSection=function(a){if(scheduler._isRender("tree")){var b=!1,c=function(a,e){for(var d=0;d<e.length;d++){e[d].key==a&&(e.splice(d,1),b=!0);if(b)break;e[d].children&&c(a,e[d].children)}};c(a,scheduler.matrix[scheduler._mode].y_unit_original);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[]);return b}};
+scheduler.deleteAllSections=function(){if(scheduler._isRender("tree"))scheduler.matrix[scheduler._mode].y_unit_original=[],scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original),scheduler.callEvent("onOptionsLoad",[])};
+scheduler.addSection=function(a,b){if(scheduler._isRender("tree")){var c=!1,g=function(a,d,f){if(b)for(var i=0;i<f.length;i++){f[i].key==d&&typeof f[i].children!="undefined"&&(f[i].children.push(a),c=!0);if(c)break;f[i].children&&g(a,d,f[i].children)}else f.push(a),c=!0};g(a,b,scheduler.matrix[scheduler._mode].y_unit_original);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[]);return c}};
+scheduler.openAllSections=function(){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(1,!0,!0)};scheduler.closeAllSections=function(){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(1,!1,!0)};scheduler.openSection=function(a){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(a,!0)};scheduler.closeSection=function(a){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(a,!1)};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_units.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_units.js
new file mode 100644
index 00000000000..d6191895c97
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_units.js
@@ -0,0 +1,16 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler._props={};
+scheduler.createUnitsView=function(a,f,j,g,k,l){if(typeof a=="object")j=a.list,f=a.property,g=a.size||0,k=a.step||1,l=a.skip_incorrect,a=a.name;scheduler._props[a]={map_to:f,options:j,step:k,position:0};if(g>scheduler._props[a].options.length)scheduler._props[a]._original_size=g,g=0;scheduler._props[a].size=g;scheduler._props[a].skip_incorrect=l||!1;scheduler.date[a+"_start"]=scheduler.date.day_start;scheduler.templates[a+"_date"]=function(a){return scheduler.templates.day_date(a)};scheduler.templates[a+
+"_scale_date"]=function(c){var h=scheduler._props[a].options;if(!h.length)return"";var f=(scheduler._props[a].position||0)+Math.floor((scheduler._correct_shift(c.valueOf(),1)-scheduler._min_date.valueOf())/864E5);return h[f].css?"<span class='"+h[f].css+"'>"+h[f].label+"</span>":h[f].label};scheduler.date["add_"+a]=function(a,f){return scheduler.date.add(a,f,"day")};scheduler.date["get_"+a+"_end"]=function(c){return scheduler.date.add(c,scheduler._props[a].size||scheduler._props[a].options.length,
+"day")};scheduler.attachEvent("onOptionsLoad",function(){for(var c=scheduler._props[a],f=c.order={},g=c.options,i=0;i<g.length;i++)f[g[i].key]=i;if(c._original_size&&c.size==0)c.size=c._original_size,delete c.original_size;c.size>g.length?(c._original_size=c.size,c.size=0):c.size=c._original_size||c.size;scheduler._date&&scheduler._mode==a&&scheduler.setCurrentView(scheduler._date,scheduler._mode)});scheduler.callEvent("onOptionsLoad",[])};
+scheduler.scrollUnit=function(a){var f=scheduler._props[this._mode];if(f)f.position=Math.min(Math.max(0,f.position+a),f.options.length-f.size),this.update_view()};
+(function(){var a=function(b){var d=scheduler._props[scheduler._mode];if(d&&d.order&&d.skip_incorrect){for(var a=[],e=0;e<b.length;e++)typeof d.order[b[e][d.map_to]]!="undefined"&&a.push(b[e]);b.splice(0,b.length);b.push.apply(b,a)}return b},f=scheduler._pre_render_events_table;scheduler._pre_render_events_table=function(b,d){b=a(b);return f.apply(this,[b,d])};var j=scheduler._pre_render_events_line;scheduler._pre_render_events_line=function(b,d){b=a(b);return j.apply(this,[b,d])};var g=function(b,
+d){if(b&&typeof b.order[d[b.map_to]]=="undefined"){var a=scheduler,e=864E5,c=Math.floor((d.end_date-a._min_date)/e);d[b.map_to]=b.options[Math.min(c+b.position,b.options.length-1)].key;return!0}},k=scheduler._reset_scale,l=scheduler.is_visible_events;scheduler.is_visible_events=function(b){var d=l.apply(this,arguments);if(d){var a=scheduler._props[this._mode];if(a&&a.size){var e=a.order[b[a.map_to]];if(e<a.position||e>=a.size+a.position)return!1}}return d};scheduler._reset_scale=function(){var b=
+scheduler._props[this._mode],a=k.apply(this,arguments);if(b){this._max_date=this.date.add(this._min_date,1,"day");for(var c=this._els.dhx_cal_data[0].childNodes,e=0;e<c.length;e++)c[e].className=c[e].className.replace("_now","");if(b.size&&b.size<b.options.length){var f=this._els.dhx_cal_header[0],g=document.createElement("DIV");if(b.position)g.className="dhx_cal_prev_button",g.style.cssText="left:1px;top:2px;position:absolute;",g.innerHTML="&nbsp;",f.firstChild.appendChild(g),g.onclick=function(){scheduler.scrollUnit(b.step*
+-1)};if(b.position+b.size<b.options.length)g=document.createElement("DIV"),g.className="dhx_cal_next_button",g.style.cssText="left:auto; right:0px;top:2px;position:absolute;",g.innerHTML="&nbsp;",f.lastChild.appendChild(g),g.onclick=function(){scheduler.scrollUnit(b.step)}}}return a};var c=scheduler._get_event_sday;scheduler._get_event_sday=function(b){var a=scheduler._props[this._mode];return a?(g(a,b),a.order[b[a.map_to]]-a.position):c.call(this,b)};var h=scheduler.locate_holder_day;scheduler.locate_holder_day=
+function(a,d,c){var e=scheduler._props[this._mode];return e?(g(e,c),e.order[c[e.map_to]]*1+(d?1:0)-e.position):h.apply(this,arguments)};var m=scheduler._mouse_coords;scheduler._mouse_coords=function(){var a=scheduler._props[this._mode],d=m.apply(this,arguments);if(a){if(!this._drag_event)this._drag_event={};var c=this._drag_event;if(this._drag_id&&this._drag_mode)c=this.getEvent(this._drag_id),this._drag_event._dhx_changed=!0;var e=Math.min(d.x+a.position,a.options.length-1);c[a.map_to]=a.options[e].key;
+d.x=0;d.custom=!0}return d};var i=scheduler._time_order;scheduler._time_order=function(a){var d=scheduler._props[this._mode];d?a.sort(function(a,b){return d.order[a[d.map_to]]>d.order[b[d.map_to]]?1:-1}):i.apply(this,arguments)};scheduler.attachEvent("onEventAdded",function(a,d){if(this._loading)return!0;for(var c in scheduler._props){var e=scheduler._props[c];if(typeof d[e.map_to]=="undefined")d[e.map_to]=e.options[0].key}return!0});scheduler.attachEvent("onEventCreated",function(a,c){var f=scheduler._props[this._mode];
+if(f){var e=this.getEvent(a);this._mouse_coords(c);g(f,e);this.event_updated(e)}return!0})})();
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_url.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_url.js
new file mode 100644
index 00000000000..bb342e484e0
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_url.js
@@ -0,0 +1,6 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.attachEvent("onTemplatesReady",function(){var d=!0,e=scheduler.date.str_to_date("%Y-%m-%d"),h=scheduler.date.date_to_str("%Y-%m-%d");scheduler.attachEvent("onBeforeViewChange",function(i,j,f,k){if(d){d=!1;for(var a={},g=(document.location.hash||"").replace("#","").split(","),b=0;b<g.length;b++){var c=g[b].split("=");c.length==2&&(a[c[0]]=c[1])}if(a.date||a.mode){try{this.setCurrentView(a.date?e(a.date):null,a.mode||null)}catch(m){this.setCurrentView(a.date?e(a.date):null,f)}return!1}}var l=
+"#date="+h(k||j)+",mode="+(f||i);document.location.hash=l;return!0})});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_week_agenda.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_week_agenda.js
new file mode 100644
index 00000000000..60042f50080
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_week_agenda.js
@@ -0,0 +1,18 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler._wa={};scheduler.xy.week_agenda_scale_height=20;scheduler.templates.week_agenda_event_text=function(c,e,f){return scheduler.templates.event_date(c)+" "+f.text};scheduler.date.week_agenda_start=scheduler.date.week_start;scheduler.date.week_agenda_end=function(c){return scheduler.date.add(c,7,"day")};scheduler.date.add_week_agenda=function(c,e){return scheduler.date.add(c,e*7,"day")};
+scheduler.attachEvent("onSchedulerReady",function(){var c=scheduler.templates;if(!c.week_agenda_date)c.week_agenda_date=c.week_date});(function(){var c=scheduler.date.date_to_str("%l, %F %d");scheduler.templates.week_agenda_scale_date=function(e){return c(e)}})();
+scheduler.attachEvent("onTemplatesReady",function(){scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="week_agenda"?(this.week_agenda_view(!0),!1):!0});var c=scheduler.render_data;scheduler.render_data=function(b){if(this._mode=="week_agenda")f();else return c.apply(this,arguments)};var e=function(){scheduler._cols=[];var b=parseInt(scheduler._els.dhx_cal_data[0].style.width);scheduler._cols.push(Math.floor(b/2));scheduler._cols.push(b-scheduler._cols[0]-1);scheduler._colsS=
+{0:[],1:[]};for(var a=parseInt(scheduler._els.dhx_cal_data[0].style.height),m=0;m<3;m++)scheduler._colsS[0].push(Math.floor(a/(3-scheduler._colsS[0].length))),a-=scheduler._colsS[0][m];scheduler._colsS[1].push(scheduler._colsS[0][0]);scheduler._colsS[1].push(scheduler._colsS[0][1]);a=scheduler._colsS[0][scheduler._colsS[0].length-1];scheduler._colsS[1].push(Math.floor(a/2));scheduler._colsS[1].push(a-scheduler._colsS[1][scheduler._colsS[1].length-1])},f=function(){for(var b=scheduler._els.dhx_cal_data[0].innerHTML=
+"",a=0;a<2;a++){var m=scheduler._cols[a],c="dhx_wa_column";a==1&&(c+=" dhx_wa_column_last");b+="<div class='"+c+"' style='width: "+m+"px;'>";for(var h=0;h<scheduler._colsS[a].length;h++){var k=scheduler.xy.week_agenda_scale_height-2,e=scheduler._colsS[a][h]-k-2;b+="<div class='dhx_wa_day_cont'><div style='height:"+k+"px; line-height:"+k+"px;' class='dhx_wa_scale_bar'></div><div style='height:"+e+"px;' class='dhx_wa_day_data'></div></div>"}b+="</div>"}scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[scheduler._mode+
+"_date"](scheduler._min_date,scheduler._max_date,scheduler._mode);scheduler._els.dhx_cal_data[0].innerHTML=b;for(var i=scheduler._els.dhx_cal_data[0].getElementsByTagName("div"),l=[],a=0;a<i.length;a++)i[a].className=="dhx_wa_day_cont"&&l.push(i[a]);scheduler._wa._selected_divs=[];for(var f=scheduler.get_visible_events(),j=scheduler.date.week_start(scheduler._date),n=scheduler.date.add(j,1,"day"),a=0;a<7;a++){l[a]._date=j;var s=l[a].childNodes[0],t=l[a].childNodes[1];s.innerHTML=scheduler.templates.week_agenda_scale_date(j);
+for(var o=[],q=0;q<f.length;q++){var r=f[q];r.start_date<n&&r.end_date>j&&o.push(r)}o.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?1:-1});for(h=0;h<o.length;h++){var d=o[h],g=document.createElement("div");scheduler._rendered.push(g);g.className="dhx_wa_ev_body";if(d._text_style)g.style.cssText=d._text_style;if(d.color)g.style.backgroundColor=d.color;if(d.textColor)g.style.color=d.textColor;scheduler._select_id&&d.id==scheduler._select_id&&
+(g.className+=" dhx_cal_event_selected",scheduler._wa._selected_divs.push(g));var p="";d._timed||(p="middle",d.start_date.valueOf()>=j.valueOf()&&d.start_date.valueOf()<=n.valueOf()&&(p="start"),d.end_date.valueOf()>=j.valueOf()&&d.end_date.valueOf()<=n.valueOf()&&(p="end"));g.innerHTML=scheduler.templates.week_agenda_event_text(d.start_date,d.end_date,d,j,p);g.setAttribute("event_id",d.id);t.appendChild(g)}j=scheduler.date.add(j,1,"day");n=scheduler.date.add(n,1,"day")}};scheduler.week_agenda_view=
+function(b){scheduler._min_date=scheduler.date.week_start(scheduler._date);scheduler._max_date=scheduler.date.add(scheduler._min_date,1,"week");scheduler.set_sizes();if(b)scheduler._table_view=!0,scheduler._wa._prev_data_border=scheduler._els.dhx_cal_data[0].style.borderTop,scheduler._els.dhx_cal_data[0].style.borderTop=0,scheduler._els.dhx_cal_data[0].style.overflowY="hidden",scheduler._els.dhx_cal_date[0].innerHTML="",scheduler._els.dhx_cal_data[0].style.top=parseInt(scheduler._els.dhx_cal_data[0].style.top)-
+scheduler.xy.bar_height-1+"px",scheduler._els.dhx_cal_data[0].style.height=parseInt(scheduler._els.dhx_cal_data[0].style.height)+scheduler.xy.bar_height+1+"px",scheduler._els.dhx_cal_header[0].style.display="none",e(),f();else{scheduler._table_view=!1;if(scheduler._wa._prev_data_border)scheduler._els.dhx_cal_data[0].style.borderTop=scheduler._wa._prev_data_border;scheduler._els.dhx_cal_data[0].style.overflowY="auto";scheduler._els.dhx_cal_data[0].style.top=parseInt(scheduler._els.dhx_cal_data[0].style.top)+
+scheduler.xy.bar_height+"px";scheduler._els.dhx_cal_data[0].style.height=parseInt(scheduler._els.dhx_cal_data[0].style.height)-scheduler.xy.bar_height+"px";scheduler._els.dhx_cal_header[0].style.display="block"}};scheduler.mouse_week_agenda=function(b){for(var a=b.ev,c=a.srcElement||a.target;c.parentNode;){if(c._date)var e=c._date;c=c.parentNode}if(!e)return b;b.x=0;var h=e.valueOf()-scheduler._min_date.valueOf();b.y=Math.ceil(h/6E4/this.config.time_step);if(this._drag_mode=="move"){this._drag_event._dhx_changed=
+!0;this._select_id=this._drag_id;for(var k=0;k<scheduler._rendered.length;k++)if(scheduler._drag_id==this._rendered[k].getAttribute("event_id"))var f=this._rendered[k];if(!scheduler._wa._dnd){var i=f.cloneNode(!0);this._wa._dnd=i;i.className=f.className;i.id="dhx_wa_dnd";i.className+=" dhx_wa_dnd";document.body.appendChild(i)}var l=document.getElementById("dhx_wa_dnd");l.style.top=(a.pageY||a.clientY)+20+"px";l.style.left=(a.pageX||a.clientX)+20+"px"}return b};scheduler.attachEvent("onBeforeEventChanged",
+function(){if(this._mode=="week_agenda"&&this._drag_mode=="move"){var b=document.getElementById("dhx_wa_dnd");b.parentNode.removeChild(b);scheduler._wa._dnd=!1}return!0});scheduler.attachEvent("onEventSave",function(b,a,c){if(c)this._select_id=b;return!0});scheduler._wa._selected_divs=[];scheduler.attachEvent("onClick",function(b){if(this._mode=="week_agenda"){if(scheduler._wa._selected_divs)for(var a=0;a<this._wa._selected_divs.length;a++){var c=this._wa._selected_divs[a];c.className=c.className.replace(/ dhx_cal_event_selected/,
+"")}this.for_rendered(b,function(a){a.className+=" dhx_cal_event_selected";scheduler._wa._selected_divs.push(a)});this._select_id=b;return!1}return!0})});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_year_view.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_year_view.js
new file mode 100644
index 00000000000..e17296b6f81
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_year_view.js
@@ -0,0 +1,17 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
+scheduler.config.year_x=4;scheduler.config.year_y=3;scheduler.config.year_mode_name="year";scheduler.xy.year_top=0;scheduler.templates.year_date=function(c){return scheduler.date.date_to_str(scheduler.locale.labels.year_tab+" %Y")(c)};scheduler.templates.year_month=scheduler.date.date_to_str("%F");scheduler.templates.year_scale_date=scheduler.date.date_to_str("%D");scheduler.templates.year_tooltip=function(c,o,p){return p.text};
+(function(){var c=function(){return scheduler._mode==scheduler.config.year_mode_name};scheduler.dblclick_dhx_month_head=function(a){if(c()){var b=a.target||a.srcElement;if(b.parentNode.className.indexOf("dhx_before")!=-1||b.parentNode.className.indexOf("dhx_after")!=-1)return!1;var d=this.templates.xml_date(b.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute("date"));d.setDate(parseInt(b.innerHTML,10));var u=this.date.add(d,1,"day");!this.config.readonly&&this.config.dblclick_create&&
+this.addEventNow(d.valueOf(),u.valueOf(),a)}};var o=scheduler.changeEventId;scheduler.changeEventId=function(){o.apply(this,arguments);c()&&this.year_view(!0)};var p=scheduler.render_data,v=scheduler.date.date_to_str("%Y/%m/%d"),w=scheduler.date.str_to_date("%Y/%m/%d");scheduler.render_data=function(a){if(!c())return p.apply(this,arguments);for(var b=0;b<a.length;b++)this._year_render_event(a[b])};var x=scheduler.clear_view;scheduler.clear_view=function(){if(!c())return x.apply(this,arguments);for(var a=
+0;a<j.length;a++)j[a].className="dhx_month_head",j[a].setAttribute("date","");j=[]};scheduler.hideToolTip=function(){if(this._tooltip)this._tooltip.style.display="none",this._tooltip.date=new Date(9999,1,1)};scheduler.showToolTip=function(a,b,d,c){if(this._tooltip){if(this._tooltip.date.valueOf()==a.valueOf())return;this._tooltip.innerHTML=""}else{var k=this._tooltip=document.createElement("DIV");k.className="dhx_tooltip";document.body.appendChild(k);k.onclick=scheduler._click.dhx_cal_data}for(var h=
+this.getEvents(a,this.date.add(a,1,"day")),l="",f=0;f<h.length;f++){var m=h[f],e=m.color?"background-color:"+m.color+";":"",g=m.textColor?"color:"+m.textColor+";":"";l+="<div class='dhx_tooltip_line' style='"+e+""+g+"' event_id='"+h[f].id+"'>";l+="<div class='dhx_tooltip_date' style='"+e+""+g+"'>"+(h[f]._timed?this.templates.event_date(h[f].start_date):"")+"</div>";l+="<div class='dhx_event_icon icon_details'>&nbsp;</div>";l+=this.templates.year_tooltip(h[f].start_date,h[f].end_date,h[f])+"</div>"}this._tooltip.style.display=
+"";this._tooltip.style.top="0px";this._tooltip.style.left=document.body.offsetWidth-b.left-this._tooltip.offsetWidth<0?b.left-this._tooltip.offsetWidth+"px":b.left+c.offsetWidth+"px";this._tooltip.date=a;this._tooltip.innerHTML=l;this._tooltip.style.top=document.body.offsetHeight-b.top-this._tooltip.offsetHeight<0?b.top-this._tooltip.offsetHeight+c.offsetHeight+"px":b.top+"px"};scheduler._init_year_tooltip=function(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(a){if(c()){var a=
+a||event,b=a.target||a.srcElement;if(b.tagName.toLowerCase()=="a")b=b.parentNode;(b.className||"").indexOf("dhx_year_event")!=-1?scheduler.showToolTip(w(b.getAttribute("date")),getOffset(b),a,b):scheduler.hideToolTip()}});this._init_year_tooltip=function(){}};scheduler.attachEvent("onSchedulerResize",function(){return c()?(this.year_view(!0),!1):!0});scheduler._get_year_cell=function(a){var b=a.getMonth()+12*(a.getFullYear()-this._min_date.getFullYear())-this.week_starts._month,d=this._els.dhx_cal_data[0].childNodes[b],
+a=this.week_starts[b]+a.getDate()-1;return d.childNodes[2].firstChild.rows[Math.floor(a/7)].cells[a%7].firstChild};var j=[];scheduler._mark_year_date=function(a,b){var d=this._get_year_cell(a);d.className="dhx_month_head dhx_year_event "+this.templates.event_class(b.start_date,b.end_date,b);d.setAttribute("date",v(a));j.push(d)};scheduler._unmark_year_date=function(a){this._get_year_cell(a).className="dhx_month_head"};scheduler._year_render_event=function(a){for(var b=a.start_date,b=b.valueOf()<this._min_date.valueOf()?
+this._min_date:this.date.date_part(new Date(b));b<a.end_date;)if(this._mark_year_date(b,a),b=this.date.add(b,1,"day"),b.valueOf()>=this._max_date.valueOf())break};scheduler.year_view=function(a){if(a){var b=scheduler.xy.scale_height;scheduler.xy.scale_height=-1}scheduler._els.dhx_cal_header[0].style.display=a?"none":"";scheduler.set_sizes();if(a)scheduler.xy.scale_height=b;scheduler._table_view=a;if(!this._load_mode||!this._load())a?(scheduler._init_year_tooltip(),scheduler._reset_year_scale(),scheduler.render_view_data()):
+scheduler.hideToolTip()};scheduler._reset_year_scale=function(){this._cols=[];this._colsS={};var a=[],b=this._els.dhx_cal_data[0],d=this.config;b.scrollTop=0;b.innerHTML="";var c=Math.floor(parseInt(b.style.width)/d.year_x),k=Math.floor((parseInt(b.style.height)-scheduler.xy.year_top)/d.year_y);k<190&&(k=190,c=Math.floor((parseInt(b.style.width)-scheduler.xy.scroll_width)/d.year_x));for(var h=c-11,l=0,f=document.createElement("div"),m=this.date.week_start(new Date),e=0;e<7;e++)this._cols[e]=Math.floor(h/
+(7-e)),this._render_x_header(e,l,m,f),m=this.date.add(m,1,"day"),h-=this._cols[e],l+=this._cols[e];f.lastChild.className+=" dhx_scale_bar_last";for(var g=this.date[this._mode+"_start"](this.date.copy(this._date)),j=g,e=0;e<d.year_y;e++)for(var r=0;r<d.year_x;r++){var i=document.createElement("DIV");i.style.cssText="position:absolute;";i.setAttribute("date",this.templates.xml_format(g));i.innerHTML="<div class='dhx_year_month'></div><div class='dhx_year_week'>"+f.innerHTML+"</div><div class='dhx_year_body'></div>";
+i.childNodes[0].innerHTML=this.templates.year_month(g);for(var p=this.date.week_start(g),t=this._reset_month_scale(i.childNodes[2],g,p),n=i.childNodes[2].firstChild.rows,q=n.length;q<6;q++){n[0].parentNode.appendChild(n[0].cloneNode(!0));for(var s=0;s<n[q].childNodes.length;s++)n[q].childNodes[s].className="dhx_after",n[q].childNodes[s].firstChild.innerHTML=scheduler.templates.month_day(t),t=scheduler.date.add(t,1,"day")}b.appendChild(i);i.childNodes[1].style.height=i.childNodes[1].childNodes[0].offsetHeight+
+"px";var o=Math.round((k-190)/2);i.style.marginTop=o+"px";this.set_xy(i,c-10,k-o-10,c*r+5,k*e+5+scheduler.xy.year_top);a[e*d.year_x+r]=(g.getDay()-(this.config.start_on_monday?1:0)+7)%7;g=this.date.add(g,1,"month")}this._els.dhx_cal_date[0].innerHTML=this.templates[this._mode+"_date"](j,g,this._mode);this.week_starts=a;a._month=j.getMonth();this._min_date=j;this._max_date=g}})();
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/but_repeat.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/but_repeat.gif
new file mode 100644
index 00000000000..dd6595e5d9e
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/but_repeat.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/buttons.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/buttons.png
new file mode 100644
index 00000000000..5036c9c2efb
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/buttons.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/calendar.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/calendar.gif
new file mode 100644
index 00000000000..67257083540
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/calendar.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_big.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_big.gif
new file mode 100644
index 00000000000..61f7dc2e5ac
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_big.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_small.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_small.gif
new file mode 100644
index 00000000000..3e4b179761e
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_small.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/colapce-expand-icon.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/colapce-expand-icon.gif
new file mode 100644
index 00000000000..64da9483ea6
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/colapce-expand-icon.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controls.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controls.gif
new file mode 100644
index 00000000000..9732e2da748
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controls.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png
new file mode 100644
index 00000000000..3bba608beeb
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg_now.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg_now.png
new file mode 100644
index 00000000000..510dfd0b17f
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg_now.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.png
new file mode 100644
index 00000000000..31d6626cdd4
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/loading.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/loading.gif
new file mode 100644
index 00000000000..f5e71df6aa4
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/loading.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.png
new file mode 100644
index 00000000000..f874fa321f7
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.png
new file mode 100644
index 00000000000..88e22e1682b
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/but_repeat.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/but_repeat.gif
new file mode 100644
index 00000000000..dd6595e5d9e
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/but_repeat.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/buttons.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/buttons.gif
new file mode 100644
index 00000000000..0c60904e75c
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/buttons.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/calendar.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/calendar.gif
new file mode 100644
index 00000000000..67257083540
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/calendar.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.gif
new file mode 100644
index 00000000000..61f7dc2e5ac
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.gif
new file mode 100644
index 00000000000..3e4b179761e
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/colapce-expand-icon.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/colapce-expand-icon.gif
new file mode 100644
index 00000000000..64da9483ea6
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/colapce-expand-icon.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/controlls5.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/controlls5.png
new file mode 100644
index 00000000000..24957208fdc
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/controlls5.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg.png
new file mode 100644
index 00000000000..f0ffbdabc10
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg_now.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg_now.png
new file mode 100644
index 00000000000..9f371b4df71
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg_now.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.png
new file mode 100644
index 00000000000..a3bae3e0186
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.png
new file mode 100644
index 00000000000..31d6626cdd4
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.png
new file mode 100644
index 00000000000..22d630927f3
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.png
new file mode 100644
index 00000000000..287a23bbdcf
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.png
new file mode 100644
index 00000000000..f0314fa6099
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/loading.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/loading.gif
new file mode 100644
index 00000000000..f5e71df6aa4
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/loading.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.png
new file mode 100644
index 00000000000..15681b311e0
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.png
new file mode 100644
index 00000000000..f43a46357b2
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.png
new file mode 100644
index 00000000000..8f9a4f6da02
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.png
new file mode 100644
index 00000000000..094b805f609
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-separator.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-separator.gif
new file mode 100644
index 00000000000..18b4bfa95b0
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-separator.gif
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.png
new file mode 100644
index 00000000000..7ee92852294
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.png
new file mode 100644
index 00000000000..6e5ffb852f0
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/add.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/add.png
new file mode 100644
index 00000000000..54880090081
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/add.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/arrow_left.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/arrow_left.png
new file mode 100644
index 00000000000..651215a15ae
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/arrow_left.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/arrow_right.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/arrow_right.png
new file mode 100644
index 00000000000..901b5b7fb79
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/arrow_right.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/event.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/event.png
new file mode 100644
index 00000000000..477749447a7
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/event.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/event_focus.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/event_focus.png
new file mode 100644
index 00000000000..d25da73bb78
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/event_focus.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/noevents.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/noevents.png
new file mode 100644
index 00000000000..05da890fe1c
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_mobile/noevents.png
Binary files differ
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/readme.txt b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/readme.txt
new file mode 100644
index 00000000000..67cb13ff468
--- /dev/null
+++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/readme.txt
@@ -0,0 +1,16 @@
+There are a lot of files here, but you need only part of them
+
+Desctop scheduler, default skin
+ dhtmlxscheduler.js
+ dhtmlxscheduler.css
+ imgs\
+
+Desctop scheduler, glossy skin
+ dhtmlxscheduler.js
+ dhtmlxscheduler_glossy.css
+ imgs_glossy\
+
+Mobile scheduler
+ dhtmlxscheduler_mobile.js
+ dhtmlxscheduler_mobile.css
+ imgs_mobile\ \ No newline at end of file