From e374844808bab5a15cee3a8355e856e64680c71e Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Tue, 1 Sep 2015 10:46:28 +0200 Subject: [PATCH] [REM] web_gantt --- addons/calendar/calendar_view.xml | 20 +- addons/crm/res_partner_view.xml | 2 +- addons/hr_holidays/hr_holidays_view.xml | 2 +- addons/mrp/mrp_view.xml | 10 +- addons/mrp_operations/mrp_operations_view.xml | 29 +- addons/project/project_view.xml | 27 +- addons/web_gantt/__init__.py | 0 addons/web_gantt/__openerp__.py | 18 - addons/web_gantt/i18n/ar.po | 32 - addons/web_gantt/i18n/bg.po | 32 - addons/web_gantt/i18n/bn.po | 32 - addons/web_gantt/i18n/bs.po | 32 - addons/web_gantt/i18n/ca.po | 32 - addons/web_gantt/i18n/cs.po | 32 - addons/web_gantt/i18n/da.po | 32 - addons/web_gantt/i18n/de.po | 32 - addons/web_gantt/i18n/el.po | 32 - addons/web_gantt/i18n/en_AU.po | 32 - addons/web_gantt/i18n/en_GB.po | 32 - addons/web_gantt/i18n/es.po | 32 - addons/web_gantt/i18n/es_AR.po | 32 - addons/web_gantt/i18n/es_CL.po | 32 - addons/web_gantt/i18n/es_CR.po | 32 - addons/web_gantt/i18n/es_DO.po | 32 - addons/web_gantt/i18n/es_EC.po | 32 - addons/web_gantt/i18n/es_MX.po | 32 - addons/web_gantt/i18n/et.po | 32 - addons/web_gantt/i18n/fa.po | 32 - addons/web_gantt/i18n/fi.po | 32 - addons/web_gantt/i18n/fr.po | 32 - addons/web_gantt/i18n/gl.po | 32 - addons/web_gantt/i18n/gu.po | 32 - addons/web_gantt/i18n/he.po | 32 - addons/web_gantt/i18n/hr.po | 32 - addons/web_gantt/i18n/hu.po | 32 - addons/web_gantt/i18n/it.po | 32 - addons/web_gantt/i18n/ja.po | 32 - addons/web_gantt/i18n/ka.po | 32 - addons/web_gantt/i18n/ko.po | 32 - addons/web_gantt/i18n/lo.po | 32 - addons/web_gantt/i18n/lt.po | 32 - addons/web_gantt/i18n/mk.po | 32 - addons/web_gantt/i18n/mn.po | 32 - addons/web_gantt/i18n/nb.po | 32 - addons/web_gantt/i18n/nl.po | 32 - addons/web_gantt/i18n/nl_BE.po | 32 - addons/web_gantt/i18n/pl.po | 32 - addons/web_gantt/i18n/pt.po | 32 - addons/web_gantt/i18n/pt_BR.po | 32 - addons/web_gantt/i18n/ro.po | 32 - addons/web_gantt/i18n/ru.po | 32 - addons/web_gantt/i18n/sl.po | 32 - addons/web_gantt/i18n/sq.po | 32 - addons/web_gantt/i18n/sr@latin.po | 32 - addons/web_gantt/i18n/sv.po | 32 - addons/web_gantt/i18n/th.po | 32 - addons/web_gantt/i18n/tr.po | 32 - addons/web_gantt/i18n/vi.po | 32 - addons/web_gantt/i18n/web_gantt.pot | 31 - addons/web_gantt/i18n/zh_CN.po | 32 - .../lib/dhtmlxGantt/codebase/dhtmlxcommon.js | 903 --- .../lib/dhtmlxGantt/codebase/dhtmlxgantt.css | 15 - .../lib/dhtmlxGantt/codebase/dhtmlxgantt.js | 384 -- .../lib/dhtmlxGantt/codebase/imgs/arr.gif | Bin 162 -> 0 bytes .../lib/dhtmlxGantt/codebase/imgs/bg.png | Bin 95 -> 0 bytes .../lib/dhtmlxGantt/codebase/imgs/bg_week.png | Bin 181 -> 0 bytes .../codebase/imgs/menu/menu_bg.png | Bin 98 -> 0 bytes .../codebase/imgs/menu/menu_selection.png | Bin 543 -> 0 bytes .../codebase/imgs/menu/window_tr.png | Bin 1942 -> 0 bytes .../lib/dhtmlxGantt/codebase/imgs/minus.gif | Bin 121 -> 0 bytes .../codebase/imgs/parentnode_filled.png | Bin 129 -> 0 bytes .../lib/dhtmlxGantt/codebase/imgs/plus.gif | Bin 124 -> 0 bytes .../dhtmlxGantt/codebase/imgs/progress_bg.png | Bin 128 -> 0 bytes .../codebase/imgs/progress_filled.png | Bin 128 -> 0 bytes .../static/lib/dhtmlxGantt/index.html | 107 - .../lib/dhtmlxGantt/sources/dhtmlxcommon.js | 907 --- .../lib/dhtmlxGantt/sources/dhtmlxgantt.js | 6123 ----------------- addons/web_gantt/static/src/js/gantt.js | 266 - addons/web_gantt/static/src/less/gantt.less | 7 - addons/web_gantt/static/src/xml/web_gantt.xml | 7 - addons/web_gantt/views/web_gantt.xml | 15 - 81 files changed, 13 insertions(+), 10492 deletions(-) delete mode 100644 addons/web_gantt/__init__.py delete mode 100644 addons/web_gantt/__openerp__.py delete mode 100644 addons/web_gantt/i18n/ar.po delete mode 100644 addons/web_gantt/i18n/bg.po delete mode 100644 addons/web_gantt/i18n/bn.po delete mode 100644 addons/web_gantt/i18n/bs.po delete mode 100644 addons/web_gantt/i18n/ca.po delete mode 100644 addons/web_gantt/i18n/cs.po delete mode 100644 addons/web_gantt/i18n/da.po delete mode 100644 addons/web_gantt/i18n/de.po delete mode 100644 addons/web_gantt/i18n/el.po delete mode 100644 addons/web_gantt/i18n/en_AU.po delete mode 100644 addons/web_gantt/i18n/en_GB.po delete mode 100644 addons/web_gantt/i18n/es.po delete mode 100644 addons/web_gantt/i18n/es_AR.po delete mode 100644 addons/web_gantt/i18n/es_CL.po delete mode 100644 addons/web_gantt/i18n/es_CR.po delete mode 100644 addons/web_gantt/i18n/es_DO.po delete mode 100644 addons/web_gantt/i18n/es_EC.po delete mode 100644 addons/web_gantt/i18n/es_MX.po delete mode 100644 addons/web_gantt/i18n/et.po delete mode 100644 addons/web_gantt/i18n/fa.po delete mode 100644 addons/web_gantt/i18n/fi.po delete mode 100644 addons/web_gantt/i18n/fr.po delete mode 100644 addons/web_gantt/i18n/gl.po delete mode 100644 addons/web_gantt/i18n/gu.po delete mode 100644 addons/web_gantt/i18n/he.po delete mode 100644 addons/web_gantt/i18n/hr.po delete mode 100644 addons/web_gantt/i18n/hu.po delete mode 100644 addons/web_gantt/i18n/it.po delete mode 100644 addons/web_gantt/i18n/ja.po delete mode 100644 addons/web_gantt/i18n/ka.po delete mode 100644 addons/web_gantt/i18n/ko.po delete mode 100644 addons/web_gantt/i18n/lo.po delete mode 100644 addons/web_gantt/i18n/lt.po delete mode 100644 addons/web_gantt/i18n/mk.po delete mode 100644 addons/web_gantt/i18n/mn.po delete mode 100644 addons/web_gantt/i18n/nb.po delete mode 100644 addons/web_gantt/i18n/nl.po delete mode 100644 addons/web_gantt/i18n/nl_BE.po delete mode 100644 addons/web_gantt/i18n/pl.po delete mode 100644 addons/web_gantt/i18n/pt.po delete mode 100644 addons/web_gantt/i18n/pt_BR.po delete mode 100644 addons/web_gantt/i18n/ro.po delete mode 100644 addons/web_gantt/i18n/ru.po delete mode 100644 addons/web_gantt/i18n/sl.po delete mode 100644 addons/web_gantt/i18n/sq.po delete mode 100644 addons/web_gantt/i18n/sr@latin.po delete mode 100644 addons/web_gantt/i18n/sv.po delete mode 100644 addons/web_gantt/i18n/th.po delete mode 100644 addons/web_gantt/i18n/tr.po delete mode 100644 addons/web_gantt/i18n/vi.po delete mode 100644 addons/web_gantt/i18n/web_gantt.pot delete mode 100644 addons/web_gantt/i18n/zh_CN.po delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxcommon.js delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.js delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/arr.gif delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_selection.png delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/window_tr.png delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/minus.gif delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/plus.gif delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/index.html delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxcommon.js delete mode 100644 addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js delete mode 100644 addons/web_gantt/static/src/js/gantt.js delete mode 100644 addons/web_gantt/static/src/less/gantt.less delete mode 100644 addons/web_gantt/static/src/xml/web_gantt.xml delete mode 100644 addons/web_gantt/views/web_gantt.xml diff --git a/addons/calendar/calendar_view.xml b/addons/calendar/calendar_view.xml index 4ca3a0af4ec..ecdb7b84c1c 100644 --- a/addons/calendar/calendar_view.xml +++ b/addons/calendar/calendar_view.xml @@ -272,16 +272,6 @@ - - - - CRM - Meetings Gantt - calendar.event - - - - - CRM - Meetings Search @@ -310,7 +300,7 @@ Meetings calendar.event - calendar,tree,form,gantt + calendar,tree,form @@ -341,12 +331,6 @@ form - - - - gantt - - @@ -359,7 +343,7 @@ Meetings calendar.event - form,calendar,tree,gantt + form,calendar,tree diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml index 300b18546c2..14083b1217e 100644 --- a/addons/crm/res_partner_view.xml +++ b/addons/crm/res_partner_view.xml @@ -7,7 +7,7 @@ Meetings res.partner calendar.event - calendar,tree,form,gantt + calendar,tree,form {'default_partner_ids': [active_id], 'search_default_partner_ids': [active_id]} diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 959d61b3d0c..344e530599b 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -656,7 +656,7 @@ name="Leave Meetings" src_model="hr.holidays" res_model="calendar.event" - view_mode="tree,form,calendar,gantt" + view_mode="tree,form,calendar" view_type="form"/> diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index ee023b9d0df..236848a466d 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -802,14 +802,6 @@ - - mrp.production.gantt - mrp.production - - - - - mrp.production.pivot mrp.production @@ -864,7 +856,7 @@ ir.actions.act_window mrp.production form - tree,kanban,form,calendar,pivot,graph,gantt + tree,kanban,form,calendar,pivot,graph {} diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml index c4003111dab..91ac1f4496c 100644 --- a/addons/mrp_operations/mrp_operations_view.xml +++ b/addons/mrp_operations/mrp_operations_view.xml @@ -152,16 +152,6 @@ - - mrp.production.workcenter.line.gantt - mrp.production.workcenter.line - - - - - - - @@ -169,7 +159,7 @@ ir.actions.act_window mrp.production.workcenter.line form - tree,form,gantt,calendar,graph + tree,form,calendar,graph

@@ -191,7 +181,7 @@ mrp.production.workcenter.line form [('production_state','in',('ready','confirmed','in_production'))] - gantt,tree,form,graph,calendar + tree,form,graph,calendar

Click to start a new work order. @@ -205,24 +195,13 @@ - - - mrp.production.workcenter.line.resource.gantt - mrp.production.workcenter.line - - - - - - Work Centers ir.actions.act_window mrp.production.workcenter.line form [('production_state','in',('ready','confirmed','in_production'))] - gantt,tree,form,calendar,graph - + tree,form,calendar,graph @@ -232,7 +211,7 @@ ir.actions.act_window mrp.production.workcenter.line form - tree,form,graph,gantt,calendar + tree,form,graph,calendar [('production_state','=','ready')] diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 7f6d130b8d5..577f0e16098 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -53,7 +53,7 @@ Tasks project.task - kanban,tree,form,calendar,gantt,pivot,graph + kanban,tree,form,calendar,pivot,graph { 'search_default_project_id': [active_id], 'default_project_id': active_id, @@ -299,15 +299,6 @@ - - -

- Assign dates to make this task appear in the gantt chart ( icon on the top right) -

- - - - @@ -421,16 +412,6 @@
- - project.task.gantt - project.task - - - - - - - project.task.pivot project.task @@ -469,7 +450,7 @@ Tasks project.task - kanban,tree,form,calendar,gantt,pivot,graph + kanban,tree,form,calendar,pivot,graph

@@ -505,7 +486,7 @@ project.task Project's tasks form - tree,form,calendar,graph,gantt,kanban + tree,form,calendar,graph,kanban [('project_id', 'child_of', [active_id])] {'project_id':active_id, 'active_test':False} @@ -624,7 +605,7 @@ + res_model="project.task" src_model="res.users" view_mode="tree,form,calendar,graph" view_type="form"/> diff --git a/addons/web_gantt/__init__.py b/addons/web_gantt/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/addons/web_gantt/__openerp__.py b/addons/web_gantt/__openerp__.py deleted file mode 100644 index af0e59ccb28..00000000000 --- a/addons/web_gantt/__openerp__.py +++ /dev/null @@ -1,18 +0,0 @@ -{ - 'name': 'Web Gantt', - 'category': 'Hidden', - 'description': """ -OpenERP Web Gantt chart view. -============================= - -""", - 'version': '2.0', - 'depends': ['web'], - 'data' : [ - 'views/web_gantt.xml', - ], - 'qweb': [ - 'static/src/xml/*.xml', - ], - 'auto_install': True -} diff --git a/addons/web_gantt/i18n/ar.po b/addons/web_gantt/i18n/ar.po deleted file mode 100644 index ec070657ffa..00000000000 --- a/addons/web_gantt/i18n/ar.po +++ /dev/null @@ -1,32 +0,0 @@ -# Arabic translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Arabic \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "إنشاء" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "جانت" diff --git a/addons/web_gantt/i18n/bg.po b/addons/web_gantt/i18n/bg.po deleted file mode 100644 index eff2d6cb064..00000000000 --- a/addons/web_gantt/i18n/bg.po +++ /dev/null @@ -1,32 +0,0 @@ -# Bulgarian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Създай" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "" diff --git a/addons/web_gantt/i18n/bn.po b/addons/web_gantt/i18n/bn.po deleted file mode 100644 index f41ec9021fb..00000000000 --- a/addons/web_gantt/i18n/bn.po +++ /dev/null @@ -1,32 +0,0 @@ -# Bengali translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bengali \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "তৈরি করুন" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "জ্ঞান্ট" diff --git a/addons/web_gantt/i18n/bs.po b/addons/web_gantt/i18n/bs.po deleted file mode 100644 index 8465c7116ad..00000000000 --- a/addons/web_gantt/i18n/bs.po +++ /dev/null @@ -1,32 +0,0 @@ -# Bosnian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bosnian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Kreiraj" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gant" diff --git a/addons/web_gantt/i18n/ca.po b/addons/web_gantt/i18n/ca.po deleted file mode 100644 index c1563c6f642..00000000000 --- a/addons/web_gantt/i18n/ca.po +++ /dev/null @@ -1,32 +0,0 @@ -# Catalan translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-09-13 13:36+0000\n" -"Last-Translator: Jordi Soldevila \n" -"Language-Team: Catalan \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-09-14 08:34+0000\n" -"X-Generator: Launchpad (build 17196)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Crea" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gràfic de Gantt" diff --git a/addons/web_gantt/i18n/cs.po b/addons/web_gantt/i18n/cs.po deleted file mode 100644 index f3234345695..00000000000 --- a/addons/web_gantt/i18n/cs.po +++ /dev/null @@ -1,32 +0,0 @@ -# Czech translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Czech \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Vytvořit" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/da.po b/addons/web_gantt/i18n/da.po deleted file mode 100644 index a2eb6a74284..00000000000 --- a/addons/web_gantt/i18n/da.po +++ /dev/null @@ -1,32 +0,0 @@ -# Danish translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Danish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Opret" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/de.po b/addons/web_gantt/i18n/de.po deleted file mode 100644 index 20141fc643c..00000000000 --- a/addons/web_gantt/i18n/de.po +++ /dev/null @@ -1,32 +0,0 @@ -# German translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: German \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Anlegen" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/el.po b/addons/web_gantt/i18n/el.po deleted file mode 100644 index 3374e2ae3e1..00000000000 --- a/addons/web_gantt/i18n/el.po +++ /dev/null @@ -1,32 +0,0 @@ -# Greek translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Greek \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Δημιουργία" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/en_AU.po b/addons/web_gantt/i18n/en_AU.po deleted file mode 100644 index 068693e2fb6..00000000000 --- a/addons/web_gantt/i18n/en_AU.po +++ /dev/null @@ -1,32 +0,0 @@ -# English (Australia) translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: English (Australia) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Create" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/en_GB.po b/addons/web_gantt/i18n/en_GB.po deleted file mode 100644 index e95336ee00c..00000000000 --- a/addons/web_gantt/i18n/en_GB.po +++ /dev/null @@ -1,32 +0,0 @@ -# English (United Kingdom) translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: English (United Kingdom) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Create" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/es.po b/addons/web_gantt/i18n/es.po deleted file mode 100644 index 3f99067a185..00000000000 --- a/addons/web_gantt/i18n/es.po +++ /dev/null @@ -1,32 +0,0 @@ -# Spanish translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Spanish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Crear" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/es_AR.po b/addons/web_gantt/i18n/es_AR.po deleted file mode 100644 index 413f5d11674..00000000000 --- a/addons/web_gantt/i18n/es_AR.po +++ /dev/null @@ -1,32 +0,0 @@ -# Spanish (Argentina) translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Spanish (Argentina) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Crear" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/es_CL.po b/addons/web_gantt/i18n/es_CL.po deleted file mode 100644 index 7a0967d6699..00000000000 --- a/addons/web_gantt/i18n/es_CL.po +++ /dev/null @@ -1,32 +0,0 @@ -# Spanish (Chile) translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Spanish (Chile) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Crear" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/es_CR.po b/addons/web_gantt/i18n/es_CR.po deleted file mode 100644 index d5ee8e81b79..00000000000 --- a/addons/web_gantt/i18n/es_CR.po +++ /dev/null @@ -1,32 +0,0 @@ -# Spanish (Costa Rica) translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Spanish (Costa Rica) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Crear" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/es_DO.po b/addons/web_gantt/i18n/es_DO.po deleted file mode 100644 index cea14fb1a27..00000000000 --- a/addons/web_gantt/i18n/es_DO.po +++ /dev/null @@ -1,32 +0,0 @@ -# Spanish (Dominican Republic) translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Spanish (Dominican Republic) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Crear" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/es_EC.po b/addons/web_gantt/i18n/es_EC.po deleted file mode 100644 index 5d1f0815351..00000000000 --- a/addons/web_gantt/i18n/es_EC.po +++ /dev/null @@ -1,32 +0,0 @@ -# Spanish (Ecuador) translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Spanish (Ecuador) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Crear" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/es_MX.po b/addons/web_gantt/i18n/es_MX.po deleted file mode 100644 index 6f21b39dde2..00000000000 --- a/addons/web_gantt/i18n/es_MX.po +++ /dev/null @@ -1,32 +0,0 @@ -# Spanish (Mexico) translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Spanish (Mexico) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Crear" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/et.po b/addons/web_gantt/i18n/et.po deleted file mode 100644 index 1166d28eda7..00000000000 --- a/addons/web_gantt/i18n/et.po +++ /dev/null @@ -1,32 +0,0 @@ -# Estonian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Estonian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Loo" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/fa.po b/addons/web_gantt/i18n/fa.po deleted file mode 100644 index b30eec882c4..00000000000 --- a/addons/web_gantt/i18n/fa.po +++ /dev/null @@ -1,32 +0,0 @@ -# Persian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Persian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "ایجاد" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "گانت" diff --git a/addons/web_gantt/i18n/fi.po b/addons/web_gantt/i18n/fi.po deleted file mode 100644 index 59c24daca06..00000000000 --- a/addons/web_gantt/i18n/fi.po +++ /dev/null @@ -1,32 +0,0 @@ -# Finnish translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Finnish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Luo" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt-kaavio" diff --git a/addons/web_gantt/i18n/fr.po b/addons/web_gantt/i18n/fr.po deleted file mode 100644 index 9ed2337c8cf..00000000000 --- a/addons/web_gantt/i18n/fr.po +++ /dev/null @@ -1,32 +0,0 @@ -# French translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: French \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Créer" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/gl.po b/addons/web_gantt/i18n/gl.po deleted file mode 100644 index 3910ab52eaa..00000000000 --- a/addons/web_gantt/i18n/gl.po +++ /dev/null @@ -1,32 +0,0 @@ -# Galician translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Galician \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Crear" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/gu.po b/addons/web_gantt/i18n/gu.po deleted file mode 100644 index a973ef76d64..00000000000 --- a/addons/web_gantt/i18n/gu.po +++ /dev/null @@ -1,32 +0,0 @@ -# Gujarati translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Gujarati \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "બનાવો" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "" diff --git a/addons/web_gantt/i18n/he.po b/addons/web_gantt/i18n/he.po deleted file mode 100644 index 405ebffdcb3..00000000000 --- a/addons/web_gantt/i18n/he.po +++ /dev/null @@ -1,32 +0,0 @@ -# Hebrew translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Hebrew \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "צור" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "גאנט" diff --git a/addons/web_gantt/i18n/hr.po b/addons/web_gantt/i18n/hr.po deleted file mode 100644 index 3ce9a9ecf52..00000000000 --- a/addons/web_gantt/i18n/hr.po +++ /dev/null @@ -1,32 +0,0 @@ -# Croatian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Croatian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Kreiraj" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantogram" diff --git a/addons/web_gantt/i18n/hu.po b/addons/web_gantt/i18n/hu.po deleted file mode 100644 index 8585798fe36..00000000000 --- a/addons/web_gantt/i18n/hu.po +++ /dev/null @@ -1,32 +0,0 @@ -# Hungarian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Hungarian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Létrehozás" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/it.po b/addons/web_gantt/i18n/it.po deleted file mode 100644 index 84e77ab4342..00000000000 --- a/addons/web_gantt/i18n/it.po +++ /dev/null @@ -1,32 +0,0 @@ -# Italian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Italian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Crea" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/ja.po b/addons/web_gantt/i18n/ja.po deleted file mode 100644 index b440f975d50..00000000000 --- a/addons/web_gantt/i18n/ja.po +++ /dev/null @@ -1,32 +0,0 @@ -# Japanese translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Japanese \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "作成" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "ガント" diff --git a/addons/web_gantt/i18n/ka.po b/addons/web_gantt/i18n/ka.po deleted file mode 100644 index 87a67f4efb6..00000000000 --- a/addons/web_gantt/i18n/ka.po +++ /dev/null @@ -1,32 +0,0 @@ -# Georgian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Georgian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "შექმნა" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "განტი" diff --git a/addons/web_gantt/i18n/ko.po b/addons/web_gantt/i18n/ko.po deleted file mode 100644 index 2672e29f885..00000000000 --- a/addons/web_gantt/i18n/ko.po +++ /dev/null @@ -1,32 +0,0 @@ -# Korean translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Korean \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "생성" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "간트" diff --git a/addons/web_gantt/i18n/lo.po b/addons/web_gantt/i18n/lo.po deleted file mode 100644 index a3b430ce892..00000000000 --- a/addons/web_gantt/i18n/lo.po +++ /dev/null @@ -1,32 +0,0 @@ -# Lao translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Lao \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "ເເກ້ນ" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "ເເກ້ນ" diff --git a/addons/web_gantt/i18n/lt.po b/addons/web_gantt/i18n/lt.po deleted file mode 100644 index 0d9f7d1500f..00000000000 --- a/addons/web_gantt/i18n/lt.po +++ /dev/null @@ -1,32 +0,0 @@ -# Lithuanian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Lithuanian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Sukurti" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Ganto diagrama" diff --git a/addons/web_gantt/i18n/mk.po b/addons/web_gantt/i18n/mk.po deleted file mode 100644 index a90730f0fe8..00000000000 --- a/addons/web_gantt/i18n/mk.po +++ /dev/null @@ -1,32 +0,0 @@ -# Macedonian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Macedonian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Креирај" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Гантограм" diff --git a/addons/web_gantt/i18n/mn.po b/addons/web_gantt/i18n/mn.po deleted file mode 100644 index 1c52ed2a438..00000000000 --- a/addons/web_gantt/i18n/mn.po +++ /dev/null @@ -1,32 +0,0 @@ -# Mongolian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Mongolian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Үүсгэх" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Гантт" diff --git a/addons/web_gantt/i18n/nb.po b/addons/web_gantt/i18n/nb.po deleted file mode 100644 index 9bdaa61c6bf..00000000000 --- a/addons/web_gantt/i18n/nb.po +++ /dev/null @@ -1,32 +0,0 @@ -# Norwegian Bokmal translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Norwegian Bokmal \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Opprett" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/nl.po b/addons/web_gantt/i18n/nl.po deleted file mode 100644 index 2b42d21cd54..00000000000 --- a/addons/web_gantt/i18n/nl.po +++ /dev/null @@ -1,32 +0,0 @@ -# Dutch translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Dutch \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Aanmaken" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/nl_BE.po b/addons/web_gantt/i18n/nl_BE.po deleted file mode 100644 index 06481393937..00000000000 --- a/addons/web_gantt/i18n/nl_BE.po +++ /dev/null @@ -1,32 +0,0 @@ -# Dutch (Belgium) translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Dutch (Belgium) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Maken" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/pl.po b/addons/web_gantt/i18n/pl.po deleted file mode 100644 index 2794f47aafc..00000000000 --- a/addons/web_gantt/i18n/pl.po +++ /dev/null @@ -1,32 +0,0 @@ -# Polish translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Polish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Utwórz" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Wykres Gantta" diff --git a/addons/web_gantt/i18n/pt.po b/addons/web_gantt/i18n/pt.po deleted file mode 100644 index 7615b290495..00000000000 --- a/addons/web_gantt/i18n/pt.po +++ /dev/null @@ -1,32 +0,0 @@ -# Portuguese translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Portuguese \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Criar" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/pt_BR.po b/addons/web_gantt/i18n/pt_BR.po deleted file mode 100644 index 50e0a177768..00000000000 --- a/addons/web_gantt/i18n/pt_BR.po +++ /dev/null @@ -1,32 +0,0 @@ -# Brazilian Portuguese translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Brazilian Portuguese \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Criar" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/ro.po b/addons/web_gantt/i18n/ro.po deleted file mode 100644 index cf8d2718772..00000000000 --- a/addons/web_gantt/i18n/ro.po +++ /dev/null @@ -1,32 +0,0 @@ -# Romanian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Romanian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Creeaza" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/ru.po b/addons/web_gantt/i18n/ru.po deleted file mode 100644 index eb6cb5039c4..00000000000 --- a/addons/web_gantt/i18n/ru.po +++ /dev/null @@ -1,32 +0,0 @@ -# Russian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Russian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Создать" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Диаграмма Ганта" diff --git a/addons/web_gantt/i18n/sl.po b/addons/web_gantt/i18n/sl.po deleted file mode 100644 index 94ffeb01fe8..00000000000 --- a/addons/web_gantt/i18n/sl.po +++ /dev/null @@ -1,32 +0,0 @@ -# Slovenian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Slovenian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Ustvari" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/sq.po b/addons/web_gantt/i18n/sq.po deleted file mode 100644 index 8b8a3206bc0..00000000000 --- a/addons/web_gantt/i18n/sq.po +++ /dev/null @@ -1,32 +0,0 @@ -# Albanian translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Albanian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "" diff --git a/addons/web_gantt/i18n/sr@latin.po b/addons/web_gantt/i18n/sr@latin.po deleted file mode 100644 index c047397b0ac..00000000000 --- a/addons/web_gantt/i18n/sr@latin.po +++ /dev/null @@ -1,32 +0,0 @@ -# Serbian Latin translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Serbian Latin \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Kreiraj" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantov dijagram" diff --git a/addons/web_gantt/i18n/sv.po b/addons/web_gantt/i18n/sv.po deleted file mode 100644 index c5b3a89dd9c..00000000000 --- a/addons/web_gantt/i18n/sv.po +++ /dev/null @@ -1,32 +0,0 @@ -# Swedish translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Swedish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Skapa" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/th.po b/addons/web_gantt/i18n/th.po deleted file mode 100644 index 95ade6f1c3c..00000000000 --- a/addons/web_gantt/i18n/th.po +++ /dev/null @@ -1,32 +0,0 @@ -# Thai translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Thai \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "สร้าง" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "แกนต์" diff --git a/addons/web_gantt/i18n/tr.po b/addons/web_gantt/i18n/tr.po deleted file mode 100644 index bc82f5ea437..00000000000 --- a/addons/web_gantt/i18n/tr.po +++ /dev/null @@ -1,32 +0,0 @@ -# Turkish translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Turkish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Oluştur" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Gantt" diff --git a/addons/web_gantt/i18n/vi.po b/addons/web_gantt/i18n/vi.po deleted file mode 100644 index 10e411f7986..00000000000 --- a/addons/web_gantt/i18n/vi.po +++ /dev/null @@ -1,32 +0,0 @@ -# Vietnamese translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Vietnamese \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "Tạo mới" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "Biểu đồ Gantt" diff --git a/addons/web_gantt/i18n/web_gantt.pot b/addons/web_gantt/i18n/web_gantt.pot deleted file mode 100644 index ae87c1de18e..00000000000 --- a/addons/web_gantt/i18n/web_gantt.pot +++ /dev/null @@ -1,31 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * web_gantt -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 9.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-08-25 09:00+0000\n" -"PO-Revision-Date: 2015-08-25 09:00+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:5 -#, python-format -msgid "Create" -msgstr "" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:19 -#, python-format -msgid "Gantt" -msgstr "" - diff --git a/addons/web_gantt/i18n/zh_CN.po b/addons/web_gantt/i18n/zh_CN.po deleted file mode 100644 index c5ee8541fdb..00000000000 --- a/addons/web_gantt/i18n/zh_CN.po +++ /dev/null @@ -1,32 +0,0 @@ -# Chinese (Simplified) translation for openerp-web -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the openerp-web package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: openerp-web\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-08-14 13:09+0000\n" -"PO-Revision-Date: 2014-08-14 16:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Chinese (Simplified) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-08-15 08:24+0000\n" -"X-Generator: Launchpad (build 17156)\n" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/xml/web_gantt.xml:10 -#, python-format -msgid "Create" -msgstr "创建" - -#. module: web_gantt -#. openerp-web -#: code:addons/web_gantt/static/src/js/gantt.js:11 -#, python-format -msgid "Gantt" -msgstr "甘特图" diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxcommon.js b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxcommon.js deleted file mode 100644 index ab3fe54405b..00000000000 --- a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxcommon.js +++ /dev/null @@ -1,903 +0,0 @@ -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 { - if (document.implementation&&document.implementation.createDocument){ - this.xmlDoc=document.implementation.createDocument("", "", null); - this.xmlDoc.onload=new this.waitLoadFunction(this); - this.xmlDoc.load(filePath); - return; - } 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._filterXPath = null; - this._getAllNamedChilds = null; - this._retry = null; - this.async = null; - this.rSeed = null; - this.filePath = null; - this.onloadAction = null; - this.mainObject = null; - this.xmlDoc = null; - this.doXPath = null; - this.doXPathOpera = null; - this.doXSLTransToObject = null; - this.doXSLTransToString = null; - this.loadXML = null; - this.loadXMLString = null; - // this.waitLoadFunction = null; - this.doSerialization = null; - this.xmlNodeToJSON = null; - this.getXMLTopNode = null; - this.setXSLParamValue = null; - return null; -} - -dtmlXMLLoaderObject.prototype.xmlNodeToJSON = function(node){ - var t={}; - for (var i=0; i-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.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]; - } - } -} diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css deleted file mode 100644 index 2923173eebc..00000000000 --- a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css +++ /dev/null @@ -1,15 +0,0 @@ -.taskPanelBorder{border-width: 2px 2px 2px 2px;border-style:solid;border-color: #737373;} -.taskName{font-family: Tahoma, Arial; font-weight: bold;font-size: 11px;color: #FFFFFF;cursor: pointer;white-space: nowrap;} -.moveInfo{font-family: Tahoma, Arial;font-size: 10px;color:#006600;white-space: nowrap;} -.descTask{font-family: Tahoma, Arial;font-size: 10px;color:#276F9E;cursor: default;white-space: nowrap;} -.descProject{font-family: Tahoma, Arial;font-size: 10px;color:#006600;cursor: default;white-space: nowrap;} -.dayNumber, .monthName{font-family:Tahoma,Arial;font-weight:bold;font-size:9px;color:#858585;text-align:center;vertical-align:middle;} -.monthName {border-top:1px solid #f1f3f1; border-bottom:1px solid #f1f3f1; border-left:1px solid #f1f3f1;text-align:left;padding-left:5px;} -.poPupInfo{background: #FFFFFF;width : 170px;border: 1px dotted #279e00;padding: 4px 6px 4px 6px;float: left;} -.poPupTime{background: #FFFFFF;border: 1px dotted #279e00;height : 25px;width : 70px;position: absolute;z-index:2;} -.contextMenu{z-index:10;width:150px;cursor:pointer;font-family: Tahoma, Arial;font-size:12px;color:#7D7D7D;border: 1px solid #808080;} -.taskNameItem{font-family: Tahoma, Arial;font-size: 11px;font-weight: normal;color: #7D7D7D;} -.panelErrors{;padding: 4px 6px 4px 6px;font-family: Tahoma, Arial;font-size: 12px;color: red;white-space: nowrap;} -.st {font-family: Arial, Helvetica, Sans-serif; font-size: 10px; font-weight: normal; color: #688060;} -.ut {font-family: Arial, Helvetica, Sans-serif; font-size: 11px; font-weight: normal; color: #323232;} -.lt {font-family: Arial, Helvetica, Sans-serif; font-size: 11px; font-weight: normal; color: #323232; padding: 0px 0px 0px 14px; margin: 0px; display: block;} diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.js b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.js deleted file mode 100644 index 454e20e7838..00000000000 --- a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.js +++ /dev/null @@ -1,384 +0,0 @@ -//v.1.3 build 100805 - -/* -Copyright DHTMLX LTD. http://www.dhtmlx.com -To use this component please contact sales@dhtmlx.com to obtain license -*/ - -function GanttProjectInfo(id, name, startDate) -{this.Id = id;this.Name = name;this.StartDate = startDate;this.ParentTasks = []};GanttProjectInfo.prototype.deleteTask = function(id) -{var task = this.getTaskById(id);if (task){if (!task.ParentTask){for (var i = 0;i < this.ParentTasks.length;i++){if (this.ParentTasks[i].Id == id){if (this.ParentTasks[i].nextParentTask){if (this.ParentTasks[i].previousParentTask){this.ParentTasks[i].previousParentTask.nextParentTask = this.ParentTasks[i].nextParentTask;this.ParentTasks[i].nextParentTask.previousParentTask = this.ParentTasks[i].previousParentTask}else {this.ParentTasks[i].nextParentTask.previousParentTask = null}}else {if (this.ParentTasks[i].previousParentTask){this.ParentTasks[i].previousParentTask.nextParentTask = null}};this.ParentTasks[i] = null;this.ParentTasks.splice(i, 1);break}}}else - {var parentTask = task.ParentTask;for (var i = 0;i < parentTask.ChildTasks.length;i++){if (parentTask.ChildTasks[i].Id == id){if (parentTask.ChildTasks[i].nextChildTask){if (parentTask.ChildTasks[i].previousChildTask){parentTask.ChildTasks[i].previousChildTask.nextChildTask = parentTask.ChildTasks[i].nextChildTask;parentTask.ChildTasks[i].nextChildTask.previousChildTask = parentTask.ChildTasks[i].previousChildTask}else {parentTask.ChildTasks[i].nextChildTask.previousChildTask = null}}else {if (parentTask.ChildTasks[i].previousChildTask){parentTask.ChildTasks[i].previousChildTask.nextChildTask = null}};parentTask.ChildTasks[i] = null;parentTask.ChildTasks.splice(i, 1);break}}}}};GanttProjectInfo.prototype.addTask = function(task) -{this.ParentTasks.push(task);task.setProject(this)};GanttProjectInfo.prototype.getTaskById = function(id) -{for (var j = 0;j < this.ParentTasks.length;j++){var task = this.getTaskByIdInTree(this.ParentTasks[j], id);if (task)return task};return null};GanttProjectInfo.prototype.getTaskByIdInTree = function(parentTask, id) -{if (parentTask.Id == id){return parentTask}else - {for (var i = 0;i < parentTask.ChildTasks.length;i++){if (parentTask.ChildTasks[i].Id == id){return parentTask.ChildTasks[i]};if (parentTask.ChildTasks[i].ChildTasks.length > 0){if (parentTask.ChildTasks[i].ChildTasks.length > 0){var cTask = this.getTaskByIdInTree(parentTask.ChildTasks[i], id);if (cTask)return cTask}}}};return null};function GanttTaskInfo(id, name, est, duration, percentCompleted, predecessorTaskId) -{this.Id = id;this.Name = name;this.EST = est;this.Duration = duration;this.PercentCompleted = percentCompleted;this.PredecessorTaskId = predecessorTaskId;this.ChildTasks = [];this.ChildPredTasks = [];this.ParentTask = null;this.PredecessorTask = null;this.Project = null;this.nextChildTask = null;this.previousChildTask = null;this.nextParentTask = null;this.previousParentTask = null};GanttTaskInfo.prototype.addChildTask = function(task) -{this.ChildTasks.push(task);task.ParentTask = this};GanttTaskInfo.prototype.setProject = function(project) -{this.Project = project;for (var j = 0;j < this.ChildTasks.length;j++){this.ChildTasks[j].setProject(project)}};function GanttTask(taskInfo, project, chart) -{this.isTask = true;this.Chart = chart;this.Project = project;this.TaskInfo = taskInfo;this.checkMove = false;this.checkResize = false;this.moveChild = false;this.maxPosXMove = -1;this.minPosXMove = -1;this.maxWidthResize = -1;this.minWidthResize = -1;this.posX = 0;this.posY = 0;this.MouseX = 0;this.taskItemWidth = 0;this.isHide = false;this._heightHideTasks = 0;this._isOpen = true;this.descrTask = null;this.cTaskItem = null;this.cTaskNameItem = null;this.parentTask = null;this.predTask = null;this.childTask = [];this.childPredTask = [];this.nextChildTask = null;this.previousChildTask = null;this.nextParentTask = null;this.previousParentTask = null};function GanttProject(Chart, projectInfo) -{this.isProject = true;this.nextProject = null;this.previousProject = null;this.arrTasks = [];this.Project = projectInfo;this.Chart = Chart;this.percentCompleted = 0;this.Duration = 0;this.descrProject = null;this.projectItem = null;this.projectNameItem = null;this.posY = 0;this.posX = 0};GanttProject.prototype.checkWidthProjectNameItem = function() -{if (this.projectNameItem.offsetWidth + this.projectNameItem.offsetLeft > this.Chart.maxWidthPanelNames){var width = this.projectNameItem.offsetWidth + this.projectNameItem.offsetLeft - this.Chart.maxWidthPanelNames;var countChar = Math.round(width / (this.projectNameItem.offsetWidth / this.projectNameItem.firstChild.length));var pName = this.Project.Name.substring(0, this.projectNameItem.firstChild.length - countChar - 3);pName += "...";this.projectNameItem.innerHTML = pName}};GanttProject.prototype.create = function() -{var containerTasks = this.Chart.oData.firstChild;this.posX = (this.Project.StartDate - this.Chart.startDate) / (60 * 60 * 1000) * this.Chart.hourInPixels;if (this.previousProject){if (this.previousProject.arrTasks.length > 0){var lastChildTask = this.Chart.getLastChildTask(this.previousProject.arrTasks[this.previousProject.arrTasks.length - 1]);this.posY = parseInt(lastChildTask.cTaskItem[0].style.top) + this.Chart.heightTaskItem + 11}else {this.posY = parseInt(this.previousProject.projectItem[0].style.top) + this.Chart.heightTaskItem + 11}}else {this.posY = 6};if (this.Chart._showTreePanel){var containerNames = this.Chart.panelNames.firstChild;this.projectNameItem = this.createProjectNameItem();containerNames.appendChild(this.projectNameItem);this.checkWidthProjectNameItem()};this.projectItem = [this.createProjectItem(),[]];containerTasks.appendChild(this.projectItem[0]);if (this.Chart.isShowDescProject){containerTasks.appendChild(this.createDescrProject())};this.addDayInPanelTime()};function GanttChart() -{this.Error = new GanttError();this.dhtmlXMLSenderObject = new dhtmlXMLSenderObject(this);this.heightTaskItem = 12;this.dayInPixels = 24;this.hoursInDay = 8;this._showTreePanel = true;this._showTooltip = true;this.isShowDescTask = false;this.isShowDescProject = false;this.isShowNewProject = true;this.isEditable = false;this.isShowConMenu = false;this.correctError = false;this.maxWidthPanelNames = 150;this.minWorkLength = 8;this.paramShowTask = [];this.paramShowProject = [];this.savePath = null;this.loadPath = null;this.divTimeInfo = null;this.divInfo = null;this.panelNames = null;this.panelTime = null;this.oData = null;this.content = null;this.panelErrors = null;this.contextMenu = null;this.hourInPixelsWork = this.dayInPixels / this.hoursInDay;this.hourInPixels = this.dayInPixels / 24;this.countDays = 0;this.startDate = null;this.initialPos = 0;this.contentHeight = 0;this.contentWidth = 0;this._oDataHeight = 0;this.Project = [];this.arrProjects = [];this.xmlLoader = null;this._isIE = false;this._isFF = false;this._isOpera = false;this._isMove = false;this._isResize = false;this._isError = false;this.imgs = "codebase/imgs/";this.stylePath = "codebase/dhtmlxgantt.css";this.shortMonthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];this.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];this._useShortMonthNames = true;dhtmlxEventable(this)};GanttChart.prototype.setImagePath = function(newPath) -{this.imgs = newPath};GanttChart.prototype.setStylePath = function(newPath) -{this.stylePath = newPath};GanttChart.prototype.setSavePath = function(newPath) -{this.savePath = newPath};GanttChart.prototype.setLoadPath = function(newPath) -{this.loadPath = newPath};GanttChart.prototype.setCorrectError = function(isCorrectError) -{this.correctError = isCorrectError};GanttChart.prototype.showDescTask = function(isShowDescTask, param) -{this.isShowDescTask = isShowDescTask;var arrValues = new Array(5);if (this.isShowDescTask){if (param){var arrParam = param.split(",");for (var i = 0;i < arrParam.length;i++){var k = this.getParamShowTask(arrParam[i]);arrValues[k] = 1}}else {arrValues[this.getParamShowTask('')] = 1};this.paramShowTask = this.getValueShowTask(arrValues)}};GanttChart.prototype.showDescProject = function(isShowDescProject, param) -{this.isShowDescProject = isShowDescProject;var arrValues = new Array(4);if (this.isShowDescProject){if (param){var arrParam = param.split(",");for (var i = 0;i < arrParam.length;i++){var k = this.getParamShowProject(arrParam[i]);arrValues[k] = 1}}else {arrValues[this.getParamShowProject('')] = 1};this.paramShowProject = this.getValueShowProject(arrValues)}};GanttChart.prototype.showContextMenu = function(show) -{this.isShowConMenu = show};GanttChart.prototype.setContextMenu = function(menu) -{this.showContextMenu(true);this.contextMenu = menu};GanttChart.prototype.showNewProject = function(show) -{this.isShowNewProject = show};GanttChart.prototype.getParamShowTask = function(param) -{switch (param) {case 'n': - - return 0;break;case 'd': - - return 1;break;case 'e': - - return 2;break;case 'p': - - return 3;break;case 's-f': - - return 4;break;default: - return 0;break}};GanttChart.prototype.getParamShowProject = function(param) -{switch (param) {case 'n': - - return 0;break;case 'd': - - return 1;break;case 's': - - return 2;break;case 'p': - - return 3;break;default: - return 0;break}};GanttChart.prototype.getValueShowTask = function(param) -{var arrValues = [];for (var i = 0;i < param.length;i++){if (param[i]){switch (i) {case 0: - arrValues.push('Name');break;case 1: - arrValues.push('Duration');break;case 2: - arrValues.push('EST');break;case 3: - arrValues.push('PercentComplete');break;case 4: - arrValues.push('S-F');break;default: - break}}};return arrValues};GanttChart.prototype.getValueShowProject = function(param) -{var arrValues = [];for (var i = 0;i < param.length;i++){if (param[i]){switch (i) {case 0: - arrValues.push('Name');break;case 1: - arrValues.push('Duration');break;case 2: - arrValues.push('StartDate');break;case 3: - arrValues.push('PercentComplete');break;default: - break}}};return arrValues};GanttChart.prototype.setEditable = function(isEditable) -{this.isEditable = isEditable};GanttChart.prototype.showTreePanel = function(show) -{this._showTreePanel = show};GanttChart.prototype.showTooltip = function(show) -{this._showTooltip = show};GanttChart.prototype.getProjectById = function(id) -{for (var i = 0;i < this.arrProjects.length;i++){if (this.arrProjects[i].Project.Id == id){return this.arrProjects[i]}};return null};GanttChart.prototype.getBrowserType = function() -{if (navigator.appName.indexOf('Explorer')!= -1) - {this._isIE = true}else if (navigator.userAgent.indexOf('Mozilla')!= -1) - {this._isFF = true}else if (navigator.userAgent.indexOf('Opera')!= -1) - {this._isOpera = true}};GanttChart.prototype.addProject = function(projectInfo) -{this.Project.push(projectInfo)};GanttProject.prototype.deleteTask = function(id) -{var task = this.getTaskById(id);if (task){this.deleteChildTask(task)}else {this.Chart.Error.throwError("DATA_INSERT_ERROR", 30, [id])}};GanttChart.prototype.deleteProject = function(id) -{var project = this.getProjectById(id);if (project){if (project.arrTasks.length > 0){while (project.arrTasks.length > 0){project.deleteChildTask(project.arrTasks[0])}};if (project.nextProject)project.shiftNextProject(project, -23);for (var i = 0;i < this.Project.length;i++){if (this.Project[i].Id == project.Project.Id){this.Project.splice(i, 1)}};if ((project.previousProject)&& - (project.nextProject)) - {var previousProject = project.previousProject;previousProject.nextProject = project.nextProject};if ((project.previousProject)&& - !(project.nextProject)) - {var previousProject = project.previousProject;previousProject.nextProject = null};if (!(project.previousProject)&& - (project.nextProject)) - {var nextProject = project.nextProject;nextProject.previousProject = null};for (var i = 0;i < this.arrProjects.length;i++){if (this.arrProjects[i].Project.Id == id){this.arrProjects.splice(i, 1)}};project.projectItem[0].parentNode.removeChild(project.projectItem[0]);if (this.isShowDescProject){project.descrProject.parentNode.removeChild(project.descrProject)};if (this._showTreePanel){project.projectNameItem.parentNode.removeChild(project.projectNameItem)};this._oDataHeight -= 11 + this.heightTaskItem;if (this.Project.length == 0){if (this.isShowNewProject){var d = new Date(this.startDate);var t = new Date(d.setDate(d.getDate() + 1));var pi = new GanttProjectInfo(1, "New project", t);this.Project.push(pi);var project = new GanttProject(this, pi);project.create();this.arrProjects.push(project);this._oDataHeight += 11 + this.heightTaskItem}}}else {this.Error.throwError("DATA_INSERT_ERROR", 31, [id])}};GanttProject.prototype.setName = function(name) -{if ((name != "")&& (name != null)) {this.Project.Name = name;if (this.Chart._showTreePanel){this.projectNameItem.innerHTML = name;this.projectNameItem.title = name;this.checkWidthProjectNameItem()};if (this.Chart.isShowDescProject)this.descrProject.innerHTML = this.getDescStr();this.addDayInPanelTime()}};GanttProject.prototype.setPercentCompleted = function(percentCompleted) -{percentCompleted = parseInt(percentCompleted);if (isNaN(percentCompleted)) - {this.Chart.Error.throwError("DATA_INSERT_ERROR", 6, null);return false};if (percentCompleted > 100){this.Chart.Error.throwError("DATA_INSERT_ERROR", 7, null);return false}else if (percentCompleted < 0){this.Chart.Error.throwError("DATA_INSERT_ERROR", 8, null);return false};if ((percentCompleted > 0)&& (percentCompleted < 100) && (this.percentCompleted > 0) && (this.percentCompleted < 100)) - {this.projectItem[0].firstChild.rows[0].cells[0].width = parseInt(percentCompleted) + "%";this.projectItem[0].firstChild.rows[0].cells[0].firstChild.style.width = (percentCompleted * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px";this.projectItem[0].firstChild.rows[0].cells[1].width = (100 - parseInt(percentCompleted)) + "%";this.projectItem[0].firstChild.rows[0].cells[1].firstChild.style.width = ((100 - percentCompleted) * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px"}else if (((percentCompleted == 0)|| (percentCompleted == 100)) && (this.percentCompleted > 0) && (this.percentCompleted < 100)) - {if (percentCompleted == 0){this.projectItem[0].firstChild.rows[0].cells[0].parentNode.removeChild(this.projectItem[0].firstChild.rows[0].cells[0]);this.projectItem[0].firstChild.rows[0].cells[0].width = 100 + "%";this.projectItem[0].firstChild.rows[0].cells[0].firstChild.style.width = this.Duration * this.Chart.hourInPixelsWork + "px"}else if (percentCompleted == 100){this.projectItem[0].firstChild.rows[0].cells[1].parentNode.removeChild(this.projectItem[0].firstChild.rows[0].cells[1]);this.projectItem[0].firstChild.rows[0].cells[0].width = 100 + "%";this.projectItem[0].firstChild.rows[0].cells[0].firstChild.style.width = this.Duration * this.Chart.hourInPixelsWork + "px"}}else if (((percentCompleted == 0)|| (percentCompleted == 100)) && ((this.percentCompleted == 0) || (this.percentCompleted == 100))) - {if ((percentCompleted == 0)&& (this.percentCompleted == 100)) - {this.projectItem[0].firstChild.rows[0].cells[0].firstChild.src = this.Chart.imgs + "progress_bg.png"}else if ((percentCompleted == 100)&& (this.percentCompleted == 0)) - {this.projectItem[0].firstChild.rows[0].cells[0].firstChild.src = this.Chart.imgs + "parentnode_filled.png"}}else if (((percentCompleted > 0)|| (percentCompleted < 100)) && ((this.percentCompleted == 0) || (this.percentCompleted == 100))) - {this.projectItem[0].firstChild.rows[0].cells[0].parentNode.removeChild(this.projectItem[0].firstChild.rows[0].cells[0]);var cellprojectItem = document.createElement("TD");this.projectItem[0].firstChild.rows[0].appendChild(cellprojectItem);cellprojectItem.width = percentCompleted + "%";var imgPr = document.createElement("img");imgPr.style.width = (percentCompleted * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px";imgPr.style.height = this.Chart.heightTaskItem + "px";cellprojectItem.appendChild(imgPr);imgPr.src = this.Chart.imgs + "parentnode_filled.png";cellprojectItem = document.createElement("TD");this.projectItem[0].firstChild.rows[0].appendChild(cellprojectItem);cellprojectItem.width = (100 - percentCompleted) + "%";imgPr = document.createElement("img");imgPr.style.width = ((100 - percentCompleted) * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px";imgPr.style.height = this.Chart.heightTaskItem + "px";cellprojectItem.appendChild(imgPr);imgPr.src = this.Chart.imgs + "progress_bg.png"}else if (this.percentCompleted == -1){if (percentCompleted == 100){this.projectItem[0].firstChild.rows[0].cells[0].firstChild.src = this.Chart.imgs + "parentnode_filled.png"}else if (percentCompleted < 100 && percentCompleted > 0){this.projectItem[0].firstChild.rows[0].cells[0].parentNode.removeChild(this.projectItem[0].firstChild.rows[0].cells[0]);var cellprojectItem = document.createElement("TD");this.projectItem[0].firstChild.rows[0].appendChild(cellprojectItem);cellprojectItem.width = percentCompleted + "%";var imgPr = document.createElement("img");imgPr.style.width = (percentCompleted * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px";imgPr.style.height = this.Chart.heightTaskItem + "px";cellprojectItem.appendChild(imgPr);imgPr.src = this.Chart.imgs + "parentnode_filled.png";cellprojectItem = document.createElement("TD");this.projectItem[0].firstChild.rows[0].appendChild(cellprojectItem);cellprojectItem.width = (100 - percentCompleted) + "%";imgPr = document.createElement("img");imgPr.style.width = ((100 - percentCompleted) * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px";imgPr.style.height = this.Chart.heightTaskItem + "px";cellprojectItem.appendChild(imgPr);imgPr.src = this.Chart.imgs + "progress_bg.png"}};this.percentCompleted = percentCompleted;if (this.Chart.isShowDescProject)this.descrProject.innerHTML = this.getDescStr();return true};GanttProject.prototype.deleteChildTask = function(task) -{if (task){if (task.cTaskItem[0].style.display == "none"){this.Chart.openTree(task.parentTask)};if (task.childPredTask.length > 0){for (var i = 0;i < task.childPredTask.length;i++){for (var t = 0;t < task.childPredTask[i].cTaskItem[1].length;t++){task.childPredTask[i].cTaskItem[1][t].parentNode.removeChild(task.childPredTask[i].cTaskItem[1][t])};task.childPredTask[i].cTaskItem[1] = [];task.childPredTask[i].predTask = null}};if (task.childTask.length > 0){while (task.childTask.length > 0){this.deleteChildTask(task.childTask[0])}};if (task.cTaskItem[0].style.display != "none")task.shiftCurrentTasks(task, -23);this.Project.deleteTask(task.TaskInfo.Id);if (task.cTaskItem[0]){task.cTaskItem[0].parentNode.removeChild(task.cTaskItem[0])};if (this.Chart.isShowDescTask){task.descrTask.parentNode.removeChild(task.descrTask)};if (task.cTaskItem[1].length > 0){for (var j = 0;j < task.cTaskItem[1].length;j++){task.cTaskItem[1][j].parentNode.removeChild(task.cTaskItem[1][j])}};if (task.cTaskNameItem[0]){task.cTaskNameItem[0].parentNode.removeChild(task.cTaskNameItem[0])};if (task.cTaskNameItem[1]){for (var j = 0;j < task.cTaskNameItem[1].length;j++){task.cTaskNameItem[1][j].parentNode.removeChild(task.cTaskNameItem[1][j])}};if (task.cTaskNameItem[2]){task.cTaskNameItem[2].parentNode.removeChild(task.cTaskNameItem[2])};if (task.parentTask){if (task.previousChildTask){if (task.nextChildTask){task.previousChildTask.nextChildTask = task.nextChildTask}else {task.previousChildTask.nextChildTask = null}};var parentTask = task.parentTask;for (var i = 0;i < parentTask.childTask.length;i++){if (parentTask.childTask[i].TaskInfo.Id == task.TaskInfo.Id){parentTask.childTask[i] = null;parentTask.childTask.splice(i, 1);break}};if (parentTask.childTask.length == 0){if (parentTask.cTaskNameItem[2]){parentTask.cTaskNameItem[2].parentNode.removeChild(parentTask.cTaskNameItem[2]);parentTask.cTaskNameItem[2] = null}}}else - {if (task.previousParentTask){if (task.nextParentTask){task.previousParentTask.nextParentTask = task.nextParentTask}else {task.previousParentTask.nextParentTask = null}};var project = task.Project;for (var i = 0;i < project.arrTasks.length;i++){if (project.arrTasks[i].TaskInfo.Id == task.TaskInfo.Id){project.arrTasks.splice(i, 1)}}};if (task.predTask){var predTask = task.predTask;for (var i = 0;i < predTask.childPredTask.length;i++){if (predTask.childPredTask[i].TaskInfo.Id == task.TaskInfo.Id){predTask.childPredTask[i] = null;predTask.childPredTask.splice(i, 1)}}};if (task.Project.arrTasks.length != 0){task.Project.shiftProjectItem()}else {task.Project.projectItem[0].style.display = "none";if (this.Chart.isShowDescProject)this.hideDescrProject()};this.Chart._oDataHeight -= 11 + this.Chart.heightTaskItem}};GanttProject.prototype.insertTask = function(id, name, EST, Duration, PercentCompleted, predecessorTaskId, parentTaskId) -{var task = null;var _task = null;if (this.Project.getTaskById(id)) {this.Chart.Error.throwError("DATA_INSERT_ERROR", 22, [id]);return false};if ((!Duration)|| (Duration < this.Chart.minWorkLength)) {Duration = this.Chart.minWorkLength};if ((!name)|| (name == "")) {name = id};if ((!PercentCompleted)|| (PercentCompleted == "")) {PercentCompleted = 0}else {PercentCompleted = parseInt(PercentCompleted);if (PercentCompleted < 0 || PercentCompleted > 100){this.Chart.Error.throwError("DATA_INSERT_ERROR", 35, null);return false}};var sortRequired = false;if ((parentTaskId)&& (parentTaskId != "")) {var parentTask = this.Project.getTaskById(parentTaskId);if (!parentTask){this.Chart.Error.throwError("DATA_INSERT_ERROR", 21, [parentTaskId]);return false};EST = EST || parentTask.EST;if (EST < parentTask.EST){this.Chart.Error.throwError("DATA_INSERT_ERROR", 20, [id,parentTaskId]);return false};task = new GanttTaskInfo(id, name, EST, Duration, PercentCompleted, predecessorTaskId);if (!this.Chart.checkPosParentTask(parentTask, task)) {this.Chart.Error.throwError("DATA_INSERT_ERROR", 19, [parentTaskId,id]);return false};task.ParentTask = parentTask;var _parentTask = this.getTaskById(parentTask.Id);var isHide = false;if (_parentTask.cTaskItem[0].style.display == "none"){isHide = true}else if (_parentTask.cTaskNameItem[2]){if (!_parentTask._isOpen){isHide = true}};if (isHide){if (_parentTask.childTask.length == 0){this.Chart.openTree(_parentTask.parentTask)}else {this.Chart.openTree(_parentTask)}};if (predecessorTaskId != ""){var predTask = this.Project.getTaskById(predecessorTaskId);if (!predTask){this.Chart.Error.throwError("DATA_INSERT_ERROR", 27, [predecessorTaskId]);return false};if (predTask.ParentTask){if (predTask.ParentTask.Id != task.ParentTask.Id){this.Chart.Error.throwError("DATA_INSERT_ERROR", 32, [predTask.Id,task.Id]);return false}}else {this.Chart.Error.throwError("DATA_INSERT_ERROR", 32, [predTask.Id,task.Id]);return false};if (!this.Chart.checkPosPredecessorTask(predTask, task)) {this.Chart.correctPosPredecessorTask(predTask, task)};task.PredecessorTask = predTask};var isAdd = false;if (sortRequired)for (var i = 0;i < parentTask.ChildTasks.length;i++){if (task.EST < parentTask.ChildTasks[i].EST){parentTask.ChildTasks.splice(i, 0, task);if (i > 0){parentTask.ChildTasks[i - 1].nextChildTask = parentTask.ChildTasks[i];parentTask.ChildTasks[i].previousChildTask = parentTask.ChildTasks[i - 1]};if (parentTask.ChildTasks[i + 1]){parentTask.ChildTasks[i + 1].previousChildTask = parentTask.ChildTasks[i];parentTask.ChildTasks[i].nextChildTask = parentTask.ChildTasks[i + 1]};isAdd = true;break}};if (!isAdd){if (parentTask.ChildTasks.length > 0){parentTask.ChildTasks[parentTask.ChildTasks.length - 1].nextChildTask = task;task.previousChildTask = parentTask.ChildTasks[parentTask.ChildTasks.length - 1]};parentTask.ChildTasks.push(task)};if (parentTask.ChildTasks.length == 1){_parentTask.cTaskNameItem[2] = _parentTask.createTreeImg()};_task = new GanttTask(task, this, this.Chart);_task.create();if (task.nextChildTask)_task.nextChildTask = _task.Project.getTaskById(task.nextChildTask.Id);_task.addDayInPanelTime();_task.shiftCurrentTasks(_task, 23)}else - {EST = EST || this.Project.StartDate;task = new GanttTaskInfo(id, name, EST, Duration, PercentCompleted, predecessorTaskId);if (task.EST <= this.Chart.startDate){this.Chart.Error.throwError("DATA_INSERT_ERROR", 18, [task.Id]);return false};if (predecessorTaskId != ""){var predTask = this.Project.getTaskById(predecessorTaskId);if (!predTask){this.Chart.Error.throwError("DATA_INSERT_ERROR", 27, [predecessorTaskId]);return false};if (!this.Chart.checkPosPredecessorTask(predTask, task)) {this.Chart.correctPosPredecessorTask(predTask, task)};if (predTask.ParentTask){this.Chart.Error.throwError("DATA_INSERT_ERROR", 15, [task.Id,predTask.Id]);return false};task.PredecessorTask = predTask};var isAdd = false;if (sortRequired)for (var i = 0;i < this.Project.ParentTasks.length;i++){if (EST < this.Project.ParentTasks[i].EST){this.Project.ParentTasks.splice(i, 0, task);if (i > 0){this.Project.ParentTasks[i - 1].nextParentTask = task;task.previousParentTask = this.Project.ParentTasks[i - 1]};if (this.Project.ParentTasks[i + 1]){this.Project.ParentTasks[i + 1].previousParentTask = task;task.nextParentTask = this.Project.ParentTasks[i + 1]};isAdd = true;break}};if (!isAdd){if (this.Project.ParentTasks.length > 0){this.Project.ParentTasks[this.Project.ParentTasks.length - 1].nextParentTask = task;task.previousParentTask = this.Project.ParentTasks[this.Project.ParentTasks.length - 1]};this.Project.ParentTasks.push(task)};_task = new GanttTask(task, this, this.Chart);_task.create();if (task.nextParentTask)_task.nextParentTask = _task.Project.getTaskById(task.nextParentTask.Id);_task.addDayInPanelTime();this.arrTasks.push(_task);_task.shiftCurrentTasks(_task, 23);this.projectItem[0].style.display = "inline";this.setPercentCompleted(this.getPercentCompleted());this.shiftProjectItem();if (this.Chart.isShowDescProject){this.showDescrProject()}};this.Chart.checkHeighPanelTasks();return _task};GanttChart.prototype.checkPosPredecessorTask = function(predTask, task) -{var widthPred = this.getWidthOnDuration(predTask.Duration);var posPred = this.getPosOnDate(predTask.EST);var posChild = this.getPosOnDate(task.EST);return (widthPred + posPred) <= posChild};GanttChart.prototype.correctPosPredecessorTask = function(predTask, ctask, ctaskObj) -{var newDate = new Date(predTask.EST);newDate.setHours(newDate.getHours() + (predTask.Duration / this.hoursInDay * 24));if (newDate.getHours()> 0) {newDate.setHours(0);newDate.setDate(newDate.getDate() + 1)};if (ctaskObj)ctaskObj.setEST(newDate, true);else ctask.EST = newDate;if (ctask.ParentTask){if (!this.checkPosParentTask(ctask.ParentTask, ctask)) - {var newDate2 = new Date(ctask.ParentTask.EST);newDate2.setHours(newDate2.getHours() + (ctask.ParentTask.Duration / this.hoursInDay * 24));ctask.Duration = parseInt((parseInt((newDate2 - ctask.EST) / (1000 * 60 * 60))) * this.hoursInDay / 24)}}};GanttChart.prototype.correctPosParentTask = function(parentTask, ctask) -{if (!ctask.PredecessorTask){if (parentTask.EST > ctask.EST){ctask.EST = new Date(parentTask.EST)};if (!this.checkPosParentTask(parentTask, ctask)) {ctask.Duration = parentTask.Duration}}else - {this.correctPosPredecessorTask(ctask.PredecessorTask, ctask)}};GanttChart.prototype.checkPosParentTaskInTree = function(parentTask) -{var isError = false;for (var t = 0;t < parentTask.ChildTasks.length;t++){if (!this.checkPosParentTask(parentTask, parentTask.ChildTasks[t])) - {if (!this.correctError){this.Error.throwError("DATA_ERROR", 28, [parentTask.Id,parentTask.ChildTasks[t].Id]);return true}else {this.correctPosParentTask(parentTask, parentTask.ChildTasks[t])}};if (parentTask.EST > parentTask.ChildTasks[t].EST){if (!this.correctError){this.Error.throwError("DATA_ERROR", 33, [parentTask.Id,parentTask.ChildTasks[t].Id]);return true}else {this.correctPosParentTask(parentTask, parentTask.ChildTasks[t])}};if (parentTask.ChildTasks[t].ChildTasks.length > 0){isError = this.checkPosParentTaskInTree(parentTask.ChildTasks[t])}};return isError};GanttChart.prototype.setPredTask = function(project) -{var isError = false;for (var k = 0;k < project.ParentTasks.length;k++){if (!this.isEmpty(project.ParentTasks[k].PredecessorTaskId)) - {project.ParentTasks[k].PredecessorTask = project.getTaskById(project.ParentTasks[k].PredecessorTaskId);if (!project.ParentTasks[k].PredecessorTask){if (!this.correctError){this.Error.throwError("DATA_ERROR", 27, [project.ParentTasks[k].PredecessorTaskId]);return true}};project.ParentTasks[k].PredecessorTask.ChildPredTasks.push(project.ParentTasks[k])};if (project.ParentTasks[k].PredecessorTask){if (!this.checkPosPredecessorTask(project.ParentTasks[k].PredecessorTask, project.ParentTasks[k])) {if (!this.correctError){this.Error.throwError("DATA_ERROR", 26, [project.ParentTasks[k].PredecessorTask.Id,project.ParentTasks[k].Id]);return true}else {this.correctPosPredecessorTask(project.ParentTasks[k].PredecessorTask, project.ParentTasks[k])}}};isError = this.setPredTaskInTree(project.ParentTasks[k]);if (isError)return isError};return isError};GanttChart.prototype.setPredTaskInTree = function(parentTask) -{var isError = false;for (var t = 0;t < parentTask.ChildTasks.length;t++){if (!this.isEmpty(parentTask.ChildTasks[t].PredecessorTaskId)) - {parentTask.ChildTasks[t].PredecessorTask = parentTask.Project.getTaskById(parentTask.ChildTasks[t].PredecessorTaskId);if (!parentTask.ChildTasks[t].PredecessorTask){if (!this.correctError){this.Error.throwError("DATA_ERROR", 27, [parentTask.ChildTasks[t].PredecessorTaskId]);return true}};if (!this.checkPosPredecessorTask(parentTask.ChildTasks[t].PredecessorTask, parentTask.ChildTasks[t])) - {if (!this.correctError){this.Error.throwError("DATA_ERROR", 26, [parentTask.ChildTasks[t].PredecessorTask.Id,parentTask.ChildTasks[t].Id]);return true}else {this.correctPosPredecessorTask(parentTask.ChildTasks[t].PredecessorTask, parentTask.ChildTasks[t])}};parentTask.ChildTasks[t].PredecessorTask.ChildPredTasks.push(parentTask.ChildTasks[t])};if (parentTask.ChildTasks[t].ChildTasks.length > 0){isError = this.setPredTaskInTree(parentTask.ChildTasks[t])}};return isError};GanttChart.prototype.checkPosParentTask = function(parentTask, task) -{var widthParent = this.getWidthOnDuration(parentTask.Duration);var posParent = this.getPosOnDate(parentTask.EST);var posChild = this.getPosOnDate(task.EST);var widthChild = this.getWidthOnDuration(task.Duration);return (widthParent + posParent) >= (posChild + widthChild)};GanttChart.prototype.insertProject = function(id, name, startDate) -{if (this._isError){this.clearData();this.clearItems();this.hidePanelErrors();this._isError = false};if (this.startDate >= startDate){this.Error.throwError("DATA_INSERT_ERROR", 14, null);return false};if (this.getProjectById(id)) {this.Error.throwError("DATA_INSERT_ERROR", 23, [id]);return false};this.checkHeighPanelTasks();var project = new GanttProjectInfo(id, name, startDate);this.Project.push(project);var _project = new GanttProject(this, project);for (var i = 0;i < this.arrProjects.length;i++){if (startDate < this.arrProjects[i].Project.StartDate){this.arrProjects.splice(i, 0, _project);if (i > 0){_project.previousProject = this.arrProjects[i - 1];this.arrProjects[i - 1].nextProject = _project};if (i + 1 <= this.arrProjects.length){_project.nextProject = this.arrProjects[i + 1];this.arrProjects[i + 1].previousProject = _project;_project.shiftNextProject(_project, 23)};_project.create();if (this.isShowDescProject){_project.hideDescrProject()};return _project}};if (this.arrProjects.length > 0){this.arrProjects[this.arrProjects.length - 1].nextProject = _project;_project.previousProject = this.arrProjects[this.arrProjects.length - 1]};this.arrProjects.push(_project);_project.create();if (this.isShowDescProject){_project.hideDescrProject()};return _project};GanttChart.prototype._showContextMenu = function(event, obj) -{if (this.contextMenu.isDhtmlxMenuObject){var res = this.callEvent("onBeforeContextMenu", [this.contextMenu, obj]);if (res === false)return;var x, y;if (_isIE){var dEl0 = window.document.documentElement, dEl1 = window.document.body, corrector = new Array((dEl0.scrollLeft||dEl1.scrollLeft),(dEl0.scrollTop||dEl1.scrollTop));x = event.clientX + corrector[0];y = event.clientY + corrector[1]}else {x = event.pageX;y = event.pageY};this.contextMenu.showContextMenu(x-1, y-1)}else {var elem = event.srcElement || event.target;this.contextMenu.showContextMenu(elem.style.left, elem.style.top, obj)}};GanttChart.prototype.openTree = function(parentTask) -{var lastParentTask = this.getLastCloseParent(parentTask);if (parentTask.TaskInfo.Id != lastParentTask.TaskInfo.Id){this.openNode(lastParentTask);this.openTree(parentTask)}else {this.openNode(lastParentTask)}};GanttChart.prototype.openNode = function(parentTask) -{if (!parentTask._isOpen){parentTask.cTaskNameItem[2].src = this.imgs + "minus.gif";parentTask._isOpen = true;parentTask.shiftCurrentTasks(parentTask, parentTask._heightHideTasks);parentTask.showChildTasks(parentTask, parentTask._isOpen);parentTask._heightHideTasks = 0}};GanttChart.prototype.getLastCloseParent = function(task) -{if (task.parentTask){if ((!task.parentTask._isOpen)|| - (task.parentTask.cTaskNameItem[2].style.display == "none")) {return this.getLastCloseParent(task.parentTask)}else {return task}}else {return task}};GanttTask.prototype.setPredecessor = function(predecessorTaskId) -{if (predecessorTaskId == "")this.clearPredTask();else - {var task = this.TaskInfo;if (task.Id == predecessorTaskId){this.Chart.Error.throwError("DATA_INSERT_ERROR", 36);return false};var predTaskObj = this.Project.getTaskById(predecessorTaskId);if (!predTaskObj){this.Chart.Error.throwError("DATA_INSERT_ERROR", 27, [predecessorTaskId]);return false};var predTask = predTaskObj.TaskInfo;var a1 = predTask.ParentTask == null, a2 = task.ParentTask == null;if (a1 && !a2 || !a1 && a2 || !a1 && !a2 && (predTask.ParentTask.Id != task.ParentTask.Id)) {this.Chart.Error.throwError("DATA_INSERT_ERROR", 32, [predTask.Id,task.Id]);return false};this.clearPredTask();if (!this.Chart.checkPosPredecessorTask(predTask, task)) {this.Chart.correctPosPredecessorTask(predTask, task, this)};task.PredecessorTaskId = predecessorTaskId;task.PredecessorTask = predTask;this.predTask = predTaskObj;predTaskObj.childPredTask.push(this);this.cTaskItem[1] = this.createConnectingLinesDS()};return true};GanttTask.prototype.clearPredTask = function() {if (this.predTask){var ch = this.predTask.childPredTask;for (var i = 0;i < ch.length;i++){if (ch[i] == this){ch.splice(i, 1);break}};for (var i = 0;i < this.cTaskItem[1].length;i++){this.cTaskItem[1][i].parentNode.removeChild(this.cTaskItem[1][i])};this.cTaskItem[1] = [];this.TaskInfo.PredecessorTaskId = null;this.TaskInfo.PredecessorTask = null;this.predTask = null}};GanttTask.prototype.setEST = function(est, shiftChild) -{this.moveChild = shiftChild;this.getMoveInfo();var pos = this.Chart.getPosOnDate(est);if ((parseInt(this.cTaskItem[0].firstChild.firstChild.width)+ pos > this.maxPosXMove) && (this.maxPosXMove != -1)) - {this.Chart.Error.throwError("DATA_INSERT_ERROR", 12, [this.TaskInfo.Id]);this.maxPosXMove = -1;this.minPosXMove = -1;return false};if (pos < this.minPosXMove){this.Chart.Error.throwError("DATA_INSERT_ERROR", 11, [this.TaskInfo.Id]);this.maxPosXMove = -1;this.minPosXMove = -1;return false};this.cTaskItem[0].style.left = pos;var width = pos - this.posX;this.moveCurrentTaskItem(width, shiftChild);this.Project.shiftProjectItem();if (this.Chart.isShowDescTask)this.descrTask.innerHTML = this.getDescStr();this.addDayInPanelTime();this.posX = 0;this.maxPosXMove = -1;this.minPosXMove = -1;return true};GanttTask.prototype.setDuration = function(duration) -{this.getResizeInfo();var width = this.Chart.getWidthOnDuration(duration);if ((width > this.maxWidthResize)&& (this.maxWidthResize != -1)) - {this.Chart.Error.throwError("DATA_INSERT_ERROR", 10, [this.TaskInfo.Id]);return false}else if (width < this.minWidthResize){this.Chart.Error.throwError("DATA_INSERT_ERROR", 9, [this.TaskInfo.Id]);return false}else {this.taskItemWidth = parseInt(this.cTaskItem[0].firstChild.firstChild.width);this.resizeTaskItem(width);this.endResizeItem();if (this.Chart.isShowDescTask)this.descrTask.innerHTML = this.getDescStr();return true}};GanttTask.prototype.setPercentCompleted = function(percentCompleted) -{percentCompleted = parseInt(percentCompleted);if (isNaN(percentCompleted)) - {this.Chart.Error.throwError("DATA_INSERT_ERROR", 6, null);return false};if (percentCompleted > 100){this.Chart.Error.throwError("DATA_INSERT_ERROR", 7, null);return false};if (percentCompleted < 0){this.Chart.Error.throwError("DATA_INSERT_ERROR", 8, null);return false};if ((percentCompleted != 0)&& (percentCompleted != 100)) - {if ((this.TaskInfo.PercentCompleted != 0)&& (this.TaskInfo.PercentCompleted != 100)) - {this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].width = percentCompleted + "%";this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[1].width = 100 - percentCompleted + "%"}else if ((this.TaskInfo.PercentCompleted == 0)|| (this.TaskInfo.PercentCompleted == 100)) - {this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].parentNode.removeChild(this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0]);var cellTblTask = document.createElement("td");this.cTaskItem[0].childNodes[0].firstChild.rows[0].appendChild(cellTblTask);cellTblTask.height = this.Chart.heightTaskItem + "px";cellTblTask.width = percentCompleted + "%";var imgPrF = document.createElement("img");imgPrF.style.width = (percentCompleted * this.TaskInfo.Duration * this.Chart.hourInPixelsWork) / 100 + "px";imgPrF.style.height = this.Chart.heightTaskItem + "px";cellTblTask.appendChild(imgPrF);imgPrF.src = this.Chart.imgs + "progress_filled.png";cellTblTask = document.createElement("td");this.cTaskItem[0].childNodes[0].firstChild.rows[0].appendChild(cellTblTask);cellTblTask.height = this.Chart.heightTaskItem + "px";cellTblTask.width = (100 - percentCompleted) + "%";imgPrF = document.createElement("img");imgPrF.style.width = ((100 - percentCompleted) * this.TaskInfo.Duration * this.Chart.hourInPixelsWork) / 100 + "px";imgPrF.style.height = this.Chart.heightTaskItem + "px";cellTblTask.appendChild(imgPrF);imgPrF.src = this.Chart.imgs + "progress_bg.png"}}else if (percentCompleted == 0){if ((this.TaskInfo.PercentCompleted != 0)&& (this.TaskInfo.PercentCompleted != 100)) - {this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].parentNode.removeChild(this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0]);this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].width = 100 + "%"}else - {this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].firstChild.src = this.Chart.imgs + "progress_bg.png"}}else if (percentCompleted == 100){if ((this.TaskInfo.PercentCompleted != 0)&& (this.TaskInfo.PercentCompleted != 100)) - {this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[1].parentNode.removeChild(this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[1]);this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].width = 100 + "%"}else - {this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].firstChild.src = this.Chart.imgs + "progress_filled.png"}};this.TaskInfo.PercentCompleted = percentCompleted;this.taskItemWidth = parseInt(this.cTaskItem[0].firstChild.firstChild.width);this.resizeTaskItem(this.taskItemWidth);this.endResizeItem();if (this.Chart.isShowDescTask)this.descrTask.innerHTML = this.getDescStr();return true};GanttTask.prototype.setName = function(name) -{if ((name != "")&& (name != null)) {this.TaskInfo.Name = name;if (this.Chart._showTreePanel){this.cTaskNameItem[0].innerHTML = name;this.cTaskNameItem[0].title = name;this.checkWidthTaskNameItem()};if (this.Chart.isShowDescTask)this.descrTask.innerHTML = this.getDescStr();this.addDayInPanelTime()}};GanttChart.prototype.getProjectInfoById = function(id) -{for (var i = 0;i < this.Project.length;i++){if (this.Project[i].Id == id){return this.Project[i]}};return null};GanttChart.prototype.loadData = function(content, isFile, isLocal) -{this.clearData();if ((isFile == null)|| (isFile == 'undefined')) - {isFile = false};if ((isLocal == null)|| (isLocal == 'undefined')) - {isLocal = false};this.loadXML(content, isFile, isLocal);this.Project.sort(this.sort_byStartDate);this.startDate = this.getStartDate();this.clearItems();for (var i = 0;i < this.Project.length;i++){for (var k = 0;k < this.Project[i].ParentTasks.length;k++){if ((this.Project[i].ParentTasks[k].EST != null)&& (this.Project[i].ParentTasks[k].EST != '')) {this.setESTChild(this.Project[i].ParentTasks[k])}else {this.Error.throwError("DATA_ERROR", 25, [this.Project[i].ParentTasks[k].Id]);return};if (this.setPredTask(this.Project[i])) return};for (var k = 0;k < this.Project[i].ParentTasks.length;k++){if (this.Project[i].ParentTasks[k].EST < this.Project[i].StartDate){this.Error.throwError("DATA_ERROR", 24, [this.Project[i].ParentTasks[k].Id,this.Project[i].Id]);return};if (this.checkPosParentTaskInTree(this.Project[i].ParentTasks[k])) return};this.sortTasksByEST(this.Project[i])};for (var i = 0;i < this.Project.length;i++){var project = new GanttProject(this, this.Project[i]);if (this.arrProjects.length > 0){var previousProject = this.arrProjects[this.arrProjects.length - 1];project.previousProject = previousProject;previousProject.nextProject = project};project.create();this.checkHeighPanelTasks();this.arrProjects.push(project);this.createTasks(project)}};GanttChart.prototype.clearAll = function() -{this._oDataHeight = 0;this.startDate = null;this._isError = false;this.hidePanelErrors();this.clearData();this.clearItems()};GanttChart.prototype.clearData = function() -{this._oDataHeight = 0;this.startDate = null;this._isError = false;this.hidePanelErrors();this.Project = [];this.arrProjects = []};GanttChart.prototype.clearItems = function() -{this.oData.removeChild(this.oData.firstChild);this.oData.appendChild(this.createPanelTasks());this.oData.firstChild.appendChild(this.divInfo);this.oData.firstChild.appendChild(this.panelErrors);if (this._showTreePanel){this.panelNames.removeChild(this.panelNames.firstChild);this.panelNames.appendChild(this.createPanelNamesTasks())};this.panelTime.removeChild(this.panelTime.firstChild);this.panelTime.appendChild(this.createPanelTime())};GanttChart.prototype.loadXML = function(content, isFile, isLocal) -{if (isFile && (content == null || content == "")) - {this.Error.throwError("DATA_SEND_ERROR", 4, null);return};this.xmlLoader = new dtmlXMLLoaderObject(null, this, false);try - {if (!isFile)try {this.xmlLoader.loadXMLString(content)}catch(e) {this.Error.throwError("DATA_LOAD_ERROR", 37, [content])}else - if (!isLocal){this.xmlLoader.loadXML(this.loadPath + "?path=" + content + "&rnd=" + (new Date() - 0), false)}else - {this.xmlLoader.loadXML(content + "?rnd=" + (new Date() - 0), false)};this.doLoadDetails(isLocal)}catch(e) - {this.Error.throwError("DATA_LOAD_ERROR", 5, [content])}};GanttChart.prototype.doLoadDetails = function(isLocal) -{switch (this.xmlLoader.xmlDoc.status) {case 0: - if (!isLocal){this.Error.throwError("DATA_LOAD_ERROR", 1, null);return};break;case 404: - if (!isLocal){this.Error.throwError("DATA_LOAD_ERROR", 5, [this.loadPath])}else - {this.Error.throwError("DATA_LOAD_ERROR", 5, [this.xmlLoader.filePath]) - };return;break;case 500: - this.Error.throwError("DATA_LOAD_ERROR", 2, null);return;break;default: - break};var name = null;var id = null;var est = null;var duration = null;var percentCompleted = null;var predecessorTaskId = null;var projectArr = this.xmlLoader.doXPath("//project");for (var j = 0;j < projectArr.length;j++){var startDateTemp = projectArr[j].getAttribute("startdate");var startDate = startDateTemp.split(",");var project = new GanttProjectInfo(projectArr[j].getAttribute("id"), projectArr[j].getAttribute("name"), new Date(startDate[0], (parseInt(startDate[1]) - 1), startDate[2]));var taskArr = this.xmlLoader.doXPath("./task", projectArr[j]);for (var i = 0;i < taskArr.length;i++){id = taskArr[i].getAttribute("id");name = (this.xmlLoader.doXPath("./name", taskArr[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./name", taskArr[i])[0].firstChild.nodeValue;var estTemp = (this.xmlLoader.doXPath("./est", taskArr[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./est", taskArr[i])[0].firstChild.nodeValue;est = estTemp.split(",");duration = (this.xmlLoader.doXPath("./duration", taskArr[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./duration", taskArr[i])[0].firstChild.nodeValue;percentCompleted = (this.xmlLoader.doXPath("./percentcompleted", taskArr[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./percentcompleted", taskArr[i])[0].firstChild.nodeValue;predecessorTaskId = (this.xmlLoader.doXPath("./predecessortasks", taskArr[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./predecessortasks", taskArr[i])[0].firstChild.nodeValue;var task = new GanttTaskInfo(id, name, new Date(est[0], (parseInt(est[1]) - 1), est[2]), duration, percentCompleted, predecessorTaskId);var childTasksNode = this.xmlLoader.doXPath("./childtasks", taskArr[i]);var childTasksArr = this.xmlLoader.doXPath("./task", childTasksNode[0]);if (childTasksArr.length != 0)this.readChildTasksXML(task, childTasksArr);project.addTask(task)};this.addProject(project)}};GanttChart.prototype.readChildTasksXML = function(parentTask, childTasksArrXML) -{var name = null;var id = null;var est = null;var duration = null;var percentCompleted = null;var predecessorTaskId = null;for (var i = 0;i < childTasksArrXML.length;i ++){id = childTasksArrXML[i].getAttribute("id");name = (this.xmlLoader.doXPath("./name", childTasksArrXML[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./name", childTasksArrXML[i])[0].firstChild.nodeValue;var estTemp = (this.xmlLoader.doXPath("./est", childTasksArrXML[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./est", childTasksArrXML[i])[0].firstChild.nodeValue;est = estTemp.split(",");duration = (this.xmlLoader.doXPath("./duration", childTasksArrXML[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./duration", childTasksArrXML[i])[0].firstChild.nodeValue;percentCompleted = (this.xmlLoader.doXPath("./percentcompleted", childTasksArrXML[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./percentcompleted", childTasksArrXML[i])[0].firstChild.nodeValue;predecessorTaskId = (this.xmlLoader.doXPath("./predecessortasks", childTasksArrXML[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./predecessortasks", childTasksArrXML[i])[0].firstChild.nodeValue;var task = new GanttTaskInfo(id, name, new Date(est[0], (parseInt(est[1]) - 1), est[2]), duration, percentCompleted, predecessorTaskId);task.ParentTask = parentTask;parentTask.addChildTask(task);var childTasksNode = this.xmlLoader.doXPath("./childtasks", childTasksArrXML[i]);var childTasksArr = this.xmlLoader.doXPath("./task", childTasksNode[0]);if (childTasksArr.length != 0){this.readChildTasksXML(task, childTasksArr)}}};GanttChart.prototype.getXML = function() -{var strXML = "";for (var i = 0;i < this.Project.length;i++){strXML += "";for (var j = 0;j < this.Project[i].ParentTasks.length;j++){strXML += "";strXML += "" + this.Project[i].ParentTasks[j].Name + "";strXML += "" + this.Project[i].ParentTasks[j].EST.getFullYear() + "," + (this.Project[i].ParentTasks[j].EST.getMonth() + 1) + "," + this.Project[i].ParentTasks[j].EST.getDate() + "";strXML += "" + this.Project[i].ParentTasks[j].Duration + "";strXML += "" + this.Project[i].ParentTasks[j].PercentCompleted + "";strXML += "" + this.Project[i].ParentTasks[j].PredecessorTaskId + "";strXML += "";strXML += this.createChildTasksXML(this.Project[i].ParentTasks[j].ChildTasks);strXML += "";strXML += ""};strXML += ""};strXML += "";return strXML};GanttChart.prototype.createChildTasksXML = function(childTasks) -{var strXML = "";for (var n = 0;n < childTasks.length;n++){strXML += "";strXML += "" + childTasks[n].Name + "";strXML += "" + childTasks[n].EST.getFullYear() + "," + (childTasks[n].EST.getMonth() + 1) + "," + childTasks[n].EST.getDate() + "";strXML += "" + childTasks[n].Duration + "";strXML += "" + childTasks[n].PercentCompleted + "";strXML += "" + childTasks[n].PredecessorTaskId + "";if (childTasks[n].ChildTasks){strXML += "";strXML += this.createChildTasksXML(childTasks[n].ChildTasks);strXML += ""};strXML += ""};return strXML};GanttChart.prototype.sort_byEST = function(a, b) -{if (a.EST < b.EST)return -1;if (a.EST > b.EST)return 1;return 0};GanttChart.prototype.sort_byStartDate = function(a, b) -{if (a["StartDate"] < b["StartDate"])return -1;if (a["StartDate"] > b["StartDate"])return 1;return 0};GanttChart.prototype.setESTChild = function(parentTask) -{for (var t = 0;t < parentTask.ChildTasks.length;t++){if ((parentTask.ChildTasks[t].EST == null )|| (parentTask.ChildTasks[t].EST == "")) - {parentTask.ChildTasks[t].EST = parentTask.EST};if (parentTask.ChildTasks[t].ChildTasks.length != 0)this.setESTChild(parentTask.ChildTasks[t])}};GanttChart.prototype.createPanelTasks = function() -{var divTasks = document.createElement("div");divTasks.className = "taskPanel";divTasks.style.cssText = "position:relative;";divTasks.style.height = this.contentHeight - 63 + "px";var w = this.startDate ? (this.startDate.getDay()-1) : ((new Date(0)).getDay()-1);if (w==-1)w=6;divTasks.style.background = "url(" + this.imgs + "bg_week.png) -"+(w*24)+"px 0px";this.panelTasks = divTasks;return divTasks};GanttChart.prototype.createPanelNamesTasks = function() -{var divListNames = document.createElement("div");divListNames.innerHTML = " ";divListNames.style.cssText = "position:relative;background:url(" + this.imgs + "bg.png)";divListNames.style.height = this.contentHeight - 63 + "px";divListNames.style.width = this.maxWidthPanelNames + "px";return divListNames};GanttChart.prototype.createPopUpInfo = function() -{var divTaskInfo = document.createElement("div");divTaskInfo.style.cssText = 'display: none;';var tblTaskInfo = document.createElement("table");tblTaskInfo.style.cssText = "position:absolute;top:0px;left:0px";tblTaskInfo.className = "poPupInfo";divTaskInfo.appendChild(tblTaskInfo);var rowTaskInfo = tblTaskInfo.insertRow(tblTaskInfo.rows.length);var cellTaskInfo = document.createElement("td");rowTaskInfo.appendChild(cellTaskInfo);this.divInfo = divTaskInfo;return divTaskInfo};GanttChart.prototype.createPopUpTimeInfo = function() -{var divTimeInfo = document.createElement("div");divTimeInfo.style.display = "none";var tblTimeInfo = document.createElement("table");tblTimeInfo.className = "poPupTime";divTimeInfo.appendChild(tblTimeInfo);var rowTimeInfo = tblTimeInfo.insertRow(tblTimeInfo.rows.length);var cellTimeInfo = document.createElement("td");cellTimeInfo.align = "center";rowTimeInfo.appendChild(cellTimeInfo);return divTimeInfo};GanttChart.prototype.createPanelTime = function() -{var panelTime = document.createElement("div");panelTime.style.position = "relative";var tblTime = document.createElement("table");panelTime.appendChild(tblTime);tblTime.cellPadding = "0px";tblTime.border = "0px";tblTime.cellSpacing = "0px";tblTime.bgColor = "#FFFFFF";tblTime.style.marginTop = "0px";var monthRow = tblTime.insertRow(tblTime.rows.length);var newRow = tblTime.insertRow(tblTime.rows.length);for (var i = 0;i < this.countDays;i++){this.addPointInTimePanel(newRow, panelTime);this.addDayInPanelTime(newRow)};return panelTime};GanttChart.prototype.addPointInTimePanel = function(row, panelTime) -{var leftLine = document.createElement("div");leftLine.style.cssText = "position:absolute;left:" + ( row.cells.length * this.dayInPixels ) + "px;top:20px;height:20px;width:1px;font-size:1px;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;background:#f1f3f1;";panelTime.appendChild(leftLine)};GanttChart.prototype._calculateMonthColSpan = function(date, maxLen) {var m1 = date.getMonth();for(var i=1;i<=maxLen;i++){date.setDate(date.getDate() + 1);var m2 = date.getMonth();if (m2 != m1)return i};return maxLen};GanttChart.prototype.getMonthScaleLabel = function(date) {return (this._useShortMonthNames ? this.shortMonthNames : this.monthNames)[date.getMonth()] + " '" + (""+date.getFullYear()).substring(2)};GanttChart.prototype.useShortMonthNames = function(flag) {this._useShortMonthNames = flag};GanttChart.prototype.setShortMonthNames = function(names) {this.shortMonthNames = names};GanttChart.prototype.setMonthNames = function(names) {this.monthNames = names};GanttChart.prototype.addDayInPanelTime = function(row) -{var self = this, idx = row.cells.length, date = new Date(this.startDate);var newCell = row.insertCell(idx);newCell.style.height = "20px";newCell.style.width = this.dayInPixels + "px";newCell.className = "dayNumber";date.setDate(date.getDate() + parseInt(idx));var day = date.getDate() - newCell.innerHTML = day;newCell.setAttribute("idx", idx);var monthRow = row.parentNode.parentNode.rows[0];if (idx==0 || day==1){var newCell2 = monthRow.insertCell(monthRow.cells.length);newCell2.className = "monthName";newCell2.style.height = "20px";if (monthRow.cells.length%2 == 0)newCell2.style.backgroundColor = "#f7f8f7";newCell2.colSpan = this._calculateMonthColSpan(new Date(date), Math.max(1,this.countDays-idx));newCell2.innerHTML = this.getMonthScaleLabel(date)}else {var n = monthRow.cells.length, cs=0;for(var i=0;i=cs)monthRow.cells[n-1].colSpan += 1};var w = date.getDay();if (w==0 || w==6)newCell.style.backgroundColor = "#f7f8f7"};GanttChart.prototype.incHeightPanelTasks = function(height) -{var containerTasks = this.oData.firstChild;containerTasks.style.height = parseInt(containerTasks.style.height) + height + "px"};GanttChart.prototype.incHeightPanelNames = function(height) -{var containerNames = this.panelNames.firstChild;containerNames.style.height = parseInt(containerNames.style.height) + height + "px"};GanttChart.prototype.checkHeighPanelTasks = function() -{this._oDataHeight += 11 + this.heightTaskItem;if ((parseInt(this.oData.firstChild.style.height)<= this._oDataHeight)) {this.incHeightPanelTasks(this.heightTaskItem + 11);if (this._showTreePanel)this.incHeightPanelNames(this.heightTaskItem + 11)}};GanttChart.prototype.sortTasksByEST = function(project) -{project.ParentTasks.sort(this.sort_byEST);for (var i = 0;i < project.ParentTasks.length;i++){project.ParentTasks[i] = this.sortChildTasks(project.ParentTasks[i])}};GanttChart.prototype.sortChildTasks = function(parenttask) -{parenttask.ChildTasks.sort(this.sort_byEST);for (var i = 0;i < parenttask.ChildTasks.length;i++){if (parenttask.ChildTasks[i].ChildTasks.length > 0)this.sortChildTasks(parenttask.ChildTasks[i])};return parenttask};GanttChart.prototype.errorDataHandler = function(type, descr, params) -{if (!this._isError){this.clearData();this.showPanelErrors();this._isError = true};this.addErrorInPanelErrors(type, descr)};GanttChart.prototype.createPanelErrors = function() -{var tbl = document.createElement("table");tbl.width = "100%";tbl.style.display = "none";tbl.className = "panelErrors";this.panelErrors = tbl;return tbl};GanttChart.prototype.showPanelErrors = function() -{this.panelErrors.style.display = "inline"};GanttChart.prototype.hidePanelErrors = function() -{for (var i = 0;i < this.panelErrors.rows.length;i++){this.panelErrors.rows[i].parentNode.removeChild(this.panelErrors.rows[i])};this.panelErrors.style.display = "none"};GanttChart.prototype.addErrorInPanelErrors = function(type, descr) -{var row = this.panelErrors.insertRow(this.panelErrors.rows.length);var cell = document.createElement("td");cell.style.height = "20px";cell.style.width = "100px";cell.innerHTML = type;row.appendChild(cell);cell = document.createElement("td");row.appendChild(cell);cell.innerHTML = descr};GanttChart.prototype.errorSendDataHandler = function(type, descr, params) -{alert(descr)};GanttChart.prototype.errorLoadDataHandler = function(type, descr, params) -{alert(descr)};GanttChart.prototype.errorAPIHandler = function(type, descr, params) -{alert(descr)};GanttChart.prototype.saveData = function(fileName) -{try {if (!this.dhtmlXMLSenderObject.isProcessed){this.dhtmlXMLSenderObject.sendData(fileName, this.savePath, this.getXML())}}catch(e) {this.Error.throwError("DATA_SEND_ERROR", e, null)}};GanttChart.prototype.create = function(divId) -{var self = this;var content = document.getElementById(divId);this.content = content;this.getBrowserType();if (this._isIE){document.body.attachEvent('onselectstart', function() {window.event.returnValue = false});document.body.attachEvent('onkeydown', function() {if (event.keyCode == 65 && event.ctrlKey)window.event.returnValue = false})}else {content.addEventListener('mousedown', function(e) {e.preventDefault()}, true);document.addEventListener('keydown', function(e) {if (e.keyCode == 65 && e.ctrlKey)e.preventDefault()}, true)};this.Error.catchError("DATA_ERROR", function(type, descr, params) {self.errorDataHandler(type, descr, params) - });this.Error.catchError("DATA_SEND_ERROR", function(type, descr, params) {self.errorSendDataHandler(type, descr, params) - });this.Error.catchError("DATA_INSERT_ERROR", function(type, descr, params) {self.errorAPIHandler(type, descr, params) - });this.Error.catchError("DATA_LOAD_ERROR", function(type, descr, params) {self.errorLoadDataHandler(type, descr, params) - });var tableControl = document.createElement("table");tableControl.cellPadding = "0";tableControl.cellSpacing = "0";tableControl.style.cssText = "width: 100%;position: relative;";var newRowTblControl = tableControl.insertRow(tableControl.rows.length);var newCellTblControl;this.contentHeight = content.offsetHeight;this.contentWidth = content.offsetWidth;content.appendChild(tableControl);this.countDays = this.getCountDays();this.Project.sort(this.sort_byStartDate);this.startDate = this.getStartDate();this.panelTime = document.createElement("div");this.panelTime.appendChild(this.createPanelTime());this.panelTime.style.cssText = "position:relative;overflow:hidden;height:40px;top:0px;left:1px";this.oData = document.createElement("div");this.oData.appendChild(this.createPanelTasks());this.oData.style.cssText = "position:relative;overflow:scroll;height:" + (this.contentHeight - 40) + "px;border-left:#f1f3f1 1px solid";this.oData.firstChild.appendChild(this.createPanelErrors());if (this._showTreePanel){this.panelNames = document.createElement("div");newCellTblControl = document.createElement("td");newCellTblControl.vAlign = "top";this.panelNames.appendChild(this.createPanelNamesTasks());this.panelNames.style.cssText = "position:relative;top:40px;overflow:hidden;border-left:#f1f3f1 1px solid;border-bottom:#f1f3f1 1px solid";newCellTblControl.appendChild(this.panelNames);newRowTblControl.appendChild(newCellTblControl)};newCellTblControl = document.createElement("td");var divCell = document.createElement("div");divCell.style.cssText = "position: relative;";divCell.appendChild(this.panelTime);divCell.appendChild(this.oData);newCellTblControl.appendChild(divCell);newRowTblControl.appendChild(newCellTblControl);if (this._showTreePanel){this.panelNames.style.height = (this.contentHeight - 56) + "px";this.panelNames.style.width = this.maxWidthPanelNames + "px";this.oData.style.width = (this.contentWidth - this.maxWidthPanelNames) + "px";this.panelTasks.style.width = this.dayInPixels * this.countDays + "px";this.panelTime.style.width = (this.contentWidth - this.maxWidthPanelNames - 0*18) + "px";this.panelTime.firstChild.style.width = this.dayInPixels * this.countDays + "px";if (this.isShowConMenu && this.contextMenu == null)this.contextMenu = new contextMenu(this)}else {this.oData.style.width = this.contentWidth + "px";this.panelTime.style.width = (this.contentWidth - 16) + "px"};if (this._isOpera){this.oData.onmousewheel = function() {return false}};this.oData.onscroll = function() {self.panelTime.scrollLeft = this.scrollLeft;if (self.panelNames){self.panelNames.scrollTop = this.scrollTop;if (self.isShowConMenu)self.contextMenu.hideContextMenu()}};this.divTimeInfo = this.createPopUpTimeInfo();divCell.appendChild(this.divTimeInfo);this.oData.firstChild.appendChild(this.createPopUpInfo());for (var i = 0;i < this.Project.length;i++){for (var k = 0;k < this.Project[i].ParentTasks.length;k++){if (this.isEmpty(this.Project[i].ParentTasks[k].EST)) {this.Project[i].ParentTasks[k].EST = this.Project[i].StartDate};this.setESTChild(this.Project[i].ParentTasks[k]);if (this.setPredTask(this.Project[i])) return};for (var k = 0;k < this.Project[i].ParentTasks.length;k++){if (this.Project[i].ParentTasks[k].EST < this.Project[i].StartDate){if (!this.correctError){this.Error.throwError("DATA_ERROR", 24, [this.Project[i].ParentTasks[k].Id,this.Project[i].Id]);return}else {this.Project[i].ParentTasks[k].EST = this.Project[i].StartDate}};if (this.checkPosParentTaskInTree(this.Project[i].ParentTasks[k])) return};this.sortTasksByEST(this.Project[i])};for (var i = 0;i < this.Project.length;i++){var project = new GanttProject(this, this.Project[i]);if (this.arrProjects.length > 0){var previousProject = this.arrProjects[this.arrProjects.length - 1];project.previousProject = previousProject;previousProject.nextProject = project};project.create();this.checkHeighPanelTasks();this.arrProjects.push(project);this.createTasks(project)};return this};GanttChart.prototype.isEmpty = function(value) -{return (value == null || value == '')};GanttChart.prototype.getPrintableHTML = function() -{var w = parseInt(this.oData.firstChild.style.width) - parseInt(this.oData.style.width);var h = parseInt(this.panelTasks.style.height) - parseInt(this.panelTasks.parentNode.style.height);this.oData.setAttribute("id","ganttPrint02");this.panelNames.setAttribute("id","ganttPrint03");var res = 'onload=function(){var w=' + w + ',h=' + h + - ',c1=document.getElementById("ganttPrint01"),c2=document.getElementById("ganttPrint02"),c3=document.getElementById("ganttPrint03");' + - 'c2.style.width=parseInt(c2.style.width)+w+"px";c2.previousSibling.style.width=c2.style.width;c1.style.width=parseInt(c1.style.width)+w+"px";c2.style.height=parseInt(c2.style.height)+h+"px";' + - 'c2.style.overflow="hidden";c3.style.height=c3.firstChild.style.height;c1.style.height=parseInt(c1.style.height)+h+"px"}' + - '

' + this.content.innerHTML + '
';this.oData.setAttribute("id",null);this.panelNames.setAttribute("id",null);return res};GanttChart.prototype.printToWindow = function(message) -{var o = window.open();o.document.write(this.getPrintableHTML());o.document.close();if (message!==null){o.alert(message ? message : "Use browser's menu \"File->Print preview\" to setup page layout." )}};GanttChart.prototype.getStartDate = function() -{for (var i = 0;i < this.Project.length;i++){if (this.startDate){if (this.Project[i].StartDate < this.startDate){this.startDate = new Date(this.Project[i].StartDate)}}else {this.startDate = new Date(this.Project[i].StartDate)}};this.initialPos = 24 * this.hourInPixels;if (this.startDate){return new Date(this.startDate.setHours(this.startDate.getHours() - 24))}else {return new Date()}};GanttChart.prototype.getCountDays = function() -{if (this._showTreePanel){return parseInt((this.contentWidth - this.maxWidthPanelNames) / (this.hourInPixels * 24))}else {return parseInt((this.contentWidth) / (this.hourInPixels * 24))}};GanttChart.prototype.createTasks = function(project) -{for (var j = 0;j < project.Project.ParentTasks.length;j++){if (j > 0){project.Project.ParentTasks[j - 1].nextParentTask = project.Project.ParentTasks[j];project.Project.ParentTasks[j].previousParentTask = project.Project.ParentTasks[j - 1]};var task = new GanttTask(project.Project.ParentTasks[j], project, this);project.arrTasks.push(task);task.create();this.checkHeighPanelTasks();if (project.Project.ParentTasks[j].ChildTasks.length > 0){this.createChildItemControls(project.Project.ParentTasks[j].ChildTasks, project)}}};GanttChart.prototype.createChildItemControls = function(arrChildTasks, project) -{for (var i = 0;i < arrChildTasks.length;i++){if (i > 0){arrChildTasks[i].previousChildTask = arrChildTasks[i - 1];arrChildTasks[i - 1].nextChildTask = arrChildTasks[i]};var task = new GanttTask(arrChildTasks[i], project, this);task.create();this.checkHeighPanelTasks();if (arrChildTasks[i].ChildTasks.length > 0){this.createChildItemControls(arrChildTasks[i].ChildTasks, project)}}};GanttTask.prototype.getPopUpInfo = function(object, event) -{var posY = object.offsetTop + this.Chart.heightTaskItem + 6;var posX = object.offsetLeft + ((event.layerX == null) ? event.offsetX : event.layerX);var tblInfo = this.Chart.divInfo.lastChild;tblInfo.rows[0].cells[0].innerHTML = "
" + this.TaskInfo.Name + "
";tblInfo.rows[0].cells[0].innerHTML += "EST: " + this.TaskInfo.EST.getDate() + "." + (this.TaskInfo.EST.getMonth() + 1) + "." + this.TaskInfo.EST.getFullYear() + "
";tblInfo.rows[0].cells[0].innerHTML += "Duration: " + this.TaskInfo.Duration + " hours
";tblInfo.rows[0].cells[0].innerHTML += "Percent Complete: " + this.TaskInfo.PercentCompleted + "%
";if (this.predTask){tblInfo.rows[0].cells[0].innerHTML += "Predecessor Task: ";tblInfo.rows[0].cells[0].innerHTML += "*" + this.TaskInfo.PredecessorTask.Name + ""};if (this.TaskInfo.ChildTasks.length != 0){tblInfo.rows[0].cells[0].innerHTML += "Child Tasks: ";for (var i = 0;i < this.TaskInfo.ChildTasks.length;i++){tblInfo.rows[0].cells[0].innerHTML += (i == this.TaskInfo.ChildTasks.length - 1) ? ("*" + this.TaskInfo.ChildTasks[i].Name + "") : ("*" + this.TaskInfo.ChildTasks[i].Name + "")}};if (this.TaskInfo.ParentTask){tblInfo.rows[0].cells[0].innerHTML += "Parent Task: ";tblInfo.rows[0].cells[0].innerHTML += "*" + this.TaskInfo.ParentTask.Name + ""};this.Chart.divInfo.style.cssText = "z-index:2;position: absolute;display: inline;";if (posY + this.Chart.divInfo.lastChild.offsetHeight + 10 > this.Chart.oData.offsetHeight + this.Chart.oData.scrollTop){this.Chart.divInfo.style.top = (posY - this.Chart.divInfo.lastChild.offsetHeight - 10 - this.Chart.heightTaskItem) + "px"}else {this.Chart.divInfo.style.top = posY + "px"};if (this.Chart.divInfo.lastChild.offsetWidth + posX + 10 > this.Chart.oData.offsetWidth + this.Chart.oData.scrollLeft){this.Chart.divInfo.style.left = posX - (this.Chart.divInfo.lastChild.offsetWidth + posX + 20 - (this.Chart.oData.offsetWidth + this.Chart.oData.scrollLeft)) + "px"}else {this.Chart.divInfo.style.left = posX + "px"}};GanttTask.prototype.closePopUpInfo = function() -{this.Chart.divInfo.style.display = "none"};GanttTask.prototype.createConnectingLinesPN = function() -{var arrConnectingLinesNames = [];return arrConnectingLinesNames};GanttTask.prototype.createConnectingLinesDS = function() -{var oData = this.Chart.oData.firstChild;var arrLines = [];var arrowImg = new Image();arrowImg.src = this.Chart.imgs + "arr.gif";var lineVerticalRight = document.createElement("div");var lineHorizontal = document.createElement("div");var posXPredecessorTask = parseInt(this.predTask.cTaskItem[0].style.left);var posYPredecessorTask = parseInt(this.predTask.cTaskItem[0].style.top);var posXChildTask = parseInt(this.cTaskItem[0].style.left);var posYChildTask = this.posY + 2;var widthChildTask = parseInt(this.predTask.cTaskItem[0].firstChild.firstChild.width);var widthPredecessorTask = parseInt(this.predTask.cTaskItem[0].firstChild.firstChild.width);if (posYPredecessorTask < posYChildTask){lineVerticalRight.style.cssText = "border-width: 0px 0px 0px 1px;border-style: solid;border-color: #4A8F43;margin: 0px;padding: 0px;z-index:0;font-size: 1px;position: absolute;" + - "height:" + (posYChildTask - this.Chart.heightTaskItem / 2 - posYPredecessorTask - 3) + "px;width:" + 1 + "px;left:" + (posXPredecessorTask + widthPredecessorTask - 20 ) + "px;top:" + (posYPredecessorTask + this.Chart.heightTaskItem) + "px;";lineHorizontal.style.cssText = "height:1px;border-color: #4A8F43;border-style: solid;border-width: 1px 0px 0px 0px;margin: 0px;padding: 0px;z-index:0;position: absolute;" + - "width:" + (15 + (posXChildTask - (widthPredecessorTask + posXPredecessorTask))) + "px;left:" + (posXPredecessorTask + widthPredecessorTask - 20 ) + "px;top:" + (posYChildTask + 2) + "px;";arrowImg.style.cssText = "margin: 0px;padding: 0px;width:7px;height:14px;position: absolute;left:" + (posXChildTask - 7) + "px;top:" + (posYChildTask - 1) + "px;"}else {lineVerticalRight.style.cssText = "border-width: 0px 0px 0px 1px;border-style: solid;border-color: #4A8F43;margin: 0px;padding: 0px;z-index:0;font-size: 1px;position: absolute;" + - "height:" + (posYPredecessorTask + 2 - posYChildTask) + "px;width:" + 1 + "px;left:" + (posXPredecessorTask + widthPredecessorTask - 20 ) + "px;top:" + (posYChildTask + 2) + "px;";lineHorizontal.style.cssText = "height:1px;border-color: #4A8F43;border-style: solid;border-width: 1px 0px 0px 0px;margin: 0px;padding: 0px;z-index:0;position: absolute;" + - "width:" + (15 + (posXChildTask - (widthPredecessorTask + posXPredecessorTask))) + "px;left:" + (posXPredecessorTask + widthPredecessorTask - 20 ) + "px;top:" + (posYChildTask + 2) + "px;";arrowImg.style.cssText = "margin: 0px;padding: 0px;width:7px;height:14px;position: absolute;left:" + (posXChildTask - 7) + "px;top:" + (posYChildTask - 1) + "px;"};oData.appendChild(lineVerticalRight);oData.appendChild(lineHorizontal);oData.appendChild(arrowImg);arrLines.push(lineVerticalRight);arrLines.push(arrowImg);arrLines.push(lineHorizontal);return arrLines};GanttTask.prototype.showChildTasks = function(task, isOpen) -{if (isOpen){for (var i = 0;i < task.childTask.length;i++){if (task.childTask[i].cTaskItem[0].style.display == "none"){task.childTask[i].cTaskItem[0].style.display = "inline";task.childTask[i].cTaskNameItem[0].style.display = "inline";if (this.Chart.isShowDescTask){task.childTask[i].showDescTask()};task.isHide = false;if (task.childTask[i].cTaskNameItem[2]){task.childTask[i].cTaskNameItem[2].style.display = "inline";isOpen = task.childTask[i]._isOpen};for (var k = 0;k < task.childTask[i].cTaskItem[1].length;k++){task.childTask[i].cTaskItem[1][k].style.display = "inline"};for (var k = 0;k < task.childTask[i].cTaskNameItem[1].length;k++){task.childTask[i].cTaskNameItem[1][k].style.display = "inline"};this._heightHideTasks += this.Chart.heightTaskItem + 11;if (task.childTask[i].childTask.length > 0){this.showChildTasks(task.childTask[i], isOpen)}}}}};GanttTask.prototype.hideChildTasks = function(task) -{for (var i = 0;i < task.childTask.length;i++){if (task.childTask[i].cTaskItem[0].style.display != "none"){task.childTask[i].cTaskItem[0].style.display = "none";task.childTask[i].cTaskNameItem[0].style.display = "none";if (this.Chart.isShowDescTask){task.childTask[i].hideDescTask()};task.isHide = true;if (task.childTask[i].cTaskNameItem[2]){task.childTask[i].cTaskNameItem[2].style.display = "none"};for (var k = 0;k < task.childTask[i].cTaskItem[1].length;k++){task.childTask[i].cTaskItem[1][k].style.display = "none"};for (var k = 0;k < task.childTask[i].cTaskNameItem[1].length;k++){task.childTask[i].cTaskNameItem[1][k].style.display = "none"};this._heightHideTasks += this.Chart.heightTaskItem + 11;if (task.childTask[i].childTask.length > 0){this.hideChildTasks(task.childTask[i])}}}};GanttTask.prototype.shiftCurrentTasks = function(task, height) -{this.shiftNextTask(this, height);task.Project.shiftNextProject(task.Project, height)};GanttProject.prototype.shiftNextProject = function(project, height) -{if (project.nextProject){project.nextProject.shiftProject(height);this.shiftNextProject(project.nextProject, height)}};GanttProject.prototype.shiftProject = function(height) -{this.projectItem[0].style.top = parseInt(this.projectItem[0].style.top) + height + "px";if (this.Chart.isShowDescProject){this.descrProject.style.top = parseInt(this.descrProject.style.top) + height + "px"};if (this.Chart._showTreePanel){this.projectNameItem.style.top = parseInt(this.projectNameItem.style.top) + height + "px"};if (this.arrTasks.length > 0)this.shiftNextParentTask(this.arrTasks[0], height)};GanttProject.prototype.shiftTask = function(task, height) -{if (this.Chart._showTreePanel){task.cTaskNameItem[0].style.top = parseInt(task.cTaskNameItem[0].style.top) + height + "px";if (task.cTaskNameItem[2]){task.cTaskNameItem[2].style.top = parseInt(task.cTaskNameItem[2].style.top) + height + "px"};if (task.parentTask && task.cTaskNameItem[1][0]){task.cTaskNameItem[1][0].style.top = parseInt(task.cTaskNameItem[1][0].style.top) + height + "px";task.cTaskNameItem[1][1].style.top = parseInt(task.cTaskNameItem[1][1].style.top) + height + "px"}};task.cTaskItem[0].style.top = parseInt(task.cTaskItem[0].style.top) + height + "px";if (this.Chart.isShowDescTask){task.descrTask.style.top = parseInt(task.descrTask.style.top) + height + "px"};if (task.cTaskItem[1][0]){task.cTaskItem[1][0].style.top = parseInt(task.cTaskItem[1][0].style.top) + height + "px";task.cTaskItem[1][1].style.top = parseInt(task.cTaskItem[1][1].style.top) + height + "px";task.cTaskItem[1][2].style.top = parseInt(task.cTaskItem[1][2].style.top) + height + "px"}};GanttProject.prototype.shiftNextParentTask = function(task, height) -{this.shiftTask(task, height);this.shiftChildTasks(task, height);if (task.nextParentTask){this.shiftNextParentTask(task.nextParentTask, height)}};GanttProject.prototype.shiftChildTasks = function(task, height) -{for (var i = 0;i < task.childTask.length;i++){this.shiftTask(task.childTask[i], height);if (task.childTask[i].childTask.length > 0){this.shiftChildTasks(task.childTask[i], height)}}};GanttTask.prototype.shiftTask = function(task, height) -{if (this.Chart._showTreePanel){task.cTaskNameItem[0].style.top = parseInt(task.cTaskNameItem[0].style.top) + height + "px";if (task.cTaskNameItem[2]){task.cTaskNameItem[2].style.top = parseInt(task.cTaskNameItem[2].style.top) + height + "px"};if (task.parentTask){if (task.cTaskNameItem[1].length > 0)if ((parseInt(this.cTaskNameItem[0].style.top)> parseInt(task.parentTask.cTaskNameItem[0].style.top)) - && (task.cTaskNameItem[1][0].style.display != "none")) {task.cTaskNameItem[1][0].style.height = parseInt(task.cTaskNameItem[1][0].style.height) + height + "px"}else {task.cTaskNameItem[1][0].style.top = parseInt(task.cTaskNameItem[1][0].style.top) + height + "px"};if (task.cTaskNameItem[1].length > 1)task.cTaskNameItem[1][1].style.top = parseInt(task.cTaskNameItem[1][1].style.top) + height + "px"}};task.cTaskItem[0].style.top = parseInt(task.cTaskItem[0].style.top) + height + "px";if (this.Chart.isShowDescTask){task.descrTask.style.top = parseInt(task.descrTask.style.top) + height + "px"};if (task.predTask){if (task.cTaskItem[1].length > 0)if (((parseInt(this.cTaskItem[0].style.top)> parseInt(task.predTask.cTaskItem[0].style.top)) || - (this.cTaskItem[0].id == task.predTask.TaskInfo.Id)) && - task.cTaskItem[1][0].style.display != "none") {task.cTaskItem[1][0].style.height = parseInt(task.cTaskItem[1][0].style.height) + height + "px"}else {task.cTaskItem[1][0].style.top = parseInt(task.cTaskItem[1][0].style.top) + height + "px"};if (task.cTaskItem[1].length > 2){task.cTaskItem[1][1].style.top = parseInt(task.cTaskItem[1][1].style.top) + height + "px";task.cTaskItem[1][2].style.top = parseInt(task.cTaskItem[1][2].style.top) + height + "px"}}};GanttTask.prototype.shiftNextTask = function(task, height) -{if (task.nextChildTask){this.shiftTask(task.nextChildTask, height);this.shiftChildTask(task.nextChildTask, height);this.shiftNextTask(task.nextChildTask, height)}else if (task.parentTask){this.shiftNextTask(task.parentTask, height)}else if (task.nextParentTask){this.shiftTask(task.nextParentTask, height);this.shiftChildTask(task.nextParentTask, height);this.shiftNextTask(task.nextParentTask, height)}};GanttTask.prototype.shiftChildTask = function(task, height) -{for (var i = 0;i < task.childTask.length;i++){this.shiftTask(task.childTask[i], height);if (task.childTask[i].childTask.length > 0){this.shiftChildTask(task.childTask[i], height)}}};GanttChart.prototype.getPosOnDate = function(est) -{return (est - this.startDate) / (60 * 60 * 1000) * this.hourInPixels};GanttChart.prototype.getWidthOnDuration = function(duration) -{return Math.round(this.hourInPixelsWork * duration)};GanttTask.prototype.endMove = function() -{var width = parseInt(this.cTaskItem[0].style.left) - this.posX;var est = this.getDateOnPosition(parseInt(this.cTaskItem[0].style.left));est = this.checkPos(est);this.wasMoved = this.TaskInfo.EST.valueOf() != est.valueOf();if (this.checkMove){width = this.Chart.getPosOnDate(est) - this.posX;this.moveCurrentTaskItem(width, this.moveChild);this.Project.shiftProjectItem()};this.checkMove = false;this.posX = 0;this.maxPosXMove = -1;this.minPosXMove = -1;this.cTaskItem[0].childNodes[1].firstChild.rows[0].cells[0].innerHTML = "";if (this.Chart._isFF)document.body.style.cursor = "";if (this.Chart._isIE)this.cTaskItem[0].childNodes[2].childNodes[0].style.cursor = ""};GanttTask.prototype.checkPos = function(est) -{var h = est.getHours();if (h >= 12){est.setDate(est.getDate() + 1);est.setHours(0);if ((parseInt(this.cTaskItem[0].firstChild.firstChild.width)+ this.Chart.getPosOnDate(est) > this.maxPosXMove) && (this.maxPosXMove != -1)) - {est.setDate(est.getDate() - 1);est.setHours(0)}}else if ((h < 12)&& (h != 0)) - {est.setHours(0);if ((this.Chart.getPosOnDate(est)< this.minPosXMove)) - {est.setDate(est.getDate() + 1)}};this.cTaskItem[0].style.left = this.Chart.getPosOnDate(est) + "px";return est};GanttTask.prototype.getMaxPosPredChildTaskItem = function() -{var posPredChildTaskItem = 0;var nextPosPredChildTaskItem = 0;for (var i = 0;i < this.childPredTask.length;i++){nextPosPredChildTaskItem = this.getMaxPosPredChildTaskItemInTree(this.childPredTask[i]);if (nextPosPredChildTaskItem > posPredChildTaskItem){posPredChildTaskItem = nextPosPredChildTaskItem}};return posPredChildTaskItem};GanttTask.prototype.getMaxPosPredChildTaskItemInTree = function(task) -{var currentPos = parseInt(task.cTaskItem[0].firstChild.firstChild.width) + parseInt(task.cTaskItem[0].style.left);var posPredChildTaskItem = 0;var nextPosPredChildTaskItem = 0;for (var i = 0;i < task.childPredTask.length;i++){nextPosPredChildTaskItem = this.getMaxPosPredChildTaskItemInTree(task.childPredTask[i]);if (nextPosPredChildTaskItem > posPredChildTaskItem){posPredChildTaskItem = nextPosPredChildTaskItem}};if (posPredChildTaskItem > currentPos){return posPredChildTaskItem}else - {return currentPos}};GanttProject.prototype.getTaskById = function(id) -{for (var i = 0;i < this.arrTasks.length;i++){var task = this.searchTaskInTree(this.arrTasks[i], id);if (task)return task};return null};GanttProject.prototype.searchTaskInTree = function(task, id) -{if (task.TaskInfo.Id == id){return task}else - {for (var i = 0;i < task.childTask.length;i++){if (task.childTask[i].TaskInfo.Id == id){return task.childTask[i]}else - {if (task.childTask[i].childTask.length > 0){var cTask = this.searchTaskInTree(task.childTask[i], id);if (cTask)return cTask}}}};return null};GanttProject.prototype.shiftProjectItem = function() -{var posItemL = null;var posItemR = null;var posProjectItemL = parseInt(this.projectItem[0].style.left);var posProjectItemR = parseInt(this.projectItem[0].firstChild.style.width) + parseInt(this.projectItem[0].style.left);var widthProjectItem = parseInt(this.projectItem[0].firstChild.style.width);for (var t = 0;t < this.arrTasks.length;t++){var tmpPosItemL = parseInt(this.arrTasks[t].cTaskItem[0].style.left);var tmpPosItemR = parseInt(this.arrTasks[t].cTaskItem[0].style.left) + parseInt(this.arrTasks[t].cTaskItem[0].firstChild.firstChild.width);if (!posItemL){posItemL = tmpPosItemL};if (!posItemR){posItemR = tmpPosItemR};if (posItemL > tmpPosItemL){posItemL = tmpPosItemL};if (posItemR < tmpPosItemR){posItemR = tmpPosItemR}};if (posItemL != posProjectItemL){this.Project.StartDate = new Date(this.Chart.startDate);this.Project.StartDate.setHours(this.Project.StartDate.getHours() + (posItemL / this.Chart.hourInPixels))};this.projectItem[0].style.left = posItemL + "px";this.resizeProjectItem(posItemR - posItemL);this.Duration = Math.round(parseInt(this.projectItem[0].firstChild.width) / (this.Chart.hourInPixelsWork));if (this.Chart.isShowDescProject){this.moveDescrProject()};this.addDayInPanelTime()};GanttProject.prototype.addDayInPanelTime = function() -{var width = parseInt(this.projectItem[0].style.left) + parseInt(this.projectItem[0].firstChild.style.width) + 20;if (this.Chart.isShowDescProject){width += this.descrProject.offsetWidth};var table = this.Chart.panelTime.firstChild, tbody = table.firstChild;if (parseInt(tbody.offsetWidth)< width) - {var countDays = Math.round((width - parseInt(tbody.offsetWidth)) / this.Chart.dayInPixels);var row = tbody.rows[1];for (var n = 0;n < countDays;n++){this.Chart.addPointInTimePanel(row, table);this.Chart.addDayInPanelTime(row)};var w = this.Chart.dayInPixels * (row.cells.length);tbody.style.width = w + "px";this.Chart.panelTasks.style.width = (w-18) + "px"}};GanttProject.prototype.addEvent = function (elm, evType, fn, useCapture) -{if (elm.addEventListener){elm.addEventListener(evType, fn, useCapture);return true}else if (elm.attachEvent){return elm.attachEvent('on' + evType, fn)}else {elm['on' + evType] = fn}};GanttProject.prototype.getPopUpInfo = function(object, event) -{var posX = object.offsetLeft + ((event.layerX == null) ? event.offsetX : event.layerX);var posY = object.offsetTop + this.Chart.heightTaskItem + 6;var tblInfo = this.Chart.divInfo.lastChild;tblInfo.rows[0].cells[0].innerHTML = "
" + this.Project.Name + "
";tblInfo.rows[0].cells[0].innerHTML += "Start Date: " + this.Project.StartDate.getDate() + "." + (this.Project.StartDate.getMonth() + 1) + "." + this.Project.StartDate.getFullYear() + "
";tblInfo.rows[0].cells[0].innerHTML += "Duration: " + this.Duration + " hours
";tblInfo.rows[0].cells[0].innerHTML += "Percent Complete: " + this.percentCompleted + "%
";this.Chart.divInfo.style.cssText = "z-index:2;position: absolute;display: inline;";if (posY + this.Chart.divInfo.lastChild.offsetHeight + 6 > this.Chart.oData.offsetHeight + this.Chart.oData.scrollTop){this.Chart.divInfo.style.top = (posY - this.Chart.divInfo.lastChild.offsetHeight - 10 - this.Chart.heightTaskItem) + "px"}else {this.Chart.divInfo.style.top = posY + "px"};if (this.Chart.divInfo.lastChild.offsetWidth + posX + 10 > this.Chart.oData.offsetWidth + this.Chart.oData.scrollLeft){this.Chart.divInfo.style.left = posX - (this.Chart.divInfo.lastChild.offsetWidth + posX + 20 - (this.Chart.oData.offsetWidth + this.Chart.oData.scrollLeft)) + "px"}else {this.Chart.divInfo.style.left = posX + "px"}};GanttProject.prototype.closePopUpInfo = function() -{this.Chart.divInfo.style.display = "none"};GanttProject.prototype.resizeProjectItem = function(width) -{var percentCompleted = this.percentCompleted;if (percentCompleted > 0 && percentCompleted < 100){this.projectItem[0].firstChild.style.width = width + "px";this.projectItem[0].firstChild.width = width + "px";this.projectItem[0].style.width = width + "px";this.projectItem[0].firstChild.rows[0].cells[0].firstChild.style.width = Math.round(width * percentCompleted / 100) + "px";this.projectItem[0].firstChild.rows[0].cells[1].firstChild.style.width = Math.round(width * (100 - percentCompleted) / 100) + "px";this.projectItem[0].lastChild.firstChild.width = width + "px"}else if (percentCompleted == 0 || percentCompleted == 100){this.projectItem[0].firstChild.style.width = width + "px";this.projectItem[0].firstChild.width = width + "px";this.projectItem[0].style.width = width + "px";this.projectItem[0].firstChild.rows[0].cells[0].firstChild.style.width = width + "px";this.projectItem[0].lastChild.firstChild.width = width + "px"}};GanttTask.prototype.moveCurrentTaskItem = function(width, moveChild) -{var taskItem = this.cTaskItem[0];this.TaskInfo.EST = new Date(this.Chart.startDate);this.TaskInfo.EST.setHours(this.TaskInfo.EST.getHours() + (parseInt(taskItem.style.left) / this.Chart.hourInPixels));if (this.Chart.isShowDescTask){this.showDescTask()};if (this.cTaskItem[1].length > 0){this.cTaskItem[1][2].style.width = parseInt(this.cTaskItem[1][2].style.width) + width + "px";this.cTaskItem[1][1].style.left = parseInt(this.cTaskItem[1][1].style.left) + width + "px"};for (var i = 0;i < this.childTask.length;i++){if (!this.childTask[i].predTask){this.moveChildTaskItems(this.childTask[i], width, moveChild)}};for (var i = 0;i < this.childPredTask.length;i++){this.moveChildTaskItems(this.childPredTask[i], width, moveChild)}};GanttTask.prototype.moveChildTaskItems = function(task, width, moveChild) -{var taskItem = task.cTaskItem[0];if (moveChild){taskItem.style.left = parseInt(taskItem.style.left) + width + "px";task.addDayInPanelTime();task.TaskInfo.EST = new Date(this.Chart.startDate);task.TaskInfo.EST.setHours(task.TaskInfo.EST.getHours() + (parseInt(taskItem.style.left) / this.Chart.hourInPixels));for (var n = 0;n < task.cTaskItem[1].length;n++){task.cTaskItem[1][n].style.left = parseInt(task.cTaskItem[1][n].style.left) + width + "px"};for (var i = 0;i < task.childTask.length;i++){if (!task.childTask[i].predTask){this.moveChildTaskItems(task.childTask[i], width, moveChild)}};for (var i = 0;i < task.childPredTask.length;i++){this.moveChildTaskItems(task.childPredTask[i], width, moveChild)}}else - {if (task.cTaskItem[1].length > 0){task.cTaskItem[1][2].style.left = parseInt(task.cTaskItem[1][2].style.left) + width + "px";task.cTaskItem[1][2].style.width = parseInt(task.cTaskItem[1][2].style.width) - width + "px";task.cTaskItem[1][0].style.left = parseInt(task.cTaskItem[1][0].style.left) + width + "px"}};if (this.Chart.isShowDescTask){task.moveDescTask()}};GanttTask.prototype.addDayInPanelTime = function() -{var taskItem = this.cTaskItem[0];var width = parseInt(taskItem.style.left) + parseInt(taskItem.firstChild.firstChild.width) + 20;if (this.Chart.isShowDescTask){width += this.descrTask.offsetWidth};var table = this.Chart.panelTime.firstChild, tbody = table.firstChild;if (parseInt(tbody.offsetWidth)< width) - {var row = tbody.rows[1];var countDays = Math.round((width + 20 - parseInt(tbody.offsetWidth)) / this.Chart.dayInPixels);for (var n = 0;n < countDays;n++){this.Chart.addPointInTimePanel(row, table);this.Chart.addDayInPanelTime(row)};var w = this.Chart.dayInPixels * (row.cells.length);tbody.style.width = w + "px";this.Chart.panelTasks.style.width = (w-18) + "px"}};GanttTask.prototype.getDateOnPosition = function(position) -{var date = new Date(this.Chart.startDate);date.setHours(date.getHours() + (position / this.Chart.hourInPixels));return date};GanttTask.prototype.moveItem = function(event) -{var pageX = event.screenX;var posTaskItem = (this.posX + (pageX - this.MouseX));var widthTaskItem = parseInt(this.cTaskItem[0].childNodes[0].firstChild.width);var posTaskItemR = posTaskItem + widthTaskItem;if (this.checkMove){var date = this.getDateOnPosition(posTaskItem);var res = this.Chart.callEvent("onTaskDragging", [this,date])!==false;if (res && ((this.minPosXMove <= posTaskItem)) - && ((posTaskItemR <= this.maxPosXMove) || (this.maxPosXMove == -1))) - {this.moveTaskItem(posTaskItem)}}};GanttTask.prototype.moveTaskItem = function(posX) -{this.addDayInPanelTime();this.cTaskItem[0].style.left = posX + "px";var date = this.getDateOnPosition(posX);this.cTaskItem[0].childNodes[1].firstChild.rows[0].cells[0].innerHTML = date.getDate() + '.' + (date.getMonth() + 1) + '.' + date.getUTCFullYear()};GanttTask.prototype.resizeItem = function(event) -{if (this.checkResize){var MouseX = event.screenX;var widthTaskItem = this.taskItemWidth + (MouseX - this.MouseX);var countHours = Math.round(widthTaskItem / this.Chart.hourInPixelsWork);if (this.Chart.callEvent("onTaskResizing", [this,countHours])===false) return;if (widthTaskItem >= this.taskItemWidth){if ((widthTaskItem <= this.maxWidthResize)|| (this.maxWidthResize == -1)) - {this.resizeTaskItem(widthTaskItem);this.addDayInPanelTime()}else if ((this.maxWidthResize != -1)&& (widthTaskItem > this.maxWidthResize)) - {this.resizeTaskItem(this.maxWidthResize)}}else if (widthTaskItem <= this.taskItemWidth){if (widthTaskItem >= this.minWidthResize){this.resizeTaskItem(widthTaskItem)}else if (widthTaskItem < this.minWidthResize){this.resizeTaskItem(this.minWidthResize)}}}};GanttTask.prototype.resizeTaskItem = function(width) -{var taskItem = this.cTaskItem[0];var countHours = Math.round(width / this.Chart.hourInPixelsWork);var c = taskItem.childNodes[0].firstChild.rows[0].cells[0];if (c){c.firstChild.style.width = parseInt(c.width) * width / 100 + "px"};c = taskItem.childNodes[0].firstChild.rows[0].cells[1];if (c){c.firstChild.style.width = parseInt(c.width) * width / 100 + "px"};taskItem.childNodes[0].firstChild.width = width + "px";taskItem.childNodes[1].firstChild.width = width + "px";this.cTaskItem[0].childNodes[1].firstChild.rows[0].cells[0].innerHTML = countHours;taskItem.childNodes[2].childNodes[0].style.width = width + "px";taskItem.childNodes[2].childNodes[1].style.left = width - 10 + "px"};GanttTask.prototype.endResizeItem = function() -{var taskItem = this.cTaskItem[0];this.wasResized = this.taskItemWidth != parseInt(taskItem.childNodes[0].firstChild.width);if (this.wasResized){var posXL = taskItem.offsetLeft;var posXR = taskItem.offsetLeft + parseInt(taskItem.childNodes[0].firstChild.width);this.TaskInfo.Duration = Math.round((posXR - posXL) / this.Chart.hourInPixelsWork);if (this.childPredTask.length > 0){for (var j = 0;j < this.childPredTask.length;j++){this.childPredTask[j].cTaskItem[1][2].style.width = parseInt(this.childPredTask[j].cTaskItem[1][2].style.width) - (parseInt(taskItem.childNodes[0].firstChild.width) - this.taskItemWidth) + "px";this.childPredTask[j].cTaskItem[1][2].style.left = parseInt(this.childPredTask[j].cTaskItem[1][2].style.left) + (parseInt(taskItem.childNodes[0].firstChild.width) - this.taskItemWidth) + "px";this.childPredTask[j].cTaskItem[1][0].style.left = parseInt(this.childPredTask[j].cTaskItem[1][0].style.left) + (parseInt(taskItem.childNodes[0].firstChild.width) - this.taskItemWidth) + "px"}}};this.cTaskItem[0].childNodes[1].firstChild.rows[0].cells[0].innerHTML = "";this.checkResize = false;this.taskItemWidth = 0;this.MouseX = 0;if (this.Chart.isShowDescTask){this.showDescTask()};this.Project.shiftProjectItem();if (this.Chart._isFF)document.body.style.cursor = ""};GanttProject.prototype.moveDescrProject = function() -{this.descrProject.style.left = (parseInt(this.projectItem[0].style.left) + this.Duration * this.Chart.hourInPixelsWork + 10);this.descrProject.innerHTML = this.getDescStr()};GanttProject.prototype.showDescrProject = function() -{var posX = (parseInt(this.projectItem[0].style.left) + this.Duration * this.Chart.hourInPixelsWork + 10);this.descrProject.style.left = posX + "px";this.descrProject.style.visibility = 'visible';this.descrProject.innerHTML = this.getDescStr()};GanttProject.prototype.hideDescrProject = function() -{this.descrProject.style.visibility = 'hidden'};GanttProject.prototype.getDescStr = function() -{var str = '', delim = ", ";for (var i = 0;i < this.Chart.paramShowProject.length;i++){switch (this.Chart.paramShowProject[i]) {case "Name": - if (str != "")str += delim;str += this.Project[this.Chart.paramShowProject[i]];break;case "StartDate": - if (str != "")str += delim;var d = this.Project[this.Chart.paramShowProject[i]];str += d.getDate() + "." + (d.getMonth() + 1) + "." + d.getFullYear();break;case "Duration": - if (str != "")str += delim;str += this[this.Chart.paramShowProject[i]] + "h";break;case "percentCompleted": - if (str != "")str += delim;str += this[this.Chart.paramShowProject[i]] + "%";break;default: - break}};return str};GanttProject.prototype.createDescrProject = function() -{var posX = (this.posX + this.Duration * this.Chart.hourInPixelsWork + 10);var divDesc = document.createElement("div");divDesc.style.cssText += ";z-index:1;position:absolute;left:" + posX + "px;top:" + this.posY + "px;";divDesc.innerHTML = this.getDescStr();divDesc.className = "descProject";this.descrProject = divDesc;if (this.Project.ParentTasks.length == 0){this.descrProject.style.visibility = 'hidden'};if (this.Chart._showTooltip){var self = this;var getPopUpInfo = function(e) {if ((!self.Chart._isMove)&& (!self.Chart._isResize)) self.getPopUpInfo(self.descrProject, e)};var closePopUpInfo = function() {self.closePopUpInfo()};this.addEvent(divDesc, 'mouseover', getPopUpInfo, false);this.addEvent(divDesc, 'mouseout', closePopUpInfo, false)};return divDesc};GanttProject.prototype.createProjectItem = function() -{var self = this;this.percentCompleted = this.getPercentCompleted();this.Duration = this.getDuration();var projectItem = document.createElement("div");projectItem.id = this.Project.Id;projectItem.style.cssText = ";z-index:1;position: absolute;left:" + this.posX + "px;top:" + this.posY + "px;";projectItem.style.width = this.Duration * this.Chart.hourInPixelsWork + "px";var tblProjectItem = document.createElement("table");projectItem.appendChild(tblProjectItem);tblProjectItem.cellPadding = "0";tblProjectItem.cellSpacing = "0";tblProjectItem.style.cssText = "border: solid 1px #BC810D;";var width = this.Duration * this.Chart.hourInPixelsWork;tblProjectItem.width = ((width == 0) ? 1 : width) + "px";tblProjectItem.style.width = ((width == 0) ? 1 : width) + "px";var rowprojectItem = tblProjectItem.insertRow(tblProjectItem.rows.length);if (this.percentCompleted != -1){if (this.percentCompleted != 0){var cellprojectItem = document.createElement("TD");rowprojectItem.appendChild(cellprojectItem);cellprojectItem.width = this.percentCompleted + "%";cellprojectItem.style.lineHeight = "1px";var imgPr = document.createElement("img");imgPr.style.width = (this.percentCompleted * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px";imgPr.style.height = this.Chart.heightTaskItem + "px";cellprojectItem.appendChild(imgPr);imgPr.src = this.Chart.imgs + "parentnode_filled.png"};if (this.percentCompleted != 100){var cellprojectItem = document.createElement("TD");rowprojectItem.appendChild(cellprojectItem);cellprojectItem.width = (100 - this.percentCompleted) + "%";cellprojectItem.style.lineHeight = "1px";var imgPr = document.createElement("img");imgPr.style.width = ((100 - this.percentCompleted) * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px";imgPr.style.height = this.Chart.heightTaskItem + "px";cellprojectItem.appendChild(imgPr);imgPr.src = this.Chart.imgs + "progress_bg.png"}}else - {var cellprojectItem = document.createElement("TD");rowprojectItem.appendChild(cellprojectItem);cellprojectItem.width = "1px";cellprojectItem.style.lineHeight = "1px";var imgPr = document.createElement("img");imgPr.style.width = "1px";imgPr.style.height = this.Chart.heightTaskItem;cellprojectItem.appendChild(imgPr);imgPr.src = this.Chart.imgs + "progress_bg.png"};var divTaskInfo = document.createElement("div");divTaskInfo.style.cssText = "text-align:center;z-index:2;position:absolute;left:0px;top:0px;";var tblTaskInfo = document.createElement("table");divTaskInfo.appendChild(tblTaskInfo);tblTaskInfo.cellPadding = "0";tblTaskInfo.cellSpacing = "0";tblTaskInfo.height = this.Chart.heightTaskItem + "px";tblTaskInfo.width = ((this.Duration * this.Chart.hourInPixelsWork == 0) ? 1 : this.Duration * this.Chart.hourInPixelsWork) + "px";var rowTaskInfo = tblTaskInfo.insertRow(0);var cellTaskInfo = document.createElement("td");cellTaskInfo.align = "center";cellTaskInfo.vAlign = "top";cellTaskInfo.height = this.Chart.heightTaskItem + "px";cellTaskInfo.className = "moveInfo";cellTaskInfo.style.cssText = ";white-space:nowrap;";rowTaskInfo.appendChild(cellTaskInfo);projectItem.appendChild(divTaskInfo);if (this.Project.ParentTasks.length == 0){projectItem.style.display = "none"};if (this.Chart._showTooltip){var getPopUpInfo = function(e) {if ((!self.Chart._isMove)&& (!self.Chart._isResize)) self.getPopUpInfo(self.projectItem[0], e)};var closePopUpInfo = function() {self.closePopUpInfo()};this.addEvent(divTaskInfo, 'mouseover', getPopUpInfo, false);this.addEvent(divTaskInfo, 'mouseout', closePopUpInfo, false)};return projectItem};GanttProject.prototype.createProjectNameItem = function() -{var self = this;var divName = document.createElement("div");divName.style.cssText = "cursor:pointer;color:#003366;font-weight:bold;font-size:12px;font-family:Tahoma,Arial;white-space:nowrap;height:15px;z-index:1;position:absolute;left:" + 5 + "px;top:" + this.posY + "px;";divName.innerHTML = this.Project.Name;divName.title = this.Project.Name;if (this.Chart.isShowConMenu){var showContMenu = function(event) {if (self.Chart.contextMenu.clear)self.Chart.contextMenu.clear();var hideContMenu = null;if (!self.Chart._isIE){hideContMenu = function() {self.Chart.contextMenu.hideContextMenu();self.Chart.content.removeEventListener("mousedown", hideContMenu, false)}}else - {hideContMenu = function() {self.Chart.contextMenu.hideContextMenu();self.Chart.content.detachEvent("mousedown", hideContMenu)}};self.Chart.content.onmousedown = hideContMenu;if (!self.Chart._isIE){event.stopPropagation()}else - {event.cancelBubble = true};self.Chart._showContextMenu(event, self)};if (this.Chart._isIE){this.addEvent(divName, "contextmenu", function(e) {showContMenu(e);return false}, false)}else - {this.addEvent(divName, "contextmenu", function(e) {e.preventDefault();showContMenu(e)}, false)}};return divName};GanttProject.prototype.getPercentCompleted = function() -{var sum = 0;var percentCompleted = 0;for (var i = 0;i < this.Project.ParentTasks.length;i++){sum += parseInt(this.Project.ParentTasks[i].PercentCompleted)};if (this.Project.ParentTasks.length != 0){return percentCompleted = Math.round(sum / this.Project.ParentTasks.length)}else {return percentCompleted = -1}};GanttProject.prototype.getDuration = function() -{var duration = 0;var tmpDuration = 0;if (this.Project.ParentTasks.length > 0){for (var i = 0;i < this.Project.ParentTasks.length;i++){tmpDuration = this.Project.ParentTasks[i].Duration * 24 / this.Chart.hoursInDay + (this.Project.ParentTasks[i].EST - this.Chart.startDate) / (60 * 60 * 1000);if (tmpDuration > duration){duration = tmpDuration}};return ((duration - this.posX) / 24) * this.Chart.hoursInDay}else - {return 0}};GanttProject.prototype.getId = function() -{return this.Project.Id};GanttProject.prototype.getName = function() -{return this.Project.Name};GanttProject.prototype.getStartDate = function() -{return this.Project.StartDate};GanttTask.prototype.addEvent = function (elm, evType, fn, useCapture) -{if (elm.addEventListener){elm.addEventListener(evType, fn, useCapture);return true}else if (elm.attachEvent){return elm.attachEvent('on' + evType, fn)}else {elm['on' + evType] = fn}};GanttTask.prototype.startMove = function (event) -{this.moveChild = event.ctrlKey;this.MouseX = event.screenX;this.getMoveInfo();this.checkMove = true;if (this.Chart.isShowDescTask){this.hideDescTask()};if (this.Chart._isFF)document.body.style.cursor = "move";if (this.Chart._isIE)event.srcElement.style.cursor = "move"};GanttTask.prototype.showDescTask = function() -{var posX = (parseInt(this.cTaskItem[0].style.left) + this.TaskInfo.Duration * this.Chart.hourInPixelsWork + 10);this.descrTask.style.left = posX + "px";this.descrTask.innerHTML = this.getDescStr();this.descrTask.style.visibility = 'visible'};GanttTask.prototype.hideDescTask = function() -{this.descrTask.style.visibility = 'hidden'};GanttTask.prototype.getDescStr = function() -{var str = '', delim = ", ";for (var i = 0;i < this.Chart.paramShowTask.length;i++){var prop = this.Chart.paramShowTask[i], propValue = this.TaskInfo[prop];switch (prop) {case "Name": - if (str != "")str += delim;str += propValue;break;case "EST": - if (str != "")str += delim;str += propValue.getDate() + "." + (propValue.getMonth() + 1) + "." + propValue.getFullYear();break;case "S-F": - if (str != "")str += delim;propValue = this.TaskInfo["EST"];str += propValue.getDate() + "." + (propValue.getMonth() + 1) + "." + propValue.getFullYear() + " - ";propValue = this.getFinishDate();str += propValue.getDate() + "." + (propValue.getMonth() + 1) + "." + propValue.getFullYear();break;case "Duration": - if (str != "")str += delim;str += propValue + "h";break;case "PercentCompleted": - if (str != "")str += delim;str += propValue + "%";break;default: - break}};return str};GanttTask.prototype.getId = function() -{return this.TaskInfo.Id};GanttTask.prototype.getName = function() -{return this.TaskInfo.Name};GanttTask.prototype.getDuration = function() -{return this.TaskInfo.Duration};GanttTask.prototype.getEST = function() -{return this.TaskInfo.EST};GanttTask.prototype.getFinishDate = function() -{var date = new Date(this.TaskInfo.EST);date.setDate(date.getDate() + parseInt((this.TaskInfo["Duration"]-1)/this.Chart.hoursInDay+1)-1);return date};GanttTask.prototype.getPercentCompleted = function() -{return this.TaskInfo.PercentCompleted};GanttTask.prototype.getPredecessorTaskId = function() -{return this.TaskInfo.PredecessorTaskId ? this.TaskInfo.PredecessorTaskId : null};GanttTask.prototype.getParentTaskId = function() -{return this.parentTask ? this.parentTask.getId() : null};GanttTask.prototype.moveDescTask = function() -{var posX = (parseInt(this.cTaskItem[0].style.left) + this.TaskInfo.Duration * this.Chart.hourInPixelsWork + 10);this.descrTask.style.left = posX + "px"};GanttTask.prototype.getMoveInfo = function() -{this.posX = parseInt(this.cTaskItem[0].style.left);var widthTaskItem = parseInt(this.cTaskItem[0].childNodes[0].firstChild.width);var posParentTaskItem = (this.parentTask == null) ? 0 : parseInt(this.parentTask.cTaskItem[0].style.left);var posPredTaskItem = (this.predTask == null) ? 0 : parseInt(this.predTask.cTaskItem[0].style.left) + parseInt(this.predTask.cTaskItem[0].childNodes[0].firstChild.width);var widthParentTaskItem = (this.parentTask == null) ? 0 : parseInt(this.parentTask.cTaskItem[0].childNodes[0].firstChild.width);var childPredPosX = 0;var childParentPosX = 0;var childParentPosXR = 0;if (this.childPredTask.length > 0){var posChildTaskItem = null;for (var n = 0;n < this.childPredTask.length;n++){if ((!posChildTaskItem)|| ((posChildTaskItem) && (posChildTaskItem > parseInt(this.childPredTask[n].cTaskItem[0].style.left)))) - {posChildTaskItem = parseInt(this.childPredTask[n].cTaskItem[0].style.left)}};childPredPosX = posChildTaskItem};if (this.childTask.length > 0){var posChildTaskItemR = null;for (var n = 0;n < this.childTask.length;n++){if ((!posChildTaskItemR)|| ((posChildTaskItemR) && (posChildTaskItemR > (parseInt(this.childTask[n].cTaskItem[0].style.left))))) - {posChildTaskItemR = parseInt(this.childTask[n].cTaskItem[0].style.left)}};childParentPosXR = posChildTaskItemR;var posChildTaskItem = null;for (var n = 0;n < this.childTask.length;n++){if ((!posChildTaskItem)|| ((posChildTaskItem) && (posChildTaskItem < (parseInt(this.childTask[n].cTaskItem[0].style.left) + parseInt(this.childTask[n].cTaskItem[0].firstChild.firstChild.width))))) - {posChildTaskItem = parseInt(this.childTask[n].cTaskItem[0].style.left) + parseInt(this.childTask[n].cTaskItem[0].firstChild.firstChild.width)}};childParentPosX = posChildTaskItem};if (!this.moveChild){if (this.childPredTask.length > 0){if (this.maxPosXMove < childPredPosX)this.maxPosXMove = childPredPosX};if (this.childTask.length > 0){if ((this.childPredTask.length > 0)&& (this.maxPosXMove - widthTaskItem) > childParentPosXR) this.maxPosXMove = this.maxPosXMove - ((this.maxPosXMove - widthTaskItem) - childParentPosXR);if (!(this.childPredTask.length > 0)) this.maxPosXMove = childParentPosXR + widthTaskItem;this.minPosXMove = (childParentPosX - widthTaskItem)};if (posParentTaskItem > 0){if ((!(this.childPredTask.length > 0)) && (this.childTask.length > 0)) {if (this.maxPosXMove > posParentTaskItem + widthParentTaskItem){this.maxPosXMove = posParentTaskItem + widthParentTaskItem}};if (this.minPosXMove <= posParentTaskItem){this.minPosXMove = posParentTaskItem};if ((!(this.childTask.length > 0)) && (!(this.childPredTask.length > 0))) {this.maxPosXMove = posParentTaskItem + widthParentTaskItem}else if ((!(this.childTask.length > 0)) && (this.childPredTask.length > 0)) {if ((posParentTaskItem + widthParentTaskItem)> posPredTaskItem) {this.maxPosXMove = childPredPosX}}};if (posPredTaskItem > 0){if (this.minPosXMove <= posPredTaskItem){this.minPosXMove = posPredTaskItem}};if ((posPredTaskItem == 0)&& (posParentTaskItem == 0)) {if (this.minPosXMove <= this.Chart.initialPos){this.minPosXMove = this.Chart.initialPos}}}else - {if ((posParentTaskItem > 0)&& (posPredTaskItem == 0)) - {this.minPosXMove = posParentTaskItem;this.maxPosXMove = posParentTaskItem + widthParentTaskItem}else if ((posParentTaskItem == 0)&& (posPredTaskItem == 0)) - {this.minPosXMove = this.Chart.initialPos;this.maxPosXMove = -1}else if ((posParentTaskItem > 0)&& (posPredTaskItem > 0)) - {this.minPosXMove = posPredTaskItem;this.maxPosXMove = posParentTaskItem + widthParentTaskItem}else if ((posParentTaskItem == 0)&& (posPredTaskItem > 0)) - {this.minPosXMove = posPredTaskItem;this.maxPosXMove = -1};if ((this.parentTask)&& (this.childPredTask.length > 0)) - {var posChildTaskItem = this.getMaxPosPredChildTaskItem(this);var posParentTaskItem = parseInt(this.parentTask.cTaskItem[0].style.left) + parseInt(this.parentTask.cTaskItem[0].firstChild.firstChild.width);this.maxPosXMove = this.posX + widthTaskItem + posParentTaskItem - posChildTaskItem}}};GanttTask.prototype.startResize = function(event) -{this.MouseX = event.screenX;this.getResizeInfo();if (this.Chart.isShowDescTask){this.hideDescTask()};this.checkResize = true;this.taskItemWidth = parseInt(this.cTaskItem[0].firstChild.firstChild.width);if (this.Chart._isFF)document.body.style.cursor = "e-resize"};GanttTask.prototype.getResizeInfo = function() -{var taskItem = this.cTaskItem[0];var posParentTaskItem = (this.parentTask == null) ? 0 : parseInt(this.parentTask.cTaskItem[0].style.left);var widthParentTaskItem = (this.parentTask == null) ? 0 : parseInt(this.parentTask.cTaskItem[0].childNodes[0].firstChild.width);var posTaskItem = parseInt(this.cTaskItem[0].style.left);var childPredPosX = 0;var childParentPosX = 0;if (this.childPredTask.length > 0){var posChildTaskItem = null;for (var n = 0;n < this.childPredTask.length;n++){if ((!posChildTaskItem)|| ((posChildTaskItem) && (posChildTaskItem > parseInt(this.childPredTask[n].cTaskItem[0].style.left)))) - {posChildTaskItem = parseInt(this.childPredTask[n].cTaskItem[0].style.left)}};childPredPosX = posChildTaskItem};if (this.childTask.length > 0){var posChildTaskItem = null;for (var n = 0;n < this.childTask.length;n++){if ((!posChildTaskItem)|| ((posChildTaskItem) && (posChildTaskItem < (parseInt(this.childTask[n].cTaskItem[0].style.left) + parseInt(this.childTask[n].cTaskItem[0].firstChild.firstChild.width))))) - {posChildTaskItem = parseInt(this.childTask[n].cTaskItem[0].style.left) + parseInt(this.childTask[n].cTaskItem[0].firstChild.firstChild.width)}};childParentPosX = posChildTaskItem};this.minWidthResize = this.Chart.dayInPixels;if (this.childTask.length > 0){this.minWidthResize = childParentPosX - posTaskItem};if ((this.childPredTask.length > 0)&& (!this.parentTask)) - {this.maxWidthResize = childPredPosX - posTaskItem}else if ((this.childPredTask.length > 0)&& (this.parentTask)) - {var w1 = posParentTaskItem + widthParentTaskItem - posTaskItem;var w2 = childPredPosX - posTaskItem;this.maxWidthResize = Math.min(w1, w2)}else if ((this.childPredTask.length == 0)&& (this.parentTask)) - {this.maxWidthResize = posParentTaskItem + widthParentTaskItem - posTaskItem}};GanttTask.prototype.createTaskItem = function() -{var self = this;this.posX = this.Chart.getPosOnDate(this.TaskInfo.EST);var itemControl = document.createElement("div");itemControl.id = this.TaskInfo.Id;itemControl.style.cssText = ";z-index:1;position:absolute;left:" + this.posX + "px;top:" + this.posY + "px;";var divTaskItem = document.createElement("div");itemControl.appendChild(divTaskItem);divTaskItem.style.cssText = "z-index:1;position: absolute;left:0px;top:0px;";var tblTaskItem = document.createElement("table");divTaskItem.appendChild(tblTaskItem);tblTaskItem.cellPadding = "0";tblTaskItem.cellSpacing = "0";tblTaskItem.width = this.TaskInfo.Duration * this.Chart.hourInPixelsWork + "px";tblTaskItem.style.cssText = "border: solid 1px #6589A9;";var rowTblTask = tblTaskItem.insertRow(tblTaskItem.rows.length);if (this.TaskInfo.PercentCompleted != 0){var cellTblTask = document.createElement("td");rowTblTask.appendChild(cellTblTask);cellTblTask.height = this.Chart.heightTaskItem + "px";cellTblTask.width = this.TaskInfo.PercentCompleted + "%";cellTblTask.style.lineHeight = "1px";var imgPr = document.createElement("img");imgPr.style.width = (this.TaskInfo.PercentCompleted * this.TaskInfo.Duration * this.Chart.hourInPixelsWork) / 100 + "px";imgPr.style.height = this.Chart.heightTaskItem + "px";cellTblTask.appendChild(imgPr);imgPr.src = this.Chart.imgs + "progress_filled.png"};if (this.TaskInfo.PercentCompleted != 100){var cellTblTask = document.createElement("td");rowTblTask.appendChild(cellTblTask);cellTblTask.height = this.Chart.heightTaskItem + "px";cellTblTask.width = (100 - this.TaskInfo.PercentCompleted) + "%";cellTblTask.style.lineHeight = "1px";var imgPrF = document.createElement("img");imgPrF.style.width = ((100 - this.TaskInfo.PercentCompleted) * this.TaskInfo.Duration * this.Chart.hourInPixelsWork) / 100 + "px";imgPrF.style.height = this.Chart.heightTaskItem + "px";cellTblTask.appendChild(imgPrF);imgPrF.src = this.Chart.imgs + "progress_bg.png"};if (this.Chart.isEditable){var divTaskInfo = document.createElement("div");divTaskInfo.style.cssText = "text-align:center;font-size:9px;z-index:2;position: absolute;left:0px;top:0px;";var tblTaskInfo = document.createElement("table");divTaskInfo.appendChild(tblTaskInfo);tblTaskInfo.cellPadding = "0";tblTaskInfo.cellSpacing = "0";tblTaskInfo.height = this.Chart.heightTaskItem + "px";tblTaskInfo.width = this.TaskInfo.Duration * this.Chart.hourInPixelsWork + "px";var rowTaskInfo = tblTaskInfo.insertRow(0);var cellTaskInfo = document.createElement("TD");cellTaskInfo.align = "center";cellTaskInfo.vAlign = "top";cellTaskInfo.height = this.Chart.heightTaskItem + "px";cellTaskInfo.className = "moveInfo";cellTaskInfo.style.cssText = ";white-space:nowrap;font-size:9px";rowTaskInfo.appendChild(cellTaskInfo);itemControl.appendChild(divTaskInfo)};var divTaskName = document.createElement("div");itemControl.appendChild(divTaskName);divTaskName.style.cssText = ";z-index:2;position: absolute;left:0px;top:0px;";var divMove = document.createElement("div");divMove.innerHTML = "";if (this.Chart._isIE){divMove.style.background = "#000000";divMove.style.filter = "alpha(opacity=0)"};divMove.style.height = this.Chart.heightTaskItem + "px";divMove.style.width = this.TaskInfo.Duration * this.Chart.hourInPixelsWork + "px";divTaskName.appendChild(divMove);if (this.Chart._showTooltip){var getPopUpInfo = function(e) {if ((!self.Chart._isMove)&& (!self.Chart._isResize)) self.getPopUpInfo(self.cTaskItem[0], e)};var closePopUpInfo = function() {self.closePopUpInfo()};this.addEvent(divMove, 'mouseover', getPopUpInfo, false);this.addEvent(divMove, 'mouseout', closePopUpInfo, false)};var taskClick = function() {self.Chart.callEvent("onTaskClick", [self])};this.addEvent(divMove, 'click', taskClick, false);if (this.Chart.isEditable){var divResize = document.createElement("div");divResize.style.cssText = ";z-index:10;position: absolute;left:" + (this.TaskInfo.Duration * this.Chart.hourInPixelsWork - 10) + "px;top:0px;";divResize.style.height = this.Chart.heightTaskItem + "px";divResize.style.width = "10px";divResize.innerHTML = "";divTaskName.appendChild(divResize);var startMove = function(e) {if (self.Chart.callEvent("onTaskStartDrag", [self])===false) return;var moveItem = function(e1) {if (self.checkMove)self.moveItem(e1)};var endMove = function() {if (self.checkMove){self.endMove();self.Chart._isMove = false;if (self.Chart._isIE){document.body.releaseCapture();document.detachEvent("onmousemove", moveItem);document.detachEvent("onmouseup", endMove)}else {document.removeEventListener("mousemove", moveItem, true);document.removeEventListener("mouseup", endMove, true)};if (self.wasMoved)self.Chart.callEvent("onTaskEndDrag", [self])}};self.addEvent(document, 'mousemove', moveItem, true);self.addEvent(document, 'mouseup', endMove, true);if (self.Chart._showTooltip)self.closePopUpInfo();self.startMove(e);self.Chart._isMove = true;if (self.Chart._isIE)document.body.setCapture(false)};var startResize = function(e) {if (self.Chart.callEvent("onTaskStartResize", [self])===false) return;var resizeItem = function(e1) {if (self.checkResize)self.resizeItem(e1)};var endResizeItem = function() {if (self.checkResize){self.endResizeItem();self.Chart._isResize = false;if (self.Chart._isIE){document.body.releaseCapture();document.detachEvent("onmousemove", resizeItem);document.detachEvent("onmouseup", endResizeItem)}else {document.removeEventListener("mousemove", resizeItem, true);document.removeEventListener("mouseup", endResizeItem, true)};if (self.wasResized)self.Chart.callEvent("onTaskEndResize", [self])}};self.addEvent(document, 'mousemove', resizeItem, false);self.addEvent(document, 'mouseup', endResizeItem, false);self.startResize(e);if (self.Chart._isIE)document.body.setCapture(false);self.Chart._isResize = true};this.addEvent(divMove, 'mousedown', startMove, false);this.addEvent(divResize, 'mousedown', startResize, false);var setCursorResize = function(e2) {if (!self.Chart._isMove)(e2.srcElement?e2.srcElement:e2.target).style.cursor = "e-resize"};var setCursorStandart = function(e3) {if (!self.checkResize)(e3.srcElement?e3.srcElement:e3.target).style.cursor = ""};this.addEvent(divResize, 'mouseover', setCursorResize, false);this.addEvent(divResize, 'mouseout', setCursorStandart, false)};return itemControl};GanttTask.prototype.createTaskNameItem = function(hasChildren) -{var self = this;var divName = document.createElement("div");divName.id = this.TaskInfo.Id;divName.style.cssText = "cursor:pointer;white-space:nowrap;height:15px;z-index:1;position:absolute;left:20px;top: " + this.posY + "px;";if (hasChildren)divName.style.fontWeight = "bold";divName.className = "taskNameItem";divName.title = this.TaskInfo.Name;divName.innerHTML = this.TaskInfo.Name;if (this.Chart.isShowConMenu){var showContMenu = function(event) {if (self.Chart.contextMenu.clear)self.Chart.contextMenu.clear();var hideContMenu = function() {self.Chart.contextMenu.hideContextMenu();if (self.Chart._isIE)self.Chart.content.detachEvent("mousedown", hideContMenu);else - self.Chart.content.removeEventListener("mousedown", hideContMenu, false)};self.Chart.content.onmousedown = hideContMenu;if (!self.Chart._isIE){event.stopPropagation()}else - {event.cancelBubble = true};self.Chart._showContextMenu(event, self)};if (this.Chart._isIE){this.addEvent(divName, "contextmenu", function(e) {showContMenu(e);return false}, false)}else - {this.addEvent(divName, "contextmenu", function(e) {e.preventDefault();showContMenu(e)}, false)}};return divName};GanttTask.prototype.createTaskDescItem = function() -{var posX = (this.posX + this.TaskInfo.Duration * this.Chart.hourInPixelsWork + 10);var divDesc = document.createElement("div");divDesc.style.cssText += ";z-index:1;position:absolute;left:" + posX + "px;top:" + this.posY + "px;";divDesc.innerHTML = this.getDescStr();divDesc.className = "descTask";this.descrTask = divDesc;if (this.Chart._showTooltip){var self = this;var getPopUpInfo = function(e) {if ((!self.Chart._isMove)&& (!self.Chart._isResize)) self.getPopUpInfo(self.descrTask, e)};var closePopUpInfo = function() {self.closePopUpInfo()};this.addEvent(divDesc, 'mouseover', getPopUpInfo, false);this.addEvent(divDesc, 'mouseout', closePopUpInfo, false)};return divDesc};GanttTask.prototype.checkWidthTaskNameItem = function() -{if (this.cTaskNameItem[0].offsetWidth + this.cTaskNameItem[0].offsetLeft > this.Chart.maxWidthPanelNames){var width = this.cTaskNameItem[0].offsetWidth + this.cTaskNameItem[0].offsetLeft - this.Chart.maxWidthPanelNames;var countChar = Math.round(width / (this.cTaskNameItem[0].offsetWidth / this.cTaskNameItem[0].firstChild.length));var tName = this.TaskInfo.Name.substring(0, this.cTaskNameItem[0].firstChild.length - countChar - 3);tName += "...";this.cTaskNameItem[0].innerHTML = tName}};GanttTask.prototype.create = function() -{var containerTasks = this.Chart.oData.firstChild;var containerNames = null;if (this.Chart._showTreePanel)containerNames = this.Chart.panelNames.firstChild;var predecessorTask = this.TaskInfo.PredecessorTask;var parentTask = this.TaskInfo.ParentTask;var isCParentTask = (this.TaskInfo.ChildTasks.length > 0);var self = this;this.cTaskItem = [];this.cTaskNameItem = [];if (!parentTask){if (this.TaskInfo.previousParentTask){this.previousParentTask = this.Project.getTaskById(this.TaskInfo.previousParentTask.Id);var lastChildTask = this.Chart.getLastChildTask(this.previousParentTask);this.posY = parseInt(lastChildTask.cTaskItem[0].style.top) + this.Chart.heightTaskItem + 11;this.previousParentTask.nextParentTask = this}else {this.posY = parseInt(this.Project.projectItem[0].style.top) + this.Chart.heightTaskItem + 11}};if (parentTask){var task = this.Project.getTaskById(this.TaskInfo.ParentTask.Id);this.parentTask = task;if (this.TaskInfo.previousChildTask){this.previousChildTask = this.Project.getTaskById(this.TaskInfo.previousChildTask.Id);var lastChildTask = this.Chart.getLastChildTask(this.previousChildTask);this.posY = parseInt(lastChildTask.cTaskItem[0].style.top) + this.Chart.heightTaskItem + 11;this.previousChildTask.nextChildTask = this}else {this.posY = parseInt(task.cTaskItem[0].style.top) + this.Chart.heightTaskItem + 11};task.childTask.push(this)};if (predecessorTask){var task = this.Project.getTaskById(predecessorTask.Id);this.predTask = task;task.childPredTask.push(this)};this.cTaskItem.push(this.createTaskItem());containerTasks.appendChild(this.cTaskItem[0]);if (this.Chart.panelNames){this.cTaskNameItem.push(this.createTaskNameItem(isCParentTask));this.Chart.panelNames.firstChild.appendChild(this.cTaskNameItem[0])};if (this.Chart.isShowDescTask){containerTasks.appendChild(this.createTaskDescItem())};var arrConnectingLines = [];if (predecessorTask)arrConnectingLines = this.createConnectingLinesDS();this.cTaskItem.push(arrConnectingLines);if (this.Chart.panelNames){var arrConnectingLinesNames = [];if (parentTask){this.cTaskNameItem[0].style.left = parseInt(this.parentTask.cTaskNameItem[0].style.left) + 15 + "px";arrConnectingLinesNames = this.createConnectingLinesPN()};this.checkWidthTaskNameItem();var treeImg = null;if (isCParentTask)treeImg = this.createTreeImg();this.cTaskNameItem.push(arrConnectingLinesNames);this.cTaskNameItem.push(treeImg)};this.addDayInPanelTime();return this};GanttTask.prototype.createTreeImg = function() -{var self = this;var treeImg = new Image();treeImg.src = this.Chart.imgs + "minus.gif";treeImg.id = this.TaskInfo.Id;treeImg.onclick = function() - {if (self._isOpen){this.src = self.Chart.imgs + "plus.gif";self._isOpen = false;self.hideChildTasks(self);self.shiftCurrentTasks(self, -self._heightHideTasks)}else - {this.src = self.Chart.imgs + "minus.gif";self._isOpen = true;self.shiftCurrentTasks(self, self._heightHideTasks);self.showChildTasks(self, true);self._heightHideTasks = 0}};this.Chart.panelNames.firstChild.appendChild(treeImg);treeImg.style.cssText = "cursor:pointer;left:" + (parseInt(this.cTaskNameItem[0].style.left) - 12) + "px;top:" + (parseInt(this.cTaskNameItem[0].style.top) + 3) + "px;z-index:12;position:absolute;";return treeImg};GanttChart.prototype.getLastChildTask = function(task) -{if (task.childTask.length > 0){return this.getLastChildTask(task.childTask[task.childTask.length - 1])}else - {return task}};dhtmlXMLSenderObject = function(ganttChart) -{this.xmlHttp = this.createXMLHttpRequest();this.isProcessed = false;this.path = null;this.filename = null;this.Chart = ganttChart};dhtmlXMLSenderObject.prototype.createXMLHttpRequest = function() -{if (window.XMLHttpRequest){return new XMLHttpRequest()}else if (window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}};dhtmlXMLSenderObject.prototype.sendData = function(filename, path, xmlData) -{var self = this;this.path = path;this.filename = filename;if ((this.path == null)|| (this.path == "")) - {this.Chart.Error.throwError("DATA_SEND_ERROR", 3, null);return};if ((this.filename == null)|| (this.filename == "")) - {this.Chart.Error.throwError("DATA_SEND_ERROR", 4, null);return};this.isProcessed = true;this.xmlHttp.open("POST", this.path, true);if (this.Chart._isFF){this.xmlHttp.onerror = function() {self.xmlHttp.onreadystatechange = null;self.xmlHttp.abort();self.isProcessed = false}};this.xmlHttp.onreadystatechange = function() {self.getStatus()};this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");this.xmlHttp.send("data=" + encodeURI(xmlData) + "&filename=" + filename)};dhtmlXMLSenderObject.prototype.getStatus = function() -{if (this.xmlHttp.readyState == 4){var _status = "";try {_status = this.xmlHttp.status}catch(e) {this.Chart.Error.throwError("DATA_SEND_ERROR", 1, null);return 0};switch (_status) {case 0: - this.Chart.Error.throwError("DATA_SEND_ERROR", 1, null);break;case 404: - this.Chart.Error.throwError("DATA_SEND_ERROR", 5, [this.path]);break;case 500: - this.Chart.Error.throwError("DATA_SEND_ERROR", 2, null);break;case 12029: - this.Chart.Error.throwError("DATA_SEND_ERROR", 1, null);break;default: - if (!(_status >= 200 && _status < 300 || _status == 304)) - {this.Chart.Error.throwError("DATA_SEND_ERROR", 0, null)};break};this.isProcessed = false}};function GanttError() {this.catches = [];this._errors = [];this._init();return this};GanttError.prototype._init = function() -{this._errors[0] = "Connection error";this._errors[1] = "Cannot connect";this._errors[2] = "Server error";this._errors[3] = "Path is null or empty";this._errors[4] = "Filename is null or empty";this._errors[5] = "File (%0) is not found";this._errors[6] = "Percent Complete should be a number";this._errors[7] = "Percent Complete should be <= 100";this._errors[8] = "Percent Complete should be >= 0";this._errors[9] = "Increase duration of task(%0)";this._errors[10] = "Reduce duration of task(%0)";this._errors[11] = "Increase EST of child task (%0)";this._errors[12] = "Reduce EST of task (%0)";this._errors[13] = "The project (%0) is added";this._errors[14] = "Start Date of the project < start Date of the control";this._errors[15] = "Task (%0) cannot be the child of predecessor task(%1)";this._errors[16] = "Time of the termination of predecessor task(%0) > EST of child task(%1)";this._errors[17] = "The Predecessor (%0) task does not exist";this._errors[18] = "The EST of task (%0) < start date of the control";this._errors[19] = "Time of the termination of parent task (%0) < time of the termination of child task(%1)";this._errors[20] = "The EST of task (%0) < EST of parent task(%1)";this._errors[21] = "The parent task (%0) does not exist";this._errors[22] = "The task (%0) is added";this._errors[23] = "The project (%0) is added";this._errors[24] = "Task (%0) EST < project (%1) startDate";this._errors[25] = "Parent task (%0) EST cannot be null";this._errors[26] = "Predecessor task (%0) position error. Reduce duration of predecessor task (%0) or increase EST of child task (%1)";this._errors[27] = "Predecessor task (%0) does not exist";this._errors[28] = "Increase duration of parent task (%0) or reduce EST of child task (%1) or reduce duration of child task(%1)";this._errors[29] = "Reduce EST of parent task (%0) or increase EST of child task (%1)";this._errors[30] = "The task(%0) does not exist";this._errors[31] = "The project(%0) does not exist";this._errors[32] = "Predecessor task(%0) and child task(%1) should have the same parent";this._errors[33] = "Reduce EST of parent task (%0) or increase EST of child task (%1)";this._errors[34] = "EST of task(%0) < start date of the project(%1)";this._errors[35] = "Percent Complete should be <= 100 and >= 0";this._errors[36] = "You may not connect a task to itself.";this._errors[37] = "Cannot parse this XML string."};GanttError.prototype.catchError = function(type, handler) {this.catches[type] = handler};GanttError.prototype.getErrorString = function(str, params) -{if (!params){return str}else {for (var i = 0;i < params.length;i++){var re = new RegExp("%" + i, "gi");str = str.replace(re, params[i])};return str}};GanttError.prototype.throwError = function(type, description, params) {if (this.catches[type]){var index = parseInt(description);var errorStr = this.getErrorString(this._errors[index], params);return this.catches[type](type, errorStr, params)};return null};function contextMenu(chart) -{this.Chart = chart;this.TabContainer = null;this.MenuPanel = null;this.tabPanel = null;this.arrTabs = [];this.isShow = false;this.hideDiv = null;this._init()};contextMenu.prototype._init = function() -{this.createMenuPanel();this.createHideDiv();this.createTabContainer();this.createTabPanel();var self = this;var arrItems = [];var tab1 = this.createTab(1, "Rename task", "t", true, this);tab1.addItem(1, "New name", document.createElement("input"), "text", function() {tab1.arrItems[0].control.focus()});tab1.addItem(2, "Rename", document.createElement("input"), "button", - function() {var name = tab1.arrItems[0].control.value;try {tab1.object.setName(name);tab1.hide()}catch(e) {}});var tab2 = this.createTab(2, "Delete task", "t", true, this);tab2.addItem(1, "Delete", document.createElement("input"), "button", - function() - {try {tab2.object.Project.deleteTask(tab2.object.TaskInfo.Id);tab2.hide()}catch(e) {}});var tab3 = this.createTab(3, "Set EST", "t", true, this);tab3.addItem(1, "EST", document.createElement("input"), "text", function() {tab3.arrItems[0].control.focus()});tab3.addItem(2, "Move children", document.createElement("input"), "checkbox", function() {tab3.arrItems[1].control.focus()});tab3.addItem(3, "Update", document.createElement("input"), "button", - function() {var isMoveChild = tab3.arrItems[1].control.checked;var arr = tab3.arrItems[0].control.value.split(".");var est = (arr.length < 3) ? null : (new Date(arr[2], parseInt(arr[1]) - 1, arr[0]));try {if (tab3.object.setEST(est, isMoveChild)) tab3.hide()}catch(e) {}});var tab4 = this.createTab(4, "Set duration", "t", true, this);tab4.addItem(1, "Duration", document.createElement("input"), "text", function() {tab4.arrItems[0].control.focus()});tab4.addItem(2, "Update", document.createElement("input"), "button", - function() {var d = tab4.arrItems[0].control.value;try {if (tab4.object.setDuration(d)) tab4.hide()}catch(e) {}});var tab5 = this.createTab(5, "Set % complete", "t", true, this);tab5.addItem(1, "Percent Complete", document.createElement("input"), "text", function() {tab5.arrItems[0].control.focus()});tab5.addItem(2, "Update", document.createElement("input"), "button", - function() {var p = tab5.arrItems[0].control.value;try {if (tab5.object.setPercentCompleted(p)) tab5.hide()}catch(e) {}});var tab13 = this.createTab(13, "Set predecessor", "t", true, this);tab13.addItem(1, "Predecessor", document.createElement("input"), "text", function() {tab13.arrItems[0].control.focus()});tab13.addItem(2, "Update", document.createElement("input"), "button", - function() {var p = tab13.arrItems[0].control.value;try {if (tab13.object.setPredecessor(p)) tab13.hide()}catch(e) {}});var tab6 = this.createTab(6, "Rename project", "p", true, this);tab6.addItem(1, "New name", document.createElement("input"), "text", function() {tab6.arrItems[0].control.focus()});tab6.addItem(2, "Rename", document.createElement("input"), "button", - function() {var name = tab6.arrItems[0].control.value;try {tab6.object.setName(name);tab6.hide()}catch(e) {}});var tab7 = this.createTab(7, "Delete project", "p", true, this);tab7.addItem(1, "Delete", document.createElement("input"), "button", - function() {try {tab7.object.Chart.deleteProject(tab7.object.Project.Id);tab7.hide()}catch(e) {}});var tab8 = this.createTab(8, "Set % complete", "p", true, this);tab8.addItem(1, "Percent Complete", document.createElement("input"), "text", function() {tab8.arrItems[0].control.focus()});tab8.addItem(2, "Update", document.createElement("input"), "button", - function() {var p = tab8.arrItems[0].control.value;try {if (tab8.object.setPercentCompleted(p)) tab8.hide()}catch(e) {}});var tab9 = this.createTab(9, "Add new task", "p", true, this);tab9.addItem(1, "Id", document.createElement("input"), "text", function() {tab9.arrItems[0].control.focus()});tab9.addItem(2, "Name", document.createElement("input"), "text", function() {tab9.arrItems[1].control.focus()});tab9.addItem(3, "EST", document.createElement("input"), "text", function() {tab9.arrItems[2].control.focus()});tab9.addItem(4, "Duration", document.createElement("input"), "text", function() {tab9.arrItems[3].control.focus()});tab9.addItem(5, "Percent complete", document.createElement("input"), "text", function() {tab9.arrItems[4].control.focus()});tab9.addItem(6, "Parent task id", document.createElement("input"), "text", function() {tab9.arrItems[5].control.focus()});tab9.addItem(7, "Pred task id", document.createElement("input"), "text", function() {tab9.arrItems[6].control.focus()});tab9.addItem(9, "Insert", document.createElement("input"), "button", - function() {try {var id = tab9.arrItems[0].control.value;var name = tab9.arrItems[1].control.value;var arr = tab9.arrItems[2].control.value.split(".");var est = (arr.length < 3) ? null : (new Date(arr[2], parseInt(arr[1]) - 1, arr[0]));var duration = tab9.arrItems[3].control.value;var pc = tab9.arrItems[4].control.value;var parentTaskId = tab9.arrItems[5].control.value;var predTaskId = tab9.arrItems[6].control.value;if (tab9.object.insertTask(id, name, est, duration, pc, predTaskId, parentTaskId)) tab9.hide()}catch(e) {}});var tab11 = this.createTab(11, "Add successor task", "t", true, this);tab11.addItem(1, "Id", document.createElement("input"), "text", function() {tab11.arrItems[0].control.focus()});tab11.addItem(2, "Name", document.createElement("input"), "text", function() {tab11.arrItems[1].control.focus()});tab11.addItem(3, "EST", document.createElement("input"), "text", function() {tab11.arrItems[2].control.focus()});tab11.addItem(4, "Duration", document.createElement("input"), "text", function() {tab11.arrItems[3].control.focus()});tab11.addItem(5, "Percent complete", document.createElement("input"), "text", function() {tab11.arrItems[4].control.focus()});tab11.addItem(6, "Insert", document.createElement("input"), "button", - function() {try {var pr = tab11.object.Project;var id = tab11.arrItems[0].control.value;var name = tab11.arrItems[1].control.value;var arr = tab11.arrItems[2].control.value.split(".");var est = (arr.length < 3) ? null : (new Date(arr[2], parseInt(arr[1]) - 1, arr[0]));var duration = tab11.arrItems[3].control.value;var pc = tab11.arrItems[4].control.value;var parentTaskId = (tab11.object.parentTask == null) ? "" : tab11.object.parentTask.TaskInfo.Id;var predTaskId = tab11.object.TaskInfo.Id;if (pr.insertTask(id, name, est, duration, pc, predTaskId, parentTaskId)) tab11.hide()}catch(e) {}});var tab10 = this.createTab(10, "Add child task", "t", true, this);tab10.addItem(1, "Id", document.createElement("input"), "text", function() {tab10.arrItems[0].control.focus()});tab10.addItem(2, "Name", document.createElement("input"), "text", function() {tab10.arrItems[1].control.focus()});tab10.addItem(3, "EST", document.createElement("input"), "text", function() {tab10.arrItems[2].control.focus()});tab10.addItem(4, "Duration", document.createElement("input"), "text", function() {tab10.arrItems[3].control.focus()});tab10.addItem(5, "Percent complete", document.createElement("input"), "text", function() {tab10.arrItems[4].control.focus()});tab10.addItem(6, "Insert", document.createElement("input"), "button", - function() {try {var pr = tab10.object.Project;var id = tab10.arrItems[0].control.value;var name = tab10.arrItems[1].control.value;var arr = tab10.arrItems[2].control.value.split(".");var est = (arr.length < 3) ? null : (new Date(arr[2], parseInt(arr[1]) - 1, arr[0]));var duration = tab10.arrItems[3].control.value;var pc = tab10.arrItems[4].control.value;var parentTaskId = tab10.object.TaskInfo.Id;var predTaskId = "";if (pr.insertTask(id, name, est, duration, pc, predTaskId, parentTaskId)) tab10.hide()}catch(e) {}});var tab12 = this.createTab(12, "-Insert new project-", "p", false, this);tab12.addItem(1, "Id", document.createElement("input"), "text", function() {tab12.arrItems[0].control.focus()});tab12.addItem(2, "Name", document.createElement("input"), "text", function() {tab12.arrItems[1].control.focus()});tab12.addItem(3, "Start date", document.createElement("input"), "text", function() {tab12.arrItems[2].control.focus()});tab12.addItem(4, "Insert", document.createElement("input"), "button", - function() {try {var id = tab12.arrItems[0].control.value;var namePr = tab12.arrItems[1].control.value;var arr = tab12.arrItems[2].control.value.split(".");var startDatePr = (arr.length < 3) ? null : (new Date(arr[2], parseInt(arr[1]) - 1, arr[0]));if (self.Chart.insertProject(id, namePr, startDatePr)) tab12.hide()}catch(e) {}})};contextMenu.prototype.createHideDiv = function() -{this.hideDiv = document.createElement("div");this.hideDiv.style.position = "absolute";this.hideDiv.style.left = "0px";this.hideDiv.style.top = "0px";this.Chart.content.appendChild(this.hideDiv);this.hideDiv.style.zIndex = 12;this.hideDiv.style.display = "none";this.hideDiv.style.background = "#7D7E7D";this.hideDiv.style.cssText += ";-moz-opacity: 0.5;filter: alpha(opacity=50);opacity:.50;";this.hideDiv.style.width = this.Chart.content.offsetWidth + 2 + "px";this.hideDiv.style.height = this.Chart.content.offsetHeight + 2 + "px"};contextMenu.prototype.createMenuPanel = function() -{this.MenuPanel = document.createElement("div");this.MenuPanel.style.visibility = "hidden";this.MenuPanel.style.cssText += ";z-index:10;";this.MenuPanel.style.position = "absolute";this.Chart.content.appendChild(this.MenuPanel);this.MenuPanel.innerHTML = "
";this.MenuPanel.firstChild.className = "contextMenu";this.MenuPanel.firstChild.cellPadding = 0;this.MenuPanel.firstChild.cellSpacing = 0;this.MenuPanel.firstChild.style.cssText += ";background:url(" + this.Chart.imgs + "menu/menu_bg.png);"};contextMenu.prototype.createTabPanel = function() -{this.tabPanel = document.createElement("div");this.tabPanel.style.visibility = "hidden";this.tabPanel.style.zIndex = "30";this.TabContainer.firstChild.rows[0].cells[0].appendChild(this.tabPanel);this.tabPanel.style.width = "385px";this.tabPanel.style.height = "290px";this.tabPanel.innerHTML = "
";this.tabPanel.firstChild.cellPadding = 0;this.tabPanel.firstChild.cellSpacing = 0;this.tabPanel.firstChild.style.cssText = "width:385px;border: 1px solid #808080;";this.tabPanel.firstChild.rows[0].cells[0].style.cssText = ";height:26px;background:url(" + this.Chart.imgs + "/menu/window_tr.png);background-repeat: no-repeat;color:#fff;font-size:14px;font-weight: bold;font-family: Tahoma, Arial";this.tabPanel.firstChild.rows[0].cells[0].align = "center";this.tabPanel.firstChild.rows[1].cells[0].style.cssText = ";height:270px;background:#F7F7F7;";this.tabPanel.firstChild.rows[1].cells[0].innerHTML = "
";this.tabPanel.firstChild.rows[1].cells[0].firstChild.style.cssText = "width:250px;font-size:11px;font-family:Tahoma,Arial;";this.tabPanel.firstChild.rows[1].cells[0].align = "center"};contextMenu.prototype.addItemMenuPanel = function(tab) -{var self = this;var row = this.MenuPanel.firstChild.insertRow(this.MenuPanel.firstChild.rows.length);var cell = document.createElement('td');cell.innerHTML = tab.Description;cell.style.cssText = "padding-left:10px;height:18px;";this.addEvent(cell, "mousedown", function() {tab.show()}, false);cell.onmouseover = function() {this.style.background = "url(" + self.Chart.imgs + "menu/menu_selection.png)"};cell.onmouseout = function() {this.style.background = ""};row.appendChild(cell)};contextMenu.prototype.showContextMenu = function(x, y, object) -{if (object.constructor == GanttTask){for (var i = 0;i < this.arrTabs.length;i++){if (this.arrTabs[i].type == "t"){this.arrTabs[i].object = object;this.addItemMenuPanel(this.arrTabs[i])}}}else if (object.constructor == GanttProject){for (var i = 0;i < this.arrTabs.length;i++){if (this.arrTabs[i].type == "p"){this.arrTabs[i].object = object;this.addItemMenuPanel(this.arrTabs[i])}}};this.isShow = true;this.MenuPanel.style.cssText += ";z-index:15;";this.MenuPanel.style.visibility = "visible";this.MenuPanel.style.top = parseInt(y) + this.Chart.heightTaskItem - this.Chart.oData.scrollTop + 5 + "px";this.MenuPanel.style.left = x};contextMenu.prototype.hideContextMenu = function() -{this.isShow = false;this.MenuPanel.style.visibility = "hidden"};contextMenu.prototype.clear = function() -{this.MenuPanel.removeChild(this.MenuPanel.firstChild);this.MenuPanel.innerHTML = "
";this.MenuPanel.firstChild.className = "contextMenu";this.MenuPanel.firstChild.cellPadding = 0;this.MenuPanel.firstChild.cellSpacing = 0;this.MenuPanel.firstChild.style.cssText += ";background:url(" + this.Chart.imgs + "menu/menu_bg.png);"};contextMenu.prototype.createTab = function(id, desc, type, showOInfo, menu) -{var tab = new contextMenuTab(id, desc, type, showOInfo, menu);this.arrTabs.push(tab);return tab};contextMenu.prototype.createTabContainer = function() -{this.TabContainer = document.createElement("div");this.TabContainer.style.position = "absolute";this.TabContainer.style.top = "0px";this.TabContainer.style.left = "0px";this.TabContainer.style.visibility = "hidden";this.TabContainer.style.zIndex = "50";this.Chart.content.appendChild(this.TabContainer);this.TabContainer.innerHTML = "
";this.TabContainer.firstChild.style.cssText = ";width:100%;height:100%;";this.TabContainer.firstChild.rows[0].cells[0].align = "center";this.TabContainer.style.width = this.Chart.content.offsetWidth + 2 + "px";this.TabContainer.style.height = this.Chart.content.offsetHeight + 2 + "px"};contextMenu.prototype.getTabById = function(id) -{for (var i = 0;i < this.arrTabs.length;i++){if (this.arrTabs[i].Id == id){return this.arrTabs[i]}};return null};function contextMenuTab(id, description, type, showOInfo, contextMenu) -{this.Id = id;this.arrItems = [];this.TabItemContainer = null;this.Description = description;this.contextMenu = contextMenu;this.type = type;this.object = null;this.showObjectInfo = showOInfo};contextMenu.prototype.addEvent = function (elm, evType, fn, useCapture) -{if (elm.addEventListener){elm.addEventListener(evType, fn, useCapture);return true}else if (elm.attachEvent){return elm.attachEvent('on' + evType, fn)}else {elm['on' + evType] = fn}};contextMenuTab.prototype.addItem = function(id, name, control, type, handler) -{if (handler){control.onclick = handler};control.type = type;if (type == "button"){control.value = name};var tabItem = new contextMenuTabItem(id, name, control, this);this.arrItems.push(tabItem)};contextMenuTab.prototype.show = function() -{this.contextMenu.hideDiv.style.display = "inline";this.contextMenu.TabContainer.style.visibility = "visible";var self = this;this.contextMenu.tabPanel.firstChild.rows[0].cells[0].innerHTML = this.Description;this.contextMenu.tabPanel.style.visibility = "visible";var t = this.contextMenu.tabPanel.firstChild.rows[1].cells[0].firstChild;var c,c2,r = null;if (this.showObjectInfo){if (this.object){if (this.object.constructor == GanttTask){this.insertData(t, "Id", this.object.TaskInfo.Id);this.insertData(t, "Name", this.object.TaskInfo.Name);this.insertData(t, "Duration", this.object.TaskInfo.Duration + " hrs");this.insertData(t, "Percent complete", this.object.TaskInfo.PercentCompleted + "%");this.insertData(t, "EST", this.object.TaskInfo.EST.getDate() + "." + (this.object.TaskInfo.EST.getMonth() + 1) + "." + this.object.TaskInfo.EST.getFullYear());this.insertData(t, "Predecessor", this.object.TaskInfo.PredecessorTaskId)}else - {this.insertData(t, "Id", this.object.Project.Id);this.insertData(t, "Name", this.object.Project.Name);this.insertData(t, "Start date", this.object.Project.StartDate.getDate() + "." + (this.object.Project.StartDate.getMonth() + 1) + "." + this.object.Project.StartDate.getFullYear())}}};var btnCell = null;for (var i = 0;i < this.arrItems.length;i++){if (this.arrItems[i].control.type == "button"){r = t.insertRow(t.rows.length);c = r.insertCell(r.cells.length);btnCell = r.insertCell(r.cells.length);btnCell.appendChild(this.arrItems[i].control)}else - {r = t.insertRow(t.rows.length);c = r.insertCell(r.cells.length);c2 = r.insertCell(r.cells.length);c.innerHTML = this.arrItems[i].Name;c2.appendChild(this.arrItems[i].control)}};var b = document.createElement("input");b.type = "button";b.value = "Cancel";b.onclick = function() - {self.hide()};if (!btnCell){r = t.insertRow(t.rows.length);c = r.insertCell(r.cells.length);btnCell = r.insertCell(r.cells.length)}else {b.style.marginLeft = "10px"};btnCell.appendChild(b)};contextMenuTab.prototype.hide = function() -{this.contextMenu.tabPanel.style.visibility = "hidden";var t = this.contextMenu.tabPanel.firstChild.rows[1].cells[0].firstChild;t.parentNode.removeChild(t);this.contextMenu.tabPanel.firstChild.rows[1].cells[0].innerHTML = "
";this.contextMenu.tabPanel.firstChild.rows[1].cells[0].firstChild.style.cssText = "width:250px;font-size:11px;font-family:Tahoma,Arial;";this.contextMenu.hideDiv.style.display = "none";this.contextMenu.TabContainer.style.visibility = "hidden"};contextMenuTab.prototype.insertData = function(t, name, value) -{var c,c2,r = null;r = t.insertRow(t.rows.length);c = r.insertCell(r.cells.length);c.style.cssText = "width:100px";c.innerHTML = name;c2 = r.insertCell(r.cells.length);c2.innerHTML = value};contextMenuTab.prototype.insertControl = function(t, name, value) -{var c,c2,r = null;r = t.insertRow(t.rows.length);c = r.insertCell(r.cells.length);c.innerHTML = name;c2 = r.insertCell(r.cells.length);c2.appendChild(value)};function contextMenuTabItem(id, name, control, tab) -{this.Id = id;this.Name = name;this.control = control;this.tab = tab}; -//v.1.3 build 9733 - -/* -Copyright DHTMLX LTD. http://www.dhtmlx.com -*/ \ No newline at end of file diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/arr.gif b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/arr.gif deleted file mode 100644 index 3bd086371b23ad0c66f4083e3a6f760f95c4a826..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmZ?wbhEHbYg>zAEawExE5-B))+ z&k8MCk()R-`v3p`7apHKcym9H!9X-n{K>+|z#zz=1JVJqlYvz}L8b38<3wcvlM~KN a=K@xAatL%MOz3I)cVIz*hfbFhgEaufL^X*3 diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png deleted file mode 100644 index 82ef54a0696a00f6756dfc2ea0e69f1fe08cc0de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 95 zcmeAS@N?(olHy`uVBq!ia0vp^j6kf%!3-qt88$}%Db4_&5ZC|z|Ns8;`}3F2c8+SV sfr5gbE{-7_vdIZa2`W-Xh7(vA*d-aHR^BN62$W>-boFyt=akR{0Dd$Yz5oCK diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png deleted file mode 100644 index 035a1f4ca129d4f71a4bc01ec0969e6ba7a8f755..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^D}Y#!gBeJ6*DP`dQW60^A+8@kfBgLA^M{Wg-hX)i z`_J$1KfeF}|NqyoUk|3=QU$7s@N{tuskrs_x*=bK0}u1T1B~DQ%YSBE&Leaw=Vew@ zxa`i4f6uH|Ksy*b MUHx3vIVCg!07rpM5dZ)H diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png deleted file mode 100644 index b98d24f25b61a4b4daa39281c8f17ab65bbcabb6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 98 zcmeAS@N?(olHy`uVBq!ia0vp^Q-GL}g9%7(|0+-nq%=KU9780gCja>V|G#?917pDl x+?@}!SszG;9xPX4D9v4RG$h*a?$`I4u?a_vV1@2KR!Lbyzx6$73Kv19PBrbT8A6;8owM229UzL zx$C>GbJA(Mj$7FH6@ryw;-)YPZ@c$F6rOh4Q+PCO@cRC7aehV!iK3`7pMkccgmPk*S!+E>ntR(k5qz#jPo?DFJI>Tc8vDgH@6%|ZX}9|K=*88wqP&OJ2Buj%`9Q& z!ymSP3p?(Xlaa>7IIdHUym>A1b7U}oEB^~R3eDOv(39(-9RK@qw7d=5rL3jGX&nC;&I%*Fz9$WJ~L>ku~0y) z0TzT$5;%od3OwBr&auN>b#mbo8XDdgcjBOe$kYUMCftcuI)`ckOjsak?bs8(Hk|Qr zCk@qg<@n5?^*mxyP|$J30%>2@!>QKjuapp#p&40 z+2j~T$Q3G)tTAQ*n+^vhg()B@_L|V;gRZ|b=tYf)8>Q-TTFrsAtkxIu_~*nFv(dDp zvqDP{9qX)d-1yc}LPFd7`O)fVum_an_3^F`I{suVY|s4|bUjbtdQX!E5{nPJ*H#8F8<&0$oK^e?gt43zBuBJ7rqNWeXCbADd`j<@4l z40^fCNoxvdPAkV!+mx+``X1N%Te>O6LtVyo-3BR)7&Exf8rN2pq>4KopZ&l#idvqW zuyjyl^JX)YL?(&yxO(vAEOxuS++KF+mVm$jRYI$-n^mX3Awdi>8%n7GQp|4|9M16OMFmu?&po7H9JvTzm zP_;8wdtf=UE`lwAm!ko5E_<^B{Bs|zXP}ND@?=@k99mt_2){(%a>{Hp5u4-cshAO| z0}&Le_(Mmzkq@6LP!h$5b;&Egi>joR085$W*ec`%yk_r)6wU^@Qi(V}d3}BkYG5G+ zE*5}*$Cdy>A=7t*!uosyJH-tqNFOX6><+gN2E_TOy4tk5?1AOX%0ev6;N|!D2=v7Gk*!!x#5DuT`3EwXNc3~WF3W(&V3M@I zx#a>MOb6PqMMuJe2=YVLb{CXRp2ZFlE4+23B&z1LO1B}*GW(P6pjs7SF`S$bcQf7! z8i8n>S{RRlsq&o4J`ifHG$Rf-xVYtZ-$6(qVfew3PTRLH~?tY?sA5=r_c(szl z1gcuJO7YUwOi&2dm|B0^`{cR=J_0q1PIQa%Q>3sN5X9r!SaG;GjoOsy*d>34u#21Q zXK#?Iw%Z*A$%Ia&gNS@k>F+N7RUZvh?RV?IO0?{;6@IuhaF0=AbEM?6#qvmGY$8_o z^o0g(=I^Yb^**xvNn(crqLh7ztl&nHbn0=c4*mvjeO6pBh~vURVx^jhJ6M4#%Rncv z%w9ROYN7_Yj9-!i@&rx_Ik@1VcgN-uJj4hwwo!8wIad0Mq;=}*nwkM?LMw4YM#6SY zyt(NOW5e#i7Y1Db0xM-PLTHbwOVY}L6&nnoi2do1D<@si;s4&b7|)h20aup^Q;G8r zWDEpcV}yAcb$MsCo!OTDCTLRFO_pyLJIEDr*i*l9(ojCAe9sClY=E+NF_BjmVEK8< zeO8jo;pLf}iypZAWqbxSur=`{&pN_`@=?&^T*4e*w1d_wfohvftoz z<)klgx9_zU;#mtL4O$7X(qZLfo)JuPdDeM#b3jX7k3-E%1iUPBAyv7CB@NBh(J7p9!W^HymA^}_4&|vL{9I8wi(<*z_ zVdWHJwW>qlwdYsW{kfn)R(qKh_8`%nk>dOuk;e{Vc#t;IqXkijR-ufVnut=n)N-ZH zATN)h)sR_kwH#ihx<6;pcRkt0n}N))-oO9zjq|hE920X>#4uA19x8qvVUSVAXCy&Z cEsrR_0wN|9Xf|GVz5oCK07*qoM6N<$f+oMVPXGV_ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/minus.gif b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/minus.gif deleted file mode 100644 index 470c6736e724a07d4534c0495f8021937fcf6fef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 121 zcmZ?wbhEHb`SW}C?tS|7 z>CKxr7cN}*|NlP&7%2W^VPs(7WzYffKxQzosBK_%$ei#xWAC#c4;%zjJOjEGuHp*a XQ{c#1qRZge^rpJVP}EzQiNP8G!52A$ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png deleted file mode 100644 index bfa2300b0ed0d9bcb03d744acea9506c842e4aa9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrI!3-oj1H|tFDa8Pv5Z7PZ&3^B7{dGF$&!vXn zm+F747614B`Oi)2e{N3x^I-X}qp^Oc#QK4Xr9E97LpWrU(?BpWjls!JAuaXa=`$zJ a@Gx)$GdixZb9e((#^CAd=d#Wzp$Pyp&M(dY diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/plus.gif b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/plus.gif deleted file mode 100644 index ff22238004d22581ed7955381871bc1f44a0e21f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 124 zcmZ?wbhEHbJm%c=6r4cduW+{`vFgw{PG6{{8#>`SVYoKD~MK z=H9(~7cN}*|NlP&7%2W^VPs(7WzYffKxQzoXl~$iSUKTU#@e)>2g3v0B&V=VWzm@( b;4E{5+4asrUxq_XfA$}34cus=#9$2oX9hfW diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png deleted file mode 100644 index be13bb1e1a50daa9eecf966ce410c2f7b0e8f4de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrI!3-oj1H|tFDa8Pv5ZCvgKL7sn=f}@qZ$Eze z{Po+T=P&O*dG_q}o3G!0yng@T!{;wEoMkrv6-#-#IEHY@CMTr;Ve&8LBla_A%=~BE bc%Ym?xrar3|5U%zKvfK$u6{1-oD!M<75+D@ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png deleted file mode 100644 index f8b20038b40fe6867fad6be568c4e7307c54c61e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrI!3-oj1H|tFDa8Pv5ZC$VUlnbx32*zmhyCQ4B?PXPD)NnNlN>5@(7EHWaF25 cg}>|!vOO%~Cm0t*0#z}1y85}Sb4q9e0MnT+egFUf diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/index.html b/addons/web_gantt/static/lib/dhtmlxGantt/index.html deleted file mode 100644 index d35c33ca747..00000000000 --- a/addons/web_gantt/static/lib/dhtmlxGantt/index.html +++ /dev/null @@ -1,107 +0,0 @@ - - - Gantt Chart - - - - - - - - - - - -
DHTML Gantt sample
- -

Initialize object on page

-

You can place this JavaScript Gantt Chart anywhere on your web page, attaching it - to any div object.
-

- - - -<div style="width:950px;height:620px;position:absolute" id="GanttDiv"></div> -<script> - var gantt = new GanttChart(); - gantt.setImagePath("codebase/imgs/"); - gantt.setEditable(true); - ... - gantt.addProject(project_1); - ... - gantt.create("GanttDiv"); -</script> - - -
-
- - - - diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxcommon.js b/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxcommon.js deleted file mode 100644 index bc7de14346d..00000000000 --- a/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxcommon.js +++ /dev/null @@ -1,907 +0,0 @@ -/* -Copyright DHTMLX LTD. http://www.dhtmlx.com -To use this component please contact sales@dhtmlx.com to obtain license -*/ -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 { - if (document.implementation&&document.implementation.createDocument){ - this.xmlDoc=document.implementation.createDocument("", "", null); - this.xmlDoc.onload=new this.waitLoadFunction(this); - this.xmlDoc.load(filePath); - return; - } 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._filterXPath = null; - this._getAllNamedChilds = null; - this._retry = null; - this.async = null; - this.rSeed = null; - this.filePath = null; - this.onloadAction = null; - this.mainObject = null; - this.xmlDoc = null; - this.doXPath = null; - this.doXPathOpera = null; - this.doXSLTransToObject = null; - this.doXSLTransToString = null; - this.loadXML = null; - this.loadXMLString = null; - // this.waitLoadFunction = null; - this.doSerialization = null; - this.xmlNodeToJSON = null; - this.getXMLTopNode = null; - this.setXSLParamValue = null; - return null; -} - -dtmlXMLLoaderObject.prototype.xmlNodeToJSON = function(node){ - var t={}; - for (var i=0; i-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.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]; - } - } -} diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js b/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js deleted file mode 100644 index e04279c6877..00000000000 --- a/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js +++ /dev/null @@ -1,6123 +0,0 @@ -//v.1.3 build 100805 - -/* -Copyright DHTMLX LTD. http://www.dhtmlx.com -To use this component please contact sales@dhtmlx.com to obtain license -*/ - -/*_TOPICS_ - * @0:Initialization - * @1:Add/delete - * @2:Lookup - * @3:Appearance - * @4:Private - * @5:Handlers - * @6:Load/Save data - * @7:Printing - */ - -/** - * @desc: GanttProjectInfo constructor - * @param: id - id of the project - * @param: name - name of the project - * @param: startDate - start date of the project (JavaScript Date object) - * @type: public - * @topic: 0 - */ -function GanttProjectInfo(id, name, startDate) -{ - this.Id = id; - this.Name = name; - this.StartDate = startDate; - this.ParentTasks = []; -} -/** - * @desc: Delete specified task - * @param: id - id of the task to be deleted - * @type: public - * @topic: 1 - * @edition: Professional - */ -GanttProjectInfo.prototype.deleteTask = function(id) -{ - var task = this.getTaskById(id); - if (task) { - if (!task.ParentTask) { - - for (var i = 0; i < this.ParentTasks.length; i++) { - - if (this.ParentTasks[i].Id == id) { - - if (this.ParentTasks[i].nextParentTask) { - - if (this.ParentTasks[i].previousParentTask) { - this.ParentTasks[i].previousParentTask.nextParentTask = this.ParentTasks[i].nextParentTask; - this.ParentTasks[i].nextParentTask.previousParentTask = this.ParentTasks[i].previousParentTask; - } else { - this.ParentTasks[i].nextParentTask.previousParentTask = null; - } - - } else { - if (this.ParentTasks[i].previousParentTask) { - this.ParentTasks[i].previousParentTask.nextParentTask = null; - } - } - - this.ParentTasks[i] = null; - this.ParentTasks.splice(i, 1); - break; - } - } - - } else - { - var parentTask = task.ParentTask; - for (var i = 0; i < parentTask.ChildTasks.length; i++) { - - if (parentTask.ChildTasks[i].Id == id) { - - if (parentTask.ChildTasks[i].nextChildTask) { - - if (parentTask.ChildTasks[i].previousChildTask) { - - parentTask.ChildTasks[i].previousChildTask.nextChildTask = parentTask.ChildTasks[i].nextChildTask; - parentTask.ChildTasks[i].nextChildTask.previousChildTask = parentTask.ChildTasks[i].previousChildTask; - - } else { - parentTask.ChildTasks[i].nextChildTask.previousChildTask = null; - } - - } else { - if (parentTask.ChildTasks[i].previousChildTask) { - parentTask.ChildTasks[i].previousChildTask.nextChildTask = null; - } - } - - parentTask.ChildTasks[i] = null; - parentTask.ChildTasks.splice(i, 1); - break; - } - - } - } - } -}; -/** - * @desc: Addition of the task in project - * @param: task - TaskInfo object - * @type: public - * @topic: 1 - */ -GanttProjectInfo.prototype.addTask = function(task) -{ - this.ParentTasks.push(task); - task.setProject(this); -}; -/** - * @desc: get object task by id - * @param: id - id of task - * @type: public - * @topic: 2 - */ -GanttProjectInfo.prototype.getTaskById = function(id) -{ - for (var j = 0; j < this.ParentTasks.length; j++) - { - var task = this.getTaskByIdInTree(this.ParentTasks[j], id); - if (task) return task; - } - return null; -}; -/** - * @desc: get object task by id - * @param: parentTask -(object) parent task - * @param: id - id of current task - * @type: private - * @topic: 2 - */ -GanttProjectInfo.prototype.getTaskByIdInTree = function(parentTask, id) -{ - if (parentTask.Id == id) - { - return parentTask; - - } else - { - for (var i = 0; i < parentTask.ChildTasks.length; i++) { - - if (parentTask.ChildTasks[i].Id == id) - { - return parentTask.ChildTasks[i]; - } - if (parentTask.ChildTasks[i].ChildTasks.length > 0) - { - if (parentTask.ChildTasks[i].ChildTasks.length > 0) - { - var cTask = this.getTaskByIdInTree(parentTask.ChildTasks[i], id); - if (cTask) return cTask; - } - } - } - - } - return null; -}; -/** - * @desc: GanttTaskInfo constructor - * @param: id - specifies id of task - * @param: name - specifies name of task - * @param: est - specifies Estimated Start Date of task - * @param: duration - specifies duration of task in hours - * @param: percentCompleted - specifies percentCompleted of task - * @param: predecessorTaskId - specifies predecessorTask Id of task - * @type: public - * @topic: 0 - */ -function GanttTaskInfo(id, name, est, duration, percentCompleted, predecessorTaskId) -{ - this.Id = id; - this.Name = name; - this.EST = est; - this.Duration = duration; - this.PercentCompleted = percentCompleted; - this.PredecessorTaskId = predecessorTaskId; - this.ChildTasks = []; - this.ChildPredTasks = []; - this.ParentTask = null; - this.PredecessorTask = null; - this.Project = null; - this.nextChildTask = null; - this.previousChildTask = null; - this.nextParentTask = null; - this.previousParentTask = null; -} -/** - * @desc: Addition of child task to the parent task - * @param: task - (object) task - * @type: public - * @topic: 1 - */ -GanttTaskInfo.prototype.addChildTask = function(task) -{ - this.ChildTasks.push(task); - task.ParentTask = this; -}; -/** - * @desc: set project to this task and its children - * @param: project - (object) project - * @type: private - * @topic: 0 - */ -GanttTaskInfo.prototype.setProject = function(project) -{ - this.Project = project; - for (var j = 0; j < this.ChildTasks.length; j++) - { - this.ChildTasks[j].setProject(project); - } -}; -/** - * @desc: private GanttTask constructor - * @param: taskInfo - (object)GanttTaskInfo - * @param: project - (object) GanttProject - * @param: chart - (object)GanttChart - * @type: public - * @topic: 0 - */ -function GanttTask(taskInfo, project, chart) -{ - this.isTask = true; - - this.Chart = chart; - this.Project = project; - this.TaskInfo = taskInfo; - - //control variables - this.checkMove = false; - this.checkResize = false; - this.moveChild = false; - - this.maxPosXMove = -1; - this.minPosXMove = -1; - this.maxWidthResize = -1; - this.minWidthResize = -1; - this.posX = 0; - this.posY = 0; - this.MouseX = 0; - this.taskItemWidth = 0; - this.isHide = false; - this._heightHideTasks = 0; - this._isOpen = true; - - this.descrTask = null; - this.cTaskItem = null; - this.cTaskNameItem = null; - - this.parentTask = null; - this.predTask = null; - this.childTask = []; - this.childPredTask = []; - this.nextChildTask = null; - this.previousChildTask = null; - this.nextParentTask = null; - this.previousParentTask = null; - -} -/** - * @desc: private GanttProject constructor - * @type: public - * @topic: 0 - */ -function GanttProject(Chart, projectInfo) -{ - this.isProject = true; - - this.nextProject = null; - this.previousProject = null; - this.arrTasks = []; - this.Project = projectInfo; - this.Chart = Chart; - this.percentCompleted = 0; - this.Duration = 0; - - this.descrProject = null; - this.projectItem = null; - this.projectNameItem = null; - - this.posY = 0; - this.posX = 0; -} -/** - * @desc: check width of projectNameItem - * @type: private - * @topic: 4 - */ -GanttProject.prototype.checkWidthProjectNameItem = function() -{ - if (this.projectNameItem.offsetWidth + this.projectNameItem.offsetLeft > this.Chart.maxWidthPanelNames) - { - var width = this.projectNameItem.offsetWidth + this.projectNameItem.offsetLeft - this.Chart.maxWidthPanelNames; - var countChar = Math.round(width / (this.projectNameItem.offsetWidth / this.projectNameItem.firstChild.length)); - var pName = this.Project.Name.substring(0, this.projectNameItem.firstChild.length - countChar - 3); - pName += "..."; - this.projectNameItem.innerHTML = pName; - } -}; -/** - * @desc: create GanttProject. - * @type: private - * @topic: 0 - */ -GanttProject.prototype.create = function() -{ - var containerTasks = this.Chart.oData.firstChild; - - this.posX = (this.Project.StartDate - this.Chart.startDate) / (60 * 60 * 1000) * this.Chart.hourInPixels; - - if (this.previousProject) - { - if (this.previousProject.arrTasks.length > 0) { - var lastChildTask = this.Chart.getLastChildTask(this.previousProject.arrTasks[this.previousProject.arrTasks.length - 1]); - this.posY = parseInt(lastChildTask.cTaskItem[0].style.top) + this.Chart.heightTaskItem + 11; - } else { - this.posY = parseInt(this.previousProject.projectItem[0].style.top) + this.Chart.heightTaskItem + 11; - } - } else { - this.posY = 6; - } - - if (this.Chart._showTreePanel) { - - var containerNames = this.Chart.panelNames.firstChild; - this.projectNameItem = this.createProjectNameItem(); - containerNames.appendChild(this.projectNameItem); - this.checkWidthProjectNameItem(); - - } - this.projectItem = [this.createProjectItem(),[]]; - containerTasks.appendChild(this.projectItem[0]); - - if (this.Chart.isShowDescProject) { - containerTasks.appendChild(this.createDescrProject()); - } - - this.addDayInPanelTime(); -}; -/** - * @desc: GanttChart constructor - * @type: public - * @topic: 0 - */ -function GanttChart() -{ - this.Error = new GanttError(); - this.dhtmlXMLSenderObject = new dhtmlXMLSenderObject(this); - - //settings - this.heightTaskItem = 12; - this.dayInPixels = 24; - this.hoursInDay = 8; - this._showTreePanel = true; - this._showTooltip = true; - this.isShowDescTask = false; - this.isShowDescProject = false; - this.isShowNewProject = true; - this.isEditable = false; - this.isShowConMenu = false; - this.correctError = false; - this.maxWidthPanelNames = 150; - this.minWorkLength = 8; - this.paramShowTask = []; - this.paramShowProject = []; - - this.savePath = null; - this.loadPath = null; - - //control variables - this.divTimeInfo = null; - this.divInfo = null; - - this.panelNames = null; - this.panelTime = null; - this.oData = null; - this.content = null; - this.panelErrors = null; - this.contextMenu = null; - - this.hourInPixelsWork = this.dayInPixels / this.hoursInDay; - this.hourInPixels = this.dayInPixels / 24; - this.minWidthResize = this.hourInPixels; - this.countDays = 0; - this.startDate = null; - this.initialPos = 0; - - this.contentHeight = 0; - this.contentWidth = 0; - this._oDataHeight = 0; - - this.Project = []; - - this.arrProjects = []; - - this.xmlLoader = null; - - - this._isIE = false; - this._isFF = false; - this._isOpera = false; - - this._isMove = false; - this._isResize = false; - this._isError = false; - - this.imgs = "codebase/imgs/"; - this.stylePath = "codebase/dhtmlxgantt.css"; // used in simple printing method getPrintableHTML() - - this.shortMonthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; - this.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; - this._useShortMonthNames = true; - - dhtmlxEventable(this); -} -/** - * @desc: set path to image directory - * @param: newPath - path to image directory, end with slash / - * @type: public - * @topic: 0 - * @before_init: 1 - */ -GanttChart.prototype.setImagePath = function(newPath) -{ - this.imgs = newPath; -}; -/** - * @desc: set path to styles file, default is "codebase/dhtmlxgantt.css"; used in simple printing method printToWindow() - * @param: newPath - path to styles file - * @type: public - * @topic: 0 - * @before_init: 1 - */ -GanttChart.prototype.setStylePath = function(newPath) -{ - this.stylePath = newPath; -}; -/** - * @desc: set url which is used to save chart data with saveData() method - * @param: newPath - url to server script. - * @type: public - * @topic: 6 - * @before_init: 1 - */ -GanttChart.prototype.setSavePath = function(newPath) -{ - this.savePath = newPath; -}; -/** - * @desc: set url which is used to load chart data with loadData() method - * @param: newPath - url to server script. - * @type: public - * @topic: 6 - * @before_init: 1 - */ -GanttChart.prototype.setLoadPath = function(newPath) -{ - this.loadPath = newPath; -}; -GanttChart.prototype.setCorrectError = function(isCorrectError) -{ - this.correctError = isCorrectError; -}; - -/** - * @desc: enable or disable inline task description (displayed right after the task bar), and configure the shown values - * @param: isShowDescTask - true/false show or hide - * @param: param - comma separated list of letters: n - Name, d - Duration, e - EST, p -Percent complete. For example value "n,e" will show task name and EST date. - * @type: public - * @topic: 3 - * @before_init: 1 - */ -GanttChart.prototype.showDescTask = function(isShowDescTask, param) -{ - this.isShowDescTask = isShowDescTask; - var arrValues = new Array(5); - - if (this.isShowDescTask) - { - if (param) { - var arrParam = param.split(","); - for (var i = 0; i < arrParam.length; i++) { - var k = this.getParamShowTask(arrParam[i]); - arrValues[k] = 1; - } - } else { - arrValues[this.getParamShowTask('')] = 1; - } - this.paramShowTask = this.getValueShowTask(arrValues); - } - -}; - -/** - * @desc: enable or disable inline project description (displayed right after the project bar), and configure the shown values - * @param: isShowDescProject - true/false show or hide - * @param: param - comma separated list of letters: n - Name, d - Duration, s - Start date, p -Percent complete. For example value "n,s" will show project name and start date. - * @type: public - * @topic: 3 - * @before_init: 1 - */ -GanttChart.prototype.showDescProject = function(isShowDescProject, param) -{ - this.isShowDescProject = isShowDescProject; - var arrValues = new Array(4); - - if (this.isShowDescProject) - { - if (param) { - var arrParam = param.split(","); - for (var i = 0; i < arrParam.length; i++) { - var k = this.getParamShowProject(arrParam[i]); - arrValues[k] = 1; - } - } else { - arrValues[this.getParamShowProject('')] = 1; - } - this.paramShowProject = this.getValueShowProject(arrValues); - } - -}; - -/** - * @desc: enable or disable context menu in tree. it can be used for a simple task manipulations. - * @param: show - true/false show or hide - * @type: public - * @topic: 3 - * @before_init: 1 - */ -GanttChart.prototype.showContextMenu = function(show) -{ - this.isShowConMenu = show; -}; - -/** - * @desc: set custom context menu for the tree. - * @param: menu - an instance of dhtmlxMenu. - * @type: public - * @topic: 3 - * @before_init: 1 - */ -GanttChart.prototype.setContextMenu = function(menu) -{ - this.showContextMenu(true); - this.contextMenu = menu; -}; - -/** - * @desc: show new project at startup. it is usefull if you have no project at all, and you need some start point. also menu is attached to this project item. - * @param: show - true/false show or hide - * @type: public - * @topic: 3 - * @before_init: 1 - */ -GanttChart.prototype.showNewProject = function(show) -{ - this.isShowNewProject = show; -}; - -GanttChart.prototype.getParamShowTask = function(param) -{ - switch (param) { - case 'n': - //name - return 0; - break; - case 'd': - //duration - return 1; - break; - case 'e': - //est - return 2; - break; - case 'p': - //percent complete - return 3; - break; - case 's-f': - //start-finish - return 4; - break; - default: - return 0; - break; - } -}; - -GanttChart.prototype.getParamShowProject = function(param) -{ - switch (param) { - case 'n': - //name - return 0; - break; - case 'd': - //duration - return 1; - break; - case 's': - //start date - return 2; - break; - case 'p': - //percent complete - return 3; - break; - default: - return 0; - break; - } -}; - -GanttChart.prototype.getValueShowTask = function(param) -{ - var arrValues = []; - for (var i = 0; i < param.length; i++) { - if (param[i]) - { - switch (i) { - case 0: - arrValues.push('Name'); - break; - case 1: - arrValues.push('Duration'); - break; - case 2: - arrValues.push('EST'); - break; - case 3: - arrValues.push('PercentComplete'); - break; - case 4: - arrValues.push('S-F'); - break; - default: - break; - } - } - } - return arrValues; -}; - -GanttChart.prototype.getValueShowProject = function(param) -{ - var arrValues = []; - for (var i = 0; i < param.length; i++) { - - if (param[i]) - { - switch (i) { - case 0: - arrValues.push('Name'); - break; - case 1: - arrValues.push('Duration'); - break; - case 2: - arrValues.push('StartDate'); - break; - case 3: - arrValues.push('PercentComplete'); - break; - - default: - break; - } - } - } - return arrValues; -}; - -/** - * @desc: make Gantt Chart editable by user - * @param: isEditable - (true/false) - * @type: public - * @topic: 0 - * @before_init: 1 - */ -GanttChart.prototype.setEditable = function(isEditable) -{ - this.isEditable = isEditable; -}; -//#__pro_feature:01102007{ -/** - * @desc: show left side tree panel - * @param: show - (true/false) - * @type: public - * @topic: 0 - * @before_init: 1 - * @edition: Professional - */ -GanttChart.prototype.showTreePanel = function(show) -{ - this._showTreePanel = show; -}; -/** - * @desc: show task & project tooltip - * @param: show - (true/false) - * @type: public - * @topic: 0 - * @before_init: 1 - */ -GanttChart.prototype.showTooltip = function(show) -{ - this._showTooltip = show; -}; -//#} -/** - * @desc: Get current project by id - * @param: id - id of current project - * @type: public - * @topic: 2 - */ -GanttChart.prototype.getProjectById = function(id) -{ - - for (var i = 0; i < this.arrProjects.length; i++) { - - if (this.arrProjects[i].Project.Id == id) - { - return this.arrProjects[i]; - } - } - return null; -}; -/** - * @desc: Get browser type - * @type: private - * @topic: 4 - */ -GanttChart.prototype.getBrowserType = function() -{ - - if (navigator.appName.indexOf('Explorer') != -1) - { - this._isIE = true; - - } else if (navigator.userAgent.indexOf('Mozilla') != -1) - { - this._isFF = true; - - } else if (navigator.userAgent.indexOf('Opera') != -1) - { - this._isOpera = true; - } -}; -/** - * @desc: Add new project - * @param: project - (object) GanttProjectInfo - * @type: public - * @topic: 0 - * @before_init: 1 - */ -GanttChart.prototype.addProject = function(projectInfo) -{ - this.Project.push(projectInfo); -}; -/** - * @desc: Removal of GanttTask - * @param: id - id of GanttTask - * @type: public - * @topic: 1 - */ -GanttProject.prototype.deleteTask = function(id) -{ - var task = this.getTaskById(id); - if (task) { - this.deleteChildTask(task); - } else { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 30, [id]); - } -}; -/** - * @desc: Removal of GanttProject - * @param: id - id of project - * @type: public - * @topic: 1 - */ -GanttChart.prototype.deleteProject = function(id) -{ - var project = this.getProjectById(id); - - if (project) - { - if (project.arrTasks.length > 0) - { - while (project.arrTasks.length > 0) { - project.deleteChildTask(project.arrTasks[0]); - } - } - - if (project.nextProject)project.shiftNextProject(project, -23); - - for (var i = 0; i < this.Project.length; i++) { - - if (this.Project[i].Id == project.Project.Id) { - this.Project.splice(i, 1); - } - } - - - if ((project.previousProject) && - (project.nextProject)) - { - var previousProject = project.previousProject; - previousProject.nextProject = project.nextProject; - } - - if ((project.previousProject) && - !(project.nextProject)) - { - var previousProject = project.previousProject; - previousProject.nextProject = null; - - } - if (!(project.previousProject) && - (project.nextProject)) - { - var nextProject = project.nextProject; - nextProject.previousProject = null; - - } - - for (var i = 0; i < this.arrProjects.length; i++) { - - if (this.arrProjects[i].Project.Id == id) - { - this.arrProjects.splice(i, 1); - } - } - - project.projectItem[0].parentNode.removeChild(project.projectItem[0]); - - if (this.isShowDescProject) { - project.descrProject.parentNode.removeChild(project.descrProject); - } - - if (this._showTreePanel) { - project.projectNameItem.parentNode.removeChild(project.projectNameItem); - } - - this._oDataHeight -= 11 + this.heightTaskItem; - - if (this.Project.length == 0) - { - if (this.isShowNewProject) - { - var d = new Date(this.startDate); - var t = new Date(d.setDate(d.getDate() + 1)); - - var pi = new GanttProjectInfo(1, "New project", t); - this.Project.push(pi); - var project = new GanttProject(this, pi); - project.create(); - this.arrProjects.push(project); - this._oDataHeight += 11 + this.heightTaskItem; - } - } - - - } else { - this.Error.throwError("DATA_INSERT_ERROR", 31, [id]); - } -}; -/** - * @desc: Set name of project. - * @param: name - new name of Project. - * @type: public - * @topic: 0 - */ -GanttProject.prototype.setName = function(name) -{ - if ((name != "") && (name != null)) { - this.Project.Name = name; - if (this.Chart._showTreePanel) - { - this.projectNameItem.innerHTML = name; - this.projectNameItem.title = name; - this.checkWidthProjectNameItem(); - } - - if (this.Chart.isShowDescProject)this.descrProject.innerHTML = this.getDescStr(); - this.addDayInPanelTime(); - } -}; -/** - * @desc: Set Percent Completed of project - * @param: percentCompleted - percent completed of Project - * @type: public - * @topic: 0 - */ -GanttProject.prototype.setPercentCompleted = function(percentCompleted) -{ - percentCompleted = parseInt(percentCompleted); - if (isNaN(percentCompleted)) - { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 6, null); - return false; - } - - if (percentCompleted > 100) - { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 7, null); - return false; - - } else if (percentCompleted < 0) - { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 8, null); - return false; - } - - if ((percentCompleted > 0) && (percentCompleted < 100) && (this.percentCompleted > 0) && (this.percentCompleted < 100)) - { - this.projectItem[0].firstChild.rows[0].cells[0].width = parseInt(percentCompleted) + "%"; - this.projectItem[0].firstChild.rows[0].cells[0].firstChild.style.width = (percentCompleted * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - this.projectItem[0].firstChild.rows[0].cells[1].width = (100 - parseInt(percentCompleted)) + "%"; - this.projectItem[0].firstChild.rows[0].cells[1].firstChild.style.width = ((100 - percentCompleted) * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - - } else if (((percentCompleted == 0) || (percentCompleted == 100)) && (this.percentCompleted > 0) && (this.percentCompleted < 100)) - { - if (percentCompleted == 0) - { - this.projectItem[0].firstChild.rows[0].cells[0].parentNode.removeChild(this.projectItem[0].firstChild.rows[0].cells[0]); - this.projectItem[0].firstChild.rows[0].cells[0].width = 100 + "%"; - this.projectItem[0].firstChild.rows[0].cells[0].firstChild.style.width = this.Duration * this.Chart.hourInPixelsWork + "px"; - - } else if (percentCompleted == 100) - { - this.projectItem[0].firstChild.rows[0].cells[1].parentNode.removeChild(this.projectItem[0].firstChild.rows[0].cells[1]); - this.projectItem[0].firstChild.rows[0].cells[0].width = 100 + "%"; - this.projectItem[0].firstChild.rows[0].cells[0].firstChild.style.width = this.Duration * this.Chart.hourInPixelsWork + "px"; - } - - } else if (((percentCompleted == 0) || (percentCompleted == 100)) && ((this.percentCompleted == 0) || (this.percentCompleted == 100))) - { - if ((percentCompleted == 0) && (this.percentCompleted == 100)) - { - this.projectItem[0].firstChild.rows[0].cells[0].firstChild.src = this.Chart.imgs + "progress_bg.png"; - - } else if ((percentCompleted == 100) && (this.percentCompleted == 0)) - { - this.projectItem[0].firstChild.rows[0].cells[0].firstChild.src = this.Chart.imgs + "parentnode_filled.png"; - } - - } else if (((percentCompleted > 0) || (percentCompleted < 100)) && ((this.percentCompleted == 0) || (this.percentCompleted == 100))) - { - this.projectItem[0].firstChild.rows[0].cells[0].parentNode.removeChild(this.projectItem[0].firstChild.rows[0].cells[0]); - - var cellprojectItem = document.createElement("TD"); - this.projectItem[0].firstChild.rows[0].appendChild(cellprojectItem); - cellprojectItem.width = percentCompleted + "%"; - - var imgPr = document.createElement("img"); - imgPr.style.width = (percentCompleted * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - imgPr.style.height = this.Chart.heightTaskItem + "px"; - cellprojectItem.appendChild(imgPr); - imgPr.src = this.Chart.imgs + "parentnode_filled.png"; - - - cellprojectItem = document.createElement("TD"); - this.projectItem[0].firstChild.rows[0].appendChild(cellprojectItem); - cellprojectItem.width = (100 - percentCompleted) + "%"; - imgPr = document.createElement("img"); - - imgPr.style.width = ((100 - percentCompleted) * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - imgPr.style.height = this.Chart.heightTaskItem + "px"; - cellprojectItem.appendChild(imgPr); - imgPr.src = this.Chart.imgs + "progress_bg.png"; - - } else if (this.percentCompleted == -1) - { - if (percentCompleted == 100) - { - this.projectItem[0].firstChild.rows[0].cells[0].firstChild.src = this.Chart.imgs + "parentnode_filled.png"; - - } else if (percentCompleted < 100 && percentCompleted > 0) - { - - this.projectItem[0].firstChild.rows[0].cells[0].parentNode.removeChild(this.projectItem[0].firstChild.rows[0].cells[0]); - - var cellprojectItem = document.createElement("TD"); - this.projectItem[0].firstChild.rows[0].appendChild(cellprojectItem); - cellprojectItem.width = percentCompleted + "%"; - - var imgPr = document.createElement("img"); - imgPr.style.width = (percentCompleted * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - imgPr.style.height = this.Chart.heightTaskItem + "px"; - cellprojectItem.appendChild(imgPr); - imgPr.src = this.Chart.imgs + "parentnode_filled.png"; - - cellprojectItem = document.createElement("TD"); - this.projectItem[0].firstChild.rows[0].appendChild(cellprojectItem); - cellprojectItem.width = (100 - percentCompleted) + "%"; - imgPr = document.createElement("img"); - - imgPr.style.width = ((100 - percentCompleted) * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - imgPr.style.height = this.Chart.heightTaskItem + "px"; - cellprojectItem.appendChild(imgPr); - imgPr.src = this.Chart.imgs + "progress_bg.png"; - } - - } - - this.percentCompleted = percentCompleted; - if (this.Chart.isShowDescProject)this.descrProject.innerHTML = this.getDescStr(); - return true; -}; -/** - * @desc: Removal of child GanttTask - * @param: task - (object)parent GanttTask - * @type: private - * @topic: 1 - */ -GanttProject.prototype.deleteChildTask = function(task) -{ - if (task) - { - if (task.cTaskItem[0].style.display == "none") { - this.Chart.openTree(task.parentTask); - } - //delete of connecting lines - if (task.childPredTask.length > 0) { - for (var i = 0; i < task.childPredTask.length; i++) - { - for (var t = 0; t < task.childPredTask[i].cTaskItem[1].length; t++) { - task.childPredTask[i].cTaskItem[1][t].parentNode.removeChild(task.childPredTask[i].cTaskItem[1][t]); - } - task.childPredTask[i].cTaskItem[1] = []; - task.childPredTask[i].predTask = null; - } - } - - //delete child task - if (task.childTask.length > 0) { - while (task.childTask.length > 0) { - this.deleteChildTask(task.childTask[0]); - } - } - - //shift tasks - if (task.cTaskItem[0].style.display != "none") task.shiftCurrentTasks(task, -23); - - //delete object task - this.Project.deleteTask(task.TaskInfo.Id); - - //delete div and connecting lines from oData - if (task.cTaskItem[0]) { - task.cTaskItem[0].parentNode.removeChild(task.cTaskItem[0]); - } - - if (this.Chart.isShowDescTask) { - task.descrTask.parentNode.removeChild(task.descrTask); - } - - if (task.cTaskItem[1].length > 0) { - for (var j = 0; j < task.cTaskItem[1].length; j++) { - task.cTaskItem[1][j].parentNode.removeChild(task.cTaskItem[1][j]); - } - } - - //delete div and connecting lines from panelName - if (task.cTaskNameItem[0]) { - task.cTaskNameItem[0].parentNode.removeChild(task.cTaskNameItem[0]); - } - - if (task.cTaskNameItem[1]) { - for (var j = 0; j < task.cTaskNameItem[1].length; j++) { - task.cTaskNameItem[1][j].parentNode.removeChild(task.cTaskNameItem[1][j]); - } - } - - if (task.cTaskNameItem[2]) { - task.cTaskNameItem[2].parentNode.removeChild(task.cTaskNameItem[2]); - } - - //delete object task - if (task.parentTask) - { - if (task.previousChildTask) { - if (task.nextChildTask) { - task.previousChildTask.nextChildTask = task.nextChildTask; - } else { - task.previousChildTask.nextChildTask = null; - } - - } - - var parentTask = task.parentTask; - for (var i = 0; i < parentTask.childTask.length; i++) - { - if (parentTask.childTask[i].TaskInfo.Id == task.TaskInfo.Id) { - parentTask.childTask[i] = null; - parentTask.childTask.splice(i, 1); - break; - } - } - if (parentTask.childTask.length == 0) { - if (parentTask.cTaskNameItem[2]) { - parentTask.cTaskNameItem[2].parentNode.removeChild(parentTask.cTaskNameItem[2]); - parentTask.cTaskNameItem[2] = null; - } - } - } else - { - if (task.previousParentTask) - { - if (task.nextParentTask) { - task.previousParentTask.nextParentTask = task.nextParentTask; - } else { - task.previousParentTask.nextParentTask = null; - } - - } - - var project = task.Project; - for (var i = 0; i < project.arrTasks.length; i++) { - if (project.arrTasks[i].TaskInfo.Id == task.TaskInfo.Id) { - project.arrTasks.splice(i, 1); - } - } - - } - - if (task.predTask) { - var predTask = task.predTask; - for (var i = 0; i < predTask.childPredTask.length; i++) { - - if (predTask.childPredTask[i].TaskInfo.Id == task.TaskInfo.Id) { - predTask.childPredTask[i] = null; - predTask.childPredTask.splice(i, 1); - } - - } - - } - if (task.Project.arrTasks.length != 0) { - task.Project.shiftProjectItem(); - } - else { - task.Project.projectItem[0].style.display = "none"; - if (this.Chart.isShowDescProject) this.hideDescrProject(); - } - this.Chart._oDataHeight -= 11 + this.Chart.heightTaskItem; - } - -}; -/** - * @desc: Insert the task in the project and returns it - * @param: id - Specifies id of task - * @param: name - Specifies name of task - * @param: EST - Specifies est of task - * @param: Duration - Specifies duration of task - * @param: PercentCompleted - Specifies percentCompleted of task - * @param: predecessorTaskId - Specifies predecessorTask Id of task - * @type: public - * @topic: 1 - */ -GanttProject.prototype.insertTask = function(id, name, EST, Duration, PercentCompleted, predecessorTaskId, parentTaskId) -{ - var task = null; - var _task = null; - - if (this.Project.getTaskById(id)) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 22, [id]); - return false; - } - - if ((!Duration) || (Duration < this.Chart.minWorkLength)) { - Duration = this.Chart.minWorkLength; - } - if ((!name) || (name == "")) { - name = id; - } - if ((!PercentCompleted) || (PercentCompleted == "")) { - PercentCompleted = 0; - - } else { - PercentCompleted = parseInt(PercentCompleted); - - if (PercentCompleted < 0 || PercentCompleted > 100) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 35, null); - return false; - } - } - - var sortRequired = false; - - if ((parentTaskId) && (parentTaskId != "")) { - var parentTask = this.Project.getTaskById(parentTaskId); - if (!parentTask) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 21, [parentTaskId]); - return false; - } - - EST = EST || parentTask.EST; - if (EST < parentTask.EST) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 20, [id,parentTaskId]); - return false; - } - - task = new GanttTaskInfo(id, name, EST, Duration, PercentCompleted, predecessorTaskId); - - if (!this.Chart.checkPosParentTask(parentTask, task)) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 19, [parentTaskId,id]); - return false; - } - task.ParentTask = parentTask; - - var _parentTask = this.getTaskById(parentTask.Id); - - var isHide = false; - if (_parentTask.cTaskItem[0].style.display == "none") { - isHide = true; - } else if (_parentTask.cTaskNameItem[2]) { - if (!_parentTask._isOpen) { - isHide = true; - } - } - - if (isHide) { - if (_parentTask.childTask.length == 0) { - this.Chart.openTree(_parentTask.parentTask); - } else { - this.Chart.openTree(_parentTask); - } - } - - if (predecessorTaskId != "") - { - var predTask = this.Project.getTaskById(predecessorTaskId); - if (!predTask) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 27, [predecessorTaskId]); - return false; - } - - if (predTask.ParentTask) { - if (predTask.ParentTask.Id != task.ParentTask.Id) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 32, [predTask.Id,task.Id]); - return false; - } - } else { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 32, [predTask.Id,task.Id]); - return false; - } - - if (!this.Chart.checkPosPredecessorTask(predTask, task)) { - this.Chart.correctPosPredecessorTask(predTask, task); - } - - task.PredecessorTask = predTask; - } - - var isAdd = false; - - if (sortRequired) for (var i = 0; i < parentTask.ChildTasks.length; i++) { - if (task.EST < parentTask.ChildTasks[i].EST) - { - parentTask.ChildTasks.splice(i, 0, task); - if (i > 0) { - parentTask.ChildTasks[i - 1].nextChildTask = parentTask.ChildTasks[i]; - parentTask.ChildTasks[i].previousChildTask = parentTask.ChildTasks[i - 1]; - } - if (parentTask.ChildTasks[i + 1]) { - parentTask.ChildTasks[i + 1].previousChildTask = parentTask.ChildTasks[i]; - parentTask.ChildTasks[i].nextChildTask = parentTask.ChildTasks[i + 1]; - } - isAdd = true; - break; - } - } - - if (!isAdd) { - if (parentTask.ChildTasks.length > 0) { - parentTask.ChildTasks[parentTask.ChildTasks.length - 1].nextChildTask = task; - task.previousChildTask = parentTask.ChildTasks[parentTask.ChildTasks.length - 1]; - } - parentTask.ChildTasks.push(task); - } - - if (parentTask.ChildTasks.length == 1) { - _parentTask.cTaskNameItem[2] = _parentTask.createTreeImg(); - } - - _task = new GanttTask(task, this, this.Chart); - _task.create(); - - if (task.nextChildTask) _task.nextChildTask = _task.Project.getTaskById(task.nextChildTask.Id); - _task.addDayInPanelTime(); - _task.shiftCurrentTasks(_task, 23); - - } else - { - - EST = EST || this.Project.StartDate; - - task = new GanttTaskInfo(id, name, EST, Duration, PercentCompleted, predecessorTaskId); - - if (task.EST <= this.Chart.startDate) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 18, [task.Id]); - return false; - } - - if (predecessorTaskId != "") { - var predTask = this.Project.getTaskById(predecessorTaskId); - if (!predTask) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 27, [predecessorTaskId]); - return false; - } - - if (!this.Chart.checkPosPredecessorTask(predTask, task)) { - this.Chart.correctPosPredecessorTask(predTask, task); - } - - if (predTask.ParentTask) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 15, [task.Id,predTask.Id]); - return false; - } - task.PredecessorTask = predTask; - } - var isAdd = false; - - if (sortRequired) for (var i = 0; i < this.Project.ParentTasks.length; i++) { - - if (EST < this.Project.ParentTasks[i].EST) - { - this.Project.ParentTasks.splice(i, 0, task); - if (i > 0) { - this.Project.ParentTasks[i - 1].nextParentTask = task; - task.previousParentTask = this.Project.ParentTasks[i - 1]; - } - if (this.Project.ParentTasks[i + 1]) { - this.Project.ParentTasks[i + 1].previousParentTask = task; - task.nextParentTask = this.Project.ParentTasks[i + 1]; - } - isAdd = true; - break; - } - } - - if (!isAdd) { - if (this.Project.ParentTasks.length > 0) { - this.Project.ParentTasks[this.Project.ParentTasks.length - 1].nextParentTask = task; - task.previousParentTask = this.Project.ParentTasks[this.Project.ParentTasks.length - 1]; - } - this.Project.ParentTasks.push(task); - } - - _task = new GanttTask(task, this, this.Chart); - _task.create(); - if (task.nextParentTask) _task.nextParentTask = _task.Project.getTaskById(task.nextParentTask.Id); - _task.addDayInPanelTime(); - - this.arrTasks.push(_task); - _task.shiftCurrentTasks(_task, 23); - this.projectItem[0].style.display = "inline"; - this.setPercentCompleted(this.getPercentCompleted()); - this.shiftProjectItem(); - - if (this.Chart.isShowDescProject) { - this.showDescrProject(); - } - - } - - this.Chart.checkHeighPanelTasks(); - - return _task; -}; -/** - * @desc: Check Position of predecessor task - * @param: predTask - (object) predecessor task - * @param: task - (object) current task - * @type: private - * @topic: 4 - */ -GanttChart.prototype.checkPosPredecessorTask = function(predTask, task) -{ - var widthPred = this.getWidthOnDuration(predTask.Duration); - var posPred = this.getPosOnDate(predTask.EST); - var posChild = this.getPosOnDate(task.EST); - return (widthPred + posPred) <= posChild; - -}; -GanttChart.prototype.correctPosPredecessorTask = function(predTask, ctask, ctaskObj) -{ - var newDate = new Date(predTask.EST); - newDate.setHours(newDate.getHours() + (predTask.Duration / this.hoursInDay * 24)); - if (newDate.getHours() > 0) { - newDate.setHours(0); - newDate.setDate(newDate.getDate() + 1); - } - - if (ctaskObj) ctaskObj.setEST(newDate, true); - else ctask.EST = newDate; - - if (ctask.ParentTask) - { - if (!this.checkPosParentTask(ctask.ParentTask, ctask)) - { - var newDate2 = new Date(ctask.ParentTask.EST); - newDate2.setHours(newDate2.getHours() + (ctask.ParentTask.Duration / this.hoursInDay * 24)); - ctask.Duration = parseInt((parseInt((newDate2 - ctask.EST) / (1000 * 60 * 60))) * this.hoursInDay / 24); - } - } -}; -GanttChart.prototype.correctPosParentTask = function(parentTask, ctask) -{ - if (!ctask.PredecessorTask) - { - if (parentTask.EST > ctask.EST) { - ctask.EST = new Date(parentTask.EST); - } - if (!this.checkPosParentTask(parentTask, ctask)) { - ctask.Duration = parentTask.Duration; - } - } else - { - this.correctPosPredecessorTask(ctask.PredecessorTask, ctask); - } -}; - -/** - * @desc: Check position of parent task - * @param: parentTask - (object) parent task - * @type: private - * @topic: 4 - */ -GanttChart.prototype.checkPosParentTaskInTree = function(parentTask) -{ - var isError = false; - for (var t = 0; t < parentTask.ChildTasks.length; t++) - { - - if (!this.checkPosParentTask(parentTask, parentTask.ChildTasks[t])) - { - if (!this.correctError) { - this.Error.throwError("DATA_ERROR", 28, [parentTask.Id,parentTask.ChildTasks[t].Id]); - return true; - } else { - this.correctPosParentTask(parentTask, parentTask.ChildTasks[t]); - } - } - if (parentTask.EST > parentTask.ChildTasks[t].EST) - { - if (!this.correctError) { - this.Error.throwError("DATA_ERROR", 33, [parentTask.Id,parentTask.ChildTasks[t].Id]); - return true; - } else { - this.correctPosParentTask(parentTask, parentTask.ChildTasks[t]); - } - } - - if (parentTask.ChildTasks[t].ChildTasks.length > 0) - { - isError = this.checkPosParentTaskInTree(parentTask.ChildTasks[t]); - } - - } - return isError; -}; -/** - * @desc: Set Predecessor Task to child - * @param: project - (object) current Project - * @type: private - * @topic: 0 - */ -GanttChart.prototype.setPredTask = function(project) -{ - var isError = false; - for (var k = 0; k < project.ParentTasks.length; k++) { - - if (!this.isEmpty(project.ParentTasks[k].PredecessorTaskId)) - { - project.ParentTasks[k].PredecessorTask = project.getTaskById(project.ParentTasks[k].PredecessorTaskId); - if (!project.ParentTasks[k].PredecessorTask) { - if (!this.correctError) { - this.Error.throwError("DATA_ERROR", 27, [project.ParentTasks[k].PredecessorTaskId]); - return true; - } - } - - project.ParentTasks[k].PredecessorTask.ChildPredTasks.push(project.ParentTasks[k]); - } - - if (project.ParentTasks[k].PredecessorTask) - { - if (!this.checkPosPredecessorTask(project.ParentTasks[k].PredecessorTask, project.ParentTasks[k])) { - if (!this.correctError) { - this.Error.throwError("DATA_ERROR", 26, [project.ParentTasks[k].PredecessorTask.Id,project.ParentTasks[k].Id]); - return true; - } else { - this.correctPosPredecessorTask(project.ParentTasks[k].PredecessorTask, project.ParentTasks[k]); - } - - } - } - isError = this.setPredTaskInTree(project.ParentTasks[k]); - if (isError) return isError; - } - return isError; - -}; -/** - * @desc: Set Predecessor Task to child - * @param: project - (object) current parent task - * @type: private - * @topic: 0 - */ -GanttChart.prototype.setPredTaskInTree = function(parentTask) -{ - var isError = false; - for (var t = 0; t < parentTask.ChildTasks.length; t++) - { - if (!this.isEmpty(parentTask.ChildTasks[t].PredecessorTaskId)) - { - parentTask.ChildTasks[t].PredecessorTask = parentTask.Project.getTaskById(parentTask.ChildTasks[t].PredecessorTaskId); - if (!parentTask.ChildTasks[t].PredecessorTask) - { - if (!this.correctError) { - this.Error.throwError("DATA_ERROR", 27, [parentTask.ChildTasks[t].PredecessorTaskId]); - return true; - } - - } - - if (!this.checkPosPredecessorTask(parentTask.ChildTasks[t].PredecessorTask, parentTask.ChildTasks[t])) - { - if (!this.correctError) { - this.Error.throwError("DATA_ERROR", 26, [parentTask.ChildTasks[t].PredecessorTask.Id,parentTask.ChildTasks[t].Id]); - return true; - } else { - this.correctPosPredecessorTask(parentTask.ChildTasks[t].PredecessorTask, parentTask.ChildTasks[t]); - } - } - parentTask.ChildTasks[t].PredecessorTask.ChildPredTasks.push(parentTask.ChildTasks[t]); - } - - if (parentTask.ChildTasks[t].ChildTasks.length > 0) - { - isError = this.setPredTaskInTree(parentTask.ChildTasks[t]); - } - - } - return isError; -}; -/** - * @desc: Check Position of Parent Task - * @param: parentTask - (object) Parent Task - * @param: task - (object) current Task - * @type: private - * @topic: 4 - */ -GanttChart.prototype.checkPosParentTask = function(parentTask, task) -{ - var widthParent = this.getWidthOnDuration(parentTask.Duration); - var posParent = this.getPosOnDate(parentTask.EST); - var posChild = this.getPosOnDate(task.EST); - var widthChild = this.getWidthOnDuration(task.Duration); - return (widthParent + posParent) >= (posChild + widthChild); -}; -/** - * @desc: Insert new GanttProject and returns it - * @param: id - id of project - * @param: name - name of project - * @param: startDate - Start Date of project - * @type: public - * @topic: 1 - */ -GanttChart.prototype.insertProject = function(id, name, startDate) -{ - if (this._isError) - { - this.clearData(); - this.clearItems(); - this.hidePanelErrors(); - this._isError = false; - } - - if (this.startDate >= startDate) { - this.Error.throwError("DATA_INSERT_ERROR", 14, null); - return false; - } - - if (this.getProjectById(id)) { - this.Error.throwError("DATA_INSERT_ERROR", 23, [id]); - return false; - } - - this.checkHeighPanelTasks(); - - var project = new GanttProjectInfo(id, name, startDate); - - this.Project.push(project); - - var _project = new GanttProject(this, project); - - for (var i = 0; i < this.arrProjects.length; i++) { - - if (startDate < this.arrProjects[i].Project.StartDate) { - this.arrProjects.splice(i, 0, _project); - if (i > 0) { - _project.previousProject = this.arrProjects[i - 1]; - this.arrProjects[i - 1].nextProject = _project; - } - if (i + 1 <= this.arrProjects.length) { - _project.nextProject = this.arrProjects[i + 1]; - this.arrProjects[i + 1].previousProject = _project; - _project.shiftNextProject(_project, 23); - } - _project.create(); - - if (this.isShowDescProject) { - _project.hideDescrProject(); - } - return _project; - } - } - - if (this.arrProjects.length > 0) { - this.arrProjects[this.arrProjects.length - 1].nextProject = _project; - _project.previousProject = this.arrProjects[this.arrProjects.length - 1]; - } - - this.arrProjects.push(_project); - _project.create(); - - if (this.isShowDescProject) { - _project.hideDescrProject(); - } - - return _project; -}; -/** - * @desc: show context menu in tree in current position - * @type: private - * @topic: 4 - */ -GanttChart.prototype._showContextMenu = function(event, obj) -{ - if (this.contextMenu.isDhtmlxMenuObject) { - var res = this.callEvent("onBeforeContextMenu", [this.contextMenu, obj]); - if (res === false) return; - - var x, y; - if (_isIE){ - var dEl0 = window.document.documentElement, dEl1 = window.document.body, corrector = new Array((dEl0.scrollLeft||dEl1.scrollLeft),(dEl0.scrollTop||dEl1.scrollTop)); - x = event.clientX + corrector[0]; - y = event.clientY + corrector[1]; - } else { - x = event.pageX; - y = event.pageY; - } - this.contextMenu.showContextMenu(x-1, y-1); - } else { - var elem = event.srcElement || event.target; - this.contextMenu.showContextMenu(elem.style.left, elem.style.top, obj); - } - -}; -/** - * @desc: Opens a tree - * @param: parentTask - (object) parent task - * @type: private - * @topic: 3 - */ -GanttChart.prototype.openTree = function(parentTask) -{ - var lastParentTask = this.getLastCloseParent(parentTask); - if (parentTask.TaskInfo.Id != lastParentTask.TaskInfo.Id) { - - this.openNode(lastParentTask); - this.openTree(parentTask); - - } else { - this.openNode(lastParentTask); - } -}; -/** - * @desc: Opens current node - * @param: parentTask - (object) parent task - * @type: private - * @topic: 3 - */ -GanttChart.prototype.openNode = function(parentTask) -{ - if (!parentTask._isOpen) - { - parentTask.cTaskNameItem[2].src = this.imgs + "minus.gif"; - parentTask._isOpen = true; - parentTask.shiftCurrentTasks(parentTask, parentTask._heightHideTasks); - parentTask.showChildTasks(parentTask, parentTask._isOpen); - parentTask._heightHideTasks = 0; - } -}; -/** - * @desc: get last close parent - * @param: task - (object) task - * @type: private - * @topic: 2 - */ -GanttChart.prototype.getLastCloseParent = function(task) -{ - if (task.parentTask) - { - if ((!task.parentTask._isOpen) || - (task.parentTask.cTaskNameItem[2].style.display == "none")) { - return this.getLastCloseParent(task.parentTask); - - } else { - return task; - } - - } else { - return task; - } -}; -/** - * @desc: create a connection line between this task and predecessor - * @param: predecessorTaskId - ID of the predecessor Task - * @type: public - * @topic: 0 - */ -GanttTask.prototype.setPredecessor = function(predecessorTaskId) -{ - if (predecessorTaskId == "") this.clearPredTask(); - else - { - var task = this.TaskInfo; - if (task.Id == predecessorTaskId) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 36); - return false; - } - - var predTaskObj = this.Project.getTaskById(predecessorTaskId); - if (!predTaskObj) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 27, [predecessorTaskId]); - return false; - } - var predTask = predTaskObj.TaskInfo; - var a1 = predTask.ParentTask == null, a2 = task.ParentTask == null; - if (a1 && !a2 || !a1 && a2 || !a1 && !a2 && (predTask.ParentTask.Id != task.ParentTask.Id)) { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 32, [predTask.Id,task.Id]); - return false; - } - - // remove current connection - this.clearPredTask(); - - if (!this.Chart.checkPosPredecessorTask(predTask, task)) { - this.Chart.correctPosPredecessorTask(predTask, task, this); - } - - task.PredecessorTaskId = predecessorTaskId; - task.PredecessorTask = predTask; - this.predTask = predTaskObj; - predTaskObj.childPredTask.push(this); - - this.cTaskItem[1] = this.createConnectingLinesDS(); - } - return true; -}; - -/** - * @desc: remove references and connections to predecessor task - * @type: private - * @topic: 0 - */ -GanttTask.prototype.clearPredTask = function() { - if (this.predTask) { - var ch = this.predTask.childPredTask; - for (var i = 0; i < ch.length; i++) { - if (ch[i] == this) { - ch.splice(i, 1); - break; - } - } - for (var i = 0; i < this.cTaskItem[1].length; i++) { - this.cTaskItem[1][i].parentNode.removeChild(this.cTaskItem[1][i]); - } - this.cTaskItem[1] = []; - - this.TaskInfo.PredecessorTaskId = null; - this.TaskInfo.PredecessorTask = null; - this.predTask = null; - } -}; - -/** - * @desc: shifts the task - * @param: est - est of current Task - * @param: shiftChild - (true/false) to shift children or not - * @type: public - * @topic: 0 - */ -GanttTask.prototype.setEST = function(est, shiftChild) -{ - this.moveChild = shiftChild; - this.getMoveInfo(); - - var pos = this.Chart.getPosOnDate(est); - if ((parseInt(this.cTaskItem[0].firstChild.firstChild.width) + pos > this.maxPosXMove) && (this.maxPosXMove != -1)) - { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 12, [this.TaskInfo.Id]); - this.maxPosXMove = -1; - this.minPosXMove = -1; - return false; - } - - if (pos < this.minPosXMove) - { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 11, [this.TaskInfo.Id]); - this.maxPosXMove = -1; - this.minPosXMove = -1; - return false; - } - - this.cTaskItem[0].style.left = pos; - - var width = pos - this.posX; - this.moveCurrentTaskItem(width, shiftChild); - this.Project.shiftProjectItem(); - if (this.Chart.isShowDescTask)this.descrTask.innerHTML = this.getDescStr(); - this.addDayInPanelTime(); - this.posX = 0; - this.maxPosXMove = -1; - this.minPosXMove = -1; - return true; -}; -/** - * @desc: set duration of the current task - * @param: duration - (int) duration of current task in hours - * @type: public - * @topic: 0 - */ -GanttTask.prototype.setDuration = function(duration) -{ - this.getResizeInfo(); - var width = this.Chart.getWidthOnDuration(duration); - if ((width > this.maxWidthResize) && (this.maxWidthResize != -1)) - { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 10, [this.TaskInfo.Id]); - return false; - } else if (width < this.minWidthResize) - { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 9, [this.TaskInfo.Id]); - return false; - } else { - this.taskItemWidth = parseInt(this.cTaskItem[0].firstChild.firstChild.width); - this.resizeTaskItem(width); - this.endResizeItem(); - if (this.Chart.isShowDescTask)this.descrTask.innerHTML = this.getDescStr(); - return true; - } - -}; -/** - * @desc: establishes percent completed of the current task - * @param: percentCompleted - (int) percent completed of current task - * @type: public - * @topic: 0 - */ -GanttTask.prototype.setPercentCompleted = function(percentCompleted) -{ - percentCompleted = parseInt(percentCompleted); - if (isNaN(percentCompleted)) - { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 6, null); - return false; - } - - if (percentCompleted > 100) - { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 7, null); - return false; - } - if (percentCompleted < 0) - { - this.Chart.Error.throwError("DATA_INSERT_ERROR", 8, null); - return false; - } - - if ((percentCompleted != 0) && (percentCompleted != 100)) - { - if ((this.TaskInfo.PercentCompleted != 0) && (this.TaskInfo.PercentCompleted != 100)) - { - this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].width = percentCompleted + "%"; - this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[1].width = 100 - percentCompleted + "%"; - - } else if ((this.TaskInfo.PercentCompleted == 0) || (this.TaskInfo.PercentCompleted == 100)) - { - this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].parentNode.removeChild(this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0]); - - var cellTblTask = document.createElement("td"); - this.cTaskItem[0].childNodes[0].firstChild.rows[0].appendChild(cellTblTask); - cellTblTask.height = this.Chart.heightTaskItem + "px"; - cellTblTask.width = percentCompleted + "%"; - - var imgPrF = document.createElement("img"); - imgPrF.style.width = (percentCompleted * this.TaskInfo.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - imgPrF.style.height = this.Chart.heightTaskItem + "px"; - cellTblTask.appendChild(imgPrF); - imgPrF.src = this.Chart.imgs + "progress_filled.png"; - - cellTblTask = document.createElement("td"); - this.cTaskItem[0].childNodes[0].firstChild.rows[0].appendChild(cellTblTask); - cellTblTask.height = this.Chart.heightTaskItem + "px"; - cellTblTask.width = (100 - percentCompleted) + "%"; - - imgPrF = document.createElement("img"); - imgPrF.style.width = ((100 - percentCompleted) * this.TaskInfo.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - imgPrF.style.height = this.Chart.heightTaskItem + "px"; - cellTblTask.appendChild(imgPrF); - imgPrF.src = this.Chart.imgs + "progress_bg.png"; - } - } else if (percentCompleted == 0) - { - if ((this.TaskInfo.PercentCompleted != 0) && (this.TaskInfo.PercentCompleted != 100)) - { - this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].parentNode.removeChild(this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0]); - this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].width = 100 + "%"; - - } else - { - this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].firstChild.src = this.Chart.imgs + "progress_bg.png"; - } - - } else if (percentCompleted == 100) - { - - if ((this.TaskInfo.PercentCompleted != 0) && (this.TaskInfo.PercentCompleted != 100)) - { - this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[1].parentNode.removeChild(this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[1]); - this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].width = 100 + "%"; - - } else - { - this.cTaskItem[0].childNodes[0].firstChild.rows[0].cells[0].firstChild.src = this.Chart.imgs + "progress_filled.png"; - } - } - - this.TaskInfo.PercentCompleted = percentCompleted; - this.taskItemWidth = parseInt(this.cTaskItem[0].firstChild.firstChild.width); - this.resizeTaskItem(this.taskItemWidth); - this.endResizeItem(); - if (this.Chart.isShowDescTask)this.descrTask.innerHTML = this.getDescStr(); - return true; -}; -/** - * @desc: set name of the current task - * @param: name - (string) name of the current task - * @type: public - * @topic: 0 - */ -GanttTask.prototype.setName = function(name) -{ - - if ((name != "") && (name != null)) { - this.TaskInfo.Name = name; - if (this.Chart._showTreePanel) - { - this.cTaskNameItem[0].innerHTML = name; - this.cTaskNameItem[0].title = name; - this.checkWidthTaskNameItem(); - } - if (this.Chart.isShowDescTask)this.descrTask.innerHTML = this.getDescStr(); - this.addDayInPanelTime(); - - } -}; -/** - * @desc: get projectInfo by id - * @param: id - Project id - * @type: private - * @topic: 2 - */ -GanttChart.prototype.getProjectInfoById = function(id) -{ - - for (var i = 0; i < this.Project.length; i++) - { - if (this.Project[i].Id == id) - { - return this.Project[i]; - } - } - return null; -}; - -/** - * @desc: load xml data from string or file - * @param: content - (string) XML string or fileName - * @param: isFile - (true/false) if the content is a file name or XML string. if youload from file, setLoadPath() url is used, fileName is passed in "path" field - * @param: isLocal - (true/false) if the file is a local file (for debugging purposes) or remote (server-side) - * @type: public - * @topic: 6 - */ -GanttChart.prototype.loadData = function(content, isFile, isLocal) -{ - this.clearData(); - - if ((isFile == null) || (isFile == 'undefined')) - { - isFile = false; - } - if ((isLocal == null) || (isLocal == 'undefined')) - { - isLocal = false; - } - this.loadXML(content, isFile, isLocal); - - this.Project.sort(this.sort_byStartDate); - this.startDate = this.getStartDate(); - - this.clearItems(); - //this.panelTime.removeChild(this.panelTime.firstChild); - //this.panelTime.appendChild(this.createPanelTime()); - - for (var i = 0; i < this.Project.length; i++) - { - for (var k = 0; k < this.Project[i].ParentTasks.length; k++) - { - if ((this.Project[i].ParentTasks[k].EST != null) && (this.Project[i].ParentTasks[k].EST != '')) { - this.setESTChild(this.Project[i].ParentTasks[k]); - } - else { - this.Error.throwError("DATA_ERROR", 25, [this.Project[i].ParentTasks[k].Id]); - return; - } - - if (this.setPredTask(this.Project[i])) return; - } - - for (var k = 0; k < this.Project[i].ParentTasks.length; k++) { - if (this.Project[i].ParentTasks[k].EST < this.Project[i].StartDate) { - this.Error.throwError("DATA_ERROR", 24, [this.Project[i].ParentTasks[k].Id,this.Project[i].Id]); - return; - } - if (this.checkPosParentTaskInTree(this.Project[i].ParentTasks[k])) return; - } - - this.sortTasksByEST(this.Project[i]); - - } - - for (var i = 0; i < this.Project.length; i++) - { - - var project = new GanttProject(this, this.Project[i]); - - if (this.arrProjects.length > 0) - { - var previousProject = this.arrProjects[this.arrProjects.length - 1]; - project.previousProject = previousProject; - previousProject.nextProject = project; - } - - project.create(); - - this.checkHeighPanelTasks(); - this.arrProjects.push(project); - this.createTasks(project); - - } - -}; - -/** - * @desc: Clearing of a control - * @type: public - * @topic: 1 - */ -GanttChart.prototype.clearAll = function() -{ - this._oDataHeight = 0; - this.startDate = null; - this._isError = false; - - this.hidePanelErrors(); - this.clearData(); - this.clearItems(); - -}; -/** - * @desc: deleting of a data - * @type: private - * @topic: 1 - */ -GanttChart.prototype.clearData = function() -{ - this._oDataHeight = 0; - this.startDate = null; - this._isError = false; - - this.hidePanelErrors(); - - this.Project = []; - this.arrProjects = []; -}; -/** - * @desc: deleting of items of a control - * @type: private - * @topic: 1 - */ -GanttChart.prototype.clearItems = function() -{ - this.oData.removeChild(this.oData.firstChild); - this.oData.appendChild(this.createPanelTasks()); - this.oData.firstChild.appendChild(this.divInfo); - this.oData.firstChild.appendChild(this.panelErrors); - if (this._showTreePanel) - { - this.panelNames.removeChild(this.panelNames.firstChild); - this.panelNames.appendChild(this.createPanelNamesTasks()); - } - this.panelTime.removeChild(this.panelTime.firstChild); - this.panelTime.appendChild(this.createPanelTime()); -}; - -/** - * @desc: load xml data - * @param: content - (string) XML string or fileName - * @param: isFile - (true/false) if the content is a file name or XML string - * @param: isLocal - (true/false) if the file is a local file (for debugging purposes) or remote (server-side) - * @type: private - * @topic: 6 - */ -GanttChart.prototype.loadXML = function(content, isFile, isLocal) -{ - if (isFile && (content == null || content == "")) - { - this.Error.throwError("DATA_SEND_ERROR", 4, null); - return; - } - - this.xmlLoader = new dtmlXMLLoaderObject(null, this, false); - - try - { - if (!isFile) - try { - this.xmlLoader.loadXMLString(content); - } catch (e) { - this.Error.throwError("DATA_LOAD_ERROR", 37, [content]); - } else - if (!isLocal) - { - this.xmlLoader.loadXML(this.loadPath + "?path=" + content + "&rnd=" + (new Date() - 0), false); - - } else - { - this.xmlLoader.loadXML(content + "?rnd=" + (new Date() - 0), false); - } - this.doLoadDetails(isLocal); - - } catch(e) - { - this.Error.throwError("DATA_LOAD_ERROR", 5, [content]); - } - -}; -/** - * @desc: parsing of XML data - * @type: private - * @topic: 4 - */ -GanttChart.prototype.doLoadDetails = function(isLocal) -{ - switch (this.xmlLoader.xmlDoc.status) { - case 0: - if (!isLocal) - { - this.Error.throwError("DATA_LOAD_ERROR", 1, null); - return; - } - break; - case 404: - if (!isLocal) - { - this.Error.throwError("DATA_LOAD_ERROR", 5, [this.loadPath]); - - } else - { - this.Error.throwError("DATA_LOAD_ERROR", 5, [this.xmlLoader.filePath]) - } - return; - break; - case 500: - this.Error.throwError("DATA_LOAD_ERROR", 2, null); - return; - break; - default: - break; - } - - var name = null; - var id = null; - var est = null; - var duration = null; - var percentCompleted = null; - var predecessorTaskId = null; - - //var prArr = []; - //var tsArr = []; - //var rootTagProject = this.xmlLoader.getXMLTopNode("projects"); - var projectArr = this.xmlLoader.doXPath("//project"); - - for (var j = 0; j < projectArr.length; j++) - { - var startDateTemp = projectArr[j].getAttribute("startdate"); - var startDate = startDateTemp.split(","); - var project = new GanttProjectInfo(projectArr[j].getAttribute("id"), projectArr[j].getAttribute("name"), new Date(startDate[0], (parseInt(startDate[1]) - 1), startDate[2])); - - var taskArr = this.xmlLoader.doXPath("./task", projectArr[j]); - - for (var i = 0; i < taskArr.length; i++) { - - id = taskArr[i].getAttribute("id"); - name = (this.xmlLoader.doXPath("./name", taskArr[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./name", taskArr[i])[0].firstChild.nodeValue; - var estTemp = (this.xmlLoader.doXPath("./est", taskArr[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./est", taskArr[i])[0].firstChild.nodeValue; - est = estTemp.split(","); - duration = (this.xmlLoader.doXPath("./duration", taskArr[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./duration", taskArr[i])[0].firstChild.nodeValue; - percentCompleted = (this.xmlLoader.doXPath("./percentcompleted", taskArr[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./percentcompleted", taskArr[i])[0].firstChild.nodeValue; - predecessorTaskId = (this.xmlLoader.doXPath("./predecessortasks", taskArr[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./predecessortasks", taskArr[i])[0].firstChild.nodeValue; - - var task = new GanttTaskInfo(id, name, new Date(est[0], (parseInt(est[1]) - 1), est[2]), duration, percentCompleted, predecessorTaskId); - var childTasksNode = this.xmlLoader.doXPath("./childtasks", taskArr[i]); - var childTasksArr = this.xmlLoader.doXPath("./task", childTasksNode[0]); - - if (childTasksArr.length != 0) this.readChildTasksXML(task, childTasksArr); - - project.addTask(task); - - } - - this.addProject(project); - } -}; -/** - * @desc: parsing of XML data - * @param: parentTask - Parent Task object - * @param: childTasksArrXML - Array of child tasks (xml) - * @type: private - * @topic: 4 - */ -GanttChart.prototype.readChildTasksXML = function(parentTask, childTasksArrXML) -{ - - var name = null; - var id = null; - var est = null; - var duration = null; - var percentCompleted = null; - var predecessorTaskId = null; - - for (var i = 0; i < childTasksArrXML.length; i ++) - { - id = childTasksArrXML[i].getAttribute("id"); - name = (this.xmlLoader.doXPath("./name", childTasksArrXML[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./name", childTasksArrXML[i])[0].firstChild.nodeValue; - var estTemp = (this.xmlLoader.doXPath("./est", childTasksArrXML[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./est", childTasksArrXML[i])[0].firstChild.nodeValue; - est = estTemp.split(","); - duration = (this.xmlLoader.doXPath("./duration", childTasksArrXML[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./duration", childTasksArrXML[i])[0].firstChild.nodeValue; - percentCompleted = (this.xmlLoader.doXPath("./percentcompleted", childTasksArrXML[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./percentcompleted", childTasksArrXML[i])[0].firstChild.nodeValue; - predecessorTaskId = (this.xmlLoader.doXPath("./predecessortasks", childTasksArrXML[i])[0].firstChild == null) ? "" : this.xmlLoader.doXPath("./predecessortasks", childTasksArrXML[i])[0].firstChild.nodeValue; - var task = new GanttTaskInfo(id, name, new Date(est[0], (parseInt(est[1]) - 1), est[2]), duration, percentCompleted, predecessorTaskId); - task.ParentTask = parentTask; - - parentTask.addChildTask(task); - - var childTasksNode = this.xmlLoader.doXPath("./childtasks", childTasksArrXML[i]); - var childTasksArr = this.xmlLoader.doXPath("./task", childTasksNode[0]); - if (childTasksArr.length != 0) - { - this.readChildTasksXML(task, childTasksArr); - } - - } - -}; -/** - * @desc: create XML string from the chart content - * @type: public - * @topic: 6 - */ -GanttChart.prototype.getXML = function() -{ - var strXML = ""; - - for (var i = 0; i < this.Project.length; i++) - { - strXML += ""; - - for (var j = 0; j < this.Project[i].ParentTasks.length; j++) - { - strXML += ""; - strXML += "" + this.Project[i].ParentTasks[j].Name + ""; - strXML += "" + this.Project[i].ParentTasks[j].EST.getFullYear() + "," + (this.Project[i].ParentTasks[j].EST.getMonth() + 1) + "," + this.Project[i].ParentTasks[j].EST.getDate() + ""; - strXML += "" + this.Project[i].ParentTasks[j].Duration + ""; - strXML += "" + this.Project[i].ParentTasks[j].PercentCompleted + ""; - strXML += "" + this.Project[i].ParentTasks[j].PredecessorTaskId + ""; - strXML += ""; - strXML += this.createChildTasksXML(this.Project[i].ParentTasks[j].ChildTasks); - strXML += ""; - strXML += ""; - - } - - strXML += ""; - - } - strXML += ""; - return strXML; - -}; -/** - * @desc: create XML - * @type: private - * @topic: 4 - */ -GanttChart.prototype.createChildTasksXML = function(childTasks) -{ - var strXML = ""; - for (var n = 0; n < childTasks.length; n++) - { - strXML += ""; - strXML += "" + childTasks[n].Name + ""; - strXML += "" + childTasks[n].EST.getFullYear() + "," + (childTasks[n].EST.getMonth() + 1) + "," + childTasks[n].EST.getDate() + ""; - strXML += "" + childTasks[n].Duration + ""; - strXML += "" + childTasks[n].PercentCompleted + ""; - strXML += "" + childTasks[n].PredecessorTaskId + ""; - if (childTasks[n].ChildTasks) - { - strXML += ""; - strXML += this.createChildTasksXML(childTasks[n].ChildTasks); - strXML += ""; - } - strXML += ""; - } - return strXML; - -}; -/** - * @desc: function of sorting by EST - * @type: private - * @topic: 4 - */ -GanttChart.prototype.sort_byEST = function(a, b) -{ - if (a.EST < b.EST) return -1; - if (a.EST > b.EST) return 1; - return 0; -}; -/** - * @desc: function of sorting by start date - * @type: private - * @topic: 4 - */ -GanttChart.prototype.sort_byStartDate = function(a, b) -{ - if (a["StartDate"] < b["StartDate"]) return -1; - if (a["StartDate"] > b["StartDate"]) return 1; - return 0; -}; - -/** - * @desc: set the date to child tasks - * @param: parentTask - (object) parent task - * @type: private - * @topic: 4 - */ -GanttChart.prototype.setESTChild = function(parentTask) -{ - for (var t = 0; t < parentTask.ChildTasks.length; t++) - { - if ((parentTask.ChildTasks[t].EST == null ) || (parentTask.ChildTasks[t].EST == "")) - { - parentTask.ChildTasks[t].EST = parentTask.EST; - } - - if (parentTask.ChildTasks[t].ChildTasks.length != 0) this.setESTChild(parentTask.ChildTasks[t]); - } - -}; - -/** - * @desc: creation of the panel containing tasks - * @type: private - * @topic: 4 - */ -GanttChart.prototype.createPanelTasks = function() -{ - var divTasks = document.createElement("div"); - divTasks.className = "taskPanel"; - divTasks.style.cssText = "position:relative;"; - divTasks.style.height = this.contentHeight - 63 + "px"; - var w = this.startDate ? (this.startDate.getDay()-1) : ((new Date(0)).getDay()-1); - if (w==-1) w=6; - divTasks.style.background = "url(" + this.imgs + "bg_week.png) -"+(w*24)+"px 0px"; - this.panelTasks = divTasks; - return divTasks; -}; -/** - * @desc: creation of the panel containing names of tasks - * @type: private - * @topic: 4 - */ -GanttChart.prototype.createPanelNamesTasks = function() -{ - var divListNames = document.createElement("div"); - divListNames.innerHTML = " "; - divListNames.style.cssText = "position:relative;background:url(" + this.imgs + "bg.png)"; - divListNames.style.height = this.contentHeight - 63 + "px"; - divListNames.style.width = this.maxWidthPanelNames + "px"; - - return divListNames; -}; -/** - * @desc: creation a window with the data of task - * @type: private - * @topic: 4 - */ -GanttChart.prototype.createPopUpInfo = function() -{ - var divTaskInfo = document.createElement("div"); - divTaskInfo.style.cssText = 'display: none;'; - - var tblTaskInfo = document.createElement("table"); - tblTaskInfo.style.cssText = "position:absolute;top:0px;left:0px"; - tblTaskInfo.className = "poPupInfo"; - divTaskInfo.appendChild(tblTaskInfo); - - var rowTaskInfo = tblTaskInfo.insertRow(tblTaskInfo.rows.length); - var cellTaskInfo = document.createElement("td"); - rowTaskInfo.appendChild(cellTaskInfo); - this.divInfo = divTaskInfo; - - return divTaskInfo; -}; -/** - * @desc: creation a window with the current date - * @type: private - * @topic: 4 - */ -GanttChart.prototype.createPopUpTimeInfo = function() -{ - var divTimeInfo = document.createElement("div"); - divTimeInfo.style.display = "none"; - - var tblTimeInfo = document.createElement("table"); - tblTimeInfo.className = "poPupTime"; - divTimeInfo.appendChild(tblTimeInfo); - - var rowTimeInfo = tblTimeInfo.insertRow(tblTimeInfo.rows.length); - var cellTimeInfo = document.createElement("td"); - cellTimeInfo.align = "center"; - rowTimeInfo.appendChild(cellTimeInfo); - - return divTimeInfo; -}; -/** - * @desc: create a panel with the days - * @type: private - * @topic: 4 - */ -GanttChart.prototype.createPanelTime = function() -{ - var panelTime = document.createElement("div"); - panelTime.style.position = "relative"; - - var tblTime = document.createElement("table"); - panelTime.appendChild(tblTime); - tblTime.cellPadding = "0px"; - tblTime.border = "0px"; - tblTime.cellSpacing = "0px"; - tblTime.bgColor = "#FFFFFF"; - tblTime.style.marginTop = "0px"; - - var monthRow = tblTime.insertRow(tblTime.rows.length); - - var newRow = tblTime.insertRow(tblTime.rows.length); - - //creating cells for tblTime - for (var i = 0; i < this.countDays; i++) - { - this.addPointInTimePanel(newRow, panelTime); - this.addDayInPanelTime(newRow); - } - - return panelTime; -}; -/** - * @desc: creation of point in panel time - * @param: row - current row - * @param: panelTime -Panel which contains days - * @type: private - * @topic: 4 - */ -GanttChart.prototype.addPointInTimePanel = function(row, panelTime) -{ - var leftLine = document.createElement("div"); - leftLine.style.cssText = "position:absolute;left:" + ( row.cells.length * this.dayInPixels ) + "px;top:20px;height:20px;width:1px;font-size:1px;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;background:#f1f3f1;"; - panelTime.appendChild(leftLine); -}; -GanttChart.prototype._calculateMonthColSpan = function(date, maxLen) { - var m1 = date.getMonth(); - for(var i=1; i<=maxLen; i++) { - date.setDate(date.getDate() + 1); - var m2 = date.getMonth(); - if (m2 != m1) return i; - } - return maxLen; -}; -/** - * @desc: Returns a string representation of current month for the month scale row. You may override this function to customize the label. - * @param: date - {JavaScript Date object}, the date of month for which you should render month label. - * @type: public, overridable - * @topic: 3 - */ -GanttChart.prototype.getMonthScaleLabel = function(date) { - return (this._useShortMonthNames ? this.shortMonthNames : this.monthNames)[date.getMonth()] + " '" + (""+date.getFullYear()).substring(2); -}; -/** - * @desc: Use short or full month name in the month label axis. Default is true. - * @param: flag - {true|false} - * @type: public - * @topic: 3 - * @before_init: 1 - */ -GanttChart.prototype.useShortMonthNames = function(flag) { - this._useShortMonthNames = flag; -}; -/** - * @desc: Define short month names for your locale - * @param: names - an array of strings, ["Jan", "Feb", ...] - * @type: public - * @topic: 3 - * @before_init: 1 - */ -GanttChart.prototype.setShortMonthNames = function(names) { - this.shortMonthNames = names; -}; -/** - * @desc: Define full month names for your locale - * @param: names - an array of strings, ["January", "February", ...] - * @type: public - * @topic: 3 - * @before_init: 1 - */ -GanttChart.prototype.setMonthNames = function(names) { - this.monthNames = names; -}; -/** - * @desc: Add day in panel time - * @param: row - row, which contains days - * @type: private - * @topic: 4 - */ -GanttChart.prototype.addDayInPanelTime = function(row) -{ - var self = this, idx = row.cells.length, date = new Date(this.startDate); - - var newCell = row.insertCell(idx); - newCell.style.height = "20px"; - newCell.style.width = this.dayInPixels + "px"; - newCell.className = "dayNumber"; - - date.setDate(date.getDate() + parseInt(idx)); - var day = date.getDate() - newCell.innerHTML = day; - newCell.setAttribute("idx", idx); - - var monthRow = row.parentNode.parentNode.rows[0]; - if (idx==0 || day==1) { - var newCell2 = monthRow.insertCell(monthRow.cells.length); - newCell2.className = "monthName"; - newCell2.style.height = "20px"; - if (monthRow.cells.length%2 == 0) newCell2.style.backgroundColor = "#f7f8f7"; - newCell2.colSpan = this._calculateMonthColSpan(new Date(date), Math.max(1,this.countDays-idx)); - newCell2.innerHTML = this.getMonthScaleLabel(date); - } else { - var n = monthRow.cells.length, cs=0; - for(var i=0; i=cs) monthRow.cells[n-1].colSpan += 1; - } - - var w = date.getDay(); - if (w==0 || w==6) newCell.style.backgroundColor = "#f7f8f7"; -}; -/** - * @desc: increment Height of Panel Tasks - * @type: private - * @topic: 4 - */ -GanttChart.prototype.incHeightPanelTasks = function(height) -{ - var containerTasks = this.oData.firstChild; - containerTasks.style.height = parseInt(containerTasks.style.height) + height + "px"; -}; -/** - * @desc: increment Height of Panel Names - * @type: private - * @topic: 4 - */ -GanttChart.prototype.incHeightPanelNames = function(height) -{ - var containerNames = this.panelNames.firstChild; - containerNames.style.height = parseInt(containerNames.style.height) + height + "px"; -}; -/** - * @desc: check Heigh of Panel Tasks - * @type: private - * @topic: 4 - */ -GanttChart.prototype.checkHeighPanelTasks = function() -{ - this._oDataHeight += 11 + this.heightTaskItem; - if ((parseInt(this.oData.firstChild.style.height) <= this._oDataHeight)) { - this.incHeightPanelTasks(this.heightTaskItem + 11); - if (this._showTreePanel) this.incHeightPanelNames(this.heightTaskItem + 11); - } -}; -/** - * @desc: sorting of tasks by EST in the current project - * @param: project - current project - * @type: private - * @topic: 4 - */ -GanttChart.prototype.sortTasksByEST = function(project) -{ - project.ParentTasks.sort(this.sort_byEST); - - for (var i = 0; i < project.ParentTasks.length; i++) - { - project.ParentTasks[i] = this.sortChildTasks(project.ParentTasks[i]); - } - -}; -/** - * @desc: sorting of child tasks in the parent task - * @param: parenttask - (object) parent task - * @type: private - * @topic: 4 - */ -GanttChart.prototype.sortChildTasks = function(parenttask) -{ - parenttask.ChildTasks.sort(this.sort_byEST); - - for (var i = 0; i < parenttask.ChildTasks.length; i++) - { - if (parenttask.ChildTasks[i].ChildTasks.length > 0) this.sortChildTasks(parenttask.ChildTasks[i]); - } - return parenttask; -}; -/** - * @desc: Handler of data errors - * @param: type - type of error - * @param: descr - description of error - * @param: params - current data - * @type: private - * @topic: 5 - */ -GanttChart.prototype.errorDataHandler = function(type, descr, params) -{ - if (!this._isError) - { - this.clearData(); - this.showPanelErrors(); - this._isError = true; - } - this.addErrorInPanelErrors(type, descr); -}; -/** - * @desc: creation of Panel Errors - * @type: private - * @topic: 4 - */ -GanttChart.prototype.createPanelErrors = function() -{ - var tbl = document.createElement("table"); - tbl.width = "100%"; - tbl.style.display = "none"; - tbl.className = "panelErrors"; - this.panelErrors = tbl; - - return tbl; - -}; -/** - * @desc: show of Panel Errors - * @type: private - * @topic: 4 - */ -GanttChart.prototype.showPanelErrors = function() -{ - this.panelErrors.style.display = "inline"; -}; -/** - * @desc: hide of Panel Errors - * @type: private - * @topic: 4 - */ -GanttChart.prototype.hidePanelErrors = function() -{ - for (var i = 0; i < this.panelErrors.rows.length; i++) { - - this.panelErrors.rows[i].parentNode.removeChild(this.panelErrors.rows[i]); - } - this.panelErrors.style.display = "none"; -}; -/** - * @desc: add error message in Panel Errors - * @type: private - * @topic: 4 - */ -GanttChart.prototype.addErrorInPanelErrors = function(type, descr) -{ - var row = this.panelErrors.insertRow(this.panelErrors.rows.length); - var cell = document.createElement("td"); - cell.style.height = "20px"; - cell.style.width = "100px"; - cell.innerHTML = type; - row.appendChild(cell); - - cell = document.createElement("td"); - row.appendChild(cell); - cell.innerHTML = descr; -}; -/** - * @desc: Handler of errors - * @param: type - type of error - * @param: descr - description of error - * @param: params - current data - * @type: private - * @topic: 5 - */ -GanttChart.prototype.errorSendDataHandler = function(type, descr, params) -{ - alert(descr); -}; -/** - * @desc: Handler of errors - * @param: type - type of error - * @param: descr - description of error - * @param: params - current data - * @type: private - * @topic: 5 - */ -GanttChart.prototype.errorLoadDataHandler = function(type, descr, params) -{ - alert(descr); -}; -/** - * @desc: Handler of API errors - * @param: type - type of error - * @param: descr - description of error - * @param: params - current data - * @type: private - * @topic: 5 - */ -GanttChart.prototype.errorAPIHandler = function(type, descr, params) -{ - alert(descr); -}; -/** - * @desc: saves data to server, using setSavePath() url and "application/x-www-form-urlencoded" encoding - * @param: fileName - passed to server as "filename" field, xml content is passed in "data" field - * @type: public - * @topic: 6 - */ -GanttChart.prototype.saveData = function(fileName) -{ - try { - - if (!this.dhtmlXMLSenderObject.isProcessed) - { - this.dhtmlXMLSenderObject.sendData(fileName, this.savePath, this.getXML()); - } - - } catch (e) { - this.Error.throwError("DATA_SEND_ERROR", e, null); - } -}; -/** - * @desc: creation of GanttChart - * @param: divId - id of div in which the control lays - * @param: xmlFile - path to XML document - * @type: public - * @topic: 0 - */ -GanttChart.prototype.create = function(divId) -{ - var self = this; - var content = document.getElementById(divId); - this.content = content; - this.getBrowserType(); - - // - if (this._isIE) { - document.body.attachEvent('onselectstart', function() { - window.event.returnValue = false; - }); - - document.body.attachEvent('onkeydown', function() { - if (event.keyCode == 65 && event.ctrlKey) window.event.returnValue = false; - }); - - } else { - content.addEventListener('mousedown', function(e) { - e.preventDefault(); - }, true); - document.addEventListener('keydown', function(e) { - if (e.keyCode == 65 && e.ctrlKey) e.preventDefault(); - }, true); - } - - //init handlers - this.Error.catchError("DATA_ERROR", function(type, descr, params) { - self.errorDataHandler(type, descr, params) - }); - this.Error.catchError("DATA_SEND_ERROR", function(type, descr, params) { - self.errorSendDataHandler(type, descr, params) - }); - this.Error.catchError("DATA_INSERT_ERROR", function(type, descr, params) { - self.errorAPIHandler(type, descr, params) - }); - this.Error.catchError("DATA_LOAD_ERROR", function(type, descr, params) { - self.errorLoadDataHandler(type, descr, params) - }); - - //create Table - var tableControl = document.createElement("table"); - tableControl.cellPadding = "0"; - tableControl.cellSpacing = "0"; - tableControl.style.cssText = "width: 100%; position: relative;"; - var newRowTblControl = tableControl.insertRow(tableControl.rows.length); - var newCellTblControl; - - //Add to content Table - this.contentHeight = content.offsetHeight; - this.contentWidth = content.offsetWidth; - content.appendChild(tableControl); - - this.countDays = this.getCountDays(); - - this.Project.sort(this.sort_byStartDate); - this.startDate = this.getStartDate(); - - //Creation panel of time - this.panelTime = document.createElement("div"); - this.panelTime.appendChild(this.createPanelTime()); - this.panelTime.style.cssText = "position:relative;overflow:hidden;height:40px;top:0px;left:1px"; - - //Creation panel oData - this.oData = document.createElement("div"); - this.oData.appendChild(this.createPanelTasks()); - this.oData.style.cssText = "position:relative;overflow:scroll;height:" + (this.contentHeight - 40) + "px;border-left:#f1f3f1 1px solid"; - - this.oData.firstChild.appendChild(this.createPanelErrors()); - - //Creation panel of names - if (this._showTreePanel) - { - this.panelNames = document.createElement("div"); - newCellTblControl = document.createElement("td"); - newCellTblControl.vAlign = "top"; - - this.panelNames.appendChild(this.createPanelNamesTasks()); - this.panelNames.style.cssText = "position:relative;top:40px;overflow:hidden;border-left:#f1f3f1 1px solid;border-bottom:#f1f3f1 1px solid"; - newCellTblControl.appendChild(this.panelNames); - newRowTblControl.appendChild(newCellTblControl); - } - - //add oData and oDataTime - newCellTblControl = document.createElement("td"); - var divCell = document.createElement("div"); - divCell.style.cssText = "position: relative;"; - divCell.appendChild(this.panelTime); - divCell.appendChild(this.oData); - newCellTblControl.appendChild(divCell); - newRowTblControl.appendChild(newCellTblControl); - - //Show panel of names - if (this._showTreePanel) { - this.panelNames.style.height = (this.contentHeight - 56) + "px"; - this.panelNames.style.width = this.maxWidthPanelNames + "px"; - this.oData.style.width = (this.contentWidth - this.maxWidthPanelNames) + "px"; - this.panelTasks.style.width = this.dayInPixels * this.countDays + "px"; - this.panelTime.style.width = (this.contentWidth - this.maxWidthPanelNames - 0*18) + "px"; - this.panelTime.firstChild.style.width = this.dayInPixels * this.countDays + "px"; - if (this.isShowConMenu && this.contextMenu == null) this.contextMenu = new contextMenu(this); - } else { - this.oData.style.width = this.contentWidth + "px"; - this.panelTime.style.width = (this.contentWidth - 16) + "px"; - } - - if (this._isOpera) { - this.oData.onmousewheel = function() { - return false; - } - } - - this.oData.onscroll = function() { - self.panelTime.scrollLeft = this.scrollLeft; - - if (self.panelNames) { - self.panelNames.scrollTop = this.scrollTop; - if (self.isShowConMenu) self.contextMenu.hideContextMenu(); - } - - }; - - //create pop up time info - this.divTimeInfo = this.createPopUpTimeInfo(); - divCell.appendChild(this.divTimeInfo); - - //create pop up info task - this.oData.firstChild.appendChild(this.createPopUpInfo()); - - //this.Project.sort(this.sort_byStartDate); - //this.startDate = this.getStartDate(); - - for (var i = 0; i < this.Project.length; i++) - { - - for (var k = 0; k < this.Project[i].ParentTasks.length; k++) - { - if (this.isEmpty(this.Project[i].ParentTasks[k].EST)) { - this.Project[i].ParentTasks[k].EST = this.Project[i].StartDate; - } - this.setESTChild(this.Project[i].ParentTasks[k]); - - if (this.setPredTask(this.Project[i])) return; - } - - for (var k = 0; k < this.Project[i].ParentTasks.length; k++) { - if (this.Project[i].ParentTasks[k].EST < this.Project[i].StartDate) { - - if (!this.correctError) { - this.Error.throwError("DATA_ERROR", 24, [this.Project[i].ParentTasks[k].Id,this.Project[i].Id]); - return; - } else { - this.Project[i].ParentTasks[k].EST = this.Project[i].StartDate; - } - } - if (this.checkPosParentTaskInTree(this.Project[i].ParentTasks[k])) return; - } - - this.sortTasksByEST(this.Project[i]); - - } - - for (var i = 0; i < this.Project.length; i++) - { - //creation project - var project = new GanttProject(this, this.Project[i]); - - if (this.arrProjects.length > 0) - { - var previousProject = this.arrProjects[this.arrProjects.length - 1]; - project.previousProject = previousProject; - previousProject.nextProject = project; - } - project.create(); - - this.checkHeighPanelTasks(); - this.arrProjects.push(project); - this.createTasks(project); - - } - - return this; -}; - -GanttChart.prototype.isEmpty = function(value) -{ - return (value == null || value == ''); -}; - -/** - * @desc: returns chart in html format suitable for printing, full-sized and without scrollbars - * @type: public - * @topic: 7 - */ -GanttChart.prototype.getPrintableHTML = function() -{ - var w = parseInt(this.oData.firstChild.style.width) - parseInt(this.oData.style.width); - var h = parseInt(this.panelTasks.style.height) - parseInt(this.panelTasks.parentNode.style.height); - - this.oData.setAttribute("id","ganttPrint02"); - this.panelNames.setAttribute("id","ganttPrint03"); - - var res = 'onload=function(){var w=' + w + ',h=' + h + - ',c1=document.getElementById("ganttPrint01"),c2=document.getElementById("ganttPrint02"),c3=document.getElementById("ganttPrint03");' + - 'c2.style.width=parseInt(c2.style.width)+w+"px";c2.previousSibling.style.width=c2.style.width;c1.style.width=parseInt(c1.style.width)+w+"px";c2.style.height=parseInt(c2.style.height)+h+"px";' + - 'c2.style.overflow="hidden";c3.style.height=c3.firstChild.style.height;c1.style.height=parseInt(c1.style.height)+h+"px";}' + - '
' + this.content.innerHTML + '
'; - - this.oData.setAttribute("id",null); - this.panelNames.setAttribute("id",null); - - return res; -}; - -/** - * @desc: opens chart in a new window, from where you can print it as you like - you can use browser's "Print preview" menu button to layout the chart on your page, choose a paper size etc. - * @param: message - (string) this message will appear in alert window to instruct user what to do for printing. Set it to null to skip this alert. By default it says "Use browser's menu File->Print preview to setup page layout." - * @type: public - * @topic: 7 - */ -GanttChart.prototype.printToWindow = function(message) -{ - var o = window.open(); - o.document.write(this.getPrintableHTML()); - o.document.close(); - if (message!==null) { - o.alert(message ? message : "Use browser's menu \"File->Print preview\" to setup page layout." ); - } -}; - -/** - * @desc: Calculation of Start Date - * @type: private - * @topic: 4 - */ -GanttChart.prototype.getStartDate = function() -{ - for (var i = 0; i < this.Project.length; i++) { - - if (this.startDate) { - if (this.Project[i].StartDate < this.startDate) { - this.startDate = new Date(this.Project[i].StartDate); - } - } - else { - this.startDate = new Date(this.Project[i].StartDate); - } - } - - this.initialPos = 24 * this.hourInPixels; - if (this.startDate) { - return new Date(this.startDate.setHours(this.startDate.getHours() - 24)); - } - else { - return new Date(); - } - -}; -/** - * @desc: Calculation of Count Days - * @type: private - * @topic: 4 - */ -GanttChart.prototype.getCountDays = function() -{ - - if (this._showTreePanel) { - return parseInt((this.contentWidth - this.maxWidthPanelNames) / (this.hourInPixels * 24)); - - } else { - return parseInt((this.contentWidth) / (this.hourInPixels * 24)); - } - -}; -/** - * @desc: Creation of tasks - * @param: project - (object)project - * @type: private - * @topic: 4 - */ -GanttChart.prototype.createTasks = function(project) -{ - for (var j = 0; j < project.Project.ParentTasks.length; j++) - { - if (j > 0) - { - project.Project.ParentTasks[j - 1].nextParentTask = project.Project.ParentTasks[j]; - project.Project.ParentTasks[j].previousParentTask = project.Project.ParentTasks[j - 1]; - } - - var task = new GanttTask(project.Project.ParentTasks[j], project, this); - project.arrTasks.push(task); - task.create(); - - this.checkHeighPanelTasks(); - - if (project.Project.ParentTasks[j].ChildTasks.length > 0) - { - this.createChildItemControls(project.Project.ParentTasks[j].ChildTasks, project); - } - } -}; -/** - * @desc: Creation of tasks - * @param: arrChildTasks - array of child tasks - * @param: project - (object)project - * @type: private - * @topic: 4 - */ -GanttChart.prototype.createChildItemControls = function(arrChildTasks, project) -{ - for (var i = 0; i < arrChildTasks.length; i++) { - - if (i > 0) - { - arrChildTasks[i].previousChildTask = arrChildTasks[i - 1]; - arrChildTasks[i - 1].nextChildTask = arrChildTasks[i]; - } - var task = new GanttTask(arrChildTasks[i], project, this); - task.create(); - - this.checkHeighPanelTasks(); - - if (arrChildTasks[i].ChildTasks.length > 0) - { - this.createChildItemControls(arrChildTasks[i].ChildTasks, project); - } - } - -}; -/** - * @desc: show a small window with the data of task - * @param: event - (object)event - * @type: private - * @topic: 4 - */ -GanttTask.prototype.getPopUpInfo = function(object, event) -{ - //this.cTaskItem[0] - var posY = object.offsetTop + this.Chart.heightTaskItem + 6; - var posX = object.offsetLeft + ((event.layerX == null) ? event.offsetX : event.layerX); - - //data of task - var tblInfo = this.Chart.divInfo.lastChild; - tblInfo.rows[0].cells[0].innerHTML = "
" + this.TaskInfo.Name + "
"; - tblInfo.rows[0].cells[0].innerHTML += "EST: " + this.TaskInfo.EST.getDate() + "." + (this.TaskInfo.EST.getMonth() + 1) + "." + this.TaskInfo.EST.getFullYear() + "
"; - tblInfo.rows[0].cells[0].innerHTML += "Duration: " + this.TaskInfo.Duration + " hours
"; - // tblInfo.rows[0].cells[0].innerHTML += "Percent Complete: " + this.TaskInfo.PercentCompleted + "%
"; - - //show predecessor task - if (this.predTask) - { - tblInfo.rows[0].cells[0].innerHTML += "Predecessor Task: "; - tblInfo.rows[0].cells[0].innerHTML += "*" + this.TaskInfo.PredecessorTask.Name + ""; - } - - //show child tasks - if (this.TaskInfo.ChildTasks.length != 0) { - tblInfo.rows[0].cells[0].innerHTML += "Child Tasks: "; - for (var i = 0; i < this.TaskInfo.ChildTasks.length; i++) - { - tblInfo.rows[0].cells[0].innerHTML += (i == this.TaskInfo.ChildTasks.length - 1) ? ("*" + this.TaskInfo.ChildTasks[i].Name + "") : ("*" + this.TaskInfo.ChildTasks[i].Name + ""); - } - } - - //show parent task - if (this.TaskInfo.ParentTask) { - tblInfo.rows[0].cells[0].innerHTML += "Parent Task: "; - tblInfo.rows[0].cells[0].innerHTML += "*" + this.TaskInfo.ParentTask.Name + ""; - } - - this.Chart.divInfo.style.cssText = "z-index:2;position: absolute;display: inline;"; - - if (posY + this.Chart.divInfo.lastChild.offsetHeight + 10 > this.Chart.oData.offsetHeight + this.Chart.oData.scrollTop) { - this.Chart.divInfo.style.top = (posY - this.Chart.divInfo.lastChild.offsetHeight - 10 - this.Chart.heightTaskItem) + "px"; - } - else { - this.Chart.divInfo.style.top = posY + "px"; - } - - if (this.Chart.divInfo.lastChild.offsetWidth + posX + 10 > this.Chart.oData.offsetWidth + this.Chart.oData.scrollLeft) { - this.Chart.divInfo.style.left = posX - (this.Chart.divInfo.lastChild.offsetWidth + posX + 20 - (this.Chart.oData.offsetWidth + this.Chart.oData.scrollLeft)) + "px"; - - } else { - this.Chart.divInfo.style.left = posX + "px"; - } - -}; -/** - * @desc: close a window in browser with the data of task - * @type: private - * @topic: 4 - */ -GanttTask.prototype.closePopUpInfo = function() -{ - this.Chart.divInfo.style.display = "none"; -}; -/** - * @desc: creation connecting lines in panel of names - * @type: private - * @topic: 4 - */ -GanttTask.prototype.createConnectingLinesPN = function() -{ - var arrConnectingLinesNames = []; - - /*var lineVerticalLeft = document.createElement("div"); - lineVerticalLeft.style.cssText = "border-width: 0px 0px 0px 1px; border-style: dotted; border-color: #C0C4C0; margin: 0px; padding: 0px;z-index:10;position: absolute;" + - "height:" + (this.cTaskNameItem[0].offsetTop - this.parentTask.cTaskNameItem[0].offsetTop) + "px;" + - "top:" + (this.parentTask.cTaskNameItem[0].offsetTop + 5) + "px;" + - "left:" + (this.parentTask.cTaskNameItem[0].offsetLeft - 9) + "px;"; - lineVerticalLeft.innerHTML = " "; - this.Chart.panelNames.firstChild.appendChild(lineVerticalLeft); - - var LineHorizontalLeft = document.createElement("div"); - LineHorizontalLeft.noShade = true; - LineHorizontalLeft.color = "#000000"; - LineHorizontalLeft.style.cssText = "left:" + (this.parentTask.cTaskNameItem[0].offsetLeft - 9) + "px;top:" + (this.cTaskNameItem[0].offsetTop + 5) + "px;z-index:10;" + - "height:" + 1 + "px;width:" + (this.cTaskNameItem[0].offsetLeft - this.parentTask.cTaskNameItem[0].offsetLeft + 4 ) + "px;position: absolute;border-width: 1px 0px 0px 0px;font-size: 1px;border-style: dotted; border-color: #C0C4C0;margin: 0px; padding: 0px;"; - this.Chart.panelNames.firstChild.appendChild(LineHorizontalLeft); - - arrConnectingLinesNames.push(lineVerticalLeft); - arrConnectingLinesNames.push(LineHorizontalLeft);*/ - - return arrConnectingLinesNames; - -}; -/** - * @desc: creation connecting lines in panel oData - * @type: private - * @topic: 4 - */ -GanttTask.prototype.createConnectingLinesDS = function() -{ - var oData = this.Chart.oData.firstChild; - var arrLines = []; - - var arrowImg = new Image(); - arrowImg.src = this.Chart.imgs + "arr.gif"; - - //vertical line - var lineVerticalRight = document.createElement("div"); - - //horizontal line - var lineHorizontal = document.createElement("div"); - - var posXPredecessorTask = parseInt(this.predTask.cTaskItem[0].style.left); - var posYPredecessorTask = parseInt(this.predTask.cTaskItem[0].style.top); - - var posXChildTask = parseInt(this.cTaskItem[0].style.left); - var posYChildTask = this.posY + 2; - - //width task item - var widthChildTask = parseInt(this.predTask.cTaskItem[0].firstChild.firstChild.width); - var widthPredecessorTask = parseInt(this.predTask.cTaskItem[0].firstChild.firstChild.width); - - if (posYPredecessorTask < posYChildTask) - { - lineVerticalRight.style.cssText = "border-width: 0px 0px 0px 1px; border-style: solid; border-color: #4A8F43;margin: 0px; padding: 0px;z-index:0;font-size: 1px;position: absolute;" + - "height:" + (posYChildTask - this.Chart.heightTaskItem / 2 - posYPredecessorTask - 3) + "px;width:" + 1 + "px;left:" + (posXPredecessorTask + widthPredecessorTask - 20 ) + "px;top:" + (posYPredecessorTask + this.Chart.heightTaskItem) + "px;"; - - lineHorizontal.style.cssText = "height:1px;border-color: #4A8F43;border-style: solid;border-width: 1px 0px 0px 0px;margin: 0px; padding: 0px;z-index:0;position: absolute;" + - "width:" + (15 + (posXChildTask - (widthPredecessorTask + posXPredecessorTask))) + "px;left:" + (posXPredecessorTask + widthPredecessorTask - 20 ) + "px;top:" + (posYChildTask + 2) + "px;"; - - arrowImg.style.cssText = "margin: 0px; padding: 0px;width:7px;height:14px;position: absolute;left:" + (posXChildTask - 7) + "px;top:" + (posYChildTask - 1) + "px;"; - } else { - lineVerticalRight.style.cssText = "border-width: 0px 0px 0px 1px; border-style: solid; border-color: #4A8F43;margin: 0px; padding: 0px;z-index:0;font-size: 1px;position: absolute;" + - "height:" + (posYPredecessorTask + 2 - posYChildTask) + "px;width:" + 1 + "px;left:" + (posXPredecessorTask + widthPredecessorTask - 20 ) + "px;top:" + (posYChildTask + 2) + "px;"; - - lineHorizontal.style.cssText = "height:1px;border-color: #4A8F43;border-style: solid;border-width: 1px 0px 0px 0px;margin: 0px; padding: 0px;z-index:0;position: absolute;" + - "width:" + (15 + (posXChildTask - (widthPredecessorTask + posXPredecessorTask))) + "px;left:" + (posXPredecessorTask + widthPredecessorTask - 20 ) + "px;top:" + (posYChildTask + 2) + "px;"; - - arrowImg.style.cssText = "margin: 0px; padding: 0px;width:7px;height:14px;position: absolute;left:" + (posXChildTask - 7) + "px;top:" + (posYChildTask - 1) + "px;"; - } - oData.appendChild(lineVerticalRight); - oData.appendChild(lineHorizontal); - oData.appendChild(arrowImg); - - arrLines.push(lineVerticalRight); - arrLines.push(arrowImg); - arrLines.push(lineHorizontal); - - return arrLines; -}; -/** - * @desc: Shows current tasks - * @param: task - GanttTask object. - * @type: private - * @topic: 3 - */ -GanttTask.prototype.showChildTasks = function(task, isOpen) -{ - if (isOpen) - { - for (var i = 0; i < task.childTask.length; i++) - { - if (task.childTask[i].cTaskItem[0].style.display == "none") { - task.childTask[i].cTaskItem[0].style.display = "inline"; - task.childTask[i].cTaskNameItem[0].style.display = "inline"; - if (this.Chart.isShowDescTask) { - task.childTask[i].showDescTask(); - } - - task.isHide = false; - - if (task.childTask[i].cTaskNameItem[2]) { - task.childTask[i].cTaskNameItem[2].style.display = "inline"; - isOpen = task.childTask[i]._isOpen; - } - - for (var k = 0; k < task.childTask[i].cTaskItem[1].length; k++) { - task.childTask[i].cTaskItem[1][k].style.display = "inline"; - - } - for (var k = 0; k < task.childTask[i].cTaskNameItem[1].length; k++) { - task.childTask[i].cTaskNameItem[1][k].style.display = "inline"; - } - - this._heightHideTasks += this.Chart.heightTaskItem + 11; - - if (task.childTask[i].childTask.length > 0) { - this.showChildTasks(task.childTask[i], isOpen); - } - - } - } - } -}; -/** - * @desc: hide child task - * @param: task - (object) GanttTask - * @type: private - * @topic: 3 - */ -GanttTask.prototype.hideChildTasks = function(task) -{ - for (var i = 0; i < task.childTask.length; i++) - { - if (task.childTask[i].cTaskItem[0].style.display != "none") - { - task.childTask[i].cTaskItem[0].style.display = "none"; - task.childTask[i].cTaskNameItem[0].style.display = "none"; - if (this.Chart.isShowDescTask) { - task.childTask[i].hideDescTask(); - } - task.isHide = true; - - if (task.childTask[i].cTaskNameItem[2]) { - task.childTask[i].cTaskNameItem[2].style.display = "none"; - } - - for (var k = 0; k < task.childTask[i].cTaskItem[1].length; k++) { - task.childTask[i].cTaskItem[1][k].style.display = "none"; - } - for (var k = 0; k < task.childTask[i].cTaskNameItem[1].length; k++) { - task.childTask[i].cTaskNameItem[1][k].style.display = "none"; - } - - this._heightHideTasks += this.Chart.heightTaskItem + 11; - - if (task.childTask[i].childTask.length > 0) { - this.hideChildTasks(task.childTask[i]); - } - - } - } -}; -/** - * @desc: shift current tasks - * @param: task - (object) GanttTask - * @param: height - specifies height on which tasks are shifted - * @type: private - * @topic: 4 - */ -GanttTask.prototype.shiftCurrentTasks = function(task, height) -{ - this.shiftNextTask(this, height); - task.Project.shiftNextProject(task.Project, height); -}; - -GanttProject.prototype.shiftNextProject = function(project, height) -{ - if (project.nextProject) { - project.nextProject.shiftProject(height); - this.shiftNextProject(project.nextProject, height); - } - -}; -GanttProject.prototype.shiftProject = function(height) -{ - this.projectItem[0].style.top = parseInt(this.projectItem[0].style.top) + height + "px"; - if (this.Chart.isShowDescProject) { - this.descrProject.style.top = parseInt(this.descrProject.style.top) + height + "px"; - } - - if (this.Chart._showTreePanel) { - this.projectNameItem.style.top = parseInt(this.projectNameItem.style.top) + height + "px"; - } - if (this.arrTasks.length > 0) - this.shiftNextParentTask(this.arrTasks[0], height); - -}; -GanttProject.prototype.shiftTask = function(task, height) -{ - if (this.Chart._showTreePanel) { - - task.cTaskNameItem[0].style.top = parseInt(task.cTaskNameItem[0].style.top) + height + "px"; - if (task.cTaskNameItem[2]) { - task.cTaskNameItem[2].style.top = parseInt(task.cTaskNameItem[2].style.top) + height + "px"; - } - if (task.parentTask && task.cTaskNameItem[1][0]) - { - task.cTaskNameItem[1][0].style.top = parseInt(task.cTaskNameItem[1][0].style.top) + height + "px"; - task.cTaskNameItem[1][1].style.top = parseInt(task.cTaskNameItem[1][1].style.top) + height + "px"; - } - } - - task.cTaskItem[0].style.top = parseInt(task.cTaskItem[0].style.top) + height + "px"; - if (this.Chart.isShowDescTask) { - task.descrTask.style.top = parseInt(task.descrTask.style.top) + height + "px"; - } - if (task.cTaskItem[1][0]) - { - task.cTaskItem[1][0].style.top = parseInt(task.cTaskItem[1][0].style.top) + height + "px"; - task.cTaskItem[1][1].style.top = parseInt(task.cTaskItem[1][1].style.top) + height + "px"; - task.cTaskItem[1][2].style.top = parseInt(task.cTaskItem[1][2].style.top) + height + "px"; - } -}; -GanttProject.prototype.shiftNextParentTask = function(task, height) -{ - this.shiftTask(task, height); - this.shiftChildTasks(task, height); - - if (task.nextParentTask) { - this.shiftNextParentTask(task.nextParentTask, height); - } - -}; -GanttProject.prototype.shiftChildTasks = function(task, height) -{ - for (var i = 0; i < task.childTask.length; i++) - { - this.shiftTask(task.childTask[i], height); - if (task.childTask[i].childTask.length > 0) { - this.shiftChildTasks(task.childTask[i], height); - } - - } -}; - -GanttTask.prototype.shiftTask = function(task, height) -{ - if (this.Chart._showTreePanel) { - task.cTaskNameItem[0].style.top = parseInt(task.cTaskNameItem[0].style.top) + height + "px"; - if (task.cTaskNameItem[2]) { - task.cTaskNameItem[2].style.top = parseInt(task.cTaskNameItem[2].style.top) + height + "px"; - } - if (task.parentTask) - { - if (task.cTaskNameItem[1].length > 0) if ((parseInt(this.cTaskNameItem[0].style.top) > parseInt(task.parentTask.cTaskNameItem[0].style.top)) - && (task.cTaskNameItem[1][0].style.display != "none")) { - task.cTaskNameItem[1][0].style.height = parseInt(task.cTaskNameItem[1][0].style.height) + height + "px"; - } else { - task.cTaskNameItem[1][0].style.top = parseInt(task.cTaskNameItem[1][0].style.top) + height + "px"; - } - if (task.cTaskNameItem[1].length > 1) task.cTaskNameItem[1][1].style.top = parseInt(task.cTaskNameItem[1][1].style.top) + height + "px"; - } - } - - task.cTaskItem[0].style.top = parseInt(task.cTaskItem[0].style.top) + height + "px"; - if (this.Chart.isShowDescTask) { - task.descrTask.style.top = parseInt(task.descrTask.style.top) + height + "px"; - } - if (task.predTask) - { - if (task.cTaskItem[1].length > 0) if (((parseInt(this.cTaskItem[0].style.top) > parseInt(task.predTask.cTaskItem[0].style.top)) || - (this.cTaskItem[0].id == task.predTask.TaskInfo.Id)) && - task.cTaskItem[1][0].style.display != "none") { - task.cTaskItem[1][0].style.height = parseInt(task.cTaskItem[1][0].style.height) + height + "px"; - } else { - task.cTaskItem[1][0].style.top = parseInt(task.cTaskItem[1][0].style.top) + height + "px"; - } - if (task.cTaskItem[1].length > 2) { - task.cTaskItem[1][1].style.top = parseInt(task.cTaskItem[1][1].style.top) + height + "px"; - task.cTaskItem[1][2].style.top = parseInt(task.cTaskItem[1][2].style.top) + height + "px"; - } - } -}; -GanttTask.prototype.shiftNextTask = function(task, height) -{ - if (task.nextChildTask) { - this.shiftTask(task.nextChildTask, height); - this.shiftChildTask(task.nextChildTask, height); - this.shiftNextTask(task.nextChildTask, height); - - } else if (task.parentTask) { - this.shiftNextTask(task.parentTask, height); - - } else if (task.nextParentTask) { - this.shiftTask(task.nextParentTask, height); - this.shiftChildTask(task.nextParentTask, height); - this.shiftNextTask(task.nextParentTask, height); - } -}; -GanttTask.prototype.shiftChildTask = function(task, height) -{ - for (var i = 0; i < task.childTask.length; i++) - { - this.shiftTask(task.childTask[i], height); - if (task.childTask[i].childTask.length > 0) { - this.shiftChildTask(task.childTask[i], height); - } - } -}; - -/** - * @desc: get position of the task on EST - * @param: est - time of the beginning of the task - * @type: private - * @topic: 4 - */ -GanttChart.prototype.getPosOnDate = function(est) -{ - return (est - this.startDate) / (60 * 60 * 1000) * this.hourInPixels; -}; -/** - * @desc: get width on duration - * @param: duration - duration of current task - * @type: private - * @topic: 4 - */ -GanttChart.prototype.getWidthOnDuration = function(duration) -{ - return Math.round(this.hourInPixelsWork * duration); -}; -/** - * @desc: end of dragging of task - * @type: private - * @topic: 5 - */ -GanttTask.prototype.endMove = function() -{ - var width = parseInt(this.cTaskItem[0].style.left) - this.posX; - var est = this.getDateOnPosition(parseInt(this.cTaskItem[0].style.left)); - est = this.checkPos(est); - - this.wasMoved = this.TaskInfo.EST.valueOf() != est.valueOf(); - - if (this.checkMove) { - width = this.Chart.getPosOnDate(est) - this.posX; - this.moveCurrentTaskItem(width, this.moveChild); - this.Project.shiftProjectItem(); - } - - this.checkMove = false; - this.posX = 0; - this.maxPosXMove = -1; - this.minPosXMove = -1; - this.cTaskItem[0].childNodes[1].firstChild.rows[0].cells[0].innerHTML = ""; - - if (this.Chart._isFF) document.body.style.cursor = ""; - if (this.Chart._isIE) this.cTaskItem[0].childNodes[2].childNodes[0].style.cursor = ""; -}; - -GanttTask.prototype.checkPos = function(est) -{ - var h = est.getHours(); - if (h >= 12) - { - est.setDate(est.getDate() + 1); - est.setHours(0); - - if ((parseInt(this.cTaskItem[0].firstChild.firstChild.width) + this.Chart.getPosOnDate(est) > this.maxPosXMove) && (this.maxPosXMove != -1)) - { - est.setDate(est.getDate() - 1); - est.setHours(0); - } - - - } else if ((h < 12) && (h != 0)) - { - est.setHours(0); - if ((this.Chart.getPosOnDate(est) < this.minPosXMove)) - { - est.setDate(est.getDate() + 1); - } - } - this.cTaskItem[0].style.left = this.Chart.getPosOnDate(est) + "px"; - - return est; - -}; - -/** - * @desc: returns max position of child task - * @type: private - * @topic: 4 - */ -GanttTask.prototype.getMaxPosPredChildTaskItem = function() -{ - var posPredChildTaskItem = 0; - var nextPosPredChildTaskItem = 0; - - for (var i = 0; i < this.childPredTask.length; i++) - { - nextPosPredChildTaskItem = this.getMaxPosPredChildTaskItemInTree(this.childPredTask[i]); - if (nextPosPredChildTaskItem > posPredChildTaskItem) - { - posPredChildTaskItem = nextPosPredChildTaskItem; - } - } - return posPredChildTaskItem; - -}; -/** - * @desc: returns max position of child task in tree - * @param: task - (object) task - * @type: private - * @topic: 4 - */ -GanttTask.prototype.getMaxPosPredChildTaskItemInTree = function(task) -{ - var currentPos = parseInt(task.cTaskItem[0].firstChild.firstChild.width) + parseInt(task.cTaskItem[0].style.left); - var posPredChildTaskItem = 0; - var nextPosPredChildTaskItem = 0; - - for (var i = 0; i < task.childPredTask.length; i++) - { - nextPosPredChildTaskItem = this.getMaxPosPredChildTaskItemInTree(task.childPredTask[i]); - if (nextPosPredChildTaskItem > posPredChildTaskItem) - { - posPredChildTaskItem = nextPosPredChildTaskItem; - } - } - - if (posPredChildTaskItem > currentPos) - { - return posPredChildTaskItem; - } - else - { - return currentPos; - } - -}; -/** - * @desc: get task by id - * @param: id - Id of GanttTask - * @type: public - * @topic: 2 - */ -GanttProject.prototype.getTaskById = function(id) -{ - for (var i = 0; i < this.arrTasks.length; i++) - { - var task = this.searchTaskInTree(this.arrTasks[i], id); - if (task) return task; - - } - return null; -}; -/** - * @desc: search GanttTask in child tasks - * @param: task - (object) parent GanttTask - * @param: id - Id of GanttTask - * @type: private - * @topic: 2 - */ -GanttProject.prototype.searchTaskInTree = function(task, id) -{ - if (task.TaskInfo.Id == id) - { - return task; - - } else - { - for (var i = 0; i < task.childTask.length; i++) - { - if (task.childTask[i].TaskInfo.Id == id) - { - return task.childTask[i]; - } - else - { - if (task.childTask[i].childTask.length > 0) - { - var cTask = this.searchTaskInTree(task.childTask[i], id); - if (cTask) return cTask; - } - } - } - } - - return null; -}; -/** - * @desc: shift current projectItem - * @type: private - * @topic: 4 - */ -GanttProject.prototype.shiftProjectItem = function() -{ - var posItemL = null; - var posItemR = null; - var posProjectItemL = parseInt(this.projectItem[0].style.left); - var posProjectItemR = parseInt(this.projectItem[0].firstChild.style.width) + parseInt(this.projectItem[0].style.left); - var widthProjectItem = parseInt(this.projectItem[0].firstChild.style.width); - - for (var t = 0; t < this.arrTasks.length; t++) - { - var tmpPosItemL = parseInt(this.arrTasks[t].cTaskItem[0].style.left); - var tmpPosItemR = parseInt(this.arrTasks[t].cTaskItem[0].style.left) + parseInt(this.arrTasks[t].cTaskItem[0].firstChild.firstChild.width); - - if (!posItemL) { - posItemL = tmpPosItemL; - } - if (!posItemR) { - posItemR = tmpPosItemR; - } - - - if (posItemL > tmpPosItemL) { - posItemL = tmpPosItemL; - } - - if (posItemR < tmpPosItemR) { - posItemR = tmpPosItemR; - } - - } - - if (posItemL != posProjectItemL) - { - this.Project.StartDate = new Date(this.Chart.startDate); - this.Project.StartDate.setHours(this.Project.StartDate.getHours() + (posItemL / this.Chart.hourInPixels)); - } - - this.projectItem[0].style.left = posItemL + "px"; - this.resizeProjectItem(posItemR - posItemL); - - this.Duration = Math.round(parseInt(this.projectItem[0].firstChild.width) / (this.Chart.hourInPixelsWork)); - if (this.Chart.isShowDescProject) { - this.moveDescrProject(); - } - this.addDayInPanelTime(); - -}; -/** - * @desc: add one day - * @type: private - * @topic: 4 - */ -GanttProject.prototype.addDayInPanelTime = function() -{ - var width = parseInt(this.projectItem[0].style.left) + parseInt(this.projectItem[0].firstChild.style.width) + 20; - if (this.Chart.isShowDescProject) { - width += this.descrProject.offsetWidth; - } - - var table = this.Chart.panelTime.firstChild, tbody = table.firstChild; - if (parseInt(tbody.offsetWidth) < width) - { - var countDays = Math.round((width - parseInt(tbody.offsetWidth)) / this.Chart.dayInPixels); - var row = tbody.rows[1]; - for (var n = 0; n < countDays; n++) - { - this.Chart.addPointInTimePanel(row, table); - this.Chart.addDayInPanelTime(row); - } - var w = this.Chart.dayInPixels * (row.cells.length); - tbody.style.width = w + "px"; - this.Chart.panelTasks.style.width = (w-18) + "px"; - } -}; -/** - * @desc: add event - * @param: elm - current element - * @param: evType - string that specifies any of the standard DHTML Events - * @param: fn - pointer that specifies the function to call when sEvent fires - * @type: private - * @topic: 5 - */ -GanttProject.prototype.addEvent = function (elm, evType, fn, useCapture) -{ - if (elm.addEventListener) { - elm.addEventListener(evType, fn, useCapture); - return true; - } - else if (elm.attachEvent) { - return elm.attachEvent('on' + evType, fn); - } - else { - elm['on' + evType] = fn; - } -}; -/** - * @desc: shows popup info - * @param: event - (object)event - * @type: private - * @topic: 4 - */ -GanttProject.prototype.getPopUpInfo = function(object, event) -{ - //this.projectItem[0] - var posX = object.offsetLeft + ((event.layerX == null) ? event.offsetX : event.layerX); - var posY = object.offsetTop + this.Chart.heightTaskItem + 6; - - var tblInfo = this.Chart.divInfo.lastChild; - tblInfo.rows[0].cells[0].innerHTML = "
" + this.Project.Name + "
"; - tblInfo.rows[0].cells[0].innerHTML += "Start Date: " + this.Project.StartDate.getDate() + "." + (this.Project.StartDate.getMonth() + 1) + "." + this.Project.StartDate.getFullYear() + "
"; - tblInfo.rows[0].cells[0].innerHTML += "Duration: " + this.Duration + " hours
"; - // tblInfo.rows[0].cells[0].innerHTML += "Percent Complete: " + this.percentCompleted + "%
"; - - this.Chart.divInfo.style.cssText = "z-index:2;position: absolute;display: inline;"; - - if (posY + this.Chart.divInfo.lastChild.offsetHeight + 6 > this.Chart.oData.offsetHeight + this.Chart.oData.scrollTop) - { - this.Chart.divInfo.style.top = (posY - this.Chart.divInfo.lastChild.offsetHeight - 10 - this.Chart.heightTaskItem) + "px"; - } - else { - this.Chart.divInfo.style.top = posY + "px"; - } - - if (this.Chart.divInfo.lastChild.offsetWidth + posX + 10 > this.Chart.oData.offsetWidth + this.Chart.oData.scrollLeft) - { - this.Chart.divInfo.style.left = posX - (this.Chart.divInfo.lastChild.offsetWidth + posX + 20 - (this.Chart.oData.offsetWidth + this.Chart.oData.scrollLeft)) + "px"; - - } else { - this.Chart.divInfo.style.left = posX + "px"; - } -}; -/** - * @desc: hides pop up info - * @type: private - * @topic: 4 - */ -GanttProject.prototype.closePopUpInfo = function() -{ - this.Chart.divInfo.style.display = "none"; -}; -/** - * @desc: resize projectItem - * @param: width - new width - * @type: private - * @topic: 4 - */ -GanttProject.prototype.resizeProjectItem = function(width) -{ - var percentCompleted = this.percentCompleted; - if (percentCompleted > 0 && percentCompleted < 100) - { - this.projectItem[0].firstChild.style.width = width + "px"; - this.projectItem[0].firstChild.width = width + "px"; - this.projectItem[0].style.width = width + "px"; - this.projectItem[0].firstChild.rows[0].cells[0].firstChild.style.width = Math.round(width * percentCompleted / 100) + "px"; - this.projectItem[0].firstChild.rows[0].cells[1].firstChild.style.width = Math.round(width * (100 - percentCompleted) / 100) + "px"; - this.projectItem[0].lastChild.firstChild.width = width + "px"; - - } else if (percentCompleted == 0 || percentCompleted == 100) - { - this.projectItem[0].firstChild.style.width = width + "px"; - this.projectItem[0].firstChild.width = width + "px"; - this.projectItem[0].style.width = width + "px"; - this.projectItem[0].firstChild.rows[0].cells[0].firstChild.style.width = width + "px"; - this.projectItem[0].lastChild.firstChild.width = width + "px"; - } -}; -/** - * @desc: Moving of current task - * @param: width - length of shift of the task - * @param: moveChild - true, if move children together - * @type: private - * @topic: 4 - */ -GanttTask.prototype.moveCurrentTaskItem = function(width, moveChild) -{ - var taskItem = this.cTaskItem[0]; - this.TaskInfo.EST = new Date(this.Chart.startDate); - this.TaskInfo.EST.setHours(this.TaskInfo.EST.getHours() + (parseInt(taskItem.style.left) / this.Chart.hourInPixels)); - if (this.Chart.isShowDescTask) { - this.showDescTask(); - } - - if (this.cTaskItem[1].length > 0) { - this.cTaskItem[1][2].style.width = parseInt(this.cTaskItem[1][2].style.width) + width + "px"; - this.cTaskItem[1][1].style.left = parseInt(this.cTaskItem[1][1].style.left) + width + "px"; - } - - for (var i = 0; i < this.childTask.length; i++) { - if (!this.childTask[i].predTask) { - this.moveChildTaskItems(this.childTask[i], width, moveChild); - } - } - - for (var i = 0; i < this.childPredTask.length; i++) { - this.moveChildTaskItems(this.childPredTask[i], width, moveChild); - } - -}; -/** - * @desc: Moving of child tasks - * @param: task - (object) GanttTask - * @param: width - length of shift of the task - * @param: moveChild - true, if move children together - * @type: private - * @topic: 4 - */ -GanttTask.prototype.moveChildTaskItems = function(task, width, moveChild) -{ - var taskItem = task.cTaskItem[0]; - - if (moveChild) - { - taskItem.style.left = parseInt(taskItem.style.left) + width + "px"; - task.addDayInPanelTime(); - task.TaskInfo.EST = new Date(this.Chart.startDate); - task.TaskInfo.EST.setHours(task.TaskInfo.EST.getHours() + (parseInt(taskItem.style.left) / this.Chart.hourInPixels)); - - for (var n = 0; n < task.cTaskItem[1].length; n++) { - task.cTaskItem[1][n].style.left = parseInt(task.cTaskItem[1][n].style.left) + width + "px"; - } - - for (var i = 0; i < task.childTask.length; i++) { - if (!task.childTask[i].predTask) { - this.moveChildTaskItems(task.childTask[i], width, moveChild); - } - } - - for (var i = 0; i < task.childPredTask.length; i++) { - this.moveChildTaskItems(task.childPredTask[i], width, moveChild); - } - } - else - { - if (task.cTaskItem[1].length > 0) - { - task.cTaskItem[1][2].style.left = parseInt(task.cTaskItem[1][2].style.left) + width + "px"; - task.cTaskItem[1][2].style.width = parseInt(task.cTaskItem[1][2].style.width) - width + "px"; - task.cTaskItem[1][0].style.left = parseInt(task.cTaskItem[1][0].style.left) + width + "px"; - } - } - if (this.Chart.isShowDescTask) { - task.moveDescTask(); - } -}; -/** - * @desc: Addition of new day in panel of time - * @type: private - * @topic: 4 - */ -GanttTask.prototype.addDayInPanelTime = function() -{ - var taskItem = this.cTaskItem[0]; - var width = parseInt(taskItem.style.left) + parseInt(taskItem.firstChild.firstChild.width) + 20; - if (this.Chart.isShowDescTask) { - width += this.descrTask.offsetWidth; - } - - var table = this.Chart.panelTime.firstChild, tbody = table.firstChild; - if (parseInt(tbody.offsetWidth) < width) - { - var row = tbody.rows[1]; - var countDays = Math.round((width + 20 - parseInt(tbody.offsetWidth)) / this.Chart.dayInPixels); - for (var n = 0; n < countDays; n++) - { - this.Chart.addPointInTimePanel(row, table); - this.Chart.addDayInPanelTime(row); - } - var w = this.Chart.dayInPixels * (row.cells.length); - tbody.style.width = w + "px"; - this.Chart.panelTasks.style.width = (w-18) + "px"; - } -}; -/** - * @desc: return of date on position of task - * @param: position - current position of task - * @type: private - * @topic: 4 - */ -GanttTask.prototype.getDateOnPosition = function(position) -{ - var date = new Date(this.Chart.startDate); - date.setHours(date.getHours() + (position / this.Chart.hourInPixels)); - return date; -}; -/** - * @desc: moving of current task - * @param: event - (object) event - * @type: private - * @topic: 4 - */ -GanttTask.prototype.moveItem = function(event) -{ - var pageX = event.screenX; - var posTaskItem = (this.posX + (pageX - this.MouseX)); - var widthTaskItem = parseInt(this.cTaskItem[0].childNodes[0].firstChild.width); - var posTaskItemR = posTaskItem + widthTaskItem; - - if (this.checkMove) - { - var date = this.getDateOnPosition(posTaskItem); - var res = this.Chart.callEvent("onTaskDragging", [this,date])!==false; - if (res && ((this.minPosXMove <= posTaskItem)) - && ((posTaskItemR <= this.maxPosXMove) || (this.maxPosXMove == -1))) - { - this.moveTaskItem(posTaskItem); - } - } -}; -/** - * @desc: shift taskItem - * @param: posX - position of task - * @type: private - * @topic: 4 - */ -GanttTask.prototype.moveTaskItem = function(posX) -{ - this.addDayInPanelTime(); - this.cTaskItem[0].style.left = posX + "px"; - var date = this.getDateOnPosition(posX); - this.cTaskItem[0].childNodes[1].firstChild.rows[0].cells[0].innerHTML = date.getDate() + '.' + (date.getMonth() + 1) + '.' + date.getUTCFullYear(); -}; -/** - * @desc: resize current task - * @param: event - (object) event - * @type: private - * @topic: 4 - */ -GanttTask.prototype.resizeItem = function(event) -{ - if (this.checkResize) - { - var MouseX = event.screenX; - var widthTaskItem = this.taskItemWidth + (MouseX - this.MouseX); - - var countHours = Math.round(widthTaskItem / this.Chart.hourInPixelsWork); - if (this.Chart.callEvent("onTaskResizing", [this,countHours])===false) return; - - if (widthTaskItem >= this.taskItemWidth) - { - if ((widthTaskItem <= this.maxWidthResize) || (this.maxWidthResize == -1)) - { - this.resizeTaskItem(widthTaskItem); - this.addDayInPanelTime(); - - } else if ((this.maxWidthResize != -1) && (widthTaskItem > this.maxWidthResize)) - { - this.resizeTaskItem(this.maxWidthResize); - } - } else if (widthTaskItem <= this.taskItemWidth) - { - if (widthTaskItem >= this.minWidthResize) - { - this.resizeTaskItem(widthTaskItem); - } - else if (widthTaskItem < this.minWidthResize) - { - this.resizeTaskItem(this.minWidthResize); - } - } - } -}; -/** - * @desc: resize current taskItem - * @param: width - width of current taskItem - * @type: private - * @topic: 4 - */ -GanttTask.prototype.resizeTaskItem = function(width) -{ - var taskItem = this.cTaskItem[0]; - var countHours = Math.round(width / this.Chart.hourInPixelsWork); - var c = taskItem.childNodes[0].firstChild.rows[0].cells[0]; - if (c) - { - c.firstChild.style.width = parseInt(c.width) * width / 100 + "px"; - } - c = taskItem.childNodes[0].firstChild.rows[0].cells[1]; - if (c) - { - c.firstChild.style.width = parseInt(c.width) * width / 100 + "px"; - } - - taskItem.childNodes[0].firstChild.width = width + "px"; - taskItem.childNodes[1].firstChild.width = width + "px"; - - //resize info - this.cTaskItem[0].childNodes[1].firstChild.rows[0].cells[0].innerHTML = countHours; - taskItem.childNodes[2].childNodes[0].style.width = width + "px"; - taskItem.childNodes[2].childNodes[1].style.left = width - 10 + "px"; -}; -/** - * @desc: end of stretch of task - * @param: event - (object) event - * @type: private - * @topic: 4 - */ -GanttTask.prototype.endResizeItem = function() -{ - var taskItem = this.cTaskItem[0]; - this.wasResized = this.taskItemWidth != parseInt(taskItem.childNodes[0].firstChild.width); - if (this.wasResized) - { - var posXL = taskItem.offsetLeft; - var posXR = taskItem.offsetLeft + parseInt(taskItem.childNodes[0].firstChild.width); - this.TaskInfo.Duration = Math.round((posXR - posXL) / this.Chart.hourInPixelsWork); - if (this.childPredTask.length > 0) - { - for (var j = 0; j < this.childPredTask.length; j++) - { - this.childPredTask[j].cTaskItem[1][2].style.width = parseInt(this.childPredTask[j].cTaskItem[1][2].style.width) - (parseInt(taskItem.childNodes[0].firstChild.width) - this.taskItemWidth) + "px"; - this.childPredTask[j].cTaskItem[1][2].style.left = parseInt(this.childPredTask[j].cTaskItem[1][2].style.left) + (parseInt(taskItem.childNodes[0].firstChild.width) - this.taskItemWidth) + "px"; - this.childPredTask[j].cTaskItem[1][0].style.left = parseInt(this.childPredTask[j].cTaskItem[1][0].style.left) + (parseInt(taskItem.childNodes[0].firstChild.width) - this.taskItemWidth) + "px"; - } - } - } - this.cTaskItem[0].childNodes[1].firstChild.rows[0].cells[0].innerHTML = ""; - this.checkResize = false; - this.taskItemWidth = 0; - this.MouseX = 0; - if (this.Chart.isShowDescTask) { - this.showDescTask(); - } - this.Project.shiftProjectItem(); - - if (this.Chart._isFF) document.body.style.cursor = ""; -}; - -GanttProject.prototype.moveDescrProject = function() -{ - this.descrProject.style.left = (parseInt(this.projectItem[0].style.left) + this.Duration * this.Chart.hourInPixelsWork + 10); - this.descrProject.innerHTML = this.getDescStr(); -}; - -GanttProject.prototype.showDescrProject = function() -{ - var posX = (parseInt(this.projectItem[0].style.left) + this.Duration * this.Chart.hourInPixelsWork + 10); - this.descrProject.style.left = posX + "px"; - this.descrProject.style.visibility = 'visible'; - this.descrProject.innerHTML = this.getDescStr(); -}; - -GanttProject.prototype.hideDescrProject = function() -{ - this.descrProject.style.visibility = 'hidden'; -}; - -GanttProject.prototype.getDescStr = function() -{ - var str = '', delim = ", "; - - for (var i = 0; i < this.Chart.paramShowProject.length; i++) { - - switch (this.Chart.paramShowProject[i]) { - case "Name": - if (str != "")str += delim; - str += this.Project[this.Chart.paramShowProject[i]]; - break; - case "StartDate": - if (str != "")str += delim; - var d = this.Project[this.Chart.paramShowProject[i]]; - str += d.getDate() + "." + (d.getMonth() + 1) + "." + d.getFullYear(); - break; - case "Duration": - if (str != "")str += delim; - str += this[this.Chart.paramShowProject[i]] + "h"; - break; - case "percentCompleted": - if (str != "")str += delim; - str += this[this.Chart.paramShowProject[i]] + "%"; - break; - - default: - break; - } - - } - return str; -}; - - -GanttProject.prototype.createDescrProject = function() -{ - var posX = (this.posX + this.Duration * this.Chart.hourInPixelsWork + 10); - var divDesc = document.createElement("div"); - divDesc.style.cssText += ";z-index:1;position:absolute;left:" + posX + "px;top:" + this.posY + "px;"; - divDesc.innerHTML = this.getDescStr(); - divDesc.className = "descProject"; - this.descrProject = divDesc; - - if (this.Project.ParentTasks.length == 0) { - this.descrProject.style.visibility = 'hidden'; - } - - if (this.Chart._showTooltip) - { - var self = this; - var getPopUpInfo = function(e) { - if ((!self.Chart._isMove) && (!self.Chart._isResize)) self.getPopUpInfo(self.descrProject, e); - }; - var closePopUpInfo = function() { - self.closePopUpInfo(); - }; - - this.addEvent(divDesc, 'mouseover', getPopUpInfo, false); - this.addEvent(divDesc, 'mouseout', closePopUpInfo, false); - } - return divDesc; -}; - -/** - * @desc: creation of projectItem - * @type: private - * @topic: 0 - */ -GanttProject.prototype.createProjectItem = function() -{ - var self = this; - this.percentCompleted = this.getPercentCompleted(); - this.Duration = this.getDuration(); - - var projectItem = document.createElement("div"); - projectItem.id = this.Project.Id; - projectItem.style.cssText = ";z-index:1;position: absolute;left:" + this.posX + "px;top:" + this.posY + "px;"; - projectItem.style.width = this.Duration * this.Chart.hourInPixelsWork + "px"; - - var tblProjectItem = document.createElement("table"); - projectItem.appendChild(tblProjectItem); - tblProjectItem.cellPadding = "0"; - tblProjectItem.cellSpacing = "0"; - tblProjectItem.style.cssText = "border: solid 1px #BC810D;"; - var width = this.Duration * this.Chart.hourInPixelsWork; - tblProjectItem.width = ((width == 0) ? 1 : width) + "px"; - tblProjectItem.style.width = ((width == 0) ? 1 : width) + "px"; - - var rowprojectItem = tblProjectItem.insertRow(tblProjectItem.rows.length); - - if (this.percentCompleted != -1) - { - if (this.percentCompleted != 0) - { - var cellprojectItem = document.createElement("TD"); - rowprojectItem.appendChild(cellprojectItem); - cellprojectItem.width = this.percentCompleted + "%"; - cellprojectItem.style.lineHeight = "1px"; - var imgPr = document.createElement("img"); - imgPr.style.width = (this.percentCompleted * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - imgPr.style.height = this.Chart.heightTaskItem + "px"; - cellprojectItem.appendChild(imgPr); - imgPr.src = this.Chart.imgs + "parentnode_filled.png"; - - } - - if (this.percentCompleted != 100) - { - var cellprojectItem = document.createElement("TD"); - rowprojectItem.appendChild(cellprojectItem); - cellprojectItem.width = (100 - this.percentCompleted) + "%"; - cellprojectItem.style.lineHeight = "1px"; - var imgPr = document.createElement("img"); - imgPr.style.width = ((100 - this.percentCompleted) * this.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - imgPr.style.height = this.Chart.heightTaskItem + "px"; - cellprojectItem.appendChild(imgPr); - imgPr.src = this.Chart.imgs + "progress_bg.png"; - } - - } else - { - var cellprojectItem = document.createElement("TD"); - rowprojectItem.appendChild(cellprojectItem); - cellprojectItem.width = "1px"; - cellprojectItem.style.lineHeight = "1px"; - var imgPr = document.createElement("img"); - imgPr.style.width = "1px"; - imgPr.style.height = this.Chart.heightTaskItem; - cellprojectItem.appendChild(imgPr); - imgPr.src = this.Chart.imgs + "progress_bg.png"; - - } - - var divTaskInfo = document.createElement("div"); - divTaskInfo.style.cssText = "text-align:center;z-index:2;position:absolute;left:0px;top:0px;"; - // - - var tblTaskInfo = document.createElement("table"); - divTaskInfo.appendChild(tblTaskInfo); - tblTaskInfo.cellPadding = "0"; - tblTaskInfo.cellSpacing = "0"; - tblTaskInfo.height = this.Chart.heightTaskItem + "px"; - tblTaskInfo.width = ((this.Duration * this.Chart.hourInPixelsWork == 0) ? 1 : this.Duration * this.Chart.hourInPixelsWork) + "px"; - - var rowTaskInfo = tblTaskInfo.insertRow(0); - var cellTaskInfo = document.createElement("td"); - cellTaskInfo.align = "center"; - cellTaskInfo.vAlign = "top"; - cellTaskInfo.height = this.Chart.heightTaskItem + "px"; - cellTaskInfo.className = "moveInfo"; - cellTaskInfo.style.cssText = ";white-space:nowrap;"; - rowTaskInfo.appendChild(cellTaskInfo); - projectItem.appendChild(divTaskInfo); - - if (this.Project.ParentTasks.length == 0) - { - projectItem.style.display = "none"; - - } - - if (this.Chart._showTooltip) - { - var getPopUpInfo = function(e) { - if ((!self.Chart._isMove) && (!self.Chart._isResize)) self.getPopUpInfo(self.projectItem[0], e); - }; - var closePopUpInfo = function() { - self.closePopUpInfo(); - }; - - this.addEvent(divTaskInfo, 'mouseover', getPopUpInfo, false); - this.addEvent(divTaskInfo, 'mouseout', closePopUpInfo, false); - } - return projectItem; -}; -/** - * @desc: Creation of projectNameItem - * @type: private - * @topic: 0 - */ -GanttProject.prototype.createProjectNameItem = function() -{ - var self = this; - var divName = document.createElement("div"); - divName.style.cssText = "cursor:pointer;color:#003366;font-weight:bold;font-size:12px;font-family:Tahoma,Arial;white-space:nowrap;height:15px;z-index:1;position:absolute;left:" + 5 + "px;top:" + this.posY + "px;"; - divName.innerHTML = this.Project.Name; - divName.title = this.Project.Name; - if (this.Chart.isShowConMenu) - { - var showContMenu = function(event) { - - if (self.Chart.contextMenu.clear) self.Chart.contextMenu.clear(); - - var hideContMenu = null; - if (!self.Chart._isIE) - { - hideContMenu = function() { - self.Chart.contextMenu.hideContextMenu(); - self.Chart.content.removeEventListener("mousedown", hideContMenu, false); - }; - - } else - { - hideContMenu = function() { - self.Chart.contextMenu.hideContextMenu(); - self.Chart.content.detachEvent("mousedown", hideContMenu); - }; - } - - self.Chart.content.onmousedown = hideContMenu; - - if (!self.Chart._isIE) - { - event.stopPropagation(); - - } else - { - event.cancelBubble = true; - } - - self.Chart._showContextMenu(event, self); - - }; - - if (this.Chart._isIE) - { - this.addEvent(divName, "contextmenu", function(e) { - showContMenu(e); - return false; - }, false); - - } else - { - this.addEvent(divName, "contextmenu", function(e) { - e.preventDefault(); - showContMenu(e); - }, false); - } - - } - return divName; -}; -/** - * @desc: calculates and returns percent completed of project - * @type: public - * @topic: 0 - */ -GanttProject.prototype.getPercentCompleted = function() -{ - var sum = 0; - var percentCompleted = 0; - - for (var i = 0; i < this.Project.ParentTasks.length; i++) { - sum += parseInt(this.Project.ParentTasks[i].PercentCompleted); - } - if (this.Project.ParentTasks.length != 0) { - return percentCompleted = Math.round(sum / this.Project.ParentTasks.length); - } - else { - return percentCompleted = -1; - } -}; -/** - * @desc: calculates and returns the duration of project in hours - * @type: public - * @topic: 0 - */ -GanttProject.prototype.getDuration = function() -{ - var duration = 0; - var tmpDuration = 0; - if (this.Project.ParentTasks.length > 0) - { - for (var i = 0; i < this.Project.ParentTasks.length; i++) - { - tmpDuration = this.Project.ParentTasks[i].Duration * 24 / this.Chart.hoursInDay + (this.Project.ParentTasks[i].EST - this.Chart.startDate) / (60 * 60 * 1000); - if (tmpDuration > duration) - { - duration = tmpDuration; - } - } - return ((duration - this.posX) / 24) * this.Chart.hoursInDay; - - } else - { - return 0; - } - -}; -/** - * @desc: returns id of project. - * @type: public - * @topic: 0 - */ -GanttProject.prototype.getId = function() -{ - return this.Project.Id; -}; -/** - * @desc: returns name of project. - * @type: public - * @topic: 0 - */ -GanttProject.prototype.getName = function() -{ - return this.Project.Name; -}; -/** - * @desc: returns start date of project. - * @type: public - * @topic: 0 - */ -GanttProject.prototype.getStartDate = function() -{ - return this.Project.StartDate; -}; - -/** - * @desc: add event - * @param: elm - current element - * @param: evType - string that specifies any of the standard DHTML Events - * @param: fn - pointer that specifies the function to call when sEvent fires - * @type: private - * @topic: 5 - */ -GanttTask.prototype.addEvent = function (elm, evType, fn, useCapture) -{ - if (elm.addEventListener) { - elm.addEventListener(evType, fn, useCapture); - return true; - } - else if (elm.attachEvent) { - return elm.attachEvent('on' + evType, fn); - } - else { - elm['on' + evType] = fn; - } -}; -/** - * @desc: the beginning of movement of task - * @param: event - (object)event - * @type: private - * @topic: 5 - */ -GanttTask.prototype.startMove = function (event) -{ - this.moveChild = event.ctrlKey; - this.MouseX = event.screenX; - - this.getMoveInfo(); - - this.checkMove = true; - - if (this.Chart.isShowDescTask) { - this.hideDescTask(); - } - if (this.Chart._isFF) document.body.style.cursor = "move"; - if (this.Chart._isIE) event.srcElement.style.cursor = "move"; -}; - -GanttTask.prototype.showDescTask = function() -{ - var posX = (parseInt(this.cTaskItem[0].style.left) + this.TaskInfo.Duration * this.Chart.hourInPixelsWork + 10); - this.descrTask.style.left = posX + "px"; - this.descrTask.innerHTML = this.getDescStr(); - this.descrTask.style.visibility = 'visible'; - -}; -GanttTask.prototype.hideDescTask = function() -{ - this.descrTask.style.visibility = 'hidden'; -}; -GanttTask.prototype.getDescStr = function() -{ - var str = '', delim = ", "; - for (var i = 0; i < this.Chart.paramShowTask.length; i++) { - var prop = this.Chart.paramShowTask[i], propValue = this.TaskInfo[prop]; - switch (prop) { - case "Name": - if (str != "")str += delim; - str += propValue; - break; - case "EST": - if (str != "")str += delim; - str += propValue.getDate() + "." + (propValue.getMonth() + 1) + "." + propValue.getFullYear(); - break; - case "S-F": - if (str != "")str += delim; - propValue = this.TaskInfo["EST"]; - str += propValue.getDate() + "." + (propValue.getMonth() + 1) + "." + propValue.getFullYear() + " - "; - propValue = this.getFinishDate(); - str += propValue.getDate() + "." + (propValue.getMonth() + 1) + "." + propValue.getFullYear(); - break; - case "Duration": - if (str != "")str += delim; - str += propValue + "h"; - break; - case "PercentCompleted": - if (str != "")str += delim; - str += propValue + "%"; - break; - default: - break; - } - } - return str; -}; -/** - * @desc: returns id of task - * @type: public - * @topic: 0 - */ -GanttTask.prototype.getId = function() -{ - return this.TaskInfo.Id; -}; -/** - * @desc: returns name of task - * @type: public - * @topic: 0 - */ -GanttTask.prototype.getName = function() -{ - return this.TaskInfo.Name; -}; -/** - * @desc: returns duration of task (in hours) - * @type: public - * @topic: 0 - */ -GanttTask.prototype.getDuration = function() -{ - return this.TaskInfo.Duration; -}; -/** - * @desc: returns EST of task - * @type: public - * @topic: 0 - */ -GanttTask.prototype.getEST = function() -{ - return this.TaskInfo.EST; -}; -/** - * @desc: calculates and returns FinishDate of task - * @type: public - * @topic: 0 - */ -GanttTask.prototype.getFinishDate = function() -{ - var date = new Date(this.TaskInfo.EST); - date.setDate(date.getDate() + parseInt((this.TaskInfo["Duration"]-1)/this.Chart.hoursInDay+1)-1); - return date; -}; -/** - * @desc: returns PercentCompleted of task - * @type: public - * @topic: 0 - */ -GanttTask.prototype.getPercentCompleted = function() -{ - return this.TaskInfo.PercentCompleted; -}; -/** - * @desc: returns PredecessorTaskId of task - * @type: public - * @topic: 0 - */ -GanttTask.prototype.getPredecessorTaskId = function() -{ - return this.TaskInfo.PredecessorTaskId ? this.TaskInfo.PredecessorTaskId : null; -}; -/** - * @desc: returns ParentTaskId of task - * @type: public - * @topic: 0 - */ -GanttTask.prototype.getParentTaskId = function() -{ - return this.parentTask ? this.parentTask.getId() : null; -}; - -GanttTask.prototype.moveDescTask = function() -{ - var posX = (parseInt(this.cTaskItem[0].style.left) + this.TaskInfo.Duration * this.Chart.hourInPixelsWork + 10); - this.descrTask.style.left = posX + "px"; -}; - -/** - * @desc: Defines max and min position of movement - * @type: private - * @topic: 4 - */ -GanttTask.prototype.getMoveInfo = function() -{ - this.posX = parseInt(this.cTaskItem[0].style.left); - var widthTaskItem = parseInt(this.cTaskItem[0].childNodes[0].firstChild.width); - var posParentTaskItem = (this.parentTask == null) ? 0 : parseInt(this.parentTask.cTaskItem[0].style.left); - var posPredTaskItem = (this.predTask == null) ? 0 : parseInt(this.predTask.cTaskItem[0].style.left) + parseInt(this.predTask.cTaskItem[0].childNodes[0].firstChild.width); - var widthParentTaskItem = (this.parentTask == null) ? 0 : parseInt(this.parentTask.cTaskItem[0].childNodes[0].firstChild.width); - - var childPredPosX = 0; - var childParentPosX = 0; - var childParentPosXR = 0; - if (this.childPredTask.length > 0) - { - var posChildTaskItem = null; - for (var n = 0; n < this.childPredTask.length; n++) - { - if ((!posChildTaskItem) || ((posChildTaskItem) && (posChildTaskItem > parseInt(this.childPredTask[n].cTaskItem[0].style.left)))) - { - posChildTaskItem = parseInt(this.childPredTask[n].cTaskItem[0].style.left); - } - } - childPredPosX = posChildTaskItem; - } - if (this.childTask.length > 0) - { - var posChildTaskItemR = null; - for (var n = 0; n < this.childTask.length; n++) - { - if ((!posChildTaskItemR) || ((posChildTaskItemR) && (posChildTaskItemR > (parseInt(this.childTask[n].cTaskItem[0].style.left))))) - { - posChildTaskItemR = parseInt(this.childTask[n].cTaskItem[0].style.left); - } - } - childParentPosXR = posChildTaskItemR; - - var posChildTaskItem = null; - for (var n = 0; n < this.childTask.length; n++) - { - if ((!posChildTaskItem) || ((posChildTaskItem) && (posChildTaskItem < (parseInt(this.childTask[n].cTaskItem[0].style.left) + parseInt(this.childTask[n].cTaskItem[0].firstChild.firstChild.width))))) - { - posChildTaskItem = parseInt(this.childTask[n].cTaskItem[0].style.left) + parseInt(this.childTask[n].cTaskItem[0].firstChild.firstChild.width); - } - } - - childParentPosX = posChildTaskItem; - } - - if (!this.moveChild) - { - if (this.childPredTask.length > 0) { - if (this.maxPosXMove < childPredPosX) this.maxPosXMove = childPredPosX; - } - if (this.childTask.length > 0) { - if ((this.childPredTask.length > 0) && (this.maxPosXMove - widthTaskItem) > childParentPosXR) this.maxPosXMove = this.maxPosXMove - ((this.maxPosXMove - widthTaskItem) - childParentPosXR); - if (!(this.childPredTask.length > 0)) this.maxPosXMove = childParentPosXR + widthTaskItem; - this.minPosXMove = (childParentPosX - widthTaskItem); - } - - if (posParentTaskItem > 0) - { - if ((!(this.childPredTask.length > 0)) && (this.childTask.length > 0)) { - if (this.maxPosXMove > posParentTaskItem + widthParentTaskItem) { - this.maxPosXMove = posParentTaskItem + widthParentTaskItem; - } - } - if (this.minPosXMove <= posParentTaskItem) { - this.minPosXMove = posParentTaskItem; - } - if ((!(this.childTask.length > 0)) && (!(this.childPredTask.length > 0))) { - this.maxPosXMove = posParentTaskItem + widthParentTaskItem; - - } else if ((!(this.childTask.length > 0)) && (this.childPredTask.length > 0)) { - if ((posParentTaskItem + widthParentTaskItem) > posPredTaskItem) { - this.maxPosXMove = childPredPosX; - } - } - } - - if (posPredTaskItem > 0) { - if (this.minPosXMove <= posPredTaskItem) { - this.minPosXMove = posPredTaskItem; - } - } - if ((posPredTaskItem == 0) && (posParentTaskItem == 0)) { - if (this.minPosXMove <= this.Chart.initialPos) { - this.minPosXMove = this.Chart.initialPos; - } - } - } else - { - if ((posParentTaskItem > 0) && (posPredTaskItem == 0)) - { - this.minPosXMove = posParentTaskItem; - this.maxPosXMove = posParentTaskItem + widthParentTaskItem; - - } else if ((posParentTaskItem == 0) && (posPredTaskItem == 0)) - { - this.minPosXMove = this.Chart.initialPos; - this.maxPosXMove = -1; - - } else if ((posParentTaskItem > 0) && (posPredTaskItem > 0)) - { - this.minPosXMove = posPredTaskItem; - this.maxPosXMove = posParentTaskItem + widthParentTaskItem; - - } else if ((posParentTaskItem == 0) && (posPredTaskItem > 0)) - { - this.minPosXMove = posPredTaskItem; - this.maxPosXMove = -1; - } - - if ((this.parentTask) && (this.childPredTask.length > 0)) - { - var posChildTaskItem = this.getMaxPosPredChildTaskItem(this); - var posParentTaskItem = parseInt(this.parentTask.cTaskItem[0].style.left) + parseInt(this.parentTask.cTaskItem[0].firstChild.firstChild.width); - this.maxPosXMove = this.posX + widthTaskItem + posParentTaskItem - posChildTaskItem; - } - } -}; -/** - * @desc: The beginning of extension of task - * @param: event - (object) event - * @type: private - * @topic: 5 - */ -GanttTask.prototype.startResize = function(event) -{ - this.MouseX = event.screenX; - this.getResizeInfo(); - if (this.Chart.isShowDescTask) { - this.hideDescTask(); - } - this.checkResize = true; - this.taskItemWidth = parseInt(this.cTaskItem[0].firstChild.firstChild.width); - if (this.Chart._isFF)document.body.style.cursor = "e-resize"; - -}; -/** - * @desc: Defines max and min position of stretchings - * @type: private - * @topic: 4 - */ -GanttTask.prototype.getResizeInfo = function() -{ - var taskItem = this.cTaskItem[0]; - var posParentTaskItem = (this.parentTask == null) ? 0 : parseInt(this.parentTask.cTaskItem[0].style.left); - var widthParentTaskItem = (this.parentTask == null) ? 0 : parseInt(this.parentTask.cTaskItem[0].childNodes[0].firstChild.width); - var posTaskItem = parseInt(this.cTaskItem[0].style.left); - - var childPredPosX = 0; - var childParentPosX = 0; - if (this.childPredTask.length > 0) - { - var posChildTaskItem = null; - for (var n = 0; n < this.childPredTask.length; n++) - { - if ((!posChildTaskItem) || ((posChildTaskItem) && (posChildTaskItem > parseInt(this.childPredTask[n].cTaskItem[0].style.left)))) - { - posChildTaskItem = parseInt(this.childPredTask[n].cTaskItem[0].style.left); - - } - } - childPredPosX = posChildTaskItem; - } - - if (this.childTask.length > 0) - { - var posChildTaskItem = null; - for (var n = 0; n < this.childTask.length; n++) - { - if ((!posChildTaskItem) || ((posChildTaskItem) && (posChildTaskItem < (parseInt(this.childTask[n].cTaskItem[0].style.left) + parseInt(this.childTask[n].cTaskItem[0].firstChild.firstChild.width))))) - { - posChildTaskItem = parseInt(this.childTask[n].cTaskItem[0].style.left) + parseInt(this.childTask[n].cTaskItem[0].firstChild.firstChild.width); - } - } - - childParentPosX = posChildTaskItem; - } - - this.minWidthResize = this.Chart.minWidthResize; - - if (this.childTask.length > 0) - { - this.minWidthResize = childParentPosX - posTaskItem; - } - - if ((this.childPredTask.length > 0) && (!this.parentTask)) - { - this.maxWidthResize = childPredPosX - posTaskItem; - - } else if ((this.childPredTask.length > 0) && (this.parentTask)) - { - var w1 = posParentTaskItem + widthParentTaskItem - posTaskItem; - var w2 = childPredPosX - posTaskItem; - this.maxWidthResize = Math.min(w1, w2); - - } else if ((this.childPredTask.length == 0) && (this.parentTask)) - { - this.maxWidthResize = posParentTaskItem + widthParentTaskItem - posTaskItem; - } - -}; -/** - * @desc: creation of taskItem - * @type: private - * @topic: 0 - */ -GanttTask.prototype.createTaskItem = function() -{ - var self = this; - this.posX = this.Chart.getPosOnDate(this.TaskInfo.EST); - - var itemControl = document.createElement("div"); - itemControl.id = this.TaskInfo.Id; - itemControl.style.cssText = ";z-index:1;position:absolute;left:" + this.posX + "px;top:" + this.posY + "px;"; - - var divTaskItem = document.createElement("div"); - itemControl.appendChild(divTaskItem); - divTaskItem.style.cssText = "z-index:1;position: absolute;left:0px;top:0px;"; - - var tblTaskItem = document.createElement("table"); - divTaskItem.appendChild(tblTaskItem); - tblTaskItem.cellPadding = "0"; - tblTaskItem.cellSpacing = "0"; - tblTaskItem.width = this.TaskInfo.Duration * this.Chart.hourInPixelsWork + "px"; - tblTaskItem.style.cssText = "border: solid 1px #6589A9;"; - - var rowTblTask = tblTaskItem.insertRow(tblTaskItem.rows.length); - - if (this.TaskInfo.PercentCompleted != 0) - { - var cellTblTask = document.createElement("td"); - rowTblTask.appendChild(cellTblTask); - cellTblTask.height = this.Chart.heightTaskItem + "px"; - cellTblTask.width = this.TaskInfo.PercentCompleted + "%"; - cellTblTask.style.lineHeight = "1px"; - var imgPr = document.createElement("img"); - imgPr.style.width = (this.TaskInfo.PercentCompleted * this.TaskInfo.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - imgPr.style.height = this.Chart.heightTaskItem + "px"; - cellTblTask.appendChild(imgPr); - imgPr.src = this.Chart.imgs + "progress_filled.png"; - } - - if (this.TaskInfo.PercentCompleted != 100) - { - var cellTblTask = document.createElement("td"); - rowTblTask.appendChild(cellTblTask); - cellTblTask.height = this.Chart.heightTaskItem + "px"; - cellTblTask.width = (100 - this.TaskInfo.PercentCompleted) + "%"; - cellTblTask.style.lineHeight = "1px"; - var imgPrF = document.createElement("img"); - imgPrF.style.width = ((100 - this.TaskInfo.PercentCompleted) * this.TaskInfo.Duration * this.Chart.hourInPixelsWork) / 100 + "px"; - imgPrF.style.height = this.Chart.heightTaskItem + "px"; - cellTblTask.appendChild(imgPrF); - imgPrF.src = this.Chart.imgs + "progress_bg.png"; - - } - - if (this.Chart.isEditable) - { - var divTaskInfo = document.createElement("div"); - divTaskInfo.style.cssText = "text-align:center;font-size:9px;z-index:2;position: absolute;left:0px;top:0px;"; - - var tblTaskInfo = document.createElement("table"); - divTaskInfo.appendChild(tblTaskInfo); - tblTaskInfo.cellPadding = "0"; - tblTaskInfo.cellSpacing = "0"; - tblTaskInfo.height = this.Chart.heightTaskItem + "px"; - tblTaskInfo.width = this.TaskInfo.Duration * this.Chart.hourInPixelsWork + "px"; - - var rowTaskInfo = tblTaskInfo.insertRow(0); - var cellTaskInfo = document.createElement("TD"); - cellTaskInfo.align = "center"; - cellTaskInfo.vAlign = "top"; - cellTaskInfo.height = this.Chart.heightTaskItem + "px"; - cellTaskInfo.className = "moveInfo"; - cellTaskInfo.style.cssText = ";white-space:nowrap;font-size:9px"; - rowTaskInfo.appendChild(cellTaskInfo); - itemControl.appendChild(divTaskInfo); - } - - var divTaskName = document.createElement("div"); - itemControl.appendChild(divTaskName); - divTaskName.style.cssText = ";z-index:2;position: absolute;left:0px;top:0px;"; - - var divMove = document.createElement("div"); - divMove.innerHTML = ""; - if (this.Chart._isIE) - { - divMove.style.background = "#000000"; - divMove.style.filter = "alpha(opacity=0)"; - } - divMove.style.height = this.Chart.heightTaskItem + "px"; - divMove.style.width = this.TaskInfo.Duration * this.Chart.hourInPixelsWork + "px"; - divTaskName.appendChild(divMove); - - if (this.Chart._showTooltip) - { - var getPopUpInfo = function(e) { - if ((!self.Chart._isMove) && (!self.Chart._isResize)) self.getPopUpInfo(self.cTaskItem[0], e); - }; - var closePopUpInfo = function() { - self.closePopUpInfo(); - }; - - this.addEvent(divMove, 'mouseover', getPopUpInfo, false); - this.addEvent(divMove, 'mouseout', closePopUpInfo, false); - } - - var taskClick = function() { - self.Chart.callEvent("onTaskClick", [self]); - }; - this.addEvent(divMove, 'click', taskClick, false); - - if (this.Chart.isEditable) - { - //Create resize area - var divResize = document.createElement("div"); - divResize.style.cssText = ";z-index:10;position: absolute;left:" + (this.TaskInfo.Duration * this.Chart.hourInPixelsWork - 10) + "px;top:0px;"; - divResize.style.height = this.Chart.heightTaskItem + "px"; - divResize.style.width = "10px"; - divResize.innerHTML = ""; - divTaskName.appendChild(divResize); - - var startMove = function(e) { - if (self.Chart.callEvent("onTaskStartDrag", [self])===false) return; - - var moveItem = function(e1) { - if (self.checkMove) self.moveItem(e1); - }; - var endMove = function() { - if (self.checkMove) { - self.endMove(); - self.Chart._isMove = false; - if (self.Chart._isIE) - { - document.body.releaseCapture(); - document.detachEvent("onmousemove", moveItem); - document.detachEvent("onmouseup", endMove); - } else { - document.removeEventListener("mousemove", moveItem, true); - document.removeEventListener("mouseup", endMove, true); - } - if (self.wasMoved) self.Chart.callEvent("onTaskEndDrag", [self]); - } - }; - self.addEvent(document, 'mousemove', moveItem, true); - self.addEvent(document, 'mouseup', endMove, true); - - if (self.Chart._showTooltip) self.closePopUpInfo(); - self.startMove(e); - self.Chart._isMove = true; - if (self.Chart._isIE) document.body.setCapture(false); - }; - - var startResize = function(e) { - if (self.Chart.callEvent("onTaskStartResize", [self])===false) return; - - var resizeItem = function(e1) { - if (self.checkResize)self.resizeItem(e1); - }; - - var endResizeItem = function() { - if (self.checkResize) { - self.endResizeItem(); - self.Chart._isResize = false; - if (self.Chart._isIE) - { - document.body.releaseCapture(); - document.detachEvent("onmousemove", resizeItem); - document.detachEvent("onmouseup", endResizeItem); - } else { - document.removeEventListener("mousemove", resizeItem, true); - document.removeEventListener("mouseup", endResizeItem, true); - } - if (self.wasResized) self.Chart.callEvent("onTaskEndResize", [self]); - } - }; - - self.addEvent(document, 'mousemove', resizeItem, false); - self.addEvent(document, 'mouseup', endResizeItem, false); - - self.startResize(e); - if (self.Chart._isIE) document.body.setCapture(false); - self.Chart._isResize = true; - }; - - this.addEvent(divMove, 'mousedown', startMove, false); - this.addEvent(divResize, 'mousedown', startResize, false); - - var setCursorResize = function(e2) { - if (!self.Chart._isMove) (e2.srcElement?e2.srcElement:e2.target).style.cursor = "e-resize"; - }; - var setCursorStandart = function(e3) { - if (!self.checkResize) (e3.srcElement?e3.srcElement:e3.target).style.cursor = ""; - }; - - this.addEvent(divResize, 'mouseover', setCursorResize, false); - this.addEvent(divResize, 'mouseout', setCursorStandart, false); - } - return itemControl; -}; -/** - * @desc: creation of taskNameItem - * @type: private - * @topic: 0 - */ -GanttTask.prototype.createTaskNameItem = function(hasChildren) -{ - var self = this; - var divName = document.createElement("div"); - divName.id = this.TaskInfo.Id; - divName.style.cssText = "cursor:pointer;white-space:nowrap;height:15px;z-index:1;position:absolute;left:20px;top: " + this.posY + "px;"; - if (hasChildren) divName.style.fontWeight = "bold"; - divName.className = "taskNameItem"; - divName.title = this.TaskInfo.Name; - divName.innerHTML = this.TaskInfo.Name; - if (this.Chart.isShowConMenu) - { - var showContMenu = function(event) { - - if (self.Chart.contextMenu.clear) self.Chart.contextMenu.clear(); - - var hideContMenu = function() { - self.Chart.contextMenu.hideContextMenu(); - if (self.Chart._isIE) - self.Chart.content.detachEvent("mousedown", hideContMenu); - else - self.Chart.content.removeEventListener("mousedown", hideContMenu, false); - }; - - self.Chart.content.onmousedown = hideContMenu; - - if (!self.Chart._isIE) - { - event.stopPropagation(); - } else - { - event.cancelBubble = true; - } - - self.Chart._showContextMenu(event, self); - - }; - - if (this.Chart._isIE) - { - this.addEvent(divName, "contextmenu", function(e) { - showContMenu(e); - return false; - }, false); - - } else - { - this.addEvent(divName, "contextmenu", function(e) { - e.preventDefault(); - showContMenu(e); - }, false); - } - } - return divName; -}; - - -GanttTask.prototype.createTaskDescItem = function() -{ - var posX = (this.posX + this.TaskInfo.Duration * this.Chart.hourInPixelsWork + 10); - var divDesc = document.createElement("div"); - divDesc.style.cssText += ";z-index:1;position:absolute;left:" + posX + "px;top:" + this.posY + "px;"; - divDesc.innerHTML = this.getDescStr(); - divDesc.className = "descTask"; - this.descrTask = divDesc; - - if (this.Chart._showTooltip) - { - var self = this; - var getPopUpInfo = function(e) { - if ((!self.Chart._isMove) && (!self.Chart._isResize)) self.getPopUpInfo(self.descrTask, e); - }; - var closePopUpInfo = function() { - self.closePopUpInfo(); - }; - - this.addEvent(divDesc, 'mouseover', getPopUpInfo, false); - this.addEvent(divDesc, 'mouseout', closePopUpInfo, false); - } - return divDesc; -}; - -/** - * @desc: check Width of taskNameItem - * @type: private - * @topic: 4 - */ -GanttTask.prototype.checkWidthTaskNameItem = function() -{ - if (this.cTaskNameItem[0].offsetWidth + this.cTaskNameItem[0].offsetLeft > this.Chart.maxWidthPanelNames) - { - var width = this.cTaskNameItem[0].offsetWidth + this.cTaskNameItem[0].offsetLeft - this.Chart.maxWidthPanelNames; - var countChar = Math.round(width / (this.cTaskNameItem[0].offsetWidth / this.cTaskNameItem[0].firstChild.length)); - var tName = this.TaskInfo.Name.substring(0, this.cTaskNameItem[0].firstChild.length - countChar - 3); - tName += "..."; - this.cTaskNameItem[0].innerHTML = tName; - } - -}; -/** - * @desc: creation of GanttTask - * @type: private - * @topic: 0 - */ -GanttTask.prototype.create = function() -{ - var containerTasks = this.Chart.oData.firstChild; - var containerNames = null; - if (this.Chart._showTreePanel) containerNames = this.Chart.panelNames.firstChild; - var predecessorTask = this.TaskInfo.PredecessorTask; - var parentTask = this.TaskInfo.ParentTask; - var isCParentTask = (this.TaskInfo.ChildTasks.length > 0); - var self = this; - - this.cTaskItem = []; - this.cTaskNameItem = []; - - //creation arrTasks - if (!parentTask) - { - if (this.TaskInfo.previousParentTask) { - this.previousParentTask = this.Project.getTaskById(this.TaskInfo.previousParentTask.Id); - var lastChildTask = this.Chart.getLastChildTask(this.previousParentTask); - this.posY = parseInt(lastChildTask.cTaskItem[0].style.top) + this.Chart.heightTaskItem + 11; - this.previousParentTask.nextParentTask = this; - - } else { - this.posY = parseInt(this.Project.projectItem[0].style.top) + this.Chart.heightTaskItem + 11; - } - } - - if (parentTask) { - var task = this.Project.getTaskById(this.TaskInfo.ParentTask.Id); - this.parentTask = task; - - if (this.TaskInfo.previousChildTask) { - this.previousChildTask = this.Project.getTaskById(this.TaskInfo.previousChildTask.Id); - var lastChildTask = this.Chart.getLastChildTask(this.previousChildTask); - this.posY = parseInt(lastChildTask.cTaskItem[0].style.top) + this.Chart.heightTaskItem + 11; - this.previousChildTask.nextChildTask = this; - - } else { - this.posY = parseInt(task.cTaskItem[0].style.top) + this.Chart.heightTaskItem + 11; - } - task.childTask.push(this); - } - - if (predecessorTask) { - var task = this.Project.getTaskById(predecessorTask.Id); - this.predTask = task; - task.childPredTask.push(this); - } - - //creation task item - this.cTaskItem.push(this.createTaskItem()); - containerTasks.appendChild(this.cTaskItem[0]); - - if (this.Chart.panelNames) { - this.cTaskNameItem.push(this.createTaskNameItem(isCParentTask)); - this.Chart.panelNames.firstChild.appendChild(this.cTaskNameItem[0]); - } - - if (this.Chart.isShowDescTask) { - containerTasks.appendChild(this.createTaskDescItem()); - } - - //Create Connecting Lines - var arrConnectingLines = []; - if (predecessorTask) arrConnectingLines = this.createConnectingLinesDS(); - this.cTaskItem.push(arrConnectingLines); - - if (this.Chart.panelNames) - { - //Create Connecting Lines - var arrConnectingLinesNames = []; - if (parentTask) - { - this.cTaskNameItem[0].style.left = parseInt(this.parentTask.cTaskNameItem[0].style.left) + 15 + "px"; - arrConnectingLinesNames = this.createConnectingLinesPN(); - } - this.checkWidthTaskNameItem(); - - var treeImg = null; - if (isCParentTask) treeImg = this.createTreeImg(); - - this.cTaskNameItem.push(arrConnectingLinesNames); - this.cTaskNameItem.push(treeImg); - } - this.addDayInPanelTime(); - return this; -}; - -/** - * @desc: creation of image of node - * @type: private - * @topic: 4 - */ -GanttTask.prototype.createTreeImg = function() -{ - var self = this; - var treeImg = new Image(); - treeImg.src = this.Chart.imgs + "minus.gif"; - treeImg.id = this.TaskInfo.Id; - - treeImg.onclick = function() - { - if (self._isOpen) - { - this.src = self.Chart.imgs + "plus.gif"; - self._isOpen = false; - self.hideChildTasks(self); - self.shiftCurrentTasks(self, -self._heightHideTasks); - } - else - { - this.src = self.Chart.imgs + "minus.gif"; - self._isOpen = true; - self.shiftCurrentTasks(self, self._heightHideTasks); - self.showChildTasks(self, true); - self._heightHideTasks = 0; - } - }; - - this.Chart.panelNames.firstChild.appendChild(treeImg); - treeImg.style.cssText = "cursor:pointer;left:" + (parseInt(this.cTaskNameItem[0].style.left) - 12) + "px;top:" + (parseInt(this.cTaskNameItem[0].style.top) + 3) + "px;z-index:12;position:absolute;"; - - return treeImg; -}; -/** - * @desc: returns last child of GanttTask - * @type: private - * @topic: 2 - */ -GanttChart.prototype.getLastChildTask = function(task) -{ - if (task.childTask.length > 0) - { - return this.getLastChildTask(task.childTask[task.childTask.length - 1]); - - } else - { - return task; - } - -}; -/** - * @desc: dhtmlXMLSenderObject constructor - * @type: public - * @topic: 0 - */ -dhtmlXMLSenderObject = function(ganttChart) -{ - this.xmlHttp = this.createXMLHttpRequest(); - this.isProcessed = false; - this.path = null; - this.filename = null; - this.Chart = ganttChart; -}; -/** - * @desc: creation (object) XMLHttpRequest - * @type: private - * @topic: 4 - */ -dhtmlXMLSenderObject.prototype.createXMLHttpRequest = function() -{ - if (window.XMLHttpRequest) { - return new XMLHttpRequest(); - } - else if (window.ActiveXObject) { - return new ActiveXObject("Microsoft.XMLHTTP"); - } -}; -/** - * @desc: Sends the data on a server - * @type: private - * @topic: 6 - */ -dhtmlXMLSenderObject.prototype.sendData = function(filename, path, xmlData) -{ - var self = this; - this.path = path; - this.filename = filename; - - if ((this.path == null) || (this.path == "")) - { - this.Chart.Error.throwError("DATA_SEND_ERROR", 3, null); - return; - } - if ((this.filename == null) || (this.filename == "")) - { - this.Chart.Error.throwError("DATA_SEND_ERROR", 4, null); - return; - } - - this.isProcessed = true; - this.xmlHttp.open("POST", this.path, true); - if (this.Chart._isFF) - { - this.xmlHttp.onerror = function() { - self.xmlHttp.onreadystatechange = null; - self.xmlHttp.abort(); - self.isProcessed = false; - } - } - this.xmlHttp.onreadystatechange = function() { - self.getStatus(); - }; - this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - this.xmlHttp.send("data=" + encodeURI(xmlData) + "&filename=" + filename); - - -}; -/** - * @desc: Returns the status of operation - * @type: private - * @topic: 4 - */ -dhtmlXMLSenderObject.prototype.getStatus = function() -{ - if (this.xmlHttp.readyState == 4) - { - - var _status = ""; - try { - _status = this.xmlHttp.status; - - } catch(e) { - this.Chart.Error.throwError("DATA_SEND_ERROR", 1, null); - return 0; - } - - switch (_status) { - - case 0: - this.Chart.Error.throwError("DATA_SEND_ERROR", 1, null); - //this.xmlHttp.abort(); - break; - case 404: - this.Chart.Error.throwError("DATA_SEND_ERROR", 5, [this.path]); - //this.xmlHttp.abort(); - break; - case 500: - this.Chart.Error.throwError("DATA_SEND_ERROR", 2, null); - //this.xmlHttp.abort(); - break; - case 12029: - this.Chart.Error.throwError("DATA_SEND_ERROR", 1, null); - //this.xmlHttp.abort(); - break; - default: - if (!(_status >= 200 && _status < 300 || _status == 304)) - { - this.Chart.Error.throwError("DATA_SEND_ERROR", 0, null); - //this.xmlHttp.abort(); - } - break; - } - this.isProcessed = false; - - } -}; -/** - * @desc: GanttError constructor - * @type: private - * @topic: 0 - */ -function GanttError() { - - this.catches = []; - this._errors = []; - this._init(); - - return this; -} -/** - * @desc: initialization of control errors - * @type: private - * @topic: 4 - */ -GanttError.prototype._init = function() -{ - //connection errors - this._errors[0] = "Connection error"; - this._errors[1] = "Cannot connect"; - this._errors[2] = "Server error"; - this._errors[3] = "Path is null or empty"; - this._errors[4] = "Filename is null or empty"; - this._errors[5] = "File (%0) is not found"; - - //API errors - this._errors[6] = "Percent Complete should be a number"; - this._errors[7] = "Percent Complete should be <= 100"; - this._errors[8] = "Percent Complete should be >= 0"; - this._errors[9] = "Increase duration of task(%0)"; - this._errors[10] = "Reduce duration of task(%0)"; - this._errors[11] = "Increase EST of child task (%0)"; - this._errors[12] = "Reduce EST of task (%0)"; - this._errors[13] = "The project (%0) is added"; - this._errors[14] = "Start Date of the project < start Date of the control"; - this._errors[15] = "Task (%0) cannot be the child of predecessor task(%1)"; - this._errors[16] = "Time of the termination of predecessor task(%0) > EST of child task(%1)"; - this._errors[17] = "The Predecessor (%0) task does not exist"; - this._errors[18] = "The EST of task (%0) < start date of the control"; - this._errors[19] = "Time of the termination of parent task (%0) < time of the termination of child task(%1)"; - this._errors[20] = "The EST of task (%0) < EST of parent task(%1)"; - this._errors[21] = "The parent task (%0) does not exist"; - this._errors[22] = "The task (%0) is added"; - this._errors[23] = "The project (%0) is added"; - this._errors[24] = "Task (%0) EST < project (%1) startDate"; - this._errors[25] = "Parent task (%0) EST cannot be null"; - this._errors[26] = "Predecessor task (%0) position error. Reduce duration of predecessor task (%0) or increase EST of child task (%1)"; - this._errors[27] = "Predecessor task (%0) does not exist"; - this._errors[28] = "Increase duration of parent task (%0) or reduce EST of child task (%1) or reduce duration of child task(%1)"; - this._errors[29] = "Reduce EST of parent task (%0) or increase EST of child task (%1)"; - this._errors[30] = "The task(%0) does not exist"; - this._errors[31] = "The project(%0) does not exist"; - this._errors[32] = "Predecessor task(%0) and child task(%1) should have the same parent"; - this._errors[33] = "Reduce EST of parent task (%0) or increase EST of child task (%1)"; - this._errors[34] = "EST of task(%0) < start date of the project(%1)"; - this._errors[35] = "Percent Complete should be <= 100 and >= 0"; - this._errors[36] = "You may not connect a task to itself."; - this._errors[37] = "Cannot parse this XML string."; -}; -/** - * @desc: bind type of exception with handler - * @param: type - type of error - * @param: handler - handler name - * @type: private - * @topic: 4 - */ -GanttError.prototype.catchError = function(type, handler) { - - this.catches[type] = handler; -}; -/** - * @desc: get error string - * @param: str - error message - * @param: params - replace %i params in message - * @type: private - * @topic: 4 - */ -GanttError.prototype.getErrorString = function(str, params) -{ - if (!params) { - return str; - } else { - for (var i = 0; i < params.length; i++) { - - var re = new RegExp("%" + i, "gi"); - str = str.replace(re, params[i]); - - } - return str; - } -}; -/** - * @desc: throw error - * @param: type - type of error - * @param: description - description of error - * @param: params - current data - * @type: private - * @topic: 4 - */ -GanttError.prototype.throwError = function(type, description, params) { - if (this.catches[type]) - { - var index = parseInt(description); - var errorStr = this.getErrorString(this._errors[index], params); - return this.catches[type](type, errorStr, params); - } - return null; -}; - -function contextMenu(chart) -{ - this.Chart = chart; - this.TabContainer = null; - this.MenuPanel = null; - this.tabPanel = null; - this.arrTabs = []; - this.isShow = false; - this.hideDiv = null; - this._init(); -} - -contextMenu.prototype._init = function() -{ - this.createMenuPanel(); - this.createHideDiv(); - this.createTabContainer(); - this.createTabPanel(); - - var self = this; - var arrItems = []; - - var tab1 = this.createTab(1, "Rename task", "t", true, this); - tab1.addItem(1, "New name", document.createElement("input"), "text", function() { - tab1.arrItems[0].control.focus(); - }); - tab1.addItem(2, "Rename", document.createElement("input"), "button", - function() { - var name = tab1.arrItems[0].control.value; - try { - tab1.object.setName(name); - tab1.hide(); - } catch(e) { - - } - } - ); - - var tab2 = this.createTab(2, "Delete task", "t", true, this); - tab2.addItem(1, "Delete", document.createElement("input"), "button", - function() - { - try { - tab2.object.Project.deleteTask(tab2.object.TaskInfo.Id); - tab2.hide(); - } - catch(e) { - - } - } - ); - var tab3 = this.createTab(3, "Set EST", "t", true, this); - tab3.addItem(1, "EST", document.createElement("input"), "text", function() { - tab3.arrItems[0].control.focus(); - }); - tab3.addItem(2, "Move children", document.createElement("input"), "checkbox", function() { - tab3.arrItems[1].control.focus(); - }); - tab3.addItem(3, "Update", document.createElement("input"), "button", - function() { - var isMoveChild = tab3.arrItems[1].control.checked; - var arr = tab3.arrItems[0].control.value.split("."); - var est = (arr.length < 3) ? null : (new Date(arr[2], parseInt(arr[1]) - 1, arr[0])); - try { - if (tab3.object.setEST(est, isMoveChild)) tab3.hide(); - } catch(e) { - - } - } - ); - - var tab4 = this.createTab(4, "Set duration", "t", true, this); - tab4.addItem(1, "Duration", document.createElement("input"), "text", function() { - tab4.arrItems[0].control.focus(); - }); - tab4.addItem(2, "Update", document.createElement("input"), "button", - function() { - var d = tab4.arrItems[0].control.value; - try { - if (tab4.object.setDuration(d)) tab4.hide(); - } catch(e) { - - } - } - ); - - var tab5 = this.createTab(5, "Set % complete", "t", true, this); - tab5.addItem(1, "Percent Complete", document.createElement("input"), "text", function() { - tab5.arrItems[0].control.focus(); - }); - tab5.addItem(2, "Update", document.createElement("input"), "button", - function() { - var p = tab5.arrItems[0].control.value; - try { - if (tab5.object.setPercentCompleted(p)) tab5.hide(); - } catch(e) { - - } - } - ); - - var tab13 = this.createTab(13, "Set predecessor", "t", true, this); - tab13.addItem(1, "Predecessor", document.createElement("input"), "text", function() { - tab13.arrItems[0].control.focus(); - }); - tab13.addItem(2, "Update", document.createElement("input"), "button", - function() { - var p = tab13.arrItems[0].control.value; - try { - if (tab13.object.setPredecessor(p)) tab13.hide(); - } catch(e) { - - } - } - ); - - var tab6 = this.createTab(6, "Rename project", "p", true, this); - tab6.addItem(1, "New name", document.createElement("input"), "text", function() { - tab6.arrItems[0].control.focus(); - }); - tab6.addItem(2, "Rename", document.createElement("input"), "button", - function() { - var name = tab6.arrItems[0].control.value; - try { - tab6.object.setName(name); - tab6.hide(); - } catch(e) { - - } - } - ); - - var tab7 = this.createTab(7, "Delete project", "p", true, this); - tab7.addItem(1, "Delete", document.createElement("input"), "button", - function() { - try { - tab7.object.Chart.deleteProject(tab7.object.Project.Id); - tab7.hide(); - } catch(e) { - - } - } - ); - - var tab8 = this.createTab(8, "Set % complete", "p", true, this); - tab8.addItem(1, "Percent Complete", document.createElement("input"), "text", function() { - tab8.arrItems[0].control.focus(); - }); - tab8.addItem(2, "Update", document.createElement("input"), "button", - function() { - var p = tab8.arrItems[0].control.value; - try { - if (tab8.object.setPercentCompleted(p)) tab8.hide(); - } catch(e) { - - } - } - ); - - var tab9 = this.createTab(9, "Add new task", "p", true, this); - tab9.addItem(1, "Id", document.createElement("input"), "text", function() { - tab9.arrItems[0].control.focus(); - }); - tab9.addItem(2, "Name", document.createElement("input"), "text", function() { - tab9.arrItems[1].control.focus(); - }); - tab9.addItem(3, "EST", document.createElement("input"), "text", function() { - tab9.arrItems[2].control.focus(); - }); - tab9.addItem(4, "Duration", document.createElement("input"), "text", function() { - tab9.arrItems[3].control.focus(); - }); - tab9.addItem(5, "Percent complete", document.createElement("input"), "text", function() { - tab9.arrItems[4].control.focus(); - }); - tab9.addItem(6, "Parent task id", document.createElement("input"), "text", function() { - tab9.arrItems[5].control.focus(); - }); - tab9.addItem(7, "Pred task id", document.createElement("input"), "text", function() { - tab9.arrItems[6].control.focus(); - }); - - tab9.addItem(9, "Insert", document.createElement("input"), "button", - function() { - try { - var id = tab9.arrItems[0].control.value; - var name = tab9.arrItems[1].control.value; - var arr = tab9.arrItems[2].control.value.split("."); - var est = (arr.length < 3) ? null : (new Date(arr[2], parseInt(arr[1]) - 1, arr[0])); - var duration = tab9.arrItems[3].control.value; - var pc = tab9.arrItems[4].control.value; - var parentTaskId = tab9.arrItems[5].control.value; - var predTaskId = tab9.arrItems[6].control.value; - if (tab9.object.insertTask(id, name, est, duration, pc, predTaskId, parentTaskId)) tab9.hide(); - - } catch(e) { - - } - } - ); - - var tab11 = this.createTab(11, "Add successor task", "t", true, this); - tab11.addItem(1, "Id", document.createElement("input"), "text", function() { - tab11.arrItems[0].control.focus(); - }); - tab11.addItem(2, "Name", document.createElement("input"), "text", function() { - tab11.arrItems[1].control.focus(); - }); - tab11.addItem(3, "EST", document.createElement("input"), "text", function() { - tab11.arrItems[2].control.focus(); - }); - tab11.addItem(4, "Duration", document.createElement("input"), "text", function() { - tab11.arrItems[3].control.focus(); - }); - tab11.addItem(5, "Percent complete", document.createElement("input"), "text", function() { - tab11.arrItems[4].control.focus(); - }); - tab11.addItem(6, "Insert", document.createElement("input"), "button", - function() { - try { - var pr = tab11.object.Project; - var id = tab11.arrItems[0].control.value; - var name = tab11.arrItems[1].control.value; - var arr = tab11.arrItems[2].control.value.split("."); - var est = (arr.length < 3) ? null : (new Date(arr[2], parseInt(arr[1]) - 1, arr[0])); - var duration = tab11.arrItems[3].control.value; - var pc = tab11.arrItems[4].control.value; - var parentTaskId = (tab11.object.parentTask == null) ? "" : tab11.object.parentTask.TaskInfo.Id; - var predTaskId = tab11.object.TaskInfo.Id; - if (pr.insertTask(id, name, est, duration, pc, predTaskId, parentTaskId)) tab11.hide(); - - } catch(e) { - // - } - } - ); - - var tab10 = this.createTab(10, "Add child task", "t", true, this); - tab10.addItem(1, "Id", document.createElement("input"), "text", function() { - tab10.arrItems[0].control.focus(); - }); - tab10.addItem(2, "Name", document.createElement("input"), "text", function() { - tab10.arrItems[1].control.focus(); - }); - tab10.addItem(3, "EST", document.createElement("input"), "text", function() { - tab10.arrItems[2].control.focus(); - }); - tab10.addItem(4, "Duration", document.createElement("input"), "text", function() { - tab10.arrItems[3].control.focus(); - }); - tab10.addItem(5, "Percent complete", document.createElement("input"), "text", function() { - tab10.arrItems[4].control.focus(); - }); - tab10.addItem(6, "Insert", document.createElement("input"), "button", - function() { - try { - var pr = tab10.object.Project; - var id = tab10.arrItems[0].control.value; - var name = tab10.arrItems[1].control.value; - var arr = tab10.arrItems[2].control.value.split("."); - var est = (arr.length < 3) ? null : (new Date(arr[2], parseInt(arr[1]) - 1, arr[0])); - var duration = tab10.arrItems[3].control.value; - var pc = tab10.arrItems[4].control.value; - var parentTaskId = tab10.object.TaskInfo.Id; - var predTaskId = ""; - if (pr.insertTask(id, name, est, duration, pc, predTaskId, parentTaskId)) tab10.hide(); - - } catch(e) { - // - } - } - ); - - var tab12 = this.createTab(12, "-Insert new project-", "p", false, this); - tab12.addItem(1, "Id", document.createElement("input"), "text", function() { - tab12.arrItems[0].control.focus(); - }); - tab12.addItem(2, "Name", document.createElement("input"), "text", function() { - tab12.arrItems[1].control.focus(); - }); - tab12.addItem(3, "Start date", document.createElement("input"), "text", function() { - tab12.arrItems[2].control.focus(); - }); - tab12.addItem(4, "Insert", document.createElement("input"), "button", - function() { - try { - - var id = tab12.arrItems[0].control.value; - var namePr = tab12.arrItems[1].control.value; - var arr = tab12.arrItems[2].control.value.split("."); - var startDatePr = (arr.length < 3) ? null : (new Date(arr[2], parseInt(arr[1]) - 1, arr[0])); - if (self.Chart.insertProject(id, namePr, startDatePr)) tab12.hide(); - - } catch(e) { - - } - } - ); -}; - -contextMenu.prototype.createHideDiv = function() -{ - this.hideDiv = document.createElement("div"); - this.hideDiv.style.position = "absolute"; - this.hideDiv.style.left = "0px"; - this.hideDiv.style.top = "0px"; - this.Chart.content.appendChild(this.hideDiv); - this.hideDiv.style.zIndex = 12; - this.hideDiv.style.display = "none"; - this.hideDiv.style.background = "#7D7E7D"; - this.hideDiv.style.cssText += ";-moz-opacity: 0.5;filter: alpha(opacity=50);opacity:.50;"; - this.hideDiv.style.width = this.Chart.content.offsetWidth + 2 + "px"; - this.hideDiv.style.height = this.Chart.content.offsetHeight + 2 + "px"; - -}; - -contextMenu.prototype.createMenuPanel = function() -{ - this.MenuPanel = document.createElement("div"); - this.MenuPanel.style.visibility = "hidden"; - this.MenuPanel.style.cssText += ";z-index:10;"; - this.MenuPanel.style.position = "absolute"; - this.Chart.content.appendChild(this.MenuPanel); - this.MenuPanel.innerHTML = "
"; - this.MenuPanel.firstChild.className = "contextMenu"; - - this.MenuPanel.firstChild.cellPadding = 0; - this.MenuPanel.firstChild.cellSpacing = 0; - this.MenuPanel.firstChild.style.cssText += ";background:url(" + this.Chart.imgs + "menu/menu_bg.png);"; -}; -contextMenu.prototype.createTabPanel = function() -{ - this.tabPanel = document.createElement("div"); - this.tabPanel.style.visibility = "hidden"; - this.tabPanel.style.zIndex = "30"; - this.TabContainer.firstChild.rows[0].cells[0].appendChild(this.tabPanel); - this.tabPanel.style.width = "385px"; - this.tabPanel.style.height = "290px"; - this.tabPanel.innerHTML = "
"; - this.tabPanel.firstChild.cellPadding = 0; - this.tabPanel.firstChild.cellSpacing = 0; - this.tabPanel.firstChild.style.cssText = "width:385px;border: 1px solid #808080;"; - this.tabPanel.firstChild.rows[0].cells[0].style.cssText = ";height:26px;background:url(" + this.Chart.imgs + "/menu/window_tr.png);background-repeat: no-repeat;color:#fff;font-size:14px;font-weight: bold;font-family: Tahoma, Arial"; - this.tabPanel.firstChild.rows[0].cells[0].align = "center"; - this.tabPanel.firstChild.rows[1].cells[0].style.cssText = ";height:270px;background:#F7F7F7;"; - this.tabPanel.firstChild.rows[1].cells[0].innerHTML = "
"; - this.tabPanel.firstChild.rows[1].cells[0].firstChild.style.cssText = "width:250px;font-size:11px;font-family:Tahoma,Arial;"; - this.tabPanel.firstChild.rows[1].cells[0].align = "center"; -}; - -contextMenu.prototype.addItemMenuPanel = function(tab) -{ - var self = this; - var row = this.MenuPanel.firstChild.insertRow(this.MenuPanel.firstChild.rows.length); - var cell = document.createElement('td'); - cell.innerHTML = tab.Description; - cell.style.cssText = "padding-left:10px;height:18px;"; - - this.addEvent(cell, "mousedown", function() { - tab.show(); - }, false); - - - cell.onmouseover = function() { - this.style.background = "url(" + self.Chart.imgs + "menu/menu_selection.png)"; - }; - cell.onmouseout = function() { - this.style.background = ""; - }; - - row.appendChild(cell); -}; - -contextMenu.prototype.showContextMenu = function(x, y, object) -{ - if (object.constructor == GanttTask) - { - for (var i = 0; i < this.arrTabs.length; i++) { - if (this.arrTabs[i].type == "t") - { - this.arrTabs[i].object = object; - this.addItemMenuPanel(this.arrTabs[i]); - } - } - } else if (object.constructor == GanttProject) - { - for (var i = 0; i < this.arrTabs.length; i++) { - if (this.arrTabs[i].type == "p") - { - this.arrTabs[i].object = object; - this.addItemMenuPanel(this.arrTabs[i]); - } - } - } - - this.isShow = true; - this.MenuPanel.style.cssText += ";z-index:15;"; - this.MenuPanel.style.visibility = "visible"; - - this.MenuPanel.style.top = parseInt(y) + this.Chart.heightTaskItem - this.Chart.oData.scrollTop + 5 + "px"; - this.MenuPanel.style.left = x; - -}; -contextMenu.prototype.hideContextMenu = function() -{ - this.isShow = false; - this.MenuPanel.style.visibility = "hidden"; - -}; -contextMenu.prototype.clear = function() -{ - this.MenuPanel.removeChild(this.MenuPanel.firstChild); - this.MenuPanel.innerHTML = "
"; - this.MenuPanel.firstChild.className = "contextMenu"; - this.MenuPanel.firstChild.cellPadding = 0; - this.MenuPanel.firstChild.cellSpacing = 0; - this.MenuPanel.firstChild.style.cssText += ";background:url(" + this.Chart.imgs + "menu/menu_bg.png);"; -}; -contextMenu.prototype.createTab = function(id, desc, type, showOInfo, menu) -{ - var tab = new contextMenuTab(id, desc, type, showOInfo, menu); - this.arrTabs.push(tab); - return tab; -}; -contextMenu.prototype.createTabContainer = function() -{ - this.TabContainer = document.createElement("div"); - this.TabContainer.style.position = "absolute"; - this.TabContainer.style.top = "0px"; - this.TabContainer.style.left = "0px"; - this.TabContainer.style.visibility = "hidden"; - this.TabContainer.style.zIndex = "50"; - this.Chart.content.appendChild(this.TabContainer); - this.TabContainer.innerHTML = "
"; - this.TabContainer.firstChild.style.cssText = ";width:100%;height:100%;"; - this.TabContainer.firstChild.rows[0].cells[0].align = "center"; - this.TabContainer.style.width = this.Chart.content.offsetWidth + 2 + "px"; - this.TabContainer.style.height = this.Chart.content.offsetHeight + 2 + "px"; - -}; - -contextMenu.prototype.getTabById = function(id) -{ - for (var i = 0; i < this.arrTabs.length; i++) { - if (this.arrTabs[i].Id == id) { - return this.arrTabs[i]; - } - } - return null; -}; -function contextMenuTab(id, description, type, showOInfo, contextMenu) -{ - this.Id = id; - this.arrItems = []; - this.TabItemContainer = null; - this.Description = description; - this.contextMenu = contextMenu; - this.type = type; - this.object = null; - this.showObjectInfo = showOInfo; - -} - -/** - * @desc: add event - * @param: elm - current element - * @param: evType - string that specifies any of the standard DHTML Events - * @param: fn - pointer that specifies the function to call when sEvent fires - * @type: private - * @topic: 5 - */ -contextMenu.prototype.addEvent = function (elm, evType, fn, useCapture) -{ - if (elm.addEventListener) { - elm.addEventListener(evType, fn, useCapture); - return true; - } - else if (elm.attachEvent) { - return elm.attachEvent('on' + evType, fn); - } - else { - elm['on' + evType] = fn; - } -}; - -contextMenuTab.prototype.addItem = function(id, name, control, type, handler) -{ - if (handler) { - control.onclick = handler; - } - control.type = type; - if (type == "button") - { - control.value = name; - } - var tabItem = new contextMenuTabItem(id, name, control, this); - this.arrItems.push(tabItem); -}; - -contextMenuTab.prototype.show = function() -{ - this.contextMenu.hideDiv.style.display = "inline"; - this.contextMenu.TabContainer.style.visibility = "visible"; - - var self = this; - this.contextMenu.tabPanel.firstChild.rows[0].cells[0].innerHTML = this.Description; - this.contextMenu.tabPanel.style.visibility = "visible"; - var t = this.contextMenu.tabPanel.firstChild.rows[1].cells[0].firstChild; - var c,c2,r = null; - - if (this.showObjectInfo) - { - if (this.object) { - if (this.object.constructor == GanttTask) { - this.insertData(t, "Id", this.object.TaskInfo.Id); - this.insertData(t, "Name", this.object.TaskInfo.Name); - this.insertData(t, "Duration", this.object.TaskInfo.Duration + " hrs"); - this.insertData(t, "Percent complete", this.object.TaskInfo.PercentCompleted + "%"); - this.insertData(t, "EST", this.object.TaskInfo.EST.getDate() + "." + (this.object.TaskInfo.EST.getMonth() + 1) + "." + this.object.TaskInfo.EST.getFullYear()); - this.insertData(t, "Predecessor", this.object.TaskInfo.PredecessorTaskId); - } else - { - this.insertData(t, "Id", this.object.Project.Id); - this.insertData(t, "Name", this.object.Project.Name); - this.insertData(t, "Start date", this.object.Project.StartDate.getDate() + "." + (this.object.Project.StartDate.getMonth() + 1) + "." + this.object.Project.StartDate.getFullYear()); - } - } - } - - var btnCell = null; - for (var i = 0; i < this.arrItems.length; i++) { - if (this.arrItems[i].control.type == "button") - { - r = t.insertRow(t.rows.length); - c = r.insertCell(r.cells.length); - btnCell = r.insertCell(r.cells.length); - btnCell.appendChild(this.arrItems[i].control); - - } else - { - r = t.insertRow(t.rows.length); - c = r.insertCell(r.cells.length); - c2 = r.insertCell(r.cells.length); - c.innerHTML = this.arrItems[i].Name; - c2.appendChild(this.arrItems[i].control); - - } - } - - var b = document.createElement("input"); - b.type = "button"; - b.value = "Cancel"; - b.onclick = function() - { - self.hide(); - }; - - if (!btnCell) { - r = t.insertRow(t.rows.length); - c = r.insertCell(r.cells.length); - btnCell = r.insertCell(r.cells.length); - } else { - b.style.marginLeft = "10px"; - } - btnCell.appendChild(b); -}; -contextMenuTab.prototype.hide = function() -{ - this.contextMenu.tabPanel.style.visibility = "hidden"; - var t = this.contextMenu.tabPanel.firstChild.rows[1].cells[0].firstChild; - t.parentNode.removeChild(t); - this.contextMenu.tabPanel.firstChild.rows[1].cells[0].innerHTML = "
"; - this.contextMenu.tabPanel.firstChild.rows[1].cells[0].firstChild.style.cssText = "width:250px;font-size:11px;font-family:Tahoma,Arial;"; - - this.contextMenu.hideDiv.style.display = "none"; - this.contextMenu.TabContainer.style.visibility = "hidden"; -}; - -contextMenuTab.prototype.insertData = function(t, name, value) -{ - var c,c2,r = null; - r = t.insertRow(t.rows.length); - c = r.insertCell(r.cells.length); - c.style.cssText = "width:100px"; - c.innerHTML = name; - c2 = r.insertCell(r.cells.length); - c2.innerHTML = value; - -}; -contextMenuTab.prototype.insertControl = function(t, name, value) -{ - var c,c2,r = null; - r = t.insertRow(t.rows.length); - c = r.insertCell(r.cells.length); - c.innerHTML = name; - c2 = r.insertCell(r.cells.length); - c2.appendChild(value); -}; - -function contextMenuTabItem(id, name, control, tab) -{ - this.Id = id; - this.Name = name; - this.control = control; - this.tab = tab; - -} diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js deleted file mode 100644 index 09ab70d659a..00000000000 --- a/addons/web_gantt/static/src/js/gantt.js +++ /dev/null @@ -1,266 +0,0 @@ -odoo.define('web_gantt.GanttView', function (require) { -"use strict"; -/*--------------------------------------------------------- - * Odoo web_gantt - *---------------------------------------------------------*/ - -var core = require('web.core'); -var form_common = require('web.form_common'); -var formats = require('web.formats'); -var Model = require('web.DataModel'); -var time = require('web.time'); -var View = require('web.View'); - -var _lt = core._lt; -var QWeb = core.qweb; - - -var GanttView = View.extend({ - display_name: _lt('Gantt'), - icon: 'fa-tasks', - view_type: "gantt", - init: function() { - this._super.apply(this, arguments); - this.has_been_loaded = $.Deferred(); - this.chart_id = _.uniqueId(); - }, - view_loading: function(r) { - return this.load_gantt(r); - }, - load_gantt: function(fields_view_get, fields_get) { - var self = this; - this.fields_view = fields_view_get; - this.$el.addClass(this.fields_view.arch.attrs['class']); - return self.alive(new Model(this.dataset.model) - .call('fields_get')).then(function (fields) { - self.fields = fields; - self.has_been_loaded.resolve(); - }); - }, - do_search: function (domains, contexts, group_bys) { - var self = this; - self.last_domains = domains; - self.last_contexts = contexts; - self.last_group_bys = group_bys; - // select the group by - var n_group_bys = []; - if (this.fields_view.arch.attrs.default_group_by) { - n_group_bys = this.fields_view.arch.attrs.default_group_by.split(','); - } - if (group_bys.length) { - n_group_bys = group_bys; - } - // gather the fields to get - var fields = _.compact(_.map(["date_start", "date_delay", "date_stop", "progress"], function(key) { - return self.fields_view.arch.attrs[key] || ''; - })); - fields = _.uniq(fields.concat(n_group_bys)); - - return $.when(this.has_been_loaded).then(function() { - return self.dataset.read_slice(fields, { - domain: domains, - context: contexts - }).then(function(data) { - return self.on_data_loaded(data, n_group_bys); - }); - }); - }, - reload: function() { - if (this.last_domains !== undefined) - return this.do_search(this.last_domains, this.last_contexts, this.last_group_bys); - }, - on_data_loaded: function(tasks, group_bys) { - var self = this; - var ids = _.pluck(tasks, "id"); - return this.dataset.name_get(ids).then(function(names) { - var ntasks = _.map(tasks, function(task) { - return _.extend({__name: _.detect(names, function(name) { return name[0] == task.id; })[1]}, task); - }); - return self.on_data_loaded_2(ntasks, group_bys); - }); - }, - on_data_loaded_2: function(tasks, group_bys) { - var self = this; - $(".oe_gantt", this.$el).html(""); - - //prevent more that 1 group by - if (group_bys.length > 0) { - group_bys = [group_bys[0]]; - } - // if there is no group by, simulate it - if (group_bys.length === 0) { - group_bys = ["_pseudo_group_by"]; - _.each(tasks, function(el) { - el._pseudo_group_by = "Gantt View"; - }); - this.fields._pseudo_group_by = {type: "string"}; - } - - // get the groups - var split_groups = function(tasks, group_bys) { - if (group_bys.length === 0) - return tasks; - var groups = []; - _.each(tasks, function(task) { - var group_name = task[_.first(group_bys)]; - var group = _.find(groups, function(group) { return _.isEqual(group.name, group_name); }); - if (group === undefined) { - group = {name:group_name, tasks: [], __is_group: true}; - groups.push(group); - } - group.tasks.push(task); - }); - _.each(groups, function(group) { - group.tasks = split_groups(group.tasks, _.rest(group_bys)); - }); - return groups; - }; - var groups = split_groups(tasks, group_bys); - - // track ids of task items for context menu - var task_ids = {}; - // creation of the chart - var generate_task_info = function(task, plevel) { - if (_.isNumber(task[self.fields_view.arch.attrs.progress])) { - var percent = task[self.fields_view.arch.attrs.progress] || 0; - } else { - var percent = 100; - } - var level = plevel || 0; - if (task.__is_group) { - var task_infos = _.compact(_.map(task.tasks, function(sub_task) { - return generate_task_info(sub_task, level + 1); - })); - if (task_infos.length === 0) - return; - var task_start = _.reduce(_.pluck(task_infos, "task_start"), function(date, memo) { - return memo === undefined || date < memo ? date : memo; - }, undefined); - var task_stop = _.reduce(_.pluck(task_infos, "task_stop"), function(date, memo) { - return memo === undefined || date > memo ? date : memo; - }, undefined); - var duration = (task_stop.getTime() - task_start.getTime()) / (1000 * 60 * 60); - var group_name = task.name ? formats.format_value(task.name, self.fields[group_bys[level]]) : "-"; - if (level === 0) { - var group = new GanttProjectInfo(_.uniqueId("gantt_project_"), group_name, task_start); - _.each(task_infos, function(el) { - group.addTask(el.task_info); - }); - return group; - } else { - var group = new GanttTaskInfo(_.uniqueId("gantt_project_task_"), group_name, task_start, duration || 1, percent); - _.each(task_infos, function(el) { - group.addChildTask(el.task_info); - }); - return {task_info: group, task_start: task_start, task_stop: task_stop}; - } - } else { - var task_name = task.__name; - var duration_in_business_hours = false; - var task_start = time.auto_str_to_date(task[self.fields_view.arch.attrs.date_start]); - if (!task_start) - return; - var task_stop; - if (self.fields_view.arch.attrs.date_stop) { - task_stop = time.auto_str_to_date(task[self.fields_view.arch.attrs.date_stop]); - if (!task_stop) - task_stop = task_start; - } else { // we assume date_duration is defined - var tmp = formats.format_value(task[self.fields_view.arch.attrs.date_delay], - self.fields[self.fields_view.arch.attrs.date_delay]); - if (!tmp) - return; - var m_task_start = moment(task_start).add(formats.parse_value(tmp, {type:"float"}), 'hours'); - task_stop = m_task_start.toDate(); - } - var duration = (task_stop.getTime() - task_start.getTime()) / (1000 * 60 * 60); - var id = _.uniqueId("gantt_task_"); - if (!duration_in_business_hours){ - duration = (duration / 24) * 8; - } - var task_info = new GanttTaskInfo(id, task_name, task_start, (duration) || 1, percent); - task_info.internal_task = task; - task_ids[id] = task_info; - return {task_info: task_info, task_start: task_start, task_stop: task_stop}; - } - }; - var gantt = new GanttChart(); - _.each(_.compact(_.map(groups, function(e) {return generate_task_info(e, 0);})), function(project) { - gantt.addProject(project); - }); - gantt.setEditable(true); - gantt.setImagePath("/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/"); - gantt.attachEvent("onTaskEndDrag", function(task) { - self.on_task_changed(task); - }); - gantt.attachEvent("onTaskEndResize", function(task) { - self.on_task_changed(task); - }); - // Horrible hack to make sure that something is in the dom with the required id. - // The problem is that the view manager renders the view in a document fragment. - var $div_with_id = $('
').addClass('o_gantt_container').attr('id', this.chart_id); - $div_with_id.prependTo(document.body); - gantt.create(this.chart_id); - - this.$el.empty().append($div_with_id); - - // bind event to display task when we click the item in the tree - $(".taskNameItem", self.$el).click(function(event) { - var task_info = task_ids[event.target.id]; - if (task_info) { - self.on_task_display(task_info.internal_task); - } - }); - if (this.is_action_enabled('create')) { - // insertion of create button - var td = $($("table td", self.$el)[0]); - var rendered = QWeb.render("GanttView-create-button"); - $(rendered).prependTo(td); - $(".oe_gantt_button_create", this.$el).click(this.on_task_create); - } - // Fix for IE to display the content of gantt view. - this.$el.find(".oe_gantt td:first > div, .oe_gantt td:eq(1) > div > div").css("overflow", ""); - }, - on_task_changed: function(task_obj) { - var self = this; - var itask = task_obj.TaskInfo.internal_task; - var start = task_obj.getEST(); - var duration = task_obj.getDuration(); - var duration_in_business_hours = !!self.fields_view.arch.attrs.date_delay; - if (!duration_in_business_hours){ - duration = (duration / 8 ) * 24; - } - var end = moment(start).add(duration, 'hours').toDate(); - var data = {}; - data[self.fields_view.arch.attrs.date_start] = - time.auto_date_to_str(start, self.fields[self.fields_view.arch.attrs.date_start].type); - if (self.fields_view.arch.attrs.date_stop) { - data[self.fields_view.arch.attrs.date_stop] = - time.auto_date_to_str(end, self.fields[self.fields_view.arch.attrs.date_stop].type); - } else { // we assume date_duration is defined - data[self.fields_view.arch.attrs.date_delay] = duration; - } - this.dataset.write(itask.id, data); - }, - on_task_display: function(task) { - var pop = new form_common.FormViewDialog(this, { - res_model: this.dataset.model, - res_id: task.id, - }).open(); - pop.on('write_completed', this, this.reload); - }, - on_task_create: function() { - var self = this; - new form_common.FormViewDialog(this, { - res_model: self.dataset.model, - on_selected: function() { - self.reload(); - } - }).open(); - }, -}); - -core.view_registry.add('gantt', GanttView); - -return GanttView; -}); diff --git a/addons/web_gantt/static/src/less/gantt.less b/addons/web_gantt/static/src/less/gantt.less deleted file mode 100644 index 5abac9ddb8e..00000000000 --- a/addons/web_gantt/static/src/less/gantt.less +++ /dev/null @@ -1,7 +0,0 @@ -.o_gantt_container { - position: absolute; - top: 16px; - bottom: 16px; - right: 16px; - left: 16px; -} diff --git a/addons/web_gantt/static/src/xml/web_gantt.xml b/addons/web_gantt/static/src/xml/web_gantt.xml deleted file mode 100644 index a542ee4b5d5..00000000000 --- a/addons/web_gantt/static/src/xml/web_gantt.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/addons/web_gantt/views/web_gantt.xml b/addons/web_gantt/views/web_gantt.xml deleted file mode 100644 index bb6da941393..00000000000 --- a/addons/web_gantt/views/web_gantt.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - -