diff --git a/bootstrap/classaliasmap.php b/bootstrap/classaliasmap.php index 4fba1a533..e497dae3b 100644 --- a/bootstrap/classaliasmap.php +++ b/bootstrap/classaliasmap.php @@ -60,7 +60,6 @@ return array( 'PmTable' => PmTable::class, 'popupMenu' => PopupMenu::class, 'Processes' => Processes::class, - 'ProcessMakerWebDav' => ProcessMakerWebDav::class, 'processMap' => ProcessMap::class, 'propelTable' => PropelTable::class, 'replacementLogo' => ReplacementLogo::class, diff --git a/composer.json b/composer.json index 40fbe3f19..8d836459f 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,6 @@ "luracast/restler": "5.0.*", "bshaffer/oauth2-server-php": "v1.0", "google/apiclient": "^2.15", - "dapphp/securimage": "^3.6", "psr/log": "^2.0", "monolog/monolog": "^3.0", "geshi/geshi": "dev-master", @@ -44,7 +43,6 @@ "league/oauth2-client": "^2.4", "league/oauth2-google": "^3.0", "tecnickcom/tcpdf": "6.4.*", - "fzaninotto/faker": "dev-master", "predis/predis": "1.1.1", "phpmyadmin/sql-parser": "^5.3", "aws/aws-sdk-php": "~3.0", @@ -58,8 +56,7 @@ "filp/whoops": "~2.0", "behat/behat": "^3.3", "behat/mink-selenium2-driver": "^1.3", - "squizlabs/php_codesniffer": "^2.2 || ^3.0.2", - "wimg/php-compatibility": "*" + "squizlabs/php_codesniffer": "^2.2 || ^3.0.2" }, "autoload": { "psr-0": { @@ -100,8 +97,8 @@ } }, "scripts": { - "post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/wimg/php-compatibility", - "post-update-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/wimg/php-compatibility", + "post-install-cmd": "", + "post-update-cmd": "", "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover" diff --git a/composer.lock b/composer.lock index f42152a60..5d282b15a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "59e463b1b3f85fe6e992573427ca0ea2", + "content-hash": "5ae6f7fe864821de747da6dc24771fed", "packages": [ { "name": "aws/aws-crt-php", @@ -62,16 +62,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.339.14", + "version": "3.340.4", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "532eb5e502c5b1181456023e41d61445b2c7101d" + "reference": "2896cfb3f6b2bd06757b16e99e1cab93c9598af3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/532eb5e502c5b1181456023e41d61445b2c7101d", - "reference": "532eb5e502c5b1181456023e41d61445b2c7101d", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/2896cfb3f6b2bd06757b16e99e1cab93c9598af3", + "reference": "2896cfb3f6b2bd06757b16e99e1cab93c9598af3", "shasum": "" }, "require": { @@ -153,9 +153,9 @@ "support": { "forum": "https://github.com/aws/aws-sdk-php/discussions", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.339.14" + "source": "https://github.com/aws/aws-sdk-php/tree/3.340.4" }, - "time": "2025-02-14T19:11:38+00:00" + "time": "2025-02-28T19:13:38+00:00" }, { "name": "brick/math", @@ -328,60 +328,6 @@ ], "time": "2024-02-09T16:56:22+00:00" }, - { - "name": "dapphp/securimage", - "version": "3.6.8", - "source": { - "type": "git", - "url": "https://github.com/dapphp/securimage.git", - "reference": "5fc5953c4ffba1eb214cc83100672f238c184ca4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dapphp/securimage/zipball/5fc5953c4ffba1eb214cc83100672f238c184ca4", - "reference": "5fc5953c4ffba1eb214cc83100672f238c184ca4", - "shasum": "" - }, - "require": { - "ext-gd": "*", - "php": ">=5.4" - }, - "suggest": { - "ext-pdo": "For database storage support", - "ext-pdo_mysql": "For MySQL database support", - "ext-pdo_sqlite": "For SQLite3 database support" - }, - "type": "library", - "autoload": { - "classmap": [ - "securimage.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Drew Phillips", - "email": "drew@drew-phillips.com" - } - ], - "description": "PHP CAPTCHA Library", - "homepage": "https://www.phpcaptcha.org", - "keywords": [ - "Forms", - "anti-spam", - "captcha", - "security" - ], - "support": { - "issues": "https://github.com/dapphp/securimage/issues", - "source": "https://github.com/dapphp/securimage/tree/3.6.8" - }, - "abandoned": true, - "time": "2020-05-30T09:43:22+00:00" - }, { "name": "dflydev/dot-access-data", "version": "v3.0.3", @@ -891,62 +837,6 @@ ], "time": "2023-10-12T05:21:21+00:00" }, - { - "name": "fzaninotto/faker", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "5ffe7db6c80f441f150fc88008d64e64af66634b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/5ffe7db6c80f441f150fc88008d64e64af66634b", - "reference": "5ffe7db6c80f441f150fc88008d64e64af66634b", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0 || ^8.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^2.9.2" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "support": { - "issues": "https://github.com/fzaninotto/Faker/issues", - "source": "https://github.com/fzaninotto/Faker/tree/master" - }, - "abandoned": true, - "time": "2020-12-11T09:59:14+00:00" - }, { "name": "geshi/geshi", "version": "dev-master", @@ -1065,16 +955,16 @@ }, { "name": "google/apiclient-services", - "version": "v0.394.0", + "version": "v0.396.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "17fa8210d62c02c398fb4985ed4bc461d18989c1" + "reference": "ceb2e432e4326c6775d24f62d554395a1a9ad3dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/17fa8210d62c02c398fb4985ed4bc461d18989c1", - "reference": "17fa8210d62c02c398fb4985ed4bc461d18989c1", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/ceb2e432e4326c6775d24f62d554395a1a9ad3dd", + "reference": "ceb2e432e4326c6775d24f62d554395a1a9ad3dd", "shasum": "" }, "require": { @@ -1103,9 +993,9 @@ ], "support": { "issues": "https://github.com/googleapis/google-api-php-client-services/issues", - "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.394.0" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.396.0" }, - "time": "2025-02-10T01:06:23+00:00" + "time": "2025-02-24T01:10:27+00:00" }, { "name": "google/auth", @@ -2346,16 +2236,16 @@ }, { "name": "league/oauth2-client", - "version": "2.8.0", + "version": "2.8.1", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-client.git", - "reference": "3d5cf8d0543731dfb725ab30e4d7289891991e13" + "reference": "9df2924ca644736c835fc60466a3a60390d334f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/3d5cf8d0543731dfb725ab30e4d7289891991e13", - "reference": "3d5cf8d0543731dfb725ab30e4d7289891991e13", + "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/9df2924ca644736c835fc60466a3a60390d334f9", + "reference": "9df2924ca644736c835fc60466a3a60390d334f9", "shasum": "" }, "require": { @@ -2405,9 +2295,9 @@ ], "support": { "issues": "https://github.com/thephpleague/oauth2-client/issues", - "source": "https://github.com/thephpleague/oauth2-client/tree/2.8.0" + "source": "https://github.com/thephpleague/oauth2-client/tree/2.8.1" }, - "time": "2024-12-11T05:05:52+00:00" + "time": "2025-02-26T04:37:30+00:00" }, { "name": "league/oauth2-google", @@ -3768,16 +3658,16 @@ }, { "name": "phpmyadmin/sql-parser", - "version": "5.10.3", + "version": "5.11.0", "source": { "type": "git", "url": "https://github.com/phpmyadmin/sql-parser.git", - "reference": "5346664973d10cf1abff20837fb1183f3c11a055" + "reference": "07044bc8c13abd542756c3fd34dc66a5d6dee8e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/5346664973d10cf1abff20837fb1183f3c11a055", - "reference": "5346664973d10cf1abff20837fb1183f3c11a055", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/07044bc8c13abd542756c3fd34dc66a5d6dee8e4", + "reference": "07044bc8c13abd542756c3fd34dc66a5d6dee8e4", "shasum": "" }, "require": { @@ -3792,9 +3682,11 @@ "phpbench/phpbench": "^1.1", "phpmyadmin/coding-standard": "^3.0", "phpmyadmin/motranslator": "^4.0 || ^5.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.9.12", - "phpstan/phpstan-phpunit": "^1.3.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^1.12", + "phpstan/phpstan-deprecation-rules": "^1.2", + "phpstan/phpstan-phpunit": "^1.4", + "phpstan/phpstan-strict-rules": "^1.6", "phpunit/phpunit": "^8.5 || ^9.6", "psalm/plugin-phpunit": "^0.16.1", "vimeo/psalm": "^4.11", @@ -3851,7 +3743,7 @@ "type": "other" } ], - "time": "2025-01-19T04:14:02+00:00" + "time": "2025-02-22T20:00:59+00:00" }, { "name": "phpoption/phpoption", @@ -5282,16 +5174,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v7.2.3", + "version": "v7.2.4", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "1d321c4bc3fe926fd4c38999a4c9af4f5d61ddfc" + "reference": "f0a1614cccb4b8431a97076f9debc08ddca321ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1d321c4bc3fe926fd4c38999a4c9af4f5d61ddfc", - "reference": "1d321c4bc3fe926fd4c38999a4c9af4f5d61ddfc", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f0a1614cccb4b8431a97076f9debc08ddca321ca", + "reference": "f0a1614cccb4b8431a97076f9debc08ddca321ca", "shasum": "" }, "require": { @@ -5342,7 +5234,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v7.2.3" + "source": "https://github.com/symfony/dependency-injection/tree/v7.2.4" }, "funding": [ { @@ -5358,7 +5250,7 @@ "type": "tidelift" } ], - "time": "2025-01-17T10:56:55+00:00" + "time": "2025-02-21T09:47:16+00:00" }, { "name": "symfony/deprecation-contracts", @@ -5429,16 +5321,16 @@ }, { "name": "symfony/error-handler", - "version": "v6.4.18", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "e8d3b5b1975e67812a54388b1ba8e9ec28eb770e" + "reference": "3d4e55cd2b8f1979a65eba9ab749d6466c316f71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/e8d3b5b1975e67812a54388b1ba8e9ec28eb770e", - "reference": "e8d3b5b1975e67812a54388b1ba8e9ec28eb770e", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/3d4e55cd2b8f1979a65eba9ab749d6466c316f71", + "reference": "3d4e55cd2b8f1979a65eba9ab749d6466c316f71", "shasum": "" }, "require": { @@ -5484,7 +5376,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.4.18" + "source": "https://github.com/symfony/error-handler/tree/v6.4.19" }, "funding": [ { @@ -5500,7 +5392,7 @@ "type": "tidelift" } ], - "time": "2025-01-06T09:38:16+00:00" + "time": "2025-02-02T20:16:33+00:00" }, { "name": "symfony/event-dispatcher", @@ -5867,16 +5759,16 @@ }, { "name": "symfony/http-kernel", - "version": "v6.4.18", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "fca7197bfe9e99dfae7fb1ad3f7f5bd9ef80e1b7" + "reference": "88f2c9f7feff86bb7b9105c5151bc2c1404cd64c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/fca7197bfe9e99dfae7fb1ad3f7f5bd9ef80e1b7", - "reference": "fca7197bfe9e99dfae7fb1ad3f7f5bd9ef80e1b7", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/88f2c9f7feff86bb7b9105c5151bc2c1404cd64c", + "reference": "88f2c9f7feff86bb7b9105c5151bc2c1404cd64c", "shasum": "" }, "require": { @@ -5961,7 +5853,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.18" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.19" }, "funding": [ { @@ -5977,7 +5869,7 @@ "type": "tidelift" } ], - "time": "2025-01-29T07:25:58+00:00" + "time": "2025-02-26T10:51:37+00:00" }, { "name": "symfony/mailer", @@ -6061,16 +5953,16 @@ }, { "name": "symfony/mime", - "version": "v6.4.18", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "917d77981eb1ea963608d5cda4d9c0cf72eaa68e" + "reference": "ac537b6c55ccc2c749f3c979edfa9ec14aaed4f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/917d77981eb1ea963608d5cda4d9c0cf72eaa68e", - "reference": "917d77981eb1ea963608d5cda4d9c0cf72eaa68e", + "url": "https://api.github.com/repos/symfony/mime/zipball/ac537b6c55ccc2c749f3c979edfa9ec14aaed4f3", + "reference": "ac537b6c55ccc2c749f3c979edfa9ec14aaed4f3", "shasum": "" }, "require": { @@ -6126,7 +6018,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.4.18" + "source": "https://github.com/symfony/mime/tree/v6.4.19" }, "funding": [ { @@ -6142,7 +6034,7 @@ "type": "tidelift" } ], - "time": "2025-01-23T13:10:52+00:00" + "time": "2025-02-17T21:23:52+00:00" }, { "name": "symfony/polyfill-ctype", @@ -6782,16 +6674,16 @@ }, { "name": "symfony/process", - "version": "v6.4.15", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3cb242f059c14ae08591c5c4087d1fe443564392" + "reference": "7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3cb242f059c14ae08591c5c4087d1fe443564392", - "reference": "3cb242f059c14ae08591c5c4087d1fe443564392", + "url": "https://api.github.com/repos/symfony/process/zipball/7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3", + "reference": "7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3", "shasum": "" }, "require": { @@ -6823,7 +6715,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.15" + "source": "https://github.com/symfony/process/tree/v6.4.19" }, "funding": [ { @@ -6839,7 +6731,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:19:14+00:00" + "time": "2025-02-04T13:35:48+00:00" }, { "name": "symfony/routing", @@ -7096,16 +6988,16 @@ }, { "name": "symfony/translation", - "version": "v6.4.13", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66" + "reference": "3b9bf9f33997c064885a7bfc126c14b9daa0e00e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/bee9bfabfa8b4045a66bf82520e492cddbaffa66", - "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66", + "url": "https://api.github.com/repos/symfony/translation/zipball/3b9bf9f33997c064885a7bfc126c14b9daa0e00e", + "reference": "3b9bf9f33997c064885a7bfc126c14b9daa0e00e", "shasum": "" }, "require": { @@ -7171,7 +7063,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.13" + "source": "https://github.com/symfony/translation/tree/v6.4.19" }, "funding": [ { @@ -7187,7 +7079,7 @@ "type": "tidelift" } ], - "time": "2024-09-27T18:14:25+00:00" + "time": "2025-02-13T10:18:43+00:00" }, { "name": "symfony/translation-contracts", @@ -7428,16 +7320,16 @@ }, { "name": "symfony/var-exporter", - "version": "v7.2.0", + "version": "v7.2.4", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "1a6a89f95a46af0f142874c9d650a6358d13070d" + "reference": "4ede73aa7a73d81506002d2caadbbdad1ef5b69a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/1a6a89f95a46af0f142874c9d650a6358d13070d", - "reference": "1a6a89f95a46af0f142874c9d650a6358d13070d", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/4ede73aa7a73d81506002d2caadbbdad1ef5b69a", + "reference": "4ede73aa7a73d81506002d2caadbbdad1ef5b69a", "shasum": "" }, "require": { @@ -7484,7 +7376,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.2.0" + "source": "https://github.com/symfony/var-exporter/tree/v7.2.4" }, "funding": [ { @@ -7500,7 +7392,7 @@ "type": "tidelift" } ], - "time": "2024-10-18T07:58:17+00:00" + "time": "2025-02-13T10:27:23+00:00" }, { "name": "tecnickcom/tcpdf", @@ -8003,24 +7895,30 @@ }, { "name": "behat/gherkin", - "version": "v4.11.0", + "version": "v4.12.0", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "32821a17b12620951e755b5d49328a6421a5b5b5" + "reference": "cc3a7e224b36373be382b53ef02ede0f1807bb58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/32821a17b12620951e755b5d49328a6421a5b5b5", - "reference": "32821a17b12620951e755b5d49328a6421a5b5b5", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/cc3a7e224b36373be382b53ef02ede0f1807bb58", + "reference": "cc3a7e224b36373be382b53ef02ede0f1807bb58", "shasum": "" }, "require": { + "composer-runtime-api": "^2.2", "php": "8.1.* || 8.2.* || 8.3.* || 8.4.*" }, "require-dev": { "cucumber/cucumber": "dev-gherkin-24.1.0", - "phpunit/phpunit": "^9.6", + "friendsofphp/php-cs-fixer": "^3.65", + "phpstan/extension-installer": "^1", + "phpstan/phpstan": "^2", + "phpstan/phpstan-phpunit": "^2", + "phpunit/phpunit": "^10.5", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", "symfony/yaml": "^5.4 || ^6.4 || ^7.0" }, "suggest": { @@ -8045,11 +7943,11 @@ { "name": "Konstantin Kudryashov", "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "homepage": "https://everzet.com" } ], "description": "Gherkin DSL parser for PHP", - "homepage": "http://behat.org/", + "homepage": "https://behat.org/", "keywords": [ "BDD", "Behat", @@ -8060,9 +7958,9 @@ ], "support": { "issues": "https://github.com/Behat/Gherkin/issues", - "source": "https://github.com/Behat/Gherkin/tree/v4.11.0" + "source": "https://github.com/Behat/Gherkin/tree/v4.12.0" }, - "time": "2024-12-06T10:07:25+00:00" + "time": "2025-02-26T14:28:23+00:00" }, { "name": "behat/mink", @@ -9068,16 +8966,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.0.1", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "72e51f7c32c5aef7c8b462195b8c599b11199893" + "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/72e51f7c32c5aef7c8b462195b8c599b11199893", - "reference": "72e51f7c32c5aef7c8b462195b8c599b11199893", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", + "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", "shasum": "" }, "require": { @@ -9109,9 +9007,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.1.0" }, - "time": "2025-02-13T12:25:43+00:00" + "time": "2025-02-19T13:28:12+00:00" }, { "name": "phpunit/php-code-coverage", @@ -10702,77 +10600,13 @@ } ], "time": "2024-03-03T12:36:25+00:00" - }, - { - "name": "wimg/php-compatibility", - "version": "9.3.5", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" - } - ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, - "abandoned": "phpcompatibility/php-compatibility", - "time": "2019-12-27T09:44:58+00:00" } ], "aliases": [], "minimum-stability": "dev", "stability-flags": { "geshi/geshi": 20, - "pdepend/pdepend": 0, - "fzaninotto/faker": 20 + "pdepend/pdepend": 0 }, "prefer-stable": true, "prefer-lowest": false, diff --git a/config/deprecatedFiles.lst b/config/deprecatedFiles.lst index aa010b8e1..1556415e4 100644 --- a/config/deprecatedFiles.lst +++ b/config/deprecatedFiles.lst @@ -38,7 +38,6 @@ rbac/engine/xmlform rbac/public_html/skins/JSForms.js virtualhost.conf.example workflow/engine/classes/class.jrml.php -workflow/engine/classes/class.webdav.php workflow/engine/classes/entities/AppSolrQueue.php workflow/engine/classes/entities/Base.php workflow/engine/classes/entities/FacetGroup.php @@ -51,7 +50,6 @@ workflow/engine/classes/entities/SelectedFacetGroupItem.php workflow/engine/classes/entities/SolrQueryResult.php workflow/engine/classes/entities/SolrRequestData.php workflow/engine/classes/entities/SolrUpdateDocument.php -workflow/engine/classes/triggers/api/class.zimbraApi.php workflow/engine/controllers/authSourceProxy.php workflow/engine/controllers/dashboard.php workflow/engine/controllers/installer.php diff --git a/features/backend/admin_setup/roles/main_tests_roles.feature b/features/backend/admin_setup/roles/main_tests_roles.feature index 2d8706669..b626c2f23 100644 --- a/features/backend/admin_setup/roles/main_tests_roles.feature +++ b/features/backend/admin_setup/roles/main_tests_roles.feature @@ -451,7 +451,6 @@ Scenario Outline: Assign Permission "PM_DASHBOARD" to Role | Assign Permissions "PM_SUPERVISOR" to rol 2 | 2 | 00000000000000000000000000000009 | | Assign Permissions "PM_SETUP_ADVANCE" to rol 3 | 3 | 00000000000000000000000000000010 | | Assign Permissions "PM_DASHBOARD" to rol 4 | 4 | 00000000000000000000000000000011 | - | Assign Permissions "PM_WEBDAV" to rol 5 | 5 | 00000000000000000000000000000012 | | Assign Permissions "PM_LOGIN" to rol 6 | 6 | 00000000000000000000000000000001 | | Assign Permissions "PM_EDITPERSONALINFO" to rol 7 | 7 | 00000000000000000000000000000014 | | Assign Permissions "PM_FOLDERS_VIEW" to rol 8 | 8 | 00000000000000000000000000000015 | @@ -542,7 +541,6 @@ Scenario Outline: Unassign Permission of the Role | Unassign Permissions "PM_SUPERVISOR" to rol 2 | 2 | 00000000000000000000000000000009 | | Unassign Permissions "PM_SETUP_ADVANCE" to rol 3 | 3 | 00000000000000000000000000000010 | | Unassign Permissions "PM_DASHBOARD" to rol 4 | 4 | 00000000000000000000000000000011 | - | Unassign Permissions "PM_WEBDAV" to rol 5 | 5 | 00000000000000000000000000000012 | | Unassign Permissions "PM_LOGIN" to rol 6 | 6 | 00000000000000000000000000000001 | | Unassign Permissions "PM_EDITPERSONALINFO" to rol 7 | 7 | 00000000000000000000000000000014 | | Unassign Permissions "PM_FOLDERS_VIEW" to rol 8 | 8 | 00000000000000000000000000000015 | diff --git a/features/backend/projects/trigger_wizard/main_tests_trigger_wizards.feature b/features/backend/projects/trigger_wizard/main_tests_trigger_wizards.feature index 1cc4446fb..d6adbb84a 100644 --- a/features/backend/projects/trigger_wizard/main_tests_trigger_wizards.feature +++ b/features/backend/projects/trigger_wizard/main_tests_trigger_wizards.feature @@ -27,13 +27,11 @@ Feature: Group | Get in process .pm | 2 | 14414793652a5d718b65590036026581 | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php | | Get in process .pm | 3 | 14414793652a5d718b65590036026581 | pmTrAlfresco | Alfresco DM Triggers v. 0.1 | class.pmTrAlfresco.pmFunctions.php | | Get in process .pm | 4 | 14414793652a5d718b65590036026581 | pmTrSharepoint | Sharepoint DWS Triggers v. 0.1 | class.pmTrSharepoint.pmFunctions.php | - | Get in process .pm | 5 | 14414793652a5d718b65590036026581 | pmZimbra | Zimbra Triggers v. 0.1 | class.pmZimbra.pmFunctions.php | | Get in process .pmx | 0 | 1455892245368ebeb11c1a5001393784 | pmFunctions | ProcessMaker Functions | class.pmFunctions.php | | Get in process .pmx | 1 | 1455892245368ebeb11c1a5001393784 | pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php | | Get in process .pmx | 2 | 1455892245368ebeb11c1a5001393784 | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php | | Get in process .pmx | 3 | 1455892245368ebeb11c1a5001393784 | pmTrAlfresco | Alfresco DM Triggers v. 0.1 | class.pmTrAlfresco.pmFunctions.php | | Get in process .pmx | 4 | 1455892245368ebeb11c1a5001393784 | pmTrSharepoint | Sharepoint DWS Triggers v. 0.1 | class.pmTrSharepoint.pmFunctions.php | - | Get in process .pmx | 5 | 1455892245368ebeb11c1a5001393784 | pmZimbra | Zimbra Triggers v. 0.1 | class.pmZimbra.pmFunctions.php | Scenario Outline: Get a single Library @@ -51,13 +49,11 @@ Feature: Group | Get in process .pm | 14414793652a5d718b65590036026581 | pmFunctions | ProcessMaker Functions | class.pmFunctions.php | | Get in process .pm | 14414793652a5d718b65590036026581 | pmTrSharepoint | Sharepoint DWS Triggers v. 0.1 | class.pmTrSharepoint.pmFunctions.php | | Get in process .pm | 14414793652a5d718b65590036026581 | pmTrAlfresco | Alfresco DM Triggers v. 0.1 | class.pmTrAlfresco.pmFunctions.php | - | Get in process .pm | 14414793652a5d718b65590036026581 | pmZimbra | Zimbra Triggers v. 0.1 | class.pmZimbra.pmFunctions.php | | Get in process .pm | 14414793652a5d718b65590036026581 | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php | | Get in process .pm | 14414793652a5d718b65590036026581 | pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php | | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmFunctions | ProcessMaker Functions | class.pmFunctions.php | | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmTrSharepoint | Sharepoint DWS Triggers v. 0.1 | class.pmTrSharepoint.pmFunctions.php | | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmTrAlfresco | Alfresco DM Triggers v. 0.1 | class.pmTrAlfresco.pmFunctions.php | - | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmZimbra | Zimbra Triggers v. 0.1 | class.pmZimbra.pmFunctions.php | | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php | | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php | @@ -76,13 +72,11 @@ Feature: Group | Get in process .pm | 14414793652a5d718b65590036026581 | pmFunctions | PMFAddAttachmentToArray | Add Element in Array | | Get in process .pm | 14414793652a5d718b65590036026581 | pmTrSharepoint | createDWS | Create a DWS in Sharepoint server | | Get in process .pm | 14414793652a5d718b65590036026581 | pmTrAlfresco | Checkin | Checkin document/file | - | Get in process .pm | 14414793652a5d718b65590036026581 | pmZimbra | createZimbraAppointment | Create Appointment | | Get in process .pm | 14414793652a5d718b65590036026581 | pmTalend | executeTalendWebservice | Executes a Talend Web Service | | Get in process .pm | 14414793652a5d718b65590036026581 | pmSugar | CreateSugarAccount | Creates SugarCRM entries from the Account module | | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmFunctions | PMFAddAttachmentToArray | Add Element in Array | | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmTrSharepoint | createDWS | Create a DWS in Sharepoint server | | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmTrAlfresco | Checkin | Checkin document/file | - | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmZimbra | createZimbraAppointment | Create Appointment | | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmTalend | executeTalendWebservice | Executes a Talend Web Service | | Get in process .pmx | 1455892245368ebeb11c1a5001393784 | pmSugar | CreateSugarAccount | Creates SugarCRM entries from the Account module | diff --git a/gulliver/system/class.rbac.php b/gulliver/system/class.rbac.php index 010950462..1b56012af 100644 --- a/gulliver/system/class.rbac.php +++ b/gulliver/system/class.rbac.php @@ -343,11 +343,6 @@ class RBAC "PER_CODE" => "PM_DASHBOARD", "PER_NAME" => "Dashboard" ], - [ - "PER_UID" => "00000000000000000000000000000012", - "PER_CODE" => "PM_WEBDAV", - "PER_NAME" => "WebDav" - ], [ "PER_UID" => "00000000000000000000000000000013", "PER_CODE" => "PM_DELETECASE", diff --git a/rbac/engine/data/mysql/insert.sql b/rbac/engine/data/mysql/insert.sql index 8a1476d7f..6bea44a3c 100755 --- a/rbac/engine/data/mysql/insert.sql +++ b/rbac/engine/data/mysql/insert.sql @@ -10,7 +10,6 @@ INSERT INTO `RBAC_PERMISSIONS` VALUES ('00000000000000000000000000000009','PM_SUPERVISOR',NULL,NULL,1,'00000000000000000000000000000002'), ('00000000000000000000000000000010','PM_SETUP_ADVANCE',NULL,NULL,1,'00000000000000000000000000000002'), ('00000000000000000000000000000011','PM_DASHBOARD','2009-02-18 00:00:00','2009-02-18 00:00:00',1,'00000000000000000000000000000002'), -('00000000000000000000000000000012','PM_WEBDAV','2009-08-21 00:00:00','2009-08-21 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000013','PM_DELETECASE','2009-10-12 00:00:00',NULL,1,'00000000000000000000000000000002'), ('00000000000000000000000000000014','PM_EDITPERSONALINFO','2009-10-12 00:00:00',NULL,1,'00000000000000000000000000000002'), ('00000000000000000000000000000015','PM_FOLDERS_ALL','2009-10-12 00:00:00',NULL,1,'00000000000000000000000000000002'), diff --git a/workflow/engine/classes/triggers/api/Zimbra.php b/workflow/engine/classes/triggers/api/Zimbra.php deleted file mode 100644 index f9ec5f626..000000000 --- a/workflow/engine/classes/triggers/api/Zimbra.php +++ /dev/null @@ -1,1306 +0,0 @@ - - * @GPL 2007, Plymouth State University, ITS - */ - -use ProcessMaker\Core\System; - -/** - * zimbra.class.php - * - * Zimbra API - * - * @version 1.3 - * @module zimbra.class.php - * @author Zachary Tirrell - * @GPL 2007, Plymouth State University, ITS - */ -class Zimbra -{ - public $debug = false; - public $error; - protected $_connected = false; // boolean to determine if the connect function has been called - protected static $_num_soap_calls = 0; // the number of times a SOAP call has been made - protected $_preAuthKey; // key for doing pre-authentication - protected $_lcached_assets = array(); // an array to hold assets that have been cached - protected $_preauth_expiration = 0; // 0 indicates using the default preauth expiration as defined on the server - protected $_dev; // boolean indicating whether this is development or not - protected $_protocol; // which protocol to use when building the URL - protected $_server1; // = 'ip-10-73-18-235.ec2.internal'; // hostname of zimbra server - protected $_server; // displayname of zimbra server - protected $_path = '/service/soap'; - protected $_timestamp; - protected $_account_info; - protected $_admin = false; // operating as an admin - protected $_curl; - protected $_auth_token; // used for repeat calls to zimbra through soap - protected $_session_id; // used for repeat calls to zimbra through soap - protected $_idm; // IDMObject - protected $_username; // the user we are operating as - - /** - * __construct - * - * constructor sets up connectivity to servers - * - * @since version 1.0 - * @acess public - * @param string $username username - * @param string $which defaults to prod - */ - - public function __construct($username, $serverUrl, $preAuthKey, $which = 'prod', $protocol = 'http') - { - if ($which == 'dev') { - $which = 'zimbra_dev'; - $this->_dev = true; - } else { - $which = 'zimbra'; - } - - $this->_preAuthKey = $preAuthKey; - $this->_protocol = $protocol . "://"; // could also be http:// - $this->_server = $serverUrl; //'zimbra.hostname.edu'; - $this->_server1 = $serverUrl; //'zimbra.hostname.edu'; - $this->_username = $username; - $this->_timestamp = time() . '000'; - } - - // end __construct - - /** - * sso - * - * sso to Zimbra - * - * @since version 1.0 - * @access public - * @param string $options options for sso - * @return boolean - */ - public function sso($options = '') - { - if ($this->_username) { - if (PHP_VERSION < 5.2) { - setcookie("ZM_SKIN", "plymouth", time() + (60 * 60 * 24 * 30), "/", ".plymouth.edu", "; HttpOnly"); - } else { - setcookie("ZM_SKIN", "plymouth", time() + (60 * 60 * 24 * 30), "/", ".plymouth.edu", false, true); - } - - $pre_auth = $this->getPreAuth($this->_username); - $url = $this->_protocol . '/service/preauth?account=' . $this->_username . '@' . $this->_server . '&expires=' . $this->_preauth_expiration . '×tamp=' . $this->_timestamp . '&preauth=' . $pre_auth; //.'&'.$options; - header("Location: $url"); - exit(); - } else { - return false; - } - } - - // end sso - - /** - * createAccount - * - * @param string $name account name - * @param string $password password - * @return string account id - */ - public function createAccount($name, $password) - { - $option_string = ''; - - try { - $soap = ' - ' . $name . '@' . $this->_server1 . ' - ' . $password . '' . $option_string . ' - - '; - - $response = $this->soapRequest($soap); - } catch (SoapFault $exception) { - print_exception($exception); - } - - return $result['SOAP:ENVELOPE']['SOAP:BODY']['CREATEACCOUNTRESPONSE']['ACCOUNT']['ID']; - } - - /** - * getPreAuth - * - * get the preauth key needed for single-sign on - * - * @since version1.0 - * @access public - * @param string $username username - * @return string preauthentication key in hmacsha1 format - */ - private function getPreAuth($username) - { - $account_identifier = $username . '@' . $this->_server1; - $by_value = 'name'; - $expires = $this->_preauth_expiration; - $timestamp = $this->_timestamp; - - $string = $account_identifier . '|' . $by_value . '|' . $expires . '|' . $timestamp; - - return $this->hmacsha1($this->_preAuthKey, $string); - } - - // end getPreAuth - - /** - * hmacsha1 - * - * generate an HMAC using SHA1, required for preauth - * - * @since version 1.0 - * @access public - * @param int $key encryption key - * @param string $data data to encrypt - * @return string converted to hmac sha1 format - */ - private function hmacsha1($key, $data) - { - $blocksize = 64; - $hashfunc = 'sha1'; - if (strlen($key) > $blocksize) { - $key = pack('H*', $hashfunc($key)); - } - $key = str_pad($key, $blocksize, chr(0x00)); - $ipad = str_repeat(chr(0x36), $blocksize); - $opad = str_repeat(chr(0x5c), $blocksize); - $hmac = pack('H*', $hashfunc(($key ^ $opad) . pack('H*', $hashfunc(($key ^ $ipad) . $data)))); - return bin2hex($hmac); - } - - // end hmacsha1 - - /** - * connect - * - * connect to the Zimbra SOAP service - * - * @since version 1.0 - * @access public - * @return array associative array of account information - */ - public function connect() - { - if ($this->_connected) { - return $this->_account_info; - } - $completeurl = $this->_protocol . $this->_server . $this->_path; - $this->_curl = curl_init(); - curl_setopt($this->_curl, CURLOPT_URL, $this->_protocol . $this->_server . $this->_path); - curl_setopt($this->_curl, CURLOPT_POST, true); - curl_setopt($this->_curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($this->_curl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($this->_curl, CURLOPT_SSL_VERIFYHOST, false); - - //Apply proxy settings - $sysConf = System::getSystemConfiguration(); - if ($sysConf['proxy_host'] != '') { - curl_setopt($this->_curl, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : '')); - if ($sysConf['proxy_port'] != '') { - curl_setopt($this->_curl, CURLOPT_PROXYPORT, $sysConf['proxy_port']); - } - if ($sysConf['proxy_user'] != '') { - curl_setopt($this->_curl, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : '')); - } - curl_setopt($this->_curl, CURLOPT_HTTPHEADER, array('Expect:')); - } - - $preauth = $this->getPreAuth($this->_username); - $header = ''; - - if ($this->_admin) { - $body = ' - ' . $this->_admin_username . ' - ' . $this->_admin_password . ' - '; - } else { - $body = ' - ' . $this->_username . '@' . $this->_server1 . ' - ' . $preauth . ' - '; - } - - $response = $this->soapRequest($body, $header, true); - if ($response) { - $tmp = $this->makeXMLTree($response); - $this->_account_info = $tmp['soap:Envelope'][0]['soap:Header'][0]['context'][0]['refresh'][0]['folder'][0]; - - $this->session_id = $this->extractSessionID($response); - $this->auth_token = $this->extractAuthToken($response); - - $this->_connected = true; - - //return $this->_account_info; - return $this->_connected; - } else { - $this->_connected = false; - return false; - } - } - - // end connect - - /** - * administerUser - * - * set the user you are administering (experimental) - * - * @since version 1.0 - * @access public - * @param string $username username to administer - * @return boolean - */ - public function administerUser($username) - { - if (!$this->_admin) { - return false; - } - - $this->_username = $username; - - $body = ' - ' . $this->_username . '@' . $this->_server . ' - '; - $response = $this->soapRequest($body, $header); - if ($response) { - $tmp = $this->makeXMLTree($response); - $this->_account_info = $tmp['soap:Envelope'][0]['soap:Header'][0]['context'][0]['refresh'][0]['folder'][0]; - - $this->session_id = $this->extractSessionID($response); - $this->auth_token = $this->extractAuthToken($response); - - return true; - } else { - return false; - } - } - - // end administerUser - - /** - * getInfo - * - * generic function to get information on mailbox, preferences, attributes, properties, and more! - * - * @since version 1.0 - * @access public - * @param string $options options for info retrieval, defaults to null - * @return array information - */ - public function getInfo($options = '') - { - // valid sections: mbox,prefs,attrs,zimlets,props,idents,sigs,dsrcs,children - $option_string = $this->buildOptionString($options); - - $soap = ''; - $response = $this->soapRequest($soap); - if ($response) { - $array = $this->makeXMLTree($response); - return $array['soap:Envelope'][0]['soap:Body'][0]['GetInfoResponse'][0]; - } else { - return false; - } - } - - // end getInfo - - /** - * getMessages - * - * get the messages in folder, deafults to inbox - * - * @since version 1.0 - * @access public - * @param string $search folder to retrieve from, defaults to in:inbox - * @param array $options options to apply to retrieval - * @return array array of messages - */ - public function getMessages($search = 'in:inbox', $options = array('limit' => 5, 'fetch' => 'none')) - { - $option_string = $this->buildOptionString($options); - - $soap = ' - ' . $search . ' - '; - $response = $this->soapRequest($soap); - if ($response) { - $array = $this->makeXMLTree($response); - return $array['soap:Envelope'][0]['soap:Body'][0]['SearchResponse'][0]; - } else { - return false; - } - } - - // end getMessages - - /** - * getContacts - * - * get the Contacts in folder, deafults to inbox - * - * @since version 1.0 - * @access public - * @param string $search folder to retrieve from, defaults to in:inbox - * @param array $options options to apply to retrieval - * @return array array of messages - */ - public function getContacts($search = 'in:contacts', $options = array('limit' => 5, 'fetch' => 'none')) - { - $option_string = $this->buildOptionString($options); - - $soap = ' - ' . $search . ' - '; - $response = $this->soapRequest($soap); - if ($response) { - $array = $this->makeXMLTree($response); - return $array['soap:Envelope'][0]['soap:Body'][0]['SearchResponse'][0]; - } else { - return false; - } - } - - // end getContacts - - - /* getAppointments - * - * get the Appointments in folder - * - * @since version 1.0 - * @access public - * @param string $search folder to retrieve from - * @param array $options options to apply to retrieval - * @return array array of messages - */ - - public function getAppointments($search = 'in:calendar', $options = array('limit' => 50, 'fetch' => 'none')) - { - $option_string = $this->buildOptionString($options); - - $soap = ' - ' . $search . ' - '; - $response = $this->soapRequest($soap); - if ($response) { - $array = $this->makeXMLTree($response); - return $array['soap:Envelope'][0]['soap:Body'][0]['SearchResponse'][0]; - } else { - return false; - } - } - - // end getAppointments - - - /* getTasks - * - * get the Tasks in folder - * - * @since version 1.0 - * @access public - * @param string $search folder to retrieve from - * @param array $options options to apply to retrieval - * @return array array of messages - */ - - public function getTasks($search = 'in:tasks', $options = array('limit' => 50, 'fetch' => 'none')) - { - $option_string = $this->buildOptionString($options); - - $soap = ' - ' . $search . ' - '; - $response = $this->soapRequest($soap); - if ($response) { - $array = $this->makeXMLTree($response); - return $array['soap:Envelope'][0]['soap:Body'][0]['SearchResponse'][0]; - } else { - return false; - } - } - - // end getTasks - - /** - * getMessageContent - * - * get the content from a message - * - * @since version 1.0 - * @access public - * @param int $id id number of message to retrieve content of - * @return array associative array with message content, valid for tasks, calendar entries, and email messages. - */ - public function getMessageContent($id) - { - $soap = ' - * - '; - $response = $this->soapRequest($soap); - - if ($response) { - $array = $this->makeXMLTree($response); - $temp = $array['soap:Envelope'][0]['soap:Body'][0]['GetMsgResponse'][0]['m'][0]; - - $message = $temp['inv'][0]['comp'][0]; - - // content with no attachment - $message['content'] = $temp['mp'][0]['mp'][1]['content'][0]; - - // content with attachment - $message['content'] .= $temp['mp'][0]['mp'][0]['mp'][1]['content'][0]; - - return $message; - } else { - return false; - } - } - - /** - * getSubscribedCalendars - * - * get the calendars the user is subscribed to - * - * @since version 1.0 - * @access public - * @return array $subscribed - */ - public function getSubscribedCalendars() - { - $subscribed = array(); - if (is_array($this->_account_info['link_attribute_name'])) { - foreach ($this->_account_info['link_attribute_name'] as $i => $name) { - if ($this->_account_info['link_attribute_view'][$i] == 'appointment') { - $subscribed[$this->_account_info['link_attribute_id'][$i]] = $name; - } - } - } - return $subscribed; - } - - // end getSubscribedCalendars - - /** - * getSubscribedTaskLists - * - * get the task lists the user is subscribed to - * - * @since version 1.0 - * @access public - * @return array $subscribed or false - */ - public function getSubscribedTaskLists() - { - $subscribed = array(); - if (is_array($this->_account_info['link_attribute_name'])) { - foreach ($this->_account_info['link_attribute_name'] as $i => $name) { - if ($this->_account_info['link_attribute_view'][$i] == 'task') { - $subscribed[$this->_account_info['link_attribute_id'][$i]] = $name; - } - } - } - return $subscribed; - } - - // end getSubscribedCalendars - - /** - * getFolder - * - * get a folder (experimental) - * - * @since version 1.0 - * @access public - * @param string $folder_options options for folder retrieval - * @return array $folder or false - */ - public function getFolder($folderName, $folder_options = '') - { - - //$folder_option_string = $this->buildOptionString($folder_options); - - - $soap = ' - - '; - $response = $this->soapRequest($soap); - if ($response) { - $array = $this->makeXMLTree($response); - - $folder = (is_array($array['soap:Envelope'][0]['soap:Body'][0]['GetFolderResponse'][0]['folder'][0])) ? $array['soap:Envelope'][0]['soap:Body'][0]['GetFolderResponse'][0]['folder'][0] : $array['soap:Envelope'][0]['soap:Body'][0]['GetFolderResponse'][0]; - - $folder['u'] = (!isset($folder['u'])) ? $folder['folder_attribute_u'][0] : $folder['u']; - $folder['n'] = (!isset($folder['n'])) ? $folder['folder_attribute_n'][0] : $folder['n']; - - return $folder; - } else { - return false; - } - } - - // end getFolder - - /** - * getPrefrences - * - * get preferences - * - * @since version 1.0 - * @access public - * @example example XML: [ ] - * @return array $prefs or false - */ - public function getPreferences() - { - $soap = ''; - $response = $this->soapRequest($soap); - if ($response) { - $prefs = array(); - $array = $this->makeXMLTree($response); - foreach ($array['soap:Envelope'][0]['soap:Body'][0]['GetPrefsResponse'][0]['pref'] as $k => $value) { - $prefs[$array['soap:Envelope'][0]['soap:Body'][0]['GetPrefsResponse'][0]['pref_attribute_name'][$k]] = $value; - } - return $prefs; - } else { - return false; - } - } - - // end getPreferences - - /** - * setPrefrences - * - * modify preferences - * - * @since version 1.0 - * @access public - * @param string $options options to set the prefrences - * @example example XML: [{value}...]+ - * @return boolean - */ - public function setPreferences($options = '') - { - $option_string = ''; - foreach ($options as $name => $value) { - $option_string .= '' . $value . ''; - } - - $soap = ' - ' . $option_string . ' - '; - $response = $this->soapRequest($soap); - if ($response) { - return true; - } else { - return false; - } - } - - // end setPreferences - - /** - * emailChannel - * - * build the email channel - * - * @since version 1.0 - * @access public - */ - public function emailChannel() - { - require_once 'xtemplate.php'; - $tpl = new XTemplate('/web/pscpages/webapp/portal/channel/email/templates/index.tpl'); - - $tpl->parse('main.transition'); - - $total_messages = 0; - $unread_messages = 0; - - $messages = $this->getMessages('in:inbox'); - if (is_array($messages)) { - $more = $messages['more']; - foreach ($messages['m'] as $message) { - $clean_message = array(); - - $clean_message['subject'] = (isset($message['su'][0]) && $message['su'][0] != '') ? htmlentities($message['su'][0]) : '[None]'; - $clean_message['subject'] = (strlen($clean_message['subject']) > 20) ? substr($clean_message['subject'], 0, 17) . '...' : $clean_message['subject']; - - $clean_message['body_fragment'] = $message['fr'][0]; - $clean_message['from_email'] = $message['e_attribute_a'][0]; - $clean_message['from'] = ($message['e_attribute_p'][0]) ? htmlspecialchars($message['e_attribute_p'][0]) : $clean_message['from_email']; - $clean_message['size'] = $this->makeBytesPretty($message['s'], 40 * 1024 * 1024); - $clean_message['date'] = date('n/j/y', ($message['d'] / 1000)); - $clean_message['id'] = $message['id']; - $clean_message['url'] = 'http://go.plymouth.edu/mymail/msg/' . $clean_message['id']; - - $clean_message['attachment'] = false; - $clean_message['status'] = 'read'; - $clean_message['deleted'] = false; - $clean_message['flagged'] = false; - if (isset($message['f'])) { - $clean_message['attachment'] = (strpos($message['f'], 'a') !== false) ? true : false; - $clean_message['status'] = (strpos($message['f'], 'u') !== false) ? 'unread' : 'read'; - ; - $clean_message['deleted'] = (strpos($message['f'], '2') !== false) ? true : false; - $clean_message['flagged'] = (strpos($message['f'], 'f') !== false) ? true : false; - } - - $tpl->assign('message', $clean_message); - $tpl->parse('main.message'); - } - $inbox = $this->getFolder(array('l' => 2 - )); - - $total_messages = (int) $inbox['n']; - $unread_messages = (int) $inbox['u']; - } - - $tpl->assign('total_messages', $total_messages); - $tpl->assign('unread_messages', $unread_messages); - - $info = $this->getInfo(array('sections' => 'mbox' - )); - if (is_array($info['attrs'][0]['attr_attribute_name'])) { - $quota = $info['attrs'][0]['attr'][array_search('zimbraMailQuota', $info['attrs'][0]['attr_attribute_name'])]; - $size_text = $this->makeBytesPretty($info['used'][0], ($quota * 0.75)) . ' out of ' . $this->makeBytesPretty($quota); - $tpl->assign('size', $size_text); - } - - /* include_once 'portal_functions.php'; - $roles = getRoles($this->_username); - - if(in_array('faculty', $roles) || in_array('employee', $roles)) - { - $tpl->parse('main.away_message'); - } */ - - $tpl->parse('main'); - $tpl->out('main'); - } - - // end emailChannel - - /** - * builOptionString - * - * make an option string that will be placed as attributes inside an XML tag - * - * @since version 1.0 - * @access public - * @param array $options array of options to be parsed into a string - * @return string $options_string - */ - protected function buildOptionString($options) - { - $options_string = ''; - foreach ($options as $k => $v) { - $options_string .= ' ' . $k . '="' . $v . '"'; - } - return $options_string; - } - - // end buildOptionString - - /** - * extractAuthToken - * - * get the Auth Token out of the XML - * - * @since version 1.0 - * @access public - * @param string $xml xml to have the auth token pulled from - * @return string $auth_token - */ - private function extractAuthToken($xml) - { - $auth_token = strstr($xml, ""); - $auth_token = substr($auth_token, 1, strpos($auth_token, "<") - 1); - return $auth_token; - } - - /** - * extractSessionID - * - * get the Session ID out of the XML - * - * @since version 1.0 - * @access public - * @param string $xml xml to have the session id pulled from - * @return int $session_id - */ - private function extractSessionID($xml) - { - - //for testing purpose we are extracting lifetime instead of sessionid - //$session_id = strstr($xml, ""); - $session_id = substr($session_id, 1, strpos($session_id, "<") - 1); - return $session_id; - } - - // end extractSessionID - - /** - * extractErrorCode - * - * get the error code out of the XML - * - * @since version 1.0 - * @access public - * @param string $xml xml to have the error code pulled from - * @return int $session_id - */ - private function extractErrorCode($xml) - { - $session_id = strstr($xml, ""); - $session_id = substr($session_id, 1, strpos($session_id, "<") - 1); - return $session_id; - } - - // end extractErrorCode - - /** - * makeBytesPretty - * - * turns byte numbers into a more readable format with KB or MB - * - * @since version 1.0 - * @access public - * @param int $bytes bytes to be worked with - * @param boolean $redlevel - * @return int $size - */ - private function makeBytesPretty($bytes, $redlevel = false) - { - if ($bytes < 1024) { - $size = $bytes . ' B'; - } elseif ($bytes < 1024 * 1024) { - $size = round($bytes / 1024, 1) . ' KB'; - } else { - $size = round(($bytes / 1024) / 1024, 1) . ' MB'; - } - if ($redlevel && $bytes > $redlevel) { - $size = '' . $size . ''; - } - - return $size; - } - - // end makeBytesPretty - - /** - * message - * - * if debug is on, show a message - * - * @since version 1.0 - * @access public - * @param string $message message for debug - */ - protected function message($message) - { - if ($this->debug) { - $filter = new InputFilter(); - $message = $filter->xssFilterHard($message); - echo $message; - } - } - - // end message - - /** - * soapRequest - * - * make a SOAP request to Zimbra server, returns the XML - * - * @since version 1.0 - * @access public - * @param string $body body of page - * @param boolean $header - * @param boolean $footer - * @return string $response - */ - protected function soapRequest($body, $header = false, $connecting = false) - { - $filter = new InputFilter(); - - if (!$connecting && !$this->_connected) { - throw new Exception('zimbra.class: soapRequest called without a connection to Zimbra server'); - } - - if ($header == false) { - $header = ' - ' . $this->auth_token . ' - ' . $this->session_id . ' - '; - } - - $soap_message = ' - ' . $header . ' - ' . $body . ' - '; - $this->message('SOAP message:'); - - curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $soap_message); - - $this->_curl = $filter->xssFilterHard($this->_curl, "url"); - $response = curl_exec($this->_curl); - if (!$response) { - $this->error = 'ERROR: curl_exec - (' . curl_errno($this->_curl) . ') ' . curl_error($this->_curl); - return false; - } elseif (strpos($response, '') !== false) { - $error_code = $this->extractErrorCode($response); - $this->error = 'ERROR: ' . $error_code . ':'; - $this->message($this->error); - $aError = array('error' => $error_code - ); - return $aError; - //return false; - } - $this->message('SOAP response:

'); - - $this->_num_soap_calls++; - return $response; - } - - // end soapRequest - - /** - * getNumSOAPCalls - * - * get the number of SOAP calls that have been made. This is for debugging and performancing - * - * @since version 1.0 - * @access public - * @return int $this->_num_soap_calls - */ - public function getNumSOAPCalls() - { - return $this->_num_soap_calls; - } - - // end getNumSOAPCalls - - /** - * makeXMLTree - * - * turns XML into an array - * - * @since version 1.0 - * @access public - * @param string $data data to be built into an array - * @return array $ret - */ - protected function makeXMLTree($data) - { - // create parser - $parser = xml_parser_create(); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); - xml_parse_into_struct($parser, $data, $values, $tags); - xml_parser_free($parser); - - // we store our path here - $hash_stack = array(); - - // this is our target - $ret = array(); - foreach ($values as $key => $val) { - switch ($val['type']) { - case 'open': - array_push($hash_stack, $val['tag']); - if (isset($val['attributes'])) { - $ret = $this->composeArray($ret, $hash_stack, $val['attributes']); - } else { - $ret = $this->composeArray($ret, $hash_stack); - } - break; - case 'close': - array_pop($hash_stack); - break; - case 'complete': - array_push($hash_stack, $val['tag']); - $ret = $this->composeArray($ret, $hash_stack, $val['value']); - array_pop($hash_stack); - - // handle attributes - if (isset($val['attributes'])) { - foreach ($val['attributes'] as $a_k => $a_v) { - $hash_stack[] = $val['tag'] . '_attribute_' . $a_k; - $ret = $this->composeArray($ret, $hash_stack, $a_v); - array_pop($hash_stack); - } - } - break; - } - } - return $ret; - } - - // end makeXMLTree - - /** - * &composeArray - * - * function used exclusively by makeXMLTree to help turn XML into an array - * - * @since version 1.0 - * @access public - * @param array $array - * @param array $elements - * @param array $value - * @return array $array - */ - private function &composeArray($array, $elements, $value = array()) - { - global $XML_LIST_ELEMENTS; - - // get current element - $element = array_shift($elements); - - // does the current element refer to a list - if (sizeof($elements) > 0) { - $array[$element][sizeof($array[$element]) - 1] = $this->composeArray($array[$element][sizeof($array[$element]) - 1], $elements, $value); - } else { - // if (is_array($value)) - $array[$element][sizeof($array[$element])] = $value; - } - - return $array; - } - - // end composeArray - - /** - * noop - * - * keeps users session alive - * - * @since version 1.0 - * @access public - * @return string xml response from the noop - */ - public function noop() - { - return $this->soapRequest(''); - } - - /** - * addAppointments - * - * add appointments in a calendar - * - * @since version 1.0 - * @access public - * @param - * - * - * @return - * - * - */ - public function addAppointment($serializeOp1) - { - $unserializeOp1 = unserialize($serializeOp1); - - $username = $unserializeOp1['username']; - $subject = $unserializeOp1['subject']; - $appointmentName = $unserializeOp1['appointmentName']; - $friendlyName = $unserializeOp1['friendlyName']; - $userEmail = $unserializeOp1['userEmail']; - $domainName = $unserializeOp1['domainName']; - $schedule = $unserializeOp1['schedule']; - $cutype = $unserializeOp1['cutype']; - $allDay = $unserializeOp1['allDay']; - $isOrg = $unserializeOp1['isOrg']; - $rsvp = $unserializeOp1['rsvp']; - $atFriendlyName = $unserializeOp1['atFriendlyName']; - $role = $unserializeOp1['role']; - $location = $unserializeOp1['location']; - $ptst = $unserializeOp1['ptst']; - - $dateFormat = $allDay == "1" ? "Ymd" : "Ymd\THis"; - $startDate = date($dateFormat, strtotime($unserializeOp1['startDate'])); - $endDate = date($dateFormat, strtotime($unserializeOp1['endDate'])); - $timeZone = $allDay == "1" ? "" : $unserializeOp1['tz']; - - $explodeEmail = explode(';', $userEmail); - $explodeFriendlyName = explode(';', $atFriendlyName); - $countExplodeEmail = count($explodeEmail); - - $soap = ' - ' . $subject . ''; - for ($i = 0; $i < $countExplodeEmail; $i++) { - $soap .= ''; - } - $soap .= ' - - - - '; - for ($i = 0; $i < $countExplodeEmail; $i++) { - $soap .= ''; - } - $soap .= ' - - - - - this is a sample Contents - - - - - '; - //G::pr($soap);die; - $response = $this->soapRequest($soap); - if ($response) { - $array = $this->makeXMLTree($response); - - return $array['soap:Envelope'][0]['soap:Body'][0]['CreateAppointmentResponse']; - } else { - return false; - } - } - - // end addAppointments - - /** - * addTask - * - * add Task in a Task Tab - * - * @since version 1.0 - * @access public - * @param array $options array of options to apply to retrieval from calendar - * @return array associative array of appointments - */ - public function addTask($serializeOp1) - { - $unserializeOp1 = unserialize($serializeOp1); - - $subject = $unserializeOp1['subject']; - $taskName = $unserializeOp1['taskName']; - $friendlyName = $unserializeOp1['friendlyName']; - $userEmail = $unserializeOp1['userEmail']; - $priority = $unserializeOp1['priority']; - $allDay = $unserializeOp1['allDay']; - $class = $unserializeOp1['class']; - $location = $unserializeOp1['location']; - $dueDate = date("Ymd", strtotime($unserializeOp1['dueDate'])); - $status = $unserializeOp1['status']; - $percent = $unserializeOp1['percent']; - - $soap = ' - - ' . $subject . ' - - - - - - - - - - - - - '; - $response = $this->soapRequest($soap); - - if ($response) { - $array = $this->makeXMLTree($response); - - //return $array['soap:Envelope'][0]['soap:Body'][0]['BatchResponse'][0]['CreateTaskRequest'][0]['appt']; - return $array['soap:Envelope'][0]['soap:Body'][0]['CreateTaskResponse']; - } else { - return false; - } - } - - // end addTask - - /** - * addContacts - * - * add contact in a AddressBook - * - * @since version 1.0 - * @access public - * @param - * - * - * @return - * - * - */ - public function addContacts($serializeOp1) - { - $unserializeOp1 = unserialize($serializeOp1); - - $firstName = $unserializeOp1['firstName']; - $lastName = $unserializeOp1['lastName']; - $email = $unserializeOp1['email']; - $otherData = $unserializeOp1['otherData']; - $otherDataValue = $unserializeOp1['otherDataValue']; - - $soap = ' - - ' . $firstName . ' - ' . $lastName . ' - ' . $email . ' - ' . $otherDataValue . ' - - '; - - $response = $this->soapRequest($soap); - if ($response) { - $array = $this->makeXMLTree($response); - - return $array['soap:Envelope'][0]['soap:Body'][0]['CreateContactResponse']; - } else { - return false; - } - } - - // end addContacts - /** - * addFolder - * - * add Folder in a BriefCase - * - * @since version 1.0 - * @access public - * @param - * - * - * @return - * - * - */ - public function addFolder($serializeOp1) - { - $unserializeOp1 = unserialize($serializeOp1); - - $folderName = $unserializeOp1['folderName']; - $folderColor = $unserializeOp1['color']; - - $soap = ' - - - '; - - $response = $this->soapRequest($soap); - if ($response) { - $array = $this->makeXMLTree($response); - - return $array['soap:Envelope'][0]['soap:Body'][0]['CreateFolderResponse']; - } else { - return false; - } - } - - // end addFolder - /** - * uploadDocument - * - * add Folder in a BriefCase - * - * @since version 1.0 - * @access public - * @param - * - * - * @return - * - * - */ - public function upload($folderId, $UploadId, $fileVersion = '', $docId = '') - { - if ($fileVersion == '' && $docId == '') { - $soap = ' - - - - '; - } else { - $soap = ' - - - - '; - } - - $response = $this->soapRequest($soap); - if (is_array($response)) { - if (isset($response['error'])) { - return $response; - } - } else { - $array = $this->makeXMLTree($response); - - return $array['soap:Envelope'][0]['soap:Body'][0]['SaveDocumentResponse']; - } - } - - // end uploadDocument - - /** - * getDocId - * - * Get ID of File in Zimbra. - * - * @since version 1.0 - * @access public - * @param - * - * - * @return - * - * - */ - public function getDocId($folderId, $fileName) - { - $soap = ' - - '; - - $response = $this->soapRequest($soap); - if (is_array($response)) { - if ($response['error']) { - return false; - } - } else { - $array = $this->makeXMLTree($response); - - return $array['soap:Envelope'][0]['soap:Body'][0]['GetItemResponse'][0]; - } - } - - // end getDocId -} diff --git a/workflow/engine/classes/triggers/class.pmTrZimbra.php b/workflow/engine/classes/triggers/class.pmTrZimbra.php deleted file mode 100644 index 6a7aed5c9..000000000 --- a/workflow/engine/classes/triggers/class.pmTrZimbra.php +++ /dev/null @@ -1,460 +0,0 @@ -connect(); - - if (!$connectionResult) { - return "Check userName or Server URL"; - } - - $aXmlArray = array(); - $aXmlArray = $zimbra->getFolder($folderName); - $sXmlArray = @G::json_decode(@G::json_encode($aXmlArray), 1); - - $serializeResult = serialize($sXmlArray); // serializing the Array for Returning. - return $serializeResult; -} - -/** - * @method - * - * Get Contact List - * - * @name getZimbraContactList - * @label Get Contact Lists from Zimbra Server - * - * @param string | $ServerUrl | Server name and port where Zimbra exists | zimbra.server:port - * @param string | $username| Valid username to connect to Zimbra server - * @param string | $preAuthKey | Server Key for SSO authentication - * @param string | $protocol | protpcol server http https - * - * @return string | $result | Response | - * - */ -function getZimbraContactList($ServerUrl, $username, $preAuthKey, $protocol = 'http') -{ - - $zimbra = new Zimbra($username, $ServerUrl, $preAuthKey, '', $protocol); - $connectionResult = $zimbra->connect(); - - if (!$connectionResult) { - return "Check userName or Server URL"; - } - - $sXmlArray = array(); - $sXmlArray = $zimbra->getContacts(); - $aXmlArray = @G::json_decode(@G::json_encode($sXmlArray), 1); - - $serializeResult = serialize($aXmlArray); // serializing the Array for Returning. - return $serializeResult; -} - -/** - * @method - * - * Get Task List - * - * @name getZimbraTaskList - * @label Get Task Lists from Zimbra Server - * - * @param string | $ServerUrl | Server name and port where Zimbra exists | zimbra.server:port - * @param string | $username| Valid username to connect to Zimbra server - * @param string | $preAuthKey | Server Key for SSO authentication - * @param string | $protocol | protpcol server http https - * - * @return string | $result | Response | - * - */ -function getZimbraTaskList($ServerUrl, $username, $preAuthKey, $protocol = 'http') -{ - - $xXmlArray = array(); - $xXmlArray1 = array(); - - $zimbra = new Zimbra($username, $ServerUrl, $preAuthKey, '', $protocol = 'http'); - $connectionResult = $zimbra->connect(); - - if (!$connectionResult) { - return "Check userName or Server URL"; - } - - $sXmlArray = array(); - $sXmlArray = $zimbra->getTasks(); - $aXmlArray = @G::json_decode(@G::json_encode($sXmlArray), 1); - - $serializeResult = serialize($aXmlArray); // serializing the Array for Returning. - return $serializeResult; -} - -/** - * @method - * - * Get Appointment List - * - * @name getZimbraAppointmentList - * @label Get Appointment Lists from Zimbra Server - * - * @param string | $ServerUrl | Server name and port where Zimbra exists | zimbra.server:port - * @param string | $username| Valid username to connect to Zimbra server - * @param string | $preAuthKey | Server Key for SSO authentication - * @param string | $protocol | protpcol server http https - * - * @return string | $result | Response | - * - */ -function getZimbraAppointmentList($ServerUrl, $username, $preAuthKey, $protocol = 'http') -{ - - $xXmlArray = array(); - $xXmlArray1 = array(); - - $zimbra = new Zimbra($username, $ServerUrl, $preAuthKey, '', $protocol); - $connectionResult = $zimbra->connect(); - - if (!$connectionResult) { - return "Check userName or Server URL"; - } - - $sXmlArray = array(); - $sXmlArray = $zimbra->getAppointments(); - $aXmlArray = @G::json_decode(@G::json_encode($sXmlArray), 1); - - $serializeResult = serialize($aXmlArray); // serializing the Array for Returning. - return $serializeResult; -} - -/** - * @method - * - * Create Folder Name and Attribute - * - * @name createZimbraFolder - * @label Create Specified Folder with Attributes in Briefcase Tab - * - * @param string | $ServerUrl | Server name and port where Zimbra exists | zimbra.server:port - * @param string | $username | Valid username to connect to Zimbra server - * @param string | $preAuthKey | Server Key for SSO authentication - * @param string | $folderName | Folder Name - * @param string | $color | Color of Folder - * @param string | $protocol | protpcol server http https - * - * @return string | $result | Response | - * - */ -function createZimbraFolder($ServerUrl, $username, $preAuthKey, $folderName, $color, $protocol = 'http') -{ - $serializeOp = array(); - $serializeOp = array('folderName' => $folderName, 'color' => $color); - $serializeOp1 = serialize($serializeOp); - - $zimbra = new Zimbra($username, $ServerUrl, $preAuthKey, '', $protocol); - $connectionResult = $zimbra->connect(); - - if (!$connectionResult) { - return "Check userName or Server URL"; - } - $sXmlArray = $zimbra->addFolder($serializeOp1); - if ($sXmlArray) { - return "Folder Created succesfully"; - } else { - return "A folder with name " . $folderName . " already exist."; - } -} - -/** - * @method - * - * Create Contacts - * - * @name createZimbraContacts - * @label Create Contacts in Address Book - * - * @param string | $ServerUrl | Server name and port where Zimbra exists | zimbra.server:port - * @param string | $username | Valid username to connect to Zimbra server - * @param string | $preAuthKey | Server Key for SSO authentication - * @param string | $firstName | First Name - * @param string | $lastName | Last Name - * @param string | $email | Email Address - * @param string | $otherData | BirthDay/Anniversary/Custom - * @param string | $otherDataValue | Corresponding Date or Value - * @param string | $protocol | protpcol server http https - * - * @return string | $result | Response | - * - */ -function createZimbraContacts($ServerUrl, $username, $preAuthKey, $firstName, $lastName, $email, $otherData, $otherDataValue, $protocol = 'http') -{ - - $serializeOp = array(); - $serializeOp = array('firstName' => $firstName, 'lastName' => $lastName, 'email' => $email, 'otherData' => $otherData, 'otherDataValue' => $otherDataValue); - $serializeOp1 = serialize($serializeOp); - - $zimbra = new Zimbra($username, $ServerUrl, $preAuthKey, '', $protocol); - $connectionResult = $zimbra->connect(); - - if (!$connectionResult) { - return "Check userName or Server URL"; - } - - $sXmlArray = $zimbra->addContacts($serializeOp1); - if ($sXmlArray) { - return "Contacts Created succesfully"; - } else { - return "Some Error"; - } -} - -/** - * @method - * - * Create Tasks - * - * @name createZimbraTask - * @label Create Task - * - * @param string | $ServerUrl | Server name and port where Zimbra exists | zimbra.server:port - * @param string | $username | Valid username to connect to Zimbra server - * @param string | $preAuthKey | Server Key for SSO authentication - * @param string | $subject | Mail Subject - * @param string | $taskName | Task Name - * @param string | $friendlyName | Friendly Name of the User - * @param string | $userEmail | Email Address of the User - * @param string | $priority | Priority of the Task - * @param string | $allDay | Is All Day Task - * @param string | $class | Access Scope of the Class - * @param string | $location | Location of the task - * @param string | $dueDate | Due Date of the task - * @param string | $status | Status of the task - * @param string | $percent | Percentage of Task Completed - * @param string | $protocol | protpcol server http https - * - * @return string | $result | Response | - * - */ -function createZimbraTask($ServerUrl, $username, $preAuthKey, $subject, $taskName, $friendlyName, $userEmail, $priority, $allDay, $class, $location, $dueDate, $status, $percent, $protocol = 'http') -{ - $serializeOp = array(); - $serializeOp = array('subject' => $subject, 'taskName' => $taskName, 'friendlyName' => $friendlyName, 'userEmail' => $userEmail, 'priority' => $priority, 'allDay' => $allDay, 'class' => $class, 'location' => $location, 'dueDate' => $dueDate, 'status' => $status, 'percent' => $percent); - $serializeOp1 = serialize($serializeOp); - - $zimbra = new Zimbra($username, $ServerUrl, $preAuthKey, '', $protocol); - - $connectionResult = $zimbra->connect(); - if (!$connectionResult) { - return "Check userName or Server URL"; - } - - $sXmlArray = $zimbra->addTask($serializeOp1); - if ($sXmlArray) { - return "Task Created succesfully"; - } else { - return "Error in Creating Task"; - } -} - -/** - * @method - * - * Create Appointment - * - * @name createZimbraAppointment - * @label Create Appointment - * - * @param string | $ServerUrl | Server name and port where Zimbra exists | zimbra.server:port - * @param string | $username | Valid username to connect to Zimbra server - * @param string | $preAuthKey | Server Key for SSO authentication - * @param string | $subject | Mail Subject - * @param string | $appointmentName | Appointment Name - * @param string | $friendlyName | Organizer's Friendly Name - * @param string | $userEmail | Email Address of the Attendee(s) seperated by ';' - * @param string | $domainName | Domain Name - * @param string | $schedule | Schedule of the Appointment - * @param string | $cutype | Type of Calendar User - * @param string | $allDay | Is All Day Appointment - * @param string | $isOrg | Is Organizer - * @param string | $rsvp | RSVP - * @param string | $atFriendlyName | Friendly Name of Attendee(s) seperated by ';' - * @param string | $role | Attendee's Role - * @param string | $location | Location - * @param string | $ptst | Paticipation Status of the user - * @param string | $startDate | Start Date of the Appointment - * @param string | $endDate | End Date of the Appointment - * @param string | $tz | Time Zone - * @param string | $protocol | protpcol server http https - * - * @return string | $result | Response | - * - */ -function createZimbraAppointment($ServerUrl, $username, $preAuthKey, $subject, $appointmentName, $friendlyName, $userEmail, $domainName, $schedule, $cutype, $allDay, $isOrg, $rsvp, $atFriendlyName, $role, $location, $ptst, $startDate, $endDate, $tz = '', $protocol = 'http') -{ - - $serializeOp = array(); - $serializeOp = array('username' => $username, 'subject' => $subject, 'appointmentName' => $appointmentName, 'friendlyName' => $friendlyName, 'userEmail' => $userEmail, 'domainName' => $domainName, 'schedule' => $schedule, 'cutype' => $cutype, 'allDay' => $allDay, 'isOrg' => $isOrg, 'rsvp' => $rsvp, 'atFriendlyName' => $atFriendlyName, 'role' => $role, 'location' => $location, 'ptst' => $ptst, 'startDate' => $startDate, 'endDate' => $endDate, 'tz' => $tz); - $serializeOp1 = serialize($serializeOp); - - $zimbra = new Zimbra($username, $ServerUrl, $preAuthKey, '', $protocol); - $connectionResult = $zimbra->connect(); - - if (!$connectionResult) { - return "Check userName or Server URL"; - } - - $sXmlArray = $zimbra->addAppointment($serializeOp1); - if ($sXmlArray) { - return "Appointment Created succesfully"; - } else { - return "Error in Creating Appointment"; - } -} - -/** - * @method - * - * Upload File/Document to Zimbra Server - * - * @name uploadZimbraFile - * @label Upload File/Document to Zimbra Server - * - * @param string | $ServerUrl | Server name and port where Zimbra exists | zimbra.server:port - * @param string | $username | Valid username to connect to Zimbra server - * @param string | $preAuthKey | Server Key for SSO authentication - * @param string | $folderName | Folder Name - * @param string | $fileLocation | Absolute path of the File to be uploaded. - * @param string | $protocol | protpcol server http https - * - * @return string | $result | Response | - * - */ -function uploadZimbraFile($ServerUrl, $username, $preAuthKey, $folderName, $fileLocation, $protocol = 'http') -{ - - $header_array = array("ENCTYPE" => "multipart/form-data"); - $file = $fileLocation; - - $oZimbraObj = new Zimbra($username, $ServerUrl, $preAuthKey, '', $protocol); - $connectResult = $oZimbraObj->connect(); - $sAuthToken = $oZimbraObj->auth_token; - $cookie = array('ZM_AUTH_TOKEN' => $sAuthToken, 'ZM_TEST' => true); - $cookie = 'ZM_AUTH_TOKEN=' . $sAuthToken. '; ZM_TEST='. true; - $url = "http://$ServerUrl/service/upload?fmt=raw"; - $params = array ( - 'uploadFile' => "@$file" - ); - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - //curl_setopt($ch, CURLOPT_VERBOSE, 1); - curl_setopt($ch, CURLOPT_COOKIE, $cookie); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $params); - curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); - curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt ($ch, CURLOPT_BINARYTRANSFER, true); - curl_setopt ($ch, CURLOPT_COOKIESESSION, true); - curl_setopt ($ch, CURLOPT_FRESH_CONNECT, true); - curl_setopt ($ch, CURLOPT_HEADER, true); - curl_setopt ($ch, CURLOPT_NOPROGRESS, false); - curl_setopt ($ch, CURLOPT_VERBOSE, true); - curl_setopt ($ch, CURLOPT_HTTPHEADER,$header_array); - - //Apply proxy settings - $sysConf = System::getSystemConfiguration(); - if ($sysConf['proxy_host'] != '') { - curl_setopt($ch, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : '')); - if ($sysConf['proxy_port'] != '') { - curl_setopt($ch, CURLOPT_PROXYPORT, $sysConf['proxy_port']); - } - if ($sysConf['proxy_user'] != '') { - curl_setopt($ch, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : '')); - } - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); - } - - if ( ! $response = curl_exec($ch)) { - return "Upload error. Connection Error"; - } - - //G::pr($response); - - $header_size = curl_getinfo($ch,CURLINFO_HEADER_SIZE); - $result['header'] = substr($response, 0, $header_size); - $result['body'] = substr( $response, $header_size ); - $result['http_code'] = curl_getinfo($ch,CURLINFO_HTTP_CODE); - $result['last_url'] = curl_getinfo($ch,CURLINFO_EFFECTIVE_URL); - - $aString = array(); - $aExplode = explode(",", $result['body']); - $uploadID = substr($aExplode[2], 1, -2); - - curl_close($ch); - - // gettin FOlder ID - - $FolderResult = $oZimbraObj->getFolder($folderName); - if (isset($FolderResult['id'])) { - $sFolderID = $FolderResult['id']; - } else { - $sFolderID = $FolderResult['folder_attribute_id']['0']; - } - - $fileNamePath = $fileLocation; - $fileName = basename($fileNamePath); - - $docDetails = $oZimbraObj->getDocId($sFolderID, $fileName); - if ($docDetails) { - $docId = $docDetails['doc_attribute_id'][0]; - $docVersion = $docDetails['doc_attribute_ver'][0]; - } - $uploadResult = $oZimbraObj->upload($sFolderID, $uploadID, $docVersion, $docId); - if (isset($uploadResult['error'])) { - return $uploadResult['error']; - } else { - return "The file has been uploaded Successfully"; - } - -} - diff --git a/workflow/engine/data/mysql/insert.sql b/workflow/engine/data/mysql/insert.sql index 0a60fe53b..d81dcf648 100755 --- a/workflow/engine/data/mysql/insert.sql +++ b/workflow/engine/data/mysql/insert.sql @@ -17,7 +17,6 @@ INSERT INTO CONTENT (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG,CON_VALUE) VALUES ('PER_NAME','','00000000000000000000000000000009','en','Supervisor'), ('PER_NAME','','00000000000000000000000000000010','en','Setup Advanced'), ('PER_NAME','','00000000000000000000000000000011','en','Dashboard'), -('PER_NAME','','00000000000000000000000000000012','en','WebDav'), ('PER_NAME','','00000000000000000000000000000013','en','Delete cases'), ('PER_NAME','','00000000000000000000000000000014','en','Edit Personal Info'), ('PER_NAME','','00000000000000000000000000000015','en','View Folders'), diff --git a/workflow/engine/methods/services/webdav.php b/workflow/engine/methods/services/webdav.php deleted file mode 100644 index a98a04e6e..000000000 --- a/workflow/engine/methods/services/webdav.php +++ /dev/null @@ -1,50 +0,0 @@ -VerifyLogin( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ); - if ($uid > 0) { - // Asign the uid of user to userloggedobj - $RBAC->loadUserRolePermission( $RBAC->sSystem, $uid ); - $res = $RBAC->userCanAccess( 'PM_WEBDAV' ); - if ($res != 1) { - if ($res == - 2) - $msg = G::LoadTranslation( 'ID_USER_HAVENT_RIGHTS_SYSTEM' ); - else - $msg = G::LoadTranslation( 'ID_USER_HAVENT_RIGHTS_PAGE' ); - header( 'WWW-Authenticate: Basic realm="' . $realm . '"' ); - header( 'HTTP/1.0 401 ' . $msg ); - die( '401 ' . $msg ); - return false; - die(); - } - - return true; - } - - header( 'WWW-Authenticate: Basic realm="' . $realm . '"' ); - header( 'HTTP/1.0 401 Unauthorized' ); - die( '401 Unauthorized' ); - return false; -} - -$realm = 'ProcessMaker Filesystem for Workspace ' . config("system.workspace"); - -# Choice an authentification type Digest or Basic -//AuthenticationDigestHTTP($realm, $users, $phpcgi); -AuthenticationBasicHTTP( $realm ); - -$server = new ProcessMakerWebDav(); - -# Real path of your site -$server->ServeRequest( "" ); - diff --git a/workflow/engine/methods/setup/upgrade_RBAC.php b/workflow/engine/methods/setup/upgrade_RBAC.php index dd86dd6ed..fb99df783 100644 --- a/workflow/engine/methods/setup/upgrade_RBAC.php +++ b/workflow/engine/methods/setup/upgrade_RBAC.php @@ -33,7 +33,6 @@ $aRequiredPermissions = array('PM_LOGIN', 'PM_SUPERVISOR', 'PM_SETUP_ADVANCE', 'PM_DASHBOARD', - 'PM_WEBDAV', 'PM_DELETECASE', 'PM_EDITPERSONALINFO', 'PM_FOLDERS_VIEW', diff --git a/workflow/public_html/lib/css/mafe-bd462bc9-0011253c.css b/workflow/public_html/lib/css/mafe-bd462bc9-0011253c.css index 9f9a47f84..ae8d301ae 100644 --- a/workflow/public_html/lib/css/mafe-bd462bc9-0011253c.css +++ b/workflow/public_html/lib/css/mafe-bd462bc9-0011253c.css @@ -7593,11 +7593,6 @@ input:checked + .slider:before { background-position: -72px -223px; } -.pmZimbra { - background: url(../img/triggerWizard.png) no-repeat; - background-position: -78px -15px; -} - .pmSugar { background: url(../img/triggerWizard.png) no-repeat; background-position: -68px -152px; diff --git a/workflow/public_html/lib/js/mafe-bd462bc9-0011253c.js b/workflow/public_html/lib/js/mafe-bd462bc9-0011253c.js index 976243173..c64fa4e77 100644 --- a/workflow/public_html/lib/js/mafe-bd462bc9-0011253c.js +++ b/workflow/public_html/lib/js/mafe-bd462bc9-0011253c.js @@ -1,1111 +1,1111 @@ -/* This notice must be untouched at all times. - -wz_jsgraphics.js v. 3.05 -The latest version is available at -http://www.walterzorn.com -or http://www.devira.com -or http://www.walterzorn.de - -Copyright (c) 2002-2009 Walter Zorn. All rights reserved. -Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) -Last modified: 2. 2. 2009 - -Performance optimizations for Internet Explorer -by Thomas Frank and John Holdsworth. -fillPolygon method implemented by Matthieu Haller. - -High Performance JavaScript Graphics Library. -Provides methods -- to draw lines, rectangles, ellipses, polygons - with specifiable line thickness, -- to fill rectangles, polygons, ellipses and arcs -- to draw text. -NOTE: Operations, functions and branching have rather been optimized -to efficiency and speed than to shortness of source code. - -LICENSE: LGPL - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License (LGPL) as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, -or see http://www.gnu.org/copyleft/lesser.html -*/ - - -var jg_ok, jg_ie, jg_fast, jg_dom, jg_moz; - - -function _chkDHTM(wnd, x, i) -// Under XUL, owner of 'document' must be specified explicitly -{ - x = wnd.document.body || null; - jg_ie = x && typeof x.insertAdjacentHTML != "undefined" && wnd.document.createElement; - jg_dom = (x && !jg_ie && - typeof x.appendChild != "undefined" && - typeof wnd.document.createRange != "undefined" && - typeof (i = wnd.document.createRange()).setStartBefore != "undefined" && - typeof i.createContextualFragment != "undefined"); - jg_fast = jg_ie && wnd.document.all && !wnd.opera; - jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; - jg_ok = !!(jg_ie || jg_dom); -} - -function _pntCnvDom() -{ - var x = this.wnd.document.createRange(); - x.setStartBefore(this.cnv); - x = x.createContextualFragment(jg_fast? this._htmRpc() : this.htm); - if(this.cnv) this.cnv.appendChild(x); - this.htm = ""; -} - -function _pntCnvIe() -{ - if(this.cnv) this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this._htmRpc() : this.htm); - this.htm = ""; -} - -function _pntDoc() -{ - this.wnd.document.write(jg_fast? this._htmRpc() : this.htm); - this.htm = ''; -} - -function _pntN() -{ - ; -} - -function _mkDiv(x, y, w, h) -{ - this.htm += '
<\/div>'; -} - -function _mkDivIe(x, y, w, h) -{ - this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; -} - -function _mkDivPrt(x, y, w, h) -{ - this.htm += '
<\/div>'; -} - -var _regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; -function _htmRpc() -{ - return this.htm.replace( - _regex, - '
\n'); -} - -function _htmPrtRpc() -{ - return this.htm.replace( - _regex, - '
\n'); -} - -function _mkLin(x1, y1, x2, y2) -{ - if(x1 > x2) - { - var _x2 = x2; - var _y2 = y2; - x2 = x1; - y2 = y1; - x1 = _x2; - y1 = _y2; - } - var dx = x2-x1, dy = Math.abs(y2-y1), - x = x1, y = y1, - yIncr = (y1 > y2)? -1 : 1; - - if(dx >= dy) - { - var pr = dy<<1, - pru = pr - (dx<<1), - p = pr-dx, - ox = x; - while(dx > 0) - {--dx; - ++x; - if(p > 0) - { - this._mkDiv(ox, y, x-ox, 1); - y += yIncr; - p += pru; - ox = x; - } - else p += pr; - } - this._mkDiv(ox, y, x2-ox+1, 1); - } - - else - { - var pr = dx<<1, - pru = pr - (dy<<1), - p = pr-dy, - oy = y; - if(y2 <= y1) - { - while(dy > 0) - {--dy; - if(p > 0) - { - this._mkDiv(x++, y, 1, oy-y+1); - y += yIncr; - p += pru; - oy = y; - } - else - { - y += yIncr; - p += pr; - } - } - this._mkDiv(x2, y2, 1, oy-y2+1); - } - else - { - while(dy > 0) - {--dy; - y += yIncr; - if(p > 0) - { - this._mkDiv(x++, oy, 1, y-oy); - p += pru; - oy = y; - } - else p += pr; - } - this._mkDiv(x2, oy, 1, y2-oy+1); - } - } -} - -function _mkLin2D(x1, y1, x2, y2) -{ - if(x1 > x2) - { - var _x2 = x2; - var _y2 = y2; - x2 = x1; - y2 = y1; - x1 = _x2; - y1 = _y2; - } - var dx = x2-x1, dy = Math.abs(y2-y1), - x = x1, y = y1, - yIncr = (y1 > y2)? -1 : 1; - - var s = this.stroke; - if(dx >= dy) - { - if(dx > 0 && s-3 > 0) - { - var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; - _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; - } - else var _s = s; - var ad = Math.ceil(s/2); - - var pr = dy<<1, - pru = pr - (dx<<1), - p = pr-dx, - ox = x; - while(dx > 0) - {--dx; - ++x; - if(p > 0) - { - this._mkDiv(ox, y, x-ox+ad, _s); - y += yIncr; - p += pru; - ox = x; - } - else p += pr; - } - this._mkDiv(ox, y, x2-ox+ad+1, _s); - } - - else - { - if(s-3 > 0) - { - var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; - _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; - } - else var _s = s; - var ad = Math.round(s/2); - - var pr = dx<<1, - pru = pr - (dy<<1), - p = pr-dy, - oy = y; - if(y2 <= y1) - { - ++ad; - while(dy > 0) - {--dy; - if(p > 0) - { - this._mkDiv(x++, y, _s, oy-y+ad); - y += yIncr; - p += pru; - oy = y; - } - else - { - y += yIncr; - p += pr; - } - } - this._mkDiv(x2, y2, _s, oy-y2+ad); - } - else - { - while(dy > 0) - {--dy; - y += yIncr; - if(p > 0) - { - this._mkDiv(x++, oy, _s, y-oy+ad); - p += pru; - oy = y; - } - else p += pr; - } - this._mkDiv(x2, oy, _s, y2-oy+ad+1); - } - } -} - -function _mkLinDott(x1, y1, x2, y2) -{ - if(x1 > x2) - { - var _x2 = x2; - var _y2 = y2; - x2 = x1; - y2 = y1; - x1 = _x2; - y1 = _y2; - } - var dx = x2-x1, dy = Math.abs(y2-y1), - x = x1, y = y1, - yIncr = (y1 > y2)? -1 : 1, - drw = true; - if(dx >= dy) - { - var pr = dy<<1, - pru = pr - (dx<<1), - p = pr-dx; - while(dx > 0) - {--dx; - if(drw) this._mkDiv(x, y, 1, 1); - drw = !drw; - if(p > 0) - { - y += yIncr; - p += pru; - } - else p += pr; - ++x; - } - } - else - { - var pr = dx<<1, - pru = pr - (dy<<1), - p = pr-dy; - while(dy > 0) - {--dy; - if(drw) this._mkDiv(x, y, 1, 1); - drw = !drw; - y += yIncr; - if(p > 0) - { - ++x; - p += pru; - } - else p += pr; - } - } - if(drw) this._mkDiv(x, y, 1, 1); -} - -function _mkOv(left, top, width, height) -{ - var a = (++width)>>1, b = (++height)>>1, - wod = width&1, hod = height&1, - cx = left+a, cy = top+b, - x = 0, y = b, - ox = 0, oy = b, - aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, - st = (aa2>>1)*(1-(b<<1)) + bb2, - tt = (bb2>>1) - aa2*((b<<1)-1), - w, h; - while(y > 0) - { - if(st < 0) - { - st += bb2*((x<<1)+3); - tt += bb4*(++x); - } - else if(tt < 0) - { - st += bb2*((x<<1)+3) - aa4*(y-1); - tt += bb4*(++x) - aa2*(((y--)<<1)-3); - w = x-ox; - h = oy-y; - if((w&2) && (h&2)) - { - this._mkOvQds(cx, cy, x-2, y+2, 1, 1, wod, hod); - this._mkOvQds(cx, cy, x-1, y+1, 1, 1, wod, hod); - } - else this._mkOvQds(cx, cy, x-1, oy, w, h, wod, hod); - ox = x; - oy = y; - } - else - { - tt -= aa2*((y<<1)-3); - st -= aa4*(--y); - } - } - w = a-ox+1; - h = (oy<<1)+hod; - y = cy-oy; - this._mkDiv(cx-a, y, w, h); - this._mkDiv(cx+ox+wod-1, y, w, h); -} - -function _mkOv2D(left, top, width, height) -{ - var s = this.stroke; - width += s+1; - height += s+1; - var a = width>>1, b = height>>1, - wod = width&1, hod = height&1, - cx = left+a, cy = top+b, - x = 0, y = b, - aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, - st = (aa2>>1)*(1-(b<<1)) + bb2, - tt = (bb2>>1) - aa2*((b<<1)-1); - - if(s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) - { - var ox = 0, oy = b, - w, h, - pxw; - while(y > 0) - { - if(st < 0) - { - st += bb2*((x<<1)+3); - tt += bb4*(++x); - } - else if(tt < 0) - { - st += bb2*((x<<1)+3) - aa4*(y-1); - tt += bb4*(++x) - aa2*(((y--)<<1)-3); - w = x-ox; - h = oy-y; - - if(w-1) - { - pxw = w+1+(s&1); - h = s; - } - else if(h-1) - { - pxw = s; - h += 1+(s&1); - } - else pxw = h = s; - this._mkOvQds(cx, cy, x-1, oy, pxw, h, wod, hod); - ox = x; - oy = y; - } - else - { - tt -= aa2*((y<<1)-3); - st -= aa4*(--y); - } - } - this._mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); - this._mkDiv(cx+a+wod-s, cy-oy, s, (oy<<1)+hod); - } - - else - { - var _a = (width-(s<<1))>>1, - _b = (height-(s<<1))>>1, - _x = 0, _y = _b, - _aa2 = (_a*_a)<<1, _aa4 = _aa2<<1, _bb2 = (_b*_b)<<1, _bb4 = _bb2<<1, - _st = (_aa2>>1)*(1-(_b<<1)) + _bb2, - _tt = (_bb2>>1) - _aa2*((_b<<1)-1), - - pxl = new Array(), - pxt = new Array(), - _pxb = new Array(); - pxl[0] = 0; - pxt[0] = b; - _pxb[0] = _b-1; - while(y > 0) - { - if(st < 0) - { - pxl[pxl.length] = x; - pxt[pxt.length] = y; - st += bb2*((x<<1)+3); - tt += bb4*(++x); - } - else if(tt < 0) - { - pxl[pxl.length] = x; - st += bb2*((x<<1)+3) - aa4*(y-1); - tt += bb4*(++x) - aa2*(((y--)<<1)-3); - pxt[pxt.length] = y; - } - else - { - tt -= aa2*((y<<1)-3); - st -= aa4*(--y); - } - - if(_y > 0) - { - if(_st < 0) - { - _st += _bb2*((_x<<1)+3); - _tt += _bb4*(++_x); - _pxb[_pxb.length] = _y-1; - } - else if(_tt < 0) - { - _st += _bb2*((_x<<1)+3) - _aa4*(_y-1); - _tt += _bb4*(++_x) - _aa2*(((_y--)<<1)-3); - _pxb[_pxb.length] = _y-1; - } - else - { - _tt -= _aa2*((_y<<1)-3); - _st -= _aa4*(--_y); - _pxb[_pxb.length-1]--; - } - } - } - - var ox = -wod, oy = b, - _oy = _pxb[0], - l = pxl.length, - w, h; - for(var i = 0; i < l; i++) - { - if(typeof _pxb[i] != "undefined") - { - if(_pxb[i] < _oy || pxt[i] < oy) - { - x = pxl[i]; - this._mkOvQds(cx, cy, x, oy, x-ox, oy-_oy, wod, hod); - ox = x; - oy = pxt[i]; - _oy = _pxb[i]; - } - } - else - { - x = pxl[i]; - this._mkDiv(cx-x, cy-oy, 1, (oy<<1)+hod); - this._mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); - ox = x; - oy = pxt[i]; - } - } - this._mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); - this._mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); - } -} - -function _mkOvDott(left, top, width, height) -{ - var a = (++width)>>1, b = (++height)>>1, - wod = width&1, hod = height&1, hodu = hod^1, - cx = left+a, cy = top+b, - x = 0, y = b, - aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, - st = (aa2>>1)*(1-(b<<1)) + bb2, - tt = (bb2>>1) - aa2*((b<<1)-1), - drw = true; - while(y > 0) - { - if(st < 0) - { - st += bb2*((x<<1)+3); - tt += bb4*(++x); - } - else if(tt < 0) - { - st += bb2*((x<<1)+3) - aa4*(y-1); - tt += bb4*(++x) - aa2*(((y--)<<1)-3); - } - else - { - tt -= aa2*((y<<1)-3); - st -= aa4*(--y); - } - if(drw && y >= hodu) this._mkOvQds(cx, cy, x, y, 1, 1, wod, hod); - drw = !drw; - } -} - -function _mkRect(x, y, w, h) -{ - var s = this.stroke; - this._mkDiv(x, y, w, s); - this._mkDiv(x+w, y, s, h); - this._mkDiv(x, y+h, w+s, s); - this._mkDiv(x, y+s, s, h-s); -} - -function _mkRectDott(x, y, w, h) -{ - this.drawLine(x, y, x+w, y); - this.drawLine(x+w, y, x+w, y+h); - this.drawLine(x, y+h, x+w, y+h); - this.drawLine(x, y, x, y+h); -} - -function jsgFont() -{ - this.PLAIN = 'font-weight:normal;'; - this.BOLD = 'font-weight:bold;'; - this.ITALIC = 'font-style:italic;'; - this.ITALIC_BOLD = this.ITALIC + this.BOLD; - this.BOLD_ITALIC = this.ITALIC_BOLD; -} -var Font = new jsgFont(); - -function jsgStroke() -{ - this.DOTTED = -1; -} -var Stroke = new jsgStroke(); - -function JSGraphics(cnv, wnd) -{ - this.setColor = function(x) - { - this.color = x.toLowerCase(); - }; - - this.setStroke = function(x) - { - this.stroke = x; - if(!(x+1)) - { - this.drawLine = _mkLinDott; - this._mkOv = _mkOvDott; - this.drawRect = _mkRectDott; - } - else if(x-1 > 0) - { - this.drawLine = _mkLin2D; - this._mkOv = _mkOv2D; - this.drawRect = _mkRect; - } - else - { - this.drawLine = _mkLin; - this._mkOv = _mkOv; - this.drawRect = _mkRect; - } - }; - - this.setPrintable = function(arg) - { - this.printable = arg; - if(jg_fast) - { - this._mkDiv = _mkDivIe; - this._htmRpc = arg? _htmPrtRpc : _htmRpc; - } - else this._mkDiv = arg? _mkDivPrt : _mkDiv; - }; - - this.setFont = function(fam, sz, sty) - { - this.ftFam = fam; - this.ftSz = sz; - this.ftSty = sty || Font.PLAIN; - }; - - this.drawPolyline = this.drawPolyLine = function(x, y) - { - for (var i=x.length - 1; i;) - {--i; - this.drawLine(x[i], y[i], x[i+1], y[i+1]); - } - }; - - this.fillRect = function(x, y, w, h) - { - this._mkDiv(x, y, w, h); - }; - - this.drawPolygon = function(x, y) - { - this.drawPolyline(x, y); - this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]); - }; - - this.drawEllipse = this.drawOval = function(x, y, w, h) - { - this._mkOv(x, y, w, h); - }; - - this.fillEllipse = this.fillOval = function(left, top, w, h) - { - var a = w>>1, b = h>>1, - wod = w&1, hod = h&1, - cx = left+a, cy = top+b, - x = 0, y = b, oy = b, - aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, - st = (aa2>>1)*(1-(b<<1)) + bb2, - tt = (bb2>>1) - aa2*((b<<1)-1), - xl, dw, dh; - if(w) while(y > 0) - { - if(st < 0) - { - st += bb2*((x<<1)+3); - tt += bb4*(++x); - } - else if(tt < 0) - { - st += bb2*((x<<1)+3) - aa4*(y-1); - xl = cx-x; - dw = (x<<1)+wod; - tt += bb4*(++x) - aa2*(((y--)<<1)-3); - dh = oy-y; - this._mkDiv(xl, cy-oy, dw, dh); - this._mkDiv(xl, cy+y+hod, dw, dh); - oy = y; - } - else - { - tt -= aa2*((y<<1)-3); - st -= aa4*(--y); - } - } - this._mkDiv(cx-a, cy-oy, w, (oy<<1)+hod); - }; - - this.fillArc = function(iL, iT, iW, iH, fAngA, fAngZ) - { - var a = iW>>1, b = iH>>1, - iOdds = (iW&1) | ((iH&1) << 16), - cx = iL+a, cy = iT+b, - x = 0, y = b, ox = x, oy = y, - aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, - st = (aa2>>1)*(1-(b<<1)) + bb2, - tt = (bb2>>1) - aa2*((b<<1)-1), - // Vars for radial boundary lines - xEndA, yEndA, xEndZ, yEndZ, - iSects = (1 << (Math.floor((fAngA %= 360.0)/180.0) << 3)) - | (2 << (Math.floor((fAngZ %= 360.0)/180.0) << 3)) - | ((fAngA >= fAngZ) << 16), - aBndA = new Array(b+1), aBndZ = new Array(b+1); - - // Set up radial boundary lines - fAngA *= Math.PI/180.0; - fAngZ *= Math.PI/180.0; - xEndA = cx+Math.round(a*Math.cos(fAngA)); - yEndA = cy+Math.round(-b*Math.sin(fAngA)); - _mkLinVirt(aBndA, cx, cy, xEndA, yEndA); - xEndZ = cx+Math.round(a*Math.cos(fAngZ)); - yEndZ = cy+Math.round(-b*Math.sin(fAngZ)); - _mkLinVirt(aBndZ, cx, cy, xEndZ, yEndZ); - - while(y > 0) - { - if(st < 0) // Advance x - { - st += bb2*((x<<1)+3); - tt += bb4*(++x); - } - else if(tt < 0) // Advance x and y - { - st += bb2*((x<<1)+3) - aa4*(y-1); - ox = x; - tt += bb4*(++x) - aa2*(((y--)<<1)-3); - this._mkArcDiv(ox, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); - oy = y; - } - else // Advance y - { - tt -= aa2*((y<<1)-3); - st -= aa4*(--y); - if(y && (aBndA[y] != aBndA[y-1] || aBndZ[y] != aBndZ[y-1])) - { - this._mkArcDiv(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); - ox = x; - oy = y; - } - } - } - this._mkArcDiv(x, 0, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); - if(iOdds >> 16) // Odd height - { - if(iSects >> 16) // Start-angle > end-angle - { - var xl = (yEndA <= cy || yEndZ > cy)? (cx - x) : cx; - this._mkDiv(xl, cy, x + cx - xl + (iOdds & 0xffff), 1); - } - else if((iSects & 0x01) && yEndZ > cy) - this._mkDiv(cx - x, cy, x, 1); - } - }; - -/* fillPolygon method, implemented by Matthieu Haller. -This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. -C source of GD 1.8.4 found at http://www.boutell.com/gd/ - -THANKS to Kirsten Schulz for the polygon fixes! - -The intersection finding technique of this code could be improved -by remembering the previous intertersection, and by using the slope. -That could help to adjust intersections to produce a nice -interior_extrema. */ - this.fillPolygon = function(array_x, array_y) - { - var i; - var y; - var miny, maxy; - var x1, y1; - var x2, y2; - var ind1, ind2; - var ints; - - var n = array_x.length; - if(!n) return; - - miny = array_y[0]; - maxy = array_y[0]; - for(i = 1; i < n; i++) - { - if(array_y[i] < miny) - miny = array_y[i]; - - if(array_y[i] > maxy) - maxy = array_y[i]; - } - for(y = miny; y <= maxy; y++) - { - var polyInts = new Array(); - ints = 0; - for(i = 0; i < n; i++) - { - if(!i) - { - ind1 = n-1; - ind2 = 0; - } - else - { - ind1 = i-1; - ind2 = i; - } - y1 = array_y[ind1]; - y2 = array_y[ind2]; - if(y1 < y2) - { - x1 = array_x[ind1]; - x2 = array_x[ind2]; - } - else if(y1 > y2) - { - y2 = array_y[ind1]; - y1 = array_y[ind2]; - x2 = array_x[ind1]; - x1 = array_x[ind2]; - } - else continue; - - // Modified 11. 2. 2004 Walter Zorn - if((y >= y1) && (y < y2)) - polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); - - else if((y == maxy) && (y > y1) && (y <= y2)) - polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); - } - polyInts.sort(_CompInt); - for(i = 0; i < ints; i+=2) - this._mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); - } - }; - - this.drawString = function(txt, x, y) - { - this.htm += '
'+ - txt + - '<\/div>'; - }; - -/* drawStringRect() added by Rick Blommers. -Allows to specify the size of the text rectangle and to align the -text both horizontally (e.g. right) and vertically within that rectangle */ - this.drawStringRect = function(txt, x, y, width, halign) - { - this.htm += '
'+ - txt + - '<\/div>'; - }; - - this.drawImage = function(imgSrc, x, y, w, h, a) - { - this.htm += '
'+ - ''+ - '<\/div>'; - }; - - this.clear = function() - { - this.htm = ""; - if(this.cnv) this.cnv.innerHTML = ""; - }; - - this._mkOvQds = function(cx, cy, x, y, w, h, wod, hod) - { - var xl = cx - x, xr = cx + x + wod - w, yt = cy - y, yb = cy + y + hod - h; - if(xr > xl+w) - { - this._mkDiv(xr, yt, w, h); - this._mkDiv(xr, yb, w, h); - } - else - w = xr - xl + w; - this._mkDiv(xl, yt, w, h); - this._mkDiv(xl, yb, w, h); - }; - - this._mkArcDiv = function(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects) - { - var xrDef = cx + x + (iOdds & 0xffff), y2, h = oy - y, xl, xr, w; - - if(!h) h = 1; - x = cx - x; - - if(iSects & 0xff0000) // Start-angle > end-angle - { - y2 = cy - y - h; - if(iSects & 0x00ff) - { - if(iSects & 0x02) - { - xl = Math.max(x, aBndZ[y]); - w = xrDef - xl; - if(w > 0) this._mkDiv(xl, y2, w, h); - } - if(iSects & 0x01) - { - xr = Math.min(xrDef, aBndA[y]); - w = xr - x; - if(w > 0) this._mkDiv(x, y2, w, h); - } - } - else - this._mkDiv(x, y2, xrDef - x, h); - y2 = cy + y + (iOdds >> 16); - if(iSects & 0xff00) - { - if(iSects & 0x0100) - { - xl = Math.max(x, aBndA[y]); - w = xrDef - xl; - if(w > 0) this._mkDiv(xl, y2, w, h); - } - if(iSects & 0x0200) - { - xr = Math.min(xrDef, aBndZ[y]); - w = xr - x; - if(w > 0) this._mkDiv(x, y2, w, h); - } - } - else - this._mkDiv(x, y2, xrDef - x, h); - } - else - { - if(iSects & 0x00ff) - { - if(iSects & 0x02) - xl = Math.max(x, aBndZ[y]); - else - xl = x; - if(iSects & 0x01) - xr = Math.min(xrDef, aBndA[y]); - else - xr = xrDef; - y2 = cy - y - h; - w = xr - xl; - if(w > 0) this._mkDiv(xl, y2, w, h); - } - if(iSects & 0xff00) - { - if(iSects & 0x0100) - xl = Math.max(x, aBndA[y]); - else - xl = x; - if(iSects & 0x0200) - xr = Math.min(xrDef, aBndZ[y]); - else - xr = xrDef; - y2 = cy + y + (iOdds >> 16); - w = xr - xl; - if(w > 0) this._mkDiv(xl, y2, w, h); - } - } - }; - - this.setStroke(1); - this.setFont("verdana,geneva,helvetica,sans-serif", "12px", Font.PLAIN); - this.color = "#000000"; - this.htm = ""; - this.wnd = wnd || window; - - if(!jg_ok) _chkDHTM(this.wnd); - if(jg_ok) - { - if(cnv) - { - if(typeof(cnv) == "string") - this.cont = document.all? (this.wnd.document.all[cnv] || null) - : document.getElementById? (this.wnd.document.getElementById(cnv) || null) - : null; - else if(cnv == window.document) - this.cont = document.getElementsByTagName("body")[0]; - // If cnv is a direct reference to a canvas DOM node - // (option suggested by Andreas Luleich) - else this.cont = cnv; - // Create new canvas inside container DIV. Thus the drawing and clearing - // methods won't interfere with the container's inner html. - // Solution suggested by Vladimir. - this.cnv = this.wnd.document.createElement("div"); - this.cnv.style.fontSize=0; - this.cont.appendChild(this.cnv); - this.paint = jg_dom? _pntCnvDom : _pntCnvIe; - } - else - this.paint = _pntDoc; - } - else - this.paint = _pntN; - - this.setPrintable(false); -} - -function _mkLinVirt(aLin, x1, y1, x2, y2) -{ - var dx = Math.abs(x2-x1), dy = Math.abs(y2-y1), - x = x1, y = y1, - xIncr = (x1 > x2)? -1 : 1, - yIncr = (y1 > y2)? -1 : 1, - p, - i = 0; - if(dx >= dy) - { - var pr = dy<<1, - pru = pr - (dx<<1); - p = pr-dx; - while(dx > 0) - {--dx; - if(p > 0) // Increment y - { - aLin[i++] = x; - y += yIncr; - p += pru; - } - else p += pr; - x += xIncr; - } - } - else - { - var pr = dx<<1, - pru = pr - (dy<<1); - p = pr-dy; - while(dy > 0) - {--dy; - y += yIncr; - aLin[i++] = x; - if(p > 0) // Increment x - { - x += xIncr; - p += pru; - } - else p += pr; - } - } - for(var len = aLin.length, i = len-i; i;) - aLin[len-(i--)] = x; -}; - -function _CompInt(x, y) -{ - return(x - y); -} - +/* This notice must be untouched at all times. + +wz_jsgraphics.js v. 3.05 +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Copyright (c) 2002-2009 Walter Zorn. All rights reserved. +Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 2. 2. 2009 + +Performance optimizations for Internet Explorer +by Thomas Frank and John Holdsworth. +fillPolygon method implemented by Matthieu Haller. + +High Performance JavaScript Graphics Library. +Provides methods +- to draw lines, rectangles, ellipses, polygons + with specifiable line thickness, +- to fill rectangles, polygons, ellipses and arcs +- to draw text. +NOTE: Operations, functions and branching have rather been optimized +to efficiency and speed than to shortness of source code. + +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, +or see http://www.gnu.org/copyleft/lesser.html +*/ + + +var jg_ok, jg_ie, jg_fast, jg_dom, jg_moz; + + +function _chkDHTM(wnd, x, i) +// Under XUL, owner of 'document' must be specified explicitly +{ + x = wnd.document.body || null; + jg_ie = x && typeof x.insertAdjacentHTML != "undefined" && wnd.document.createElement; + jg_dom = (x && !jg_ie && + typeof x.appendChild != "undefined" && + typeof wnd.document.createRange != "undefined" && + typeof (i = wnd.document.createRange()).setStartBefore != "undefined" && + typeof i.createContextualFragment != "undefined"); + jg_fast = jg_ie && wnd.document.all && !wnd.opera; + jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; + jg_ok = !!(jg_ie || jg_dom); +} + +function _pntCnvDom() +{ + var x = this.wnd.document.createRange(); + x.setStartBefore(this.cnv); + x = x.createContextualFragment(jg_fast? this._htmRpc() : this.htm); + if(this.cnv) this.cnv.appendChild(x); + this.htm = ""; +} + +function _pntCnvIe() +{ + if(this.cnv) this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this._htmRpc() : this.htm); + this.htm = ""; +} + +function _pntDoc() +{ + this.wnd.document.write(jg_fast? this._htmRpc() : this.htm); + this.htm = ''; +} + +function _pntN() +{ + ; +} + +function _mkDiv(x, y, w, h) +{ + this.htm += '
<\/div>'; +} + +function _mkDivIe(x, y, w, h) +{ + this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; +} + +function _mkDivPrt(x, y, w, h) +{ + this.htm += '
<\/div>'; +} + +var _regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; +function _htmRpc() +{ + return this.htm.replace( + _regex, + '
\n'); +} + +function _htmPrtRpc() +{ + return this.htm.replace( + _regex, + '
\n'); +} + +function _mkLin(x1, y1, x2, y2) +{ + if(x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + if(dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while(dx > 0) + {--dx; + ++x; + if(p > 0) + { + this._mkDiv(ox, y, x-ox, 1); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this._mkDiv(ox, y, x2-ox+1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if(y2 <= y1) + { + while(dy > 0) + {--dy; + if(p > 0) + { + this._mkDiv(x++, y, 1, oy-y+1); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this._mkDiv(x2, y2, 1, oy-y2+1); + } + else + { + while(dy > 0) + {--dy; + y += yIncr; + if(p > 0) + { + this._mkDiv(x++, oy, 1, y-oy); + p += pru; + oy = y; + } + else p += pr; + } + this._mkDiv(x2, oy, 1, y2-oy+1); + } + } +} + +function _mkLin2D(x1, y1, x2, y2) +{ + if(x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + var s = this.stroke; + if(dx >= dy) + { + if(dx > 0 && s-3 > 0) + { + var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.ceil(s/2); + + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while(dx > 0) + {--dx; + ++x; + if(p > 0) + { + this._mkDiv(ox, y, x-ox+ad, _s); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this._mkDiv(ox, y, x2-ox+ad+1, _s); + } + + else + { + if(s-3 > 0) + { + var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.round(s/2); + + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if(y2 <= y1) + { + ++ad; + while(dy > 0) + {--dy; + if(p > 0) + { + this._mkDiv(x++, y, _s, oy-y+ad); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this._mkDiv(x2, y2, _s, oy-y2+ad); + } + else + { + while(dy > 0) + {--dy; + y += yIncr; + if(p > 0) + { + this._mkDiv(x++, oy, _s, y-oy+ad); + p += pru; + oy = y; + } + else p += pr; + } + this._mkDiv(x2, oy, _s, y2-oy+ad+1); + } + } +} + +function _mkLinDott(x1, y1, x2, y2) +{ + if(x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1, + drw = true; + if(dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx; + while(dx > 0) + {--dx; + if(drw) this._mkDiv(x, y, 1, 1); + drw = !drw; + if(p > 0) + { + y += yIncr; + p += pru; + } + else p += pr; + ++x; + } + } + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy; + while(dy > 0) + {--dy; + if(drw) this._mkDiv(x, y, 1, 1); + drw = !drw; + y += yIncr; + if(p > 0) + { + ++x; + p += pru; + } + else p += pr; + } + } + if(drw) this._mkDiv(x, y, 1, 1); +} + +function _mkOv(left, top, width, height) +{ + var a = (++width)>>1, b = (++height)>>1, + wod = width&1, hod = height&1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, + st = (aa2>>1)*(1-(b<<1)) + bb2, + tt = (bb2>>1) - aa2*((b<<1)-1), + w, h; + while(y > 0) + { + if(st < 0) + { + st += bb2*((x<<1)+3); + tt += bb4*(++x); + } + else if(tt < 0) + { + st += bb2*((x<<1)+3) - aa4*(y-1); + tt += bb4*(++x) - aa2*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + if((w&2) && (h&2)) + { + this._mkOvQds(cx, cy, x-2, y+2, 1, 1, wod, hod); + this._mkOvQds(cx, cy, x-1, y+1, 1, 1, wod, hod); + } + else this._mkOvQds(cx, cy, x-1, oy, w, h, wod, hod); + ox = x; + oy = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + } + w = a-ox+1; + h = (oy<<1)+hod; + y = cy-oy; + this._mkDiv(cx-a, y, w, h); + this._mkDiv(cx+ox+wod-1, y, w, h); +} + +function _mkOv2D(left, top, width, height) +{ + var s = this.stroke; + width += s+1; + height += s+1; + var a = width>>1, b = height>>1, + wod = width&1, hod = height&1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, + st = (aa2>>1)*(1-(b<<1)) + bb2, + tt = (bb2>>1) - aa2*((b<<1)-1); + + if(s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) + { + var ox = 0, oy = b, + w, h, + pxw; + while(y > 0) + { + if(st < 0) + { + st += bb2*((x<<1)+3); + tt += bb4*(++x); + } + else if(tt < 0) + { + st += bb2*((x<<1)+3) - aa4*(y-1); + tt += bb4*(++x) - aa2*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + + if(w-1) + { + pxw = w+1+(s&1); + h = s; + } + else if(h-1) + { + pxw = s; + h += 1+(s&1); + } + else pxw = h = s; + this._mkOvQds(cx, cy, x-1, oy, pxw, h, wod, hod); + ox = x; + oy = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + } + this._mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); + this._mkDiv(cx+a+wod-s, cy-oy, s, (oy<<1)+hod); + } + + else + { + var _a = (width-(s<<1))>>1, + _b = (height-(s<<1))>>1, + _x = 0, _y = _b, + _aa2 = (_a*_a)<<1, _aa4 = _aa2<<1, _bb2 = (_b*_b)<<1, _bb4 = _bb2<<1, + _st = (_aa2>>1)*(1-(_b<<1)) + _bb2, + _tt = (_bb2>>1) - _aa2*((_b<<1)-1), + + pxl = new Array(), + pxt = new Array(), + _pxb = new Array(); + pxl[0] = 0; + pxt[0] = b; + _pxb[0] = _b-1; + while(y > 0) + { + if(st < 0) + { + pxl[pxl.length] = x; + pxt[pxt.length] = y; + st += bb2*((x<<1)+3); + tt += bb4*(++x); + } + else if(tt < 0) + { + pxl[pxl.length] = x; + st += bb2*((x<<1)+3) - aa4*(y-1); + tt += bb4*(++x) - aa2*(((y--)<<1)-3); + pxt[pxt.length] = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + + if(_y > 0) + { + if(_st < 0) + { + _st += _bb2*((_x<<1)+3); + _tt += _bb4*(++_x); + _pxb[_pxb.length] = _y-1; + } + else if(_tt < 0) + { + _st += _bb2*((_x<<1)+3) - _aa4*(_y-1); + _tt += _bb4*(++_x) - _aa2*(((_y--)<<1)-3); + _pxb[_pxb.length] = _y-1; + } + else + { + _tt -= _aa2*((_y<<1)-3); + _st -= _aa4*(--_y); + _pxb[_pxb.length-1]--; + } + } + } + + var ox = -wod, oy = b, + _oy = _pxb[0], + l = pxl.length, + w, h; + for(var i = 0; i < l; i++) + { + if(typeof _pxb[i] != "undefined") + { + if(_pxb[i] < _oy || pxt[i] < oy) + { + x = pxl[i]; + this._mkOvQds(cx, cy, x, oy, x-ox, oy-_oy, wod, hod); + ox = x; + oy = pxt[i]; + _oy = _pxb[i]; + } + } + else + { + x = pxl[i]; + this._mkDiv(cx-x, cy-oy, 1, (oy<<1)+hod); + this._mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + ox = x; + oy = pxt[i]; + } + } + this._mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); + this._mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + } +} + +function _mkOvDott(left, top, width, height) +{ + var a = (++width)>>1, b = (++height)>>1, + wod = width&1, hod = height&1, hodu = hod^1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, + st = (aa2>>1)*(1-(b<<1)) + bb2, + tt = (bb2>>1) - aa2*((b<<1)-1), + drw = true; + while(y > 0) + { + if(st < 0) + { + st += bb2*((x<<1)+3); + tt += bb4*(++x); + } + else if(tt < 0) + { + st += bb2*((x<<1)+3) - aa4*(y-1); + tt += bb4*(++x) - aa2*(((y--)<<1)-3); + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + if(drw && y >= hodu) this._mkOvQds(cx, cy, x, y, 1, 1, wod, hod); + drw = !drw; + } +} + +function _mkRect(x, y, w, h) +{ + var s = this.stroke; + this._mkDiv(x, y, w, s); + this._mkDiv(x+w, y, s, h); + this._mkDiv(x, y+h, w+s, s); + this._mkDiv(x, y+s, s, h-s); +} + +function _mkRectDott(x, y, w, h) +{ + this.drawLine(x, y, x+w, y); + this.drawLine(x+w, y, x+w, y+h); + this.drawLine(x, y+h, x+w, y+h); + this.drawLine(x, y, x, y+h); +} + +function jsgFont() +{ + this.PLAIN = 'font-weight:normal;'; + this.BOLD = 'font-weight:bold;'; + this.ITALIC = 'font-style:italic;'; + this.ITALIC_BOLD = this.ITALIC + this.BOLD; + this.BOLD_ITALIC = this.ITALIC_BOLD; +} +var Font = new jsgFont(); + +function jsgStroke() +{ + this.DOTTED = -1; +} +var Stroke = new jsgStroke(); + +function JSGraphics(cnv, wnd) +{ + this.setColor = function(x) + { + this.color = x.toLowerCase(); + }; + + this.setStroke = function(x) + { + this.stroke = x; + if(!(x+1)) + { + this.drawLine = _mkLinDott; + this._mkOv = _mkOvDott; + this.drawRect = _mkRectDott; + } + else if(x-1 > 0) + { + this.drawLine = _mkLin2D; + this._mkOv = _mkOv2D; + this.drawRect = _mkRect; + } + else + { + this.drawLine = _mkLin; + this._mkOv = _mkOv; + this.drawRect = _mkRect; + } + }; + + this.setPrintable = function(arg) + { + this.printable = arg; + if(jg_fast) + { + this._mkDiv = _mkDivIe; + this._htmRpc = arg? _htmPrtRpc : _htmRpc; + } + else this._mkDiv = arg? _mkDivPrt : _mkDiv; + }; + + this.setFont = function(fam, sz, sty) + { + this.ftFam = fam; + this.ftSz = sz; + this.ftSty = sty || Font.PLAIN; + }; + + this.drawPolyline = this.drawPolyLine = function(x, y) + { + for (var i=x.length - 1; i;) + {--i; + this.drawLine(x[i], y[i], x[i+1], y[i+1]); + } + }; + + this.fillRect = function(x, y, w, h) + { + this._mkDiv(x, y, w, h); + }; + + this.drawPolygon = function(x, y) + { + this.drawPolyline(x, y); + this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]); + }; + + this.drawEllipse = this.drawOval = function(x, y, w, h) + { + this._mkOv(x, y, w, h); + }; + + this.fillEllipse = this.fillOval = function(left, top, w, h) + { + var a = w>>1, b = h>>1, + wod = w&1, hod = h&1, + cx = left+a, cy = top+b, + x = 0, y = b, oy = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, + st = (aa2>>1)*(1-(b<<1)) + bb2, + tt = (bb2>>1) - aa2*((b<<1)-1), + xl, dw, dh; + if(w) while(y > 0) + { + if(st < 0) + { + st += bb2*((x<<1)+3); + tt += bb4*(++x); + } + else if(tt < 0) + { + st += bb2*((x<<1)+3) - aa4*(y-1); + xl = cx-x; + dw = (x<<1)+wod; + tt += bb4*(++x) - aa2*(((y--)<<1)-3); + dh = oy-y; + this._mkDiv(xl, cy-oy, dw, dh); + this._mkDiv(xl, cy+y+hod, dw, dh); + oy = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + } + this._mkDiv(cx-a, cy-oy, w, (oy<<1)+hod); + }; + + this.fillArc = function(iL, iT, iW, iH, fAngA, fAngZ) + { + var a = iW>>1, b = iH>>1, + iOdds = (iW&1) | ((iH&1) << 16), + cx = iL+a, cy = iT+b, + x = 0, y = b, ox = x, oy = y, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1, + st = (aa2>>1)*(1-(b<<1)) + bb2, + tt = (bb2>>1) - aa2*((b<<1)-1), + // Vars for radial boundary lines + xEndA, yEndA, xEndZ, yEndZ, + iSects = (1 << (Math.floor((fAngA %= 360.0)/180.0) << 3)) + | (2 << (Math.floor((fAngZ %= 360.0)/180.0) << 3)) + | ((fAngA >= fAngZ) << 16), + aBndA = new Array(b+1), aBndZ = new Array(b+1); + + // Set up radial boundary lines + fAngA *= Math.PI/180.0; + fAngZ *= Math.PI/180.0; + xEndA = cx+Math.round(a*Math.cos(fAngA)); + yEndA = cy+Math.round(-b*Math.sin(fAngA)); + _mkLinVirt(aBndA, cx, cy, xEndA, yEndA); + xEndZ = cx+Math.round(a*Math.cos(fAngZ)); + yEndZ = cy+Math.round(-b*Math.sin(fAngZ)); + _mkLinVirt(aBndZ, cx, cy, xEndZ, yEndZ); + + while(y > 0) + { + if(st < 0) // Advance x + { + st += bb2*((x<<1)+3); + tt += bb4*(++x); + } + else if(tt < 0) // Advance x and y + { + st += bb2*((x<<1)+3) - aa4*(y-1); + ox = x; + tt += bb4*(++x) - aa2*(((y--)<<1)-3); + this._mkArcDiv(ox, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); + oy = y; + } + else // Advance y + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + if(y && (aBndA[y] != aBndA[y-1] || aBndZ[y] != aBndZ[y-1])) + { + this._mkArcDiv(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); + ox = x; + oy = y; + } + } + } + this._mkArcDiv(x, 0, oy, cx, cy, iOdds, aBndA, aBndZ, iSects); + if(iOdds >> 16) // Odd height + { + if(iSects >> 16) // Start-angle > end-angle + { + var xl = (yEndA <= cy || yEndZ > cy)? (cx - x) : cx; + this._mkDiv(xl, cy, x + cx - xl + (iOdds & 0xffff), 1); + } + else if((iSects & 0x01) && yEndZ > cy) + this._mkDiv(cx - x, cy, x, 1); + } + }; + +/* fillPolygon method, implemented by Matthieu Haller. +This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. +C source of GD 1.8.4 found at http://www.boutell.com/gd/ + +THANKS to Kirsten Schulz for the polygon fixes! + +The intersection finding technique of this code could be improved +by remembering the previous intertersection, and by using the slope. +That could help to adjust intersections to produce a nice +interior_extrema. */ + this.fillPolygon = function(array_x, array_y) + { + var i; + var y; + var miny, maxy; + var x1, y1; + var x2, y2; + var ind1, ind2; + var ints; + + var n = array_x.length; + if(!n) return; + + miny = array_y[0]; + maxy = array_y[0]; + for(i = 1; i < n; i++) + { + if(array_y[i] < miny) + miny = array_y[i]; + + if(array_y[i] > maxy) + maxy = array_y[i]; + } + for(y = miny; y <= maxy; y++) + { + var polyInts = new Array(); + ints = 0; + for(i = 0; i < n; i++) + { + if(!i) + { + ind1 = n-1; + ind2 = 0; + } + else + { + ind1 = i-1; + ind2 = i; + } + y1 = array_y[ind1]; + y2 = array_y[ind2]; + if(y1 < y2) + { + x1 = array_x[ind1]; + x2 = array_x[ind2]; + } + else if(y1 > y2) + { + y2 = array_y[ind1]; + y1 = array_y[ind2]; + x2 = array_x[ind1]; + x1 = array_x[ind2]; + } + else continue; + + // Modified 11. 2. 2004 Walter Zorn + if((y >= y1) && (y < y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + + else if((y == maxy) && (y > y1) && (y <= y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + } + polyInts.sort(_CompInt); + for(i = 0; i < ints; i+=2) + this._mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); + } + }; + + this.drawString = function(txt, x, y) + { + this.htm += '
'+ + txt + + '<\/div>'; + }; + +/* drawStringRect() added by Rick Blommers. +Allows to specify the size of the text rectangle and to align the +text both horizontally (e.g. right) and vertically within that rectangle */ + this.drawStringRect = function(txt, x, y, width, halign) + { + this.htm += '
'+ + txt + + '<\/div>'; + }; + + this.drawImage = function(imgSrc, x, y, w, h, a) + { + this.htm += '
'+ + ''+ + '<\/div>'; + }; + + this.clear = function() + { + this.htm = ""; + if(this.cnv) this.cnv.innerHTML = ""; + }; + + this._mkOvQds = function(cx, cy, x, y, w, h, wod, hod) + { + var xl = cx - x, xr = cx + x + wod - w, yt = cy - y, yb = cy + y + hod - h; + if(xr > xl+w) + { + this._mkDiv(xr, yt, w, h); + this._mkDiv(xr, yb, w, h); + } + else + w = xr - xl + w; + this._mkDiv(xl, yt, w, h); + this._mkDiv(xl, yb, w, h); + }; + + this._mkArcDiv = function(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects) + { + var xrDef = cx + x + (iOdds & 0xffff), y2, h = oy - y, xl, xr, w; + + if(!h) h = 1; + x = cx - x; + + if(iSects & 0xff0000) // Start-angle > end-angle + { + y2 = cy - y - h; + if(iSects & 0x00ff) + { + if(iSects & 0x02) + { + xl = Math.max(x, aBndZ[y]); + w = xrDef - xl; + if(w > 0) this._mkDiv(xl, y2, w, h); + } + if(iSects & 0x01) + { + xr = Math.min(xrDef, aBndA[y]); + w = xr - x; + if(w > 0) this._mkDiv(x, y2, w, h); + } + } + else + this._mkDiv(x, y2, xrDef - x, h); + y2 = cy + y + (iOdds >> 16); + if(iSects & 0xff00) + { + if(iSects & 0x0100) + { + xl = Math.max(x, aBndA[y]); + w = xrDef - xl; + if(w > 0) this._mkDiv(xl, y2, w, h); + } + if(iSects & 0x0200) + { + xr = Math.min(xrDef, aBndZ[y]); + w = xr - x; + if(w > 0) this._mkDiv(x, y2, w, h); + } + } + else + this._mkDiv(x, y2, xrDef - x, h); + } + else + { + if(iSects & 0x00ff) + { + if(iSects & 0x02) + xl = Math.max(x, aBndZ[y]); + else + xl = x; + if(iSects & 0x01) + xr = Math.min(xrDef, aBndA[y]); + else + xr = xrDef; + y2 = cy - y - h; + w = xr - xl; + if(w > 0) this._mkDiv(xl, y2, w, h); + } + if(iSects & 0xff00) + { + if(iSects & 0x0100) + xl = Math.max(x, aBndA[y]); + else + xl = x; + if(iSects & 0x0200) + xr = Math.min(xrDef, aBndZ[y]); + else + xr = xrDef; + y2 = cy + y + (iOdds >> 16); + w = xr - xl; + if(w > 0) this._mkDiv(xl, y2, w, h); + } + } + }; + + this.setStroke(1); + this.setFont("verdana,geneva,helvetica,sans-serif", "12px", Font.PLAIN); + this.color = "#000000"; + this.htm = ""; + this.wnd = wnd || window; + + if(!jg_ok) _chkDHTM(this.wnd); + if(jg_ok) + { + if(cnv) + { + if(typeof(cnv) == "string") + this.cont = document.all? (this.wnd.document.all[cnv] || null) + : document.getElementById? (this.wnd.document.getElementById(cnv) || null) + : null; + else if(cnv == window.document) + this.cont = document.getElementsByTagName("body")[0]; + // If cnv is a direct reference to a canvas DOM node + // (option suggested by Andreas Luleich) + else this.cont = cnv; + // Create new canvas inside container DIV. Thus the drawing and clearing + // methods won't interfere with the container's inner html. + // Solution suggested by Vladimir. + this.cnv = this.wnd.document.createElement("div"); + this.cnv.style.fontSize=0; + this.cont.appendChild(this.cnv); + this.paint = jg_dom? _pntCnvDom : _pntCnvIe; + } + else + this.paint = _pntDoc; + } + else + this.paint = _pntN; + + this.setPrintable(false); +} + +function _mkLinVirt(aLin, x1, y1, x2, y2) +{ + var dx = Math.abs(x2-x1), dy = Math.abs(y2-y1), + x = x1, y = y1, + xIncr = (x1 > x2)? -1 : 1, + yIncr = (y1 > y2)? -1 : 1, + p, + i = 0; + if(dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1); + p = pr-dx; + while(dx > 0) + {--dx; + if(p > 0) // Increment y + { + aLin[i++] = x; + y += yIncr; + p += pru; + } + else p += pr; + x += xIncr; + } + } + else + { + var pr = dx<<1, + pru = pr - (dy<<1); + p = pr-dy; + while(dy > 0) + {--dy; + y += yIncr; + aLin[i++] = x; + if(p > 0) // Increment x + { + x += xIncr; + p += pru; + } + else p += pr; + } + } + for(var len = aLin.length, i = len-i; i;) + aLin[len-(i--)] = x; +}; + +function _CompInt(x, y) +{ + return(x - y); +} + /*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license*/ (function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="
",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
t
",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t @@ -17331,115 +17331,115 @@ if (typeof exports !== "undefined") { } }()); -(function () { - var TextAnnotationField = function (settings) { - TextAnnotationField.superclass.call(this, settings); - this.text = null; - this._textType = null; - this.text_Align = null; - this._labelTag = null; - TextAnnotationField.prototype.init.call(this, settings); - }; - - PMUI.inheritFrom('PMUI.form.Field', TextAnnotationField); - - TextAnnotationField.prototype.type = "TextAnnotationField"; - - TextAnnotationField.TEXT_TYPES = { - Plain: 0, - HTML: 1 - }; - - TextAnnotationField.prototype.init = function (settings) { - var defaults = { - maxLength: 0, - text: "", - textType: TextAnnotationField.TEXT_TYPES.Plain, - text_Align: "left" - }; - - $.extend(true, defaults, settings); - this.setText(defaults.text); - this.setTextType(defaults.textType); - this.setText_Align(defaults.text_Align); - }; - - TextAnnotationField.prototype.setTextType = function (type) { - switch (type) { - case TextAnnotationField.TEXT_TYPES.Plain: - case TextAnnotationField.TEXT_TYPES.HTML: - this._textType = type; - break; - default: - throw new Error("setTextType(): Invalid argument."); - } - this.setText(this.text); - return this; - }; - - TextAnnotationField.prototype.setText = function (text) { - if (typeof text !== "string") { - throw new Error("setText(): The parameter is not valid"); - } - this.text = text; - if (this.html) { - if (this._textType == TextAnnotationField.TEXT_TYPES.HTML) { - jQuery(this._labelTag).html(this.text); - } else { - jQuery(this._labelTag).text(this.text); - } - } - return this; - }; - - TextAnnotationField.prototype.setText_Align = function (value) { - if (typeof value === "string") { - this.text_Align = value; - } else { - throw new Error("the enter parameter is no valid"); - } - return this; - }; - - TextAnnotationField.prototype.setValue = function () { - return this; - }; - - TextAnnotationField.prototype.setControls = function () { - return this; - }; - - TextAnnotationField.prototype.setHelper = function () { - return this; - }; - - TextAnnotationField.prototype.createHTML = function () { - var labelTag, textbefore, spanRequired, sp = " "; - if (this.html) { - return this.html; - } - TextAnnotationField.superclass.superclass.prototype.createHTML.call(this); - labelTag = PMUI.createHTMLElement('span'); - labelTag.className = 'pmui-field-label'; - labelTag.style.width = "100%"; - labelTag.style.textAlign = this.text_Align; - this._labelTag = labelTag; - this.html.appendChild(labelTag); - - this.setText(this.text); - return this.html; - }; - - TextAnnotationField.prototype.isValid = function () { - return true; - }; - - PMUI.extendNamespace('PMUI.field.TextAnnotationField', TextAnnotationField); - - if (typeof exports !== "undefined") { - module.exports = TextAnnotationField; - } - +(function () { + var TextAnnotationField = function (settings) { + TextAnnotationField.superclass.call(this, settings); + this.text = null; + this._textType = null; + this.text_Align = null; + this._labelTag = null; + TextAnnotationField.prototype.init.call(this, settings); + }; + + PMUI.inheritFrom('PMUI.form.Field', TextAnnotationField); + + TextAnnotationField.prototype.type = "TextAnnotationField"; + + TextAnnotationField.TEXT_TYPES = { + Plain: 0, + HTML: 1 + }; + + TextAnnotationField.prototype.init = function (settings) { + var defaults = { + maxLength: 0, + text: "", + textType: TextAnnotationField.TEXT_TYPES.Plain, + text_Align: "left" + }; + + $.extend(true, defaults, settings); + this.setText(defaults.text); + this.setTextType(defaults.textType); + this.setText_Align(defaults.text_Align); + }; + + TextAnnotationField.prototype.setTextType = function (type) { + switch (type) { + case TextAnnotationField.TEXT_TYPES.Plain: + case TextAnnotationField.TEXT_TYPES.HTML: + this._textType = type; + break; + default: + throw new Error("setTextType(): Invalid argument."); + } + this.setText(this.text); + return this; + }; + + TextAnnotationField.prototype.setText = function (text) { + if (typeof text !== "string") { + throw new Error("setText(): The parameter is not valid"); + } + this.text = text; + if (this.html) { + if (this._textType == TextAnnotationField.TEXT_TYPES.HTML) { + jQuery(this._labelTag).html(this.text); + } else { + jQuery(this._labelTag).text(this.text); + } + } + return this; + }; + + TextAnnotationField.prototype.setText_Align = function (value) { + if (typeof value === "string") { + this.text_Align = value; + } else { + throw new Error("the enter parameter is no valid"); + } + return this; + }; + + TextAnnotationField.prototype.setValue = function () { + return this; + }; + + TextAnnotationField.prototype.setControls = function () { + return this; + }; + + TextAnnotationField.prototype.setHelper = function () { + return this; + }; + + TextAnnotationField.prototype.createHTML = function () { + var labelTag, textbefore, spanRequired, sp = " "; + if (this.html) { + return this.html; + } + TextAnnotationField.superclass.superclass.prototype.createHTML.call(this); + labelTag = PMUI.createHTMLElement('span'); + labelTag.className = 'pmui-field-label'; + labelTag.style.width = "100%"; + labelTag.style.textAlign = this.text_Align; + this._labelTag = labelTag; + this.html.appendChild(labelTag); + + this.setText(this.text); + return this.html; + }; + + TextAnnotationField.prototype.isValid = function () { + return true; + }; + + PMUI.extendNamespace('PMUI.field.TextAnnotationField', TextAnnotationField); + + if (typeof exports !== "undefined") { + module.exports = TextAnnotationField; + } + }()); (function () { /** @@ -59715,1415 +59715,1415 @@ var PMExtend = function (classObj, method, additionalFunc) { } }.call(this)); -// wrapper for non-node envs -;(function (sax) { - - sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } - sax.SAXParser = SAXParser - sax.SAXStream = SAXStream - sax.createStream = createStream - -// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. -// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), -// since that's the earliest that a buffer overrun could occur. This way, checks are -// as rare as required, but as often as necessary to ensure never crossing this bound. -// Furthermore, buffers are only tested at most once per write(), so passing a very -// large string into write() might have undesirable effects, but this is manageable by -// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme -// edge case, result in creating at most one complete copy of the string passed in. -// Set to Infinity to have unlimited buffers. - sax.MAX_BUFFER_LENGTH = 64 * 1024 - - var buffers = [ - "comment", "sgmlDecl", "textNode", "tagName", "doctype", - "procInstName", "procInstBody", "entity", "attribName", - "attribValue", "cdata", "script" - ] - - sax.EVENTS = // for discoverability. - [ "text" - , "processinginstruction" - , "sgmldeclaration" - , "doctype" - , "comment" - , "attribute" - , "opentag" - , "closetag" - , "opencdata" - , "cdata" - , "closecdata" - , "error" - , "end" - , "ready" - , "script" - , "opennamespace" - , "closenamespace" - ] - - function SAXParser (strict, opt) { - if (!(this instanceof SAXParser)) return new SAXParser(strict, opt) - - var parser = this - clearBuffers(parser) - parser.q = parser.c = "" - parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH - parser.opt = opt || {} - parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags - parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase" - parser.tags = [] - parser.closed = parser.closedRoot = parser.sawRoot = false - parser.tag = parser.error = null - parser.strict = !!strict - parser.noscript = !!(strict || parser.opt.noscript) - parser.state = S.BEGIN - parser.ENTITIES = Object.create(sax.ENTITIES) - parser.attribList = [] - - // namespaces form a prototype chain. - // it always points at the current tag, - // which protos to its parent tag. - if (parser.opt.xmlns) parser.ns = Object.create(rootNS) - - // mostly just for error reporting - parser.trackPosition = parser.opt.position !== false - if (parser.trackPosition) { - parser.position = parser.line = parser.column = 0 - } - emit(parser, "onready") - } - - if (!Object.create) Object.create = function (o) { - function f () { this.__proto__ = o } - f.prototype = o - return new f - } - - if (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) { - return o.__proto__ - } - - if (!Object.keys) Object.keys = function (o) { - var a = [] - for (var i in o) if (o.hasOwnProperty(i)) a.push(i) - return a - } - - function checkBufferLength (parser) { - var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) - , maxActual = 0 - for (var i = 0, l = buffers.length; i < l; i ++) { - var len = parser[buffers[i]].length - if (len > maxAllowed) { - // Text/cdata nodes can get big, and since they're buffered, - // we can get here under normal conditions. - // Avoid issues by emitting the text node now, - // so at least it won't get any bigger. - switch (buffers[i]) { - case "textNode": - closeText(parser) - break - - case "cdata": - emitNode(parser, "oncdata", parser.cdata) - parser.cdata = "" - break - - case "script": - emitNode(parser, "onscript", parser.script) - parser.script = "" - break - - default: - error(parser, "Max buffer length exceeded: "+buffers[i]) - } - } - maxActual = Math.max(maxActual, len) - } - // schedule the next check for the earliest possible buffer overrun. - parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual) - + parser.position - } - - function clearBuffers (parser) { - for (var i = 0, l = buffers.length; i < l; i ++) { - parser[buffers[i]] = "" - } - } - - function flushBuffers (parser) { - closeText(parser) - if (parser.cdata !== "") { - emitNode(parser, "oncdata", parser.cdata) - parser.cdata = "" - } - if (parser.script !== "") { - emitNode(parser, "onscript", parser.script) - parser.script = "" - } - } - - SAXParser.prototype = - { end: function () { end(this) } - , write: write - , resume: function () { this.error = null; return this } - , close: function () { return this.write(null) } - , flush: function () { flushBuffers(this) } - } - - try { - var Stream = require("stream").Stream - } catch (ex) { - var Stream = function () {} - } - - - var streamWraps = sax.EVENTS.filter(function (ev) { - return ev !== "error" && ev !== "end" - }) - - function createStream (strict, opt) { - return new SAXStream(strict, opt) - } - - function SAXStream (strict, opt) { - if (!(this instanceof SAXStream)) return new SAXStream(strict, opt) - - Stream.apply(this) - - this._parser = new SAXParser(strict, opt) - this.writable = true - this.readable = true - - - var me = this - - this._parser.onend = function () { - me.emit("end") - } - - this._parser.onerror = function (er) { - me.emit("error", er) - - // if didn't throw, then means error was handled. - // go ahead and clear error, so we can write again. - me._parser.error = null - } - - this._decoder = null; - - streamWraps.forEach(function (ev) { - Object.defineProperty(me, "on" + ev, { - get: function () { return me._parser["on" + ev] }, - set: function (h) { - if (!h) { - me.removeAllListeners(ev) - return me._parser["on"+ev] = h - } - me.on(ev, h) - }, - enumerable: true, - configurable: false - }) - }) - } - - SAXStream.prototype = Object.create(Stream.prototype, - { constructor: { value: SAXStream } }) - - SAXStream.prototype.write = function (data) { - if (typeof Buffer === 'function' && - typeof Buffer.isBuffer === 'function' && - Buffer.isBuffer(data)) { - if (!this._decoder) { - var SD = require('string_decoder').StringDecoder - this._decoder = new SD('utf8') - } - data = this._decoder.write(data); - } - - this._parser.write(data.toString()) - this.emit("data", data) - return true - } - - SAXStream.prototype.end = function (chunk) { - if (chunk && chunk.length) this.write(chunk) - this._parser.end() - return true - } - - SAXStream.prototype.on = function (ev, handler) { - var me = this - if (!me._parser["on"+ev] && streamWraps.indexOf(ev) !== -1) { - me._parser["on"+ev] = function () { - var args = arguments.length === 1 ? [arguments[0]] - : Array.apply(null, arguments) - args.splice(0, 0, ev) - me.emit.apply(me, args) - } - } - - return Stream.prototype.on.call(me, ev, handler) - } - - - -// character classes and tokens - var whitespace = "\r\n\t " - // this really needs to be replaced with character classes. - // XML allows all manner of ridiculous numbers and digits. - , number = "0124356789" - , letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - // (Letter | "_" | ":") - , quote = "'\"" - , entity = number+letter+"#" - , attribEnd = whitespace + ">" - , CDATA = "[CDATA[" - , DOCTYPE = "DOCTYPE" - , XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace" - , XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/" - , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } - -// turn all the string character sets into character class objects. - whitespace = charClass(whitespace) - number = charClass(number) - letter = charClass(letter) - -// http://www.w3.org/TR/REC-xml/#NT-NameStartChar -// This implementation works on strings, a single character at a time -// as such, it cannot ever support astral-plane characters (10000-EFFFF) -// without a significant breaking change to either this parser, or the -// JavaScript language. Implementation of an emoji-capable xml parser -// is left as an exercise for the reader. - var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - - var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/ - - quote = charClass(quote) - entity = charClass(entity) - attribEnd = charClass(attribEnd) - - function charClass (str) { - return str.split("").reduce(function (s, c) { - s[c] = true - return s - }, {}) - } - - function isRegExp (c) { - return Object.prototype.toString.call(c) === '[object RegExp]' - } - - function is (charclass, c) { - return isRegExp(charclass) ? !!c.match(charclass) : charclass[c] - } - - function not (charclass, c) { - return !is(charclass, c) - } - - var S = 0 - sax.STATE = - { BEGIN : S++ - , TEXT : S++ // general stuff - , TEXT_ENTITY : S++ // & and such. - , OPEN_WAKA : S++ // < - , SGML_DECL : S++ // - , SCRIPT : S++ //