partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit e1d95a0f07e42229eed3f7fd267daf5626932102
parent fb105fb1f3404cb2bbd88bf7164844b2848b0c91
Author: Timo A. Hummel <felicitus@felicitus.org>
Date:   Sun, 14 May 2017 23:39:22 +0200

Merge branch 'master' of github.com:partkeepr/PartKeepr

Diffstat:
Mcomposer.lock | 680+++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
Msrc/PartKeepr/FootprintBundle/Entity/Footprint.php | 6++++--
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/CategoryEditor/CategoryEditorTree.js | 26+++++++++++++++++---------
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/ImportFieldMatcherGrid.js | 2+-
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/Importer.js | 2+-
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/ImporterEntityConfiguration.js | 4++++
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/MenuBar.js | 14+++++---------
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/DataApplicator.js | 487++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/SearchPanel.js | 65++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/SearchWindow.js | 2+-
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditorWindow.js | 2+-
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js | 8++++----
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Preferences/Panel.js | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Preferences/PreferenceEditor.js | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Preferences/Tree.js | 67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Panel.js | 89+++----------------------------------------------------------------------------
Dsrc/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/PreferenceEditor.js | 58----------------------------------------------------------
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/ActionsConfiguration.js | 8++++----
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/BarcodeScannerConfiguration.js | 12++++++------
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/FulltextSearch.js | 2+-
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartDistributorFields.js | 4++--
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartFields.js | 4++--
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartManufacturerFields.js | 4++--
Dsrc/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Tree.js | 68--------------------------------------------------------------------
Dsrc/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/DisplayPreferencesPanel.js | 76----------------------------------------------------------------------------
Dsrc/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/FormattingPreferences.js | 109-------------------------------------------------------------------------------
Dsrc/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/StockPreferences.js | 27---------------------------
Dsrc/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/TipOfTheDayPreferences.js | 51---------------------------------------------------
Dsrc/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/UserPasswordChangePanel.js | 100-------------------------------------------------------------------------------
Dsrc/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserPreferences.js | 35-----------------------------------
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Panel.js | 22++++++++++++++++++++++
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/DisplayConfiguration.js | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/FormattingConfiguration.js | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/OctoPartConfiguration.js | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/PasswordConfiguration.js | 92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/StockConfiguration.js | 30++++++++++++++++++++++++++++++
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/TipOfTheDayConfiguration.js | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/PreferencePlugin.js | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/PartKeepr/FrontendBundle/Resources/views/index.html.twig | 19+++++++++++--------
Msrc/PartKeepr/ImportBundle/Configuration/Configuration.php | 9++++++---
Asrc/PartKeepr/ImportBundle/Configuration/EntityConfiguration.php | 155+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/PartKeepr/ImportBundle/Configuration/ManyToOneConfiguration.php | 8++++++--
Msrc/PartKeepr/ImportBundle/Configuration/OneToManyConfiguration.php | 6++++--
Msrc/PartKeepr/ImportBundle/Controller/ImportController.php | 6------
Msrc/PartKeepr/ImportBundle/Service/ImporterService.php | 21++++++++++++++++++---
Msrc/PartKeepr/PartBundle/Controller/PartController.php | 2+-
Msrc/PartKeepr/ProjectBundle/Entity/ProjectPart.php | 1+
Aweb/setup/css/AllowCopy.css | 5+++++
Dweb/setup/css/BreadCrumbWizard.css | 0
Mweb/setup/index.html | 2+-
50 files changed, 1772 insertions(+), 1149 deletions(-)

diff --git a/composer.lock b/composer.lock @@ -138,18 +138,21 @@ }, { "name": "composer/installers", - "version": "v1.0.21", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45" + "reference": "d78064c68299743e0161004f2de3a0204e33b804" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", - "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", + "url": "https://api.github.com/repos/composer/installers/zipball/d78064c68299743e0161004f2de3a0204e33b804", + "reference": "d78064c68299743e0161004f2de3a0204e33b804", "shasum": "" }, + "require": { + "composer-plugin-api": "^1.0" + }, "replace": { "roundcube/plugin-installer": "*", "shama/baton": "*" @@ -158,16 +161,16 @@ "composer/composer": "1.0.*@dev", "phpunit/phpunit": "4.1.*" }, - "type": "composer-installer", + "type": "composer-plugin", "extra": { - "class": "Composer\\Installers\\Installer", + "class": "Composer\\Installers\\Plugin", "branch-alias": { "dev-master": "1.0-dev" } }, "autoload": { - "psr-0": { - "Composer\\Installers\\": "src/" + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" } }, "notification-url": "https://packagist.org/downloads/", @@ -182,28 +185,35 @@ } ], "description": "A multi-framework Composer library installer", - "homepage": "http://composer.github.com/installers/", + "homepage": "https://composer.github.io/installers/", "keywords": [ "Craft", "Dolibarr", "Hurad", + "ImageCMS", "MODX Evo", + "Mautic", "OXID", + "Plentymarkets", + "RadPHP", "SMF", "Thelia", "WolfCMS", "agl", "aimeos", "annotatecms", + "attogram", "bitrix", "cakephp", "chef", + "cockpit", "codeigniter", "concrete5", "croogo", "dokuwiki", "drupal", "elgg", + "expressionengine", "fuelphp", "grav", "installer", @@ -220,16 +230,18 @@ "piwik", "ppi", "puppet", + "reindex", "roundcube", "shopware", "silverstripe", "symfony", "typo3", "wordpress", + "yawik", "zend", "zikula" ], - "time": "2015-02-18T17:17:01+00:00" + "time": "2016-08-13 20:53:52" }, { "name": "doctrine/annotations", @@ -1312,16 +1324,16 @@ }, { "name": "dunglas/php-property-info", - "version": "v0.2.1", + "version": "v0.2.3", "source": { "type": "git", "url": "https://github.com/dunglas/php-property-info.git", - "reference": "f378ad895f64885dcfcedfd198ad5aa1b19f6c97" + "reference": "698a5fa4f3901dba31e9163599aa9d4fdbf88f1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dunglas/php-property-info/zipball/f378ad895f64885dcfcedfd198ad5aa1b19f6c97", - "reference": "f378ad895f64885dcfcedfd198ad5aa1b19f6c97", + "url": "https://api.github.com/repos/dunglas/php-property-info/zipball/698a5fa4f3901dba31e9163599aa9d4fdbf88f1a", + "reference": "698a5fa4f3901dba31e9163599aa9d4fdbf88f1a", "shasum": "" }, "require": { @@ -1363,7 +1375,7 @@ "type", "validator" ], - "time": "2015-04-03T17:49:18+00:00" + "time": "2015-12-29 08:21:00" }, { "name": "escapestudios/wsse-authentication-bundle", @@ -1427,16 +1439,16 @@ }, { "name": "fortawesome/font-awesome", - "version": "v4.5.0", + "version": "v4.7.0", "source": { "type": "git", "url": "https://github.com/FortAwesome/Font-Awesome.git", - "reference": "fddd2c240452e6c8990c4ef75e0265b455aa7968" + "reference": "a8386aae19e200ddb0f6845b5feeee5eb7013687" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FortAwesome/Font-Awesome/zipball/fddd2c240452e6c8990c4ef75e0265b455aa7968", - "reference": "fddd2c240452e6c8990c4ef75e0265b455aa7968", + "url": "https://api.github.com/repos/FortAwesome/Font-Awesome/zipball/a8386aae19e200ddb0f6845b5feeee5eb7013687", + "reference": "a8386aae19e200ddb0f6845b5feeee5eb7013687", "shasum": "" }, "require-dev": { @@ -1446,7 +1458,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "4.6.x-dev" } }, "notification-url": "https://packagist.org/downloads/", @@ -1471,7 +1483,7 @@ "font", "icon" ], - "time": "2015-11-30T17:28:02+00:00" + "time": "2016-10-24 15:52:54" }, { "name": "fr3d/ldap-bundle", @@ -1686,16 +1698,16 @@ }, { "name": "gedmo/doctrine-extensions", - "version": "v2.4.7", + "version": "v2.4.26", "source": { "type": "git", "url": "https://github.com/Atlantic18/DoctrineExtensions.git", - "reference": "1a86ba1c7426238b4f765089e0af51174a38af7f" + "reference": "983dd85d6860f87fb7dffd0d9f7ad1462e20a09d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Atlantic18/DoctrineExtensions/zipball/1a86ba1c7426238b4f765089e0af51174a38af7f", - "reference": "1a86ba1c7426238b4f765089e0af51174a38af7f", + "url": "https://api.github.com/repos/Atlantic18/DoctrineExtensions/zipball/983dd85d6860f87fb7dffd0d9f7ad1462e20a09d", + "reference": "983dd85d6860f87fb7dffd0d9f7ad1462e20a09d", "shasum": "" }, "require": { @@ -1761,7 +1773,7 @@ "tree", "uploadable" ], - "time": "2015-09-28T16:39:27+00:00" + "time": "2016-12-21 13:46:54" }, { "name": "guzzlehttp/guzzle", @@ -2208,16 +2220,16 @@ }, { "name": "knplabs/gaufrette", - "version": "0.2.0", + "version": "0.2.1", "source": { "type": "git", "url": "https://github.com/KnpLabs/Gaufrette.git", - "reference": "9d52413665284f9c96e0cef399fc14e68ac0aa5a" + "reference": "1696386ca66f2f046dea7892cf1f85fd82b5b68e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/Gaufrette/zipball/9d52413665284f9c96e0cef399fc14e68ac0aa5a", - "reference": "9d52413665284f9c96e0cef399fc14e68ac0aa5a", + "url": "https://api.github.com/repos/KnpLabs/Gaufrette/zipball/1696386ca66f2f046dea7892cf1f85fd82b5b68e", + "reference": "1696386ca66f2f046dea7892cf1f85fd82b5b68e", "shasum": "" }, "require": { @@ -2228,11 +2240,11 @@ "aws/aws-sdk-php": "~2", "doctrine/dbal": ">=2.3", "dropbox-php/dropbox-php": "*", - "google/apiclient": "~1.1", + "google/apiclient": "~1.1.3", "herzult/php-ssh": "*", "microsoft/windowsazure": "dev-master", "mikey179/vfsstream": "~1.2.0", - "phpseclib/phpseclib": "dev-master", + "phpseclib/phpseclib": "^2.0", "phpspec/phpspec": "2.0.*", "phpunit/phpunit": "3.7.*", "rackspace/php-opencloud": "1.9.*" @@ -2258,7 +2270,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.2.x-dev" + "dev-master": "0.4.x-dev" } }, "autoload": { @@ -2288,7 +2300,7 @@ "filesystem", "media" ], - "time": "2015-05-26T08:25:40+00:00" + "time": "2016-03-03 09:36:22" }, { "name": "knplabs/knp-gaufrette-bundle", @@ -2350,39 +2362,38 @@ }, { "name": "kriswallsmith/assetic", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/kriswallsmith/assetic.git", - "reference": "56cb5d6dec9e7a68a4da2fa89844f39d41092f31" + "reference": "e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/56cb5d6dec9e7a68a4da2fa89844f39d41092f31", - "reference": "56cb5d6dec9e7a68a4da2fa89844f39d41092f31", + "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1", + "reference": "e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1", "shasum": "" }, "require": { "php": ">=5.3.1", - "symfony/process": "~2.1" + "symfony/process": "~2.1|~3.0" }, "conflict": { - "twig/twig": "<1.12" + "twig/twig": "<1.27" }, "require-dev": { - "cssmin/cssmin": "*", - "joliclic/javascript-packer": "*", - "kamicane/packager": "*", "leafo/lessphp": "^0.3.7", - "leafo/scssphp": "*@dev", - "leafo/scssphp-compass": "*@dev", - "mrclay/minify": "*", + "leafo/scssphp": "~0.1", + "meenie/javascript-packer": "^1.1", + "mrclay/minify": "<2.3", + "natxet/cssmin": "3.0.4", "patchwork/jsqueeze": "~1.0|~2.0", - "phpunit/phpunit": "~4.8", + "phpunit/phpunit": "~4.8 || ^5.6", "psr/log": "~1.0", - "ptachoire/cssembed": "*", - "symfony/phpunit-bridge": "~2.7", - "twig/twig": "~1.8|~2.0" + "ptachoire/cssembed": "~1.0", + "symfony/phpunit-bridge": "~2.7|~3.0", + "twig/twig": "~1.23|~2.0", + "yfix/packager": "dev-master" }, "suggest": { "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", @@ -2395,7 +2406,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -2424,20 +2435,20 @@ "compression", "minification" ], - "time": "2015-08-31T19:07:16+00:00" + "time": "2016-11-11 18:43:20" }, { "name": "michelf/php-markdown", - "version": "1.5.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/michelf/php-markdown.git", - "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9" + "reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/michelf/php-markdown/zipball/e1aabe18173231ebcefc90e615565742fc1c7fd9", - "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/1f51cc520948f66cd2af8cbc45a5ee175e774220", + "reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220", "shasum": "" }, "require": { @@ -2460,14 +2471,14 @@ ], "authors": [ { - "name": "John Gruber", - "homepage": "http://daringfireball.net/" - }, - { "name": "Michel Fortin", "email": "michel.fortin@michelf.ca", "homepage": "https://michelf.ca/", "role": "Developer" + }, + { + "name": "John Gruber", + "homepage": "https://daringfireball.net/" } ], "description": "PHP Markdown", @@ -2475,20 +2486,20 @@ "keywords": [ "markdown" ], - "time": "2015-03-01T12:03:08+00:00" + "time": "2016-10-29 18:58:20" }, { "name": "monolog/monolog", - "version": "1.17.1", + "version": "1.22.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422" + "reference": "bad29cb8d18ab0315e6c477751418a82c850d558" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/0524c87587ab85bc4c2d6f5b41253ccb930a5422", - "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558", + "reference": "bad29cb8d18ab0315e6c477751418a82c850d558", "shasum": "" }, "require": { @@ -2499,16 +2510,17 @@ "psr/log-implementation": "1.0.0" }, "require-dev": { - "aws/aws-sdk-php": "^2.4.9", + "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", "phpunit/phpunit": "~4.5", "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "~0.11", "ruflin/elastica": ">=0.90 <3.0", - "swiftmailer/swiftmailer": "~5.3", - "videlalvaro/php-amqplib": "~2.4" + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "~5.3" }, "suggest": { "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", @@ -2516,16 +2528,17 @@ "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", "ext-mongo": "Allow sending log messages to a MongoDB server", "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", "php-console/php-console": "Allow sending log messages to Google Chrome", - "raven/raven": "Allow sending log messages to a Sentry server", "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" + "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.16.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -2551,43 +2564,56 @@ "logging", "psr-3" ], - "time": "2015-08-31T09:17:37+00:00" + "time": "2016-11-26 00:15:39" }, { "name": "moontoast/math", - "version": "1.1.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/ramsey/moontoast-math.git", - "reference": "fce28a9d1e73e73376cb44e5e581675d15fbe2f3" + "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/moontoast-math/zipball/fce28a9d1e73e73376cb44e5e581675d15fbe2f3", - "reference": "fce28a9d1e73e73376cb44e5e581675d15fbe2f3", + "url": "https://api.github.com/repos/ramsey/moontoast-math/zipball/c2792a25df5cad4ff3d760dd37078fc5b6fccc79", + "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79", "shasum": "" }, "require": { "ext-bcmath": "*", "php": ">=5.3.3" }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "^0.9.0", + "phpunit/phpunit": "^4.7|>=5.0 <5.4", + "satooshi/php-coveralls": "^0.6.1", + "squizlabs/php_codesniffer": "^2.3" + }, "type": "library", "autoload": { - "psr-0": { - "Moontoast\\Math": "src/" + "psr-4": { + "Moontoast\\Math\\": "src/Moontoast/Math/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], "description": "A mathematics library, providing functionality for large numbers", - "homepage": "https://github.com/moontoast/math", + "homepage": "https://github.com/ramsey/moontoast-math", "keywords": [ "bcmath", "math" ], - "time": "2013-01-19T17:42:34+00:00" + "time": "2017-02-16 16:54:46" }, { "name": "nelmio/api-doc-bundle", @@ -2822,16 +2848,16 @@ }, { "name": "paragonie/random_compat", - "version": "1.1.1", + "version": "v1.4.1", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "a208865a5aeffc2dbbef2a5b3409887272d93f32" + "reference": "c7e26a21ba357863de030f0b9e701c7d04593774" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/a208865a5aeffc2dbbef2a5b3409887272d93f32", - "reference": "a208865a5aeffc2dbbef2a5b3409887272d93f32", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/c7e26a21ba357863de030f0b9e701c7d04593774", + "reference": "c7e26a21ba357863de030f0b9e701c7d04593774", "shasum": "" }, "require": { @@ -2866,7 +2892,7 @@ "pseudorandom", "random" ], - "time": "2015-12-01T02:52:15+00:00" + "time": "2016-03-18 20:34:03" }, { "name": "partkeepr/extjs6", @@ -3059,16 +3085,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "1.0.1", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "f60e365be28d9218b4bcdc0ab96ac7e338668f11" + "reference": "38fa7332e96bcc546ce6eb5cbaa1168c96839393" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f60e365be28d9218b4bcdc0ab96ac7e338668f11", - "reference": "f60e365be28d9218b4bcdc0ab96ac7e338668f11", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/38fa7332e96bcc546ce6eb5cbaa1168c96839393", + "reference": "38fa7332e96bcc546ce6eb5cbaa1168c96839393", "shasum": "" }, "require": { @@ -3095,6 +3121,7 @@ "System": "phpseclib/" }, "files": [ + "phpseclib/bootstrap.php", "phpseclib/Crypt/Random.php" ] }, @@ -3153,27 +3180,27 @@ "x.509", "x509" ], - "time": "2016-01-18T17:07:12+00:00" + "time": "2016-10-22 17:53:16" }, { "name": "predis/predis", - "version": "v1.0.3", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/nrk/predis.git", - "reference": "84060b9034d756b4d79641667d7f9efe1aeb8e04" + "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nrk/predis/zipball/84060b9034d756b4d79641667d7f9efe1aeb8e04", - "reference": "84060b9034d756b4d79641667d7f9efe1aeb8e04", + "url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1", + "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.3.9" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.8" }, "suggest": { "ext-curl": "Allows access to Webdis when paired with phpiredis", @@ -3196,14 +3223,14 @@ "homepage": "http://clorophilla.net" } ], - "description": "Flexible and feature-complete PHP client library for Redis", + "description": "Flexible and feature-complete Redis client for PHP and HHVM", "homepage": "http://github.com/nrk/predis", "keywords": [ "nosql", "predis", "redis" ], - "time": "2015-07-30T18:34:15+00:00" + "time": "2016-06-16 16:22:20" }, { "name": "psr/http-message", @@ -3295,19 +3322,20 @@ }, { "name": "ramsey/uuid", - "version": "3.1.0", + "version": "3.5.2", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "3cc2dd253e296ce05f99635b2f633048adfbaa96" + "reference": "5677cfe02397dd6b58c861870dfaa5d9007d3954" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/3cc2dd253e296ce05f99635b2f633048adfbaa96", - "reference": "3cc2dd253e296ce05f99635b2f633048adfbaa96", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/5677cfe02397dd6b58c861870dfaa5d9007d3954", + "reference": "5677cfe02397dd6b58c861870dfaa5d9007d3954", "shasum": "" }, "require": { + "paragonie/random_compat": "^1.0|^2.0", "php": ">=5.4" }, "replace": { @@ -3315,14 +3343,20 @@ }, "require-dev": { "apigen/apigen": "^4.1", + "codeception/aspect-mock": "1.0.0", + "doctrine/annotations": "~1.2.0", + "goaop/framework": "1.0.0-alpha.2", "ircmaxell/random-lib": "^1.1", "jakub-onderka/php-parallel-lint": "^0.9.0", + "mockery/mockery": "^0.9.4", "moontoast/math": "^1.1", - "phpunit/phpunit": "^4.7", + "php-mock/php-mock-phpunit": "^0.3|^1.1", + "phpunit/phpunit": "^4.7|>=5.0 <5.4", "satooshi/php-coveralls": "^0.6.1", "squizlabs/php_codesniffer": "^2.3" }, "suggest": { + "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", @@ -3330,6 +3364,11 @@ "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, "autoload": { "psr-4": { "Ramsey\\Uuid\\": "src/" @@ -3361,7 +3400,7 @@ "identifier", "uuid" ], - "time": "2015-12-17T15:21:44+00:00" + "time": "2016-11-22 19:21:44" }, { "name": "reputation-vip/composer-assets-installer", @@ -3405,17 +3444,17 @@ }, { "name": "sensio/distribution-bundle", - "version": "v4.0.5", + "version": "v4.0.38", "target-dir": "Sensio/Bundle/DistributionBundle", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioDistributionBundle.git", - "reference": "c89375c9d95fc5afaeb99e7a49b428b6e3beb9d3" + "reference": "95469374e703f01b8e760023ac4f2f64da6a1dd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/c89375c9d95fc5afaeb99e7a49b428b6e3beb9d3", - "reference": "c89375c9d95fc5afaeb99e7a49b428b6e3beb9d3", + "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/95469374e703f01b8e760023ac4f2f64da6a1dd9", + "reference": "95469374e703f01b8e760023ac4f2f64da6a1dd9", "shasum": "" }, "require": { @@ -3461,29 +3500,44 @@ "configuration", "distribution" ], - "time": "2016-02-12T16:21:25+00:00" + "time": "2017-01-04 13:34:44" }, { "name": "sensio/framework-extra-bundle", - "version": "v3.0.12", + "version": "v3.0.22", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git", - "reference": "3e8936fe13aa4086644977d334d8fcd275f50357" + "reference": "1c66c2e3b8f17f06178142386aff5a9f8057a104" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/3e8936fe13aa4086644977d334d8fcd275f50357", - "reference": "3e8936fe13aa4086644977d334d8fcd275f50357", + "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/1c66c2e3b8f17f06178142386aff5a9f8057a104", + "reference": "1c66c2e3b8f17f06178142386aff5a9f8057a104", "shasum": "" }, "require": { "doctrine/common": "~2.2", + "symfony/dependency-injection": "~2.3|~3.0", "symfony/framework-bundle": "~2.3|~3.0" }, "require-dev": { + "doctrine/doctrine-bundle": "~1.5", + "doctrine/orm": "~2.4,>=2.4.5", + "symfony/asset": "~2.7|~3.0", + "symfony/browser-kit": "~2.3|~3.0", + "symfony/dom-crawler": "~2.3|~3.0", "symfony/expression-language": "~2.4|~3.0", - "symfony/security-bundle": "~2.4|~3.0" + "symfony/finder": "~2.3|~3.0", + "symfony/phpunit-bridge": "~3.2", + "symfony/psr-http-message-bridge": "^0.3", + "symfony/security-bundle": "~2.4|~3.0", + "symfony/templating": "~2.3|~3.0", + "symfony/translation": "~2.3|~3.0", + "symfony/twig-bundle": "~2.3|~3.0", + "symfony/yaml": "~2.3|~3.0", + "twig/twig": "~1.12|~2.0", + "zendframework/zend-diactoros": "^1.3" }, "suggest": { "symfony/expression-language": "", @@ -3516,24 +3570,24 @@ "annotations", "controllers" ], - "time": "2015-12-18T17:39:27+00:00" + "time": "2017-02-15 06:52:30" }, { "name": "sensiolabs/security-checker", - "version": "v3.0.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/sensiolabs/security-checker.git", - "reference": "7735fd97ff7303d9df776b8dbc970f949399abc9" + "reference": "21696b0daa731064c23cfb694c60a2584a7b6e93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/7735fd97ff7303d9df776b8dbc970f949399abc9", - "reference": "7735fd97ff7303d9df776b8dbc970f949399abc9", + "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/21696b0daa731064c23cfb694c60a2584a7b6e93", + "reference": "21696b0daa731064c23cfb694c60a2584a7b6e93", "shasum": "" }, "require": { - "symfony/console": "~2.0" + "symfony/console": "~2.0|~3.0" }, "bin": [ "security-checker" @@ -3560,7 +3614,7 @@ } ], "description": "A security checker for your composer.lock", - "time": "2015-08-11T12:11:25+00:00" + "time": "2015-11-07 08:07:40" }, { "name": "snc/redis-bundle", @@ -3624,43 +3678,49 @@ }, { "name": "sonata-project/exporter", - "version": "1.4.1", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/sonata-project/exporter.git", - "reference": "474be8b9dbb8ca1c378aa24e701df940a89ec124" + "reference": "8ee7c0e804dc5e162187d8ed440d260adb3f1bce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sonata-project/exporter/zipball/474be8b9dbb8ca1c378aa24e701df940a89ec124", - "reference": "474be8b9dbb8ca1c378aa24e701df940a89ec124", + "url": "https://api.github.com/repos/sonata-project/exporter/zipball/8ee7c0e804dc5e162187d8ed440d260adb3f1bce", + "reference": "8ee7c0e804dc5e162187d8ed440d260adb3f1bce", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^5.3 || ^7.0" }, "require-dev": { - "fabpot/php-cs-fixer": "~0.1|~1.0", - "propel/propel1": "~1.6", - "symfony/phpunit-bridge": "~2.7|~3.0", - "symfony/property-access": "~2.3|~3.0", - "symfony/routing": "~2.3|~3.0" + "doctrine/dbal": "^2.2", + "matthiasnoback/symfony-config-test": "^1.2.1 || ^2.0", + "matthiasnoback/symfony-dependency-injection-test": "^0.7.6 || ^1.0", + "propel/propel1": "^1.6", + "sllh/php-cs-fixer-styleci-bridge": "^2.0", + "symfony/dependency-injection": "^2.3 || ^3.0", + "symfony/http-foundation": "^2.3 || ^3.0", + "symfony/http-kernel": "^2.3 || ^3.0", + "symfony/phpunit-bridge": "^2.7 || ^3.0", + "symfony/property-access": "^2.3 || ^3.0", + "symfony/routing": "^2.3 || ^3.0" }, "suggest": { "ext-curl": "*", - "propel/propel1": "~1.6", - "symfony/property-access": "~2.3|~3.0", - "symfony/routing": "~2.3|~3.0" + "propel/propel1": "^1.6", + "symfony/property-access": "^2.3 || ^3.0", + "symfony/routing": "^2.3 || ^3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1-dev" + "dev-master": "1.x-dev" } }, "autoload": { - "psr-0": { - "Exporter": "lib/" + "psr-4": { + "Exporter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3683,7 +3743,7 @@ "export", "xls" ], - "time": "2015-11-25T09:33:45+00:00" + "time": "2017-02-09 16:39:40" }, { "name": "stof/doctrine-extensions-bundle", @@ -3748,23 +3808,24 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v5.4.1", + "version": "v5.4.6", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" + "reference": "81fdccfaf8bdc5d5d7a1ef6bb3a61bbb1a6c4a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", - "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/81fdccfaf8bdc5d5d7a1ef6bb3a61bbb1a6c4a3e", + "reference": "81fdccfaf8bdc5d5d7a1ef6bb3a61bbb1a6c4a3e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "~0.9.1,<0.9.4" + "mockery/mockery": "~0.9.1", + "symfony/phpunit-bridge": "~3.2" }, "type": "library", "extra": { @@ -3797,7 +3858,7 @@ "mail", "mailer" ], - "time": "2015-06-06T14:19:39+00:00" + "time": "2017-02-13 07:52:53" }, { "name": "symfony/assetic-bundle", @@ -3929,6 +3990,59 @@ "time": "2015-11-17T10:02:29+00:00" }, { + "name": "symfony/polyfill-apcu", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-apcu.git", + "reference": "5d4474f447403c3348e37b70acc2b95475b7befa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/5d4474f447403c3348e37b70acc2b95475b7befa", + "reference": "5d4474f447403c3348e37b70acc2b95475b7befa", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting apcu_* functions to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "apcu", + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2016-11-14 01:06:16" + }, + { "name": "symfony/polyfill-intl-icu", "version": "v1.0.0", "source": { @@ -4383,28 +4497,30 @@ }, { "name": "symfony/swiftmailer-bundle", - "version": "v2.3.11", + "version": "v2.4.2", "source": { "type": "git", "url": "https://github.com/symfony/swiftmailer-bundle.git", - "reference": "5e1a90f28213231ceee19c953bbebc5b5b95c690" + "reference": "ad751095576ce0c12a284e30e3fff80c91f27225" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/5e1a90f28213231ceee19c953bbebc5b5b95c690", - "reference": "5e1a90f28213231ceee19c953bbebc5b5b95c690", + "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/ad751095576ce0c12a284e30e3fff80c91f27225", + "reference": "ad751095576ce0c12a284e30e3fff80c91f27225", "shasum": "" }, "require": { "php": ">=5.3.2", "swiftmailer/swiftmailer": ">=4.2.0,~5.0", - "symfony/config": "~2.3|~3.0", - "symfony/dependency-injection": "~2.3|~3.0", - "symfony/http-kernel": "~2.3|~3.0", - "symfony/yaml": "~2.3|~3.0" + "symfony/config": "~2.7|~3.0", + "symfony/dependency-injection": "~2.7|~3.0", + "symfony/http-kernel": "~2.7|~3.0" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" + "symfony/console": "~2.7|~3.0", + "symfony/framework-bundle": "~2.7|~3.0", + "symfony/phpunit-bridge": "~2.7|~3.0", + "symfony/yaml": "~2.7|~3.0" }, "suggest": { "psr/log": "Allows logging" @@ -4412,7 +4528,7 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.4-dev" } }, "autoload": { @@ -4436,26 +4552,27 @@ ], "description": "Symfony SwiftmailerBundle", "homepage": "http://symfony.com", - "time": "2016-01-15T16:41:20+00:00" + "time": "2016-12-20 04:44:33" }, { "name": "symfony/symfony", - "version": "v2.8.2", + "version": "v2.8.16", "source": { "type": "git", "url": "https://github.com/symfony/symfony.git", - "reference": "f3e6a82bcbea4db3b56df08e491e20a1faae82b5" + "reference": "9fef72a3ab561c4bfa703a70369db028dec387d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/symfony/zipball/f3e6a82bcbea4db3b56df08e491e20a1faae82b5", - "reference": "f3e6a82bcbea4db3b56df08e491e20a1faae82b5", + "url": "https://api.github.com/repos/symfony/symfony/zipball/9fef72a3ab561c4bfa703a70369db028dec387d2", + "reference": "9fef72a3ab561c4bfa703a70369db028dec387d2", "shasum": "" }, "require": { "doctrine/common": "~2.4", "php": ">=5.3.9", "psr/log": "~1.0", + "symfony/polyfill-apcu": "~1.1", "symfony/polyfill-intl-icu": "~1.0", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php54": "~1.0", @@ -4463,8 +4580,8 @@ "symfony/polyfill-php56": "~1.0", "symfony/polyfill-php70": "~1.0", "symfony/polyfill-util": "~1.0", - "symfony/security-acl": "~2.7", - "twig/twig": "~1.23|~2.0" + "symfony/security-acl": "~2.7|~3.0.0", + "twig/twig": "~1.28|~2.0" }, "conflict": { "phpdocumentor/reflection": "<1.0.7" @@ -4522,10 +4639,11 @@ "doctrine/dbal": "~2.4", "doctrine/doctrine-bundle": "~1.2", "doctrine/orm": "~2.4,>=2.4.5", - "egulias/email-validator": "~1.2", + "egulias/email-validator": "~1.2,>=1.2.1", "monolog/monolog": "~1.11", - "ocramius/proxy-manager": "~0.4|~1.0", - "phpdocumentor/reflection": "^1.0.7" + "ocramius/proxy-manager": "~0.4|~1.0|~2.0", + "phpdocumentor/reflection": "^1.0.7", + "symfony/phpunit-bridge": "~3.2" }, "type": "library", "extra": { @@ -4569,20 +4687,20 @@ "keywords": [ "framework" ], - "time": "2016-01-14T12:01:11+00:00" + "time": "2017-01-12 20:27:46" }, { "name": "twig/extensions", - "version": "v1.3.0", + "version": "v1.4.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig-extensions.git", - "reference": "449e3c8a9ffad7c2479c7864557275a32b037499" + "reference": "f0bb8431c8691f5a39f1017d9a5967a082bf01ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/449e3c8a9ffad7c2479c7864557275a32b037499", - "reference": "449e3c8a9ffad7c2479c7864557275a32b037499", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/f0bb8431c8691f5a39f1017d9a5967a082bf01ff", + "reference": "f0bb8431c8691f5a39f1017d9a5967a082bf01ff", "shasum": "" }, "require": { @@ -4597,7 +4715,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -4621,20 +4739,20 @@ "i18n", "text" ], - "time": "2015-08-22T16:38:35+00:00" + "time": "2016-10-25 17:34:14" }, { "name": "twig/twig", - "version": "v1.23.1", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "d9b6333ae8dd2c8e3fd256e127548def0bc614c6" + "reference": "ddc9e3e20ee9c0b6908f401ac8353635b750eca7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/d9b6333ae8dd2c8e3fd256e127548def0bc614c6", - "reference": "d9b6333ae8dd2c8e3fd256e127548def0bc614c6", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/ddc9e3e20ee9c0b6908f401ac8353635b750eca7", + "reference": "ddc9e3e20ee9c0b6908f401ac8353635b750eca7", "shasum": "" }, "require": { @@ -4642,12 +4760,12 @@ }, "require-dev": { "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~2.7" + "symfony/phpunit-bridge": "~3.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.23-dev" + "dev-master": "1.31-dev" } }, "autoload": { @@ -4682,7 +4800,7 @@ "keywords": [ "templating" ], - "time": "2015-11-05T12:49:06+00:00" + "time": "2017-01-11 19:36:15" }, { "name": "willdurand/jsonp-callback-validator", @@ -5260,52 +5378,59 @@ "web service" ], "abandoned": "guzzlehttp/guzzle", - "time": "2015-03-18T18:23:50+00:00" + "time": "2015-03-18 18:23:50" }, { "name": "liip/functional-test-bundle", - "version": "1.4.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/liip/LiipFunctionalTestBundle.git", - "reference": "633cb540c509e5c40b1139813214b29371e6988a" + "reference": "8466b71c7a923295c3045b257efb53015f432ff5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/liip/LiipFunctionalTestBundle/zipball/633cb540c509e5c40b1139813214b29371e6988a", - "reference": "633cb540c509e5c40b1139813214b29371e6988a", + "url": "https://api.github.com/repos/liip/LiipFunctionalTestBundle/zipball/8466b71c7a923295c3045b257efb53015f432ff5", + "reference": "8466b71c7a923295c3045b257efb53015f432ff5", "shasum": "" }, "require": { "doctrine/common": "~2.0", - "php": "^5.3.9|^7.0", + "php": "^5.6.0|^7.0", "symfony/browser-kit": "~2.3|~3.0", "symfony/framework-bundle": "2.3.*|~2.7|~3.0" }, "require-dev": { + "brianium/paratest": "~0.12.0|~0.13.2", + "doctrine/data-fixtures": "1.2.2", "doctrine/doctrine-fixtures-bundle": "~2.3", - "doctrine/orm": "^2.4.8", + "doctrine/orm": "~2.5", "doctrine/phpcr-bundle": "~1.3", "doctrine/phpcr-odm": "~1.3", + "hautelook/alice-bundle": "~0.2|~1.2", "jackalope/jackalope-doctrine-dbal": "1.1.*|1.2.*", "nelmio/alice": "~1.7|~2.0", - "phpunit/phpunit": "4.8.*|5.1.*", + "phpunit/phpunit": "4.8.*|~5.2", "symfony/assetic-bundle": "~2.3", + "symfony/console": "~2.5|~3.0", "symfony/monolog-bundle": "~2.4", - "symfony/symfony": "~2.3.1|~2.7|~3.0", + "symfony/phpunit-bridge": "^2.7|~3.0", + "symfony/symfony": "~2.3.27|~2.7|~3.0", "twig/twig": "~1.12" }, "suggest": { + "brianium/paratest": "Required when using paratest to parallelize tests", "doctrine/dbal": "Required when using the fixture loading functionality with an ORM and SQLite", "doctrine/doctrine-fixtures-bundle": "Required when using the fixture loading functionality", "doctrine/orm": "Required when using the fixture loading functionality with an ORM and SQLite", + "hautelook/alice-bundle": "Required when using loadFixtureFiles functionality with custom providers", "nelmio/alice": "Required when using loadFixtureFiles functionality", "symfony/framework-bundle": "To use assertStatusCode and assertValidationErrors ~2.5" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -5331,20 +5456,20 @@ "keywords": [ "Symfony2" ], - "time": "2016-02-08T10:14:11+00:00" + "time": "2017-01-11 18:04:59" }, { "name": "myclabs/deep-copy", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "e3abefcd7f106677fd352cd7c187d6c969aa9ddc" + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e3abefcd7f106677fd352cd7c187d6c969aa9ddc", - "reference": "e3abefcd7f106677fd352cd7c187d6c969aa9ddc", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", "shasum": "" }, "require": { @@ -5373,34 +5498,37 @@ "object", "object graph" ], - "time": "2015-11-07T22:20:37+00:00" + "time": "2017-01-26 22:05:40" }, { "name": "phpspec/prophecy", - "version": "v1.5.0", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", + "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0|^2.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.0", + "phpunit/phpunit": "^4.8 || ^5.6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -5433,20 +5561,20 @@ "spy", "stub" ], - "time": "2015-08-13T10:07:40+00:00" + "time": "2016-11-21 14:58:47" }, { "name": "phpunit/php-code-coverage", - "version": "3.2.1", + "version": "3.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "a58f95ae76fe201b571fad3e8370a50c4368678c" + "reference": "44cd8e3930e431658d1a5de7d282d5cb37837fd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a58f95ae76fe201b571fad3e8370a50c4368678c", - "reference": "a58f95ae76fe201b571fad3e8370a50c4368678c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/44cd8e3930e431658d1a5de7d282d5cb37837fd5", + "reference": "44cd8e3930e431658d1a5de7d282d5cb37837fd5", "shasum": "" }, "require": { @@ -5464,13 +5592,13 @@ }, "suggest": { "ext-dom": "*", - "ext-xdebug": ">=2.2.1", + "ext-xdebug": ">=2.4.0", "ext-xmlwriter": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "3.3.x-dev" } }, "autoload": { @@ -5496,20 +5624,20 @@ "testing", "xunit" ], - "time": "2016-02-18T07:31:12+00:00" + "time": "2016-05-27 16:24:29" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", "shasum": "" }, "require": { @@ -5543,7 +5671,7 @@ "filesystem", "iterator" ], - "time": "2015-06-21T13:08:43+00:00" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -5588,21 +5716,24 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.7", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, "type": "library", "autoload": { "classmap": [ @@ -5625,20 +5756,20 @@ "keywords": [ "timer" ], - "time": "2015-06-21T08:01:12+00:00" + "time": "2016-05-12 18:03:57" }, { "name": "phpunit/php-token-stream", - "version": "1.4.8", + "version": "1.4.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", + "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", "shasum": "" }, "require": { @@ -5674,7 +5805,7 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15T10:49:45+00:00" + "time": "2016-11-15 14:06:22" }, { "name": "phpunit/phpunit", @@ -5752,16 +5883,16 @@ }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.0.6", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "49bc700750196c04dd6bc2c4c99cb632b893836b" + "reference": "151c96874bff6fe61a25039df60e776613a61489" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/49bc700750196c04dd6bc2c4c99cb632b893836b", - "reference": "49bc700750196c04dd6bc2c4c99cb632b893836b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/151c96874bff6fe61a25039df60e776613a61489", + "reference": "151c96874bff6fe61a25039df60e776613a61489", "shasum": "" }, "require": { @@ -5779,7 +5910,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -5804,7 +5935,7 @@ "mock", "xunit" ], - "time": "2015-12-08T08:47:06+00:00" + "time": "2016-04-20 14:39:26" }, { "name": "satooshi/php-coveralls", @@ -5921,22 +6052,22 @@ }, { "name": "sebastian/comparator", - "version": "1.2.0", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { "php": ">=5.3.3", "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -5981,32 +6112,32 @@ "compare", "equality" ], - "time": "2015-07-26T15:48:44+00:00" + "time": "2017-01-29 09:50:25" }, { "name": "sebastian/diff", - "version": "1.3.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -6029,31 +6160,31 @@ } ], "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff" ], - "time": "2015-02-22T15:13:53+00:00" + "time": "2015-12-08 07:14:41" }, { "name": "sebastian/environment", - "version": "1.3.2", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { @@ -6083,20 +6214,20 @@ "environment", "hhvm" ], - "time": "2015-08-03T06:14:51+00:00" + "time": "2016-08-18 05:49:44" }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -6104,12 +6235,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -6149,20 +6281,20 @@ "export", "exporter" ], - "time": "2015-06-21T07:55:53+00:00" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { @@ -6200,20 +6332,20 @@ "keywords": [ "global state" ], - "time": "2014-10-06T09:23:50+00:00" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/recursion-context", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", "shasum": "" }, "require": { @@ -6253,7 +6385,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21T08:04:50+00:00" + "time": "2015-11-11 19:50:13" }, { "name": "sebastian/resource-operations", @@ -6299,16 +6431,16 @@ }, { "name": "sebastian/version", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { @@ -6338,7 +6470,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-02-04T12:56:52+00:00" + "time": "2016-10-03 07:35:21" }, { "name": "sensio/generator-bundle", diff --git a/src/PartKeepr/FootprintBundle/Entity/Footprint.php b/src/PartKeepr/FootprintBundle/Entity/Footprint.php @@ -226,9 +226,11 @@ class Footprint extends BaseEntity * * @return void */ - public function removeAttachment(FootprintAttachment $attachment) + public function removeAttachment($attachment) { - $attachment->setFootprint(null); + if ($attachment instanceof FootprintAttachment) { + $attachment->setFootprint(null); + } $this->attachments->removeElement($attachment); } } diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/CategoryEditor/CategoryEditorTree.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/CategoryEditor/CategoryEditorTree.js @@ -11,16 +11,26 @@ Ext.define("PartKeepr.CategoryEditorTree", { categoryModel: null, categoryService: null, categoryEditActions: true, - columns: [ - { + + initComponent: function () + { + this.columns = [{ xtype: 'treecolumn', header: 'Name', dataIndex: 'name', flex: 1 + }]; + + if (PartKeepr.getApplication().getUserPreference("partkeepr.categorytree.showdescriptions", false) === true) { + this.columns.push( + { + xtype: 'gridcolumn', + header: 'Description', + dataIndex: 'description', + flex: 0.5 + }); + } - ], - initComponent: function () - { this.createToolbar(); @@ -75,9 +85,7 @@ Ext.define("PartKeepr.CategoryEditorTree", { { var draggedRecord = data.records[0]; - if (!(draggedRecord instanceof PartKeepr.data.HydraTreeModel)) { - return; - } else { + if (draggedRecord instanceof PartKeepr.data.HydraTreeModel) { var targetRecord; if (dropPosition === "after" || dropPosition === "before") { @@ -211,7 +219,7 @@ Ext.define("PartKeepr.CategoryEditorTree", { }, onCategoryDelete: function (btn) { - if (btn == "yes") { + if (btn === "yes") { this.getSelection()[0].erase(); } } diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/ImportFieldMatcherGrid.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/ImportFieldMatcherGrid.js @@ -193,7 +193,7 @@ Ext.define("PartKeepr.Importer.ImportFieldMatcherGrid", { }, scope: this } - ], + ] }).show(); } }); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/Importer.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/Importer.js @@ -44,7 +44,7 @@ Ext.define("PartKeepr.Importer.Importer", { disabledCls: '', header: i18n("Required"), dataIndex: 'required', - width: 70, + width: 70 } ], store: { diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/ImporterEntityConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Importer/ImporterEntityConfiguration.js @@ -5,6 +5,7 @@ Ext.define("PartKeepr.Importer.ImporterEntityConfiguration", { align: 'stretch' }, scrollable: 'y', + defaultListenerScope: true, importerField: null, xtype: 'importerEntityConfiguration', @@ -29,6 +30,9 @@ Ext.define("PartKeepr.Importer.ImporterEntityConfiguration", { disabled: true, xtype: 'importFieldMatcherGrid', itemId: 'importFieldMatcherGrid', + listeners: { + change: "onImportBehaviourChange" + }, height: 100 }, { diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/MenuBar.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/MenuBar.js @@ -20,7 +20,7 @@ Ext.define('PartKeepr.MenuBar', { var foundItem = false; for (var i = 0; i < root.menu.length; i++) { - if (root.menu[i].text == item.text) { + if (root.menu[i].text === item.text) { Ext.applyIf(root.menu[i], item); foundItem = i; } @@ -48,7 +48,7 @@ Ext.define('PartKeepr.MenuBar', { var menuItems = [ // System Menu - "PartKeepr.UserPreferencePanel", + "PartKeepr.Components.UserPreferences.Panel", "PartKeepr.Components.SystemPreferences.Panel", "PartKeepr.Actions.LogoutAction", @@ -70,7 +70,7 @@ Ext.define('PartKeepr.MenuBar', { "PartKeepr.ProjectReportView", 'PartKeepr.ProjectRunEditorComponent', "PartKeepr.SystemNoticeEditorComponent", - "PartKeepr.StockHistoryGrid", + "PartKeepr.StockHistoryGrid" ]; @@ -96,11 +96,7 @@ Ext.define('PartKeepr.MenuBar', { }); for (var i in window.themes) { - if (window.theme == i) { - checked = true; - } else { - checked = false; - } + checked = window.theme === i; this.themesMenu.push({ text: window.themes[i].themeName, theme: i, @@ -119,7 +115,7 @@ Ext.define('PartKeepr.MenuBar', { var i,j,menuItem; for (i=0;i<this.items.getCount();i++) { - if (this.items.getAt(i).type == "themes") { + if (this.items.getAt(i).type === "themes") { for (j=0;j<this.items.getAt(i).menu.items.getCount();j++) { menuItem = this.items.getAt(i).menu.items.getAt(j); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/DataApplicator.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/DataApplicator.js @@ -2,27 +2,48 @@ Ext.define("PartKeepr.Components.OctoPart.DataApplicator", { extend: "Ext.Base", mixins: ['Ext.mixin.Observable'], + import: {}, + constructor: function (config) { + this.setImport("parameters", true); + this.setImport("distributors", true); + this.setImport("datasheets", true); + this.setImport("cadModels", true); + this.setImport("complianceDocuments", true); + this.setImport("referenceDesigns", true); + this.setImport("images", true); + this.mixins.observable.constructor.call(this, config); }, + setImport: function (item, flag) { + this.import[item] = flag; + }, setPart: function (part) { this.part = part; }, + /** + * Loads the data via the PartKeepr API from OctoPart. + * + * @param {String} id The OctoPart UID to load + */ loadData: function (id) { Ext.Ajax.request({ url: PartKeepr.getBasePath() + '/api/octopart/get/' + id, - success: this.onPartLoaded, + success: this.onPartDataLoaded, scope: this }); }, - onPartLoaded: function (response) + /** + * Called after the OctoPart Part data has been loaded. + * + * @param {Object} response The response data + */ + onPartDataLoaded: function (response) { - var data = Ext.decode(response.responseText); - - this.data = data; + this.data = Ext.decode(response.responseText); this.applyData(); }, @@ -32,7 +53,8 @@ Ext.define("PartKeepr.Components.OctoPart.DataApplicator", { var manufacturer = PartKeepr.getApplication().getManufacturerStore().findRecord("name", this.data.manufacturer.name); - if (manufacturer === null) { + if (manufacturer === null) + { this.displayWaitWindow(i18n("Creating Manufacturer…"), this.data.manufacturer.name); manufacturer = Ext.create("PartKeepr.ManufacturerBundle.Entity.Manufacturer"); manufacturer.set("name", this.data.manufacturer.name); @@ -50,19 +72,54 @@ Ext.define("PartKeepr.Components.OctoPart.DataApplicator", { return false; } - for (i in this.data.specs) { - if (this.data.specs[i].metadata.unit !== null) { - unit = PartKeepr.getApplication().getUnitStore().findRecord("symbol", - this.data.specs[i].metadata.unit.symbol, 0, false, true, true); - if (unit === null) { - this.displayWaitWindow(i18n("Creating Unit…"), this.data.specs[i].metadata.unit.name); - unit = Ext.create("PartKeepr.UnitBundle.Entity.Unit"); - unit.set("name", this.data.specs[i].metadata.unit.name); - unit.set("symbol", this.data.specs[i].metadata.unit.symbol); - unit.save({ + if (this.import.parameters) + { + for (i in this.data.specs) + { + if (this.data.specs[i].metadata.unit !== null) + { + unit = PartKeepr.getApplication().getUnitStore().findRecord("symbol", + this.data.specs[i].metadata.unit.symbol, 0, false, true, true); + if (unit === null) + { + this.displayWaitWindow(i18n("Creating Unit…"), this.data.specs[i].metadata.unit.name); + unit = Ext.create("PartKeepr.UnitBundle.Entity.Unit"); + unit.set("name", this.data.specs[i].metadata.unit.name); + unit.set("symbol", this.data.specs[i].metadata.unit.symbol); + unit.save({ + success: function () + { + PartKeepr.getApplication().getUnitStore().load({ + callback: this.applyData, + scope: this + }); + }, + scope: this + + }); + return false; + } + } + } + } + + if (this.import.distributors) + { + for (i in this.data.offers) + { + distributor = PartKeepr.getApplication().getDistributorStore().findRecord("name", + this.data.offers[i].seller.name, 0, false, true, true); + + if (distributor === null) + { + this.displayWaitWindow(i18n("Creating Distributor…"), this.data.offers[i].seller.name); + distributor = Ext.create("PartKeepr.DistributorBundle.Entity.Distributor"); + distributor.set("name", this.data.offers[i].seller.name); + distributor.set("website", this.data.offers[i].seller.homepage_url); + distributor.save({ success: function () { - PartKeepr.getApplication().getUnitStore().load({ + PartKeepr.getApplication().getDistributorStore().load({ callback: this.applyData, scope: this }); @@ -75,108 +132,124 @@ Ext.define("PartKeepr.Components.OctoPart.DataApplicator", { } } - for (i in this.data.offers) { - distributor = PartKeepr.getApplication().getDistributorStore().findRecord("name", - this.data.offers[i].seller.name, 0, false, true, true); - - if (distributor === null) { - this.displayWaitWindow(i18n("Creating Distributor…"), this.data.offers[i].seller.name); - distributor = Ext.create("PartKeepr.DistributorBundle.Entity.Distributor"); - distributor.set("name", this.data.offers[i].seller.name); - distributor.set("website", this.data.offers[i].seller.homepage_url); - distributor.save({ - success: function () - { - PartKeepr.getApplication().getDistributorStore().load({ - callback: this.applyData, - scope: this - }); - }, - scope: this + if (this.import.datasheets) + { + if (this.data.datasheets.length > 0) + { + file = this.data.datasheets.shift(); + this.displayWaitWindow(i18n("Uploading datasheet…"), file.url); - }); - return false; - } - } - - if (this.data.datasheets.length > 0) { - file = this.data.datasheets.shift(); - this.displayWaitWindow(i18n("Uploading datasheet…"), file.url); + if (!this.checkIfAttachmentFilenameExists(file.url)) + { + PartKeepr.getApplication().uploadFileFromURL(file.url, i18n("Datasheet"), this.onFileUploaded, + this); + } else + { + this.applyData(); + } - if (!this.checkIfAttachmentFilenameExists(file.url)) { - PartKeepr.getApplication().uploadFileFromURL(file.url, i18n("Datasheet"), this.onFileUploaded, this); - } else { - this.applyData(); + return false; } - - return false; } - if (this.data.cad_models.length > 0) { - file = this.data.cad_models.shift(); - this.displayWaitWindow(i18n("Uploading CAD Model…"), file.url); - if (!this.checkIfAttachmentFilenameExists(file.url)) { - PartKeepr.getApplication().uploadFileFromURL(file.url, i18n("CAD Model"), this.onFileUploaded, this); - } else { - this.applyData(); + if (this.import.cadModels) + { + if (this.data.cad_models.length > 0) + { + file = this.data.cad_models.shift(); + this.displayWaitWindow(i18n("Uploading CAD Model…"), file.url); + if (!this.checkIfAttachmentFilenameExists(file.url)) + { + PartKeepr.getApplication().uploadFileFromURL(file.url, i18n("CAD Model"), this.onFileUploaded, + this); + } else + { + this.applyData(); + } + return false; } - return false; } - if (this.data.compliance_documents.length > 0) { - file = this.data.compliance_documents.shift(); - this.displayWaitWindow(i18n("Uploading Compliance Document…"), file.url); - if (!this.checkIfAttachmentFilenameExists(file.url)) { - PartKeepr.getApplication().uploadFileFromURL(file.url, i18n("Compliance Document"), this.onFileUploaded, - this); - } else { - this.applyData(); + if (this.import.complianceDocuments) + { + if (this.data.compliance_documents.length > 0) + { + file = this.data.compliance_documents.shift(); + this.displayWaitWindow(i18n("Uploading Compliance Document…"), file.url); + if (!this.checkIfAttachmentFilenameExists(file.url)) + { + PartKeepr.getApplication().uploadFileFromURL(file.url, i18n("Compliance Document"), + this.onFileUploaded, + this); + } else + { + this.applyData(); + } + return false; } - return false; } - if (this.data.reference_designs.length > 0) { - file = this.data.reference_designs.shift(); - this.displayWaitWindow(i18n("Uploading Reference Designs…"), file.url); - if (!this.checkIfAttachmentFilenameExists(file.url)) { - PartKeepr.getApplication().uploadFileFromURL(file.url, i18n("Reference Design"), this.onFileUploaded, - this); - } else { - this.applyData(); + if (this.import.referenceDesigns) + { + if (this.data.reference_designs.length > 0) + { + file = this.data.reference_designs.shift(); + this.displayWaitWindow(i18n("Uploading Reference Designs…"), file.url); + if (!this.checkIfAttachmentFilenameExists(file.url)) + { + PartKeepr.getApplication().uploadFileFromURL(file.url, i18n("Reference Design"), + this.onFileUploaded, + this); + } else + { + this.applyData(); + } + return false; } - return false; } - if (this.data.imagesets.length > 0) { - file = this.data.imagesets.shift(); - image = null; + if (this.import.images) + { + if (this.data.imagesets.length > 0) + { + file = this.data.imagesets.shift(); + image = null; - if (file.swatch_image !== null) { - image = file.swatch_image; - } + if (file.swatch_image !== null) + { + image = file.swatch_image; + } - if (file.small_image !== null) { - image = file.small_image; - } + if (file.small_image !== null) + { + image = file.small_image; + } - if (file.medium_image !== null) { - image = file.medium_image; - } + if (file.medium_image !== null) + { + image = file.medium_image; + } - if (file.large_image !== null) { - image = file.large_image; - } + if (file.large_image !== null) + { + image = file.large_image; + } - if (image !== null) { - this.displayWaitWindow(i18n("Uploading Image…"), image.url); - if (!this.checkIfAttachmentFilenameExists(image.url)) { - PartKeepr.getApplication().uploadFileFromURL(image.url, i18n("Image"), this.onFileUploaded, this); - } else { - this.applyData(); + if (image !== null) + { + this.displayWaitWindow(i18n("Uploading Image…"), image.url); + if (!this.checkIfAttachmentFilenameExists(image.url)) + { + PartKeepr.getApplication().uploadFileFromURL(image.url, i18n("Image"), this.onFileUploaded, + this); + } else + { + this.applyData(); + } } - } - return false; + return false; + } } @@ -188,8 +261,10 @@ Ext.define("PartKeepr.Components.OctoPart.DataApplicator", { found = false; - for (k = 0; k < this.part.attachments().count(); k++) { - if (this.part.attachments().getAt(k).get("originalFilename") == filename) { + for (k = 0; k < this.part.attachments().count(); k++) + { + if (this.part.attachments().getAt(k).get("originalFilename") === filename) + { found = true; } } @@ -198,7 +273,8 @@ Ext.define("PartKeepr.Components.OctoPart.DataApplicator", { }, onFileUploaded: function (options, success, response) { - if (success) { + if (success) + { var result = Ext.decode(response.responseText); var uploadedFile = Ext.create("PartKeepr.UploadedFileBundle.Entity.TempUploadedFile", result.response); @@ -216,18 +292,20 @@ Ext.define("PartKeepr.Components.OctoPart.DataApplicator", { width: 300, wait: { interval: 100 - }, + } }); }, applyData: function () { var spec, i, unit, value, siPrefix, distributor, j, partDistributor, currency, k, found; - if (this.waitMessage instanceof Ext.window.MessageBox) { + if (this.waitMessage instanceof Ext.window.MessageBox) + { this.waitMessage.hide(); } - if (!this.checkRequirements()) { + if (!this.checkRequirements()) + { return; } @@ -238,7 +316,8 @@ Ext.define("PartKeepr.Components.OctoPart.DataApplicator", { this.data.manufacturer.name); var partManufacturer; - if (manufacturer === null) { + if (manufacturer === null) + { // @todo put out error message } @@ -248,113 +327,140 @@ Ext.define("PartKeepr.Components.OctoPart.DataApplicator", { found = null; - for (k = 0; k < this.part.manufacturers().count(); k++) { + for (k = 0; k < this.part.manufacturers().count(); k++) + { if (this.part.manufacturers().getAt(k).isPartiallyEqualTo(partManufacturer, - ["manufacturer.name"])) { + ["manufacturer.name"])) + { found = this.part.manufacturers().getAt(k); } } - if (found !== null) { + if (found !== null) + { found.set("partNumber", this.data.mpn); - } else { + } else + { this.part.manufacturers().add(partManufacturer); } - for (i = 0; i < this.data.offers.length; i++) { - distributor = PartKeepr.getApplication().getDistributorStore().findRecord("name", - this.data.offers[i].seller.name, 0, false, true, true); - if (distributor === null) { - // @todo put out error message - continue; - } + if (this.import.distributors) + { + for (i = 0; i < this.data.offers.length; i++) + { + distributor = PartKeepr.getApplication().getDistributorStore().findRecord("name", + this.data.offers[i].seller.name, 0, false, true, true); + if (distributor === null) + { + // @todo put out error message + continue; + } + + for (currency in this.data.offers[i].prices) + { + for (j = 0; j < this.data.offers[i].prices[currency].length; j++) + { + partDistributor = Ext.create("PartKeepr.PartBundle.Entity.PartDistributor"); + partDistributor.setDistributor(distributor); + partDistributor.set("sku", this.data.offers[i].sku); + partDistributor.set("packagingUnit", this.data.offers[i].prices[currency][j][0]); + partDistributor.set("currency", currency); + partDistributor.set("price", this.data.offers[i].prices[currency][j][1]); + + found = null; - for (currency in this.data.offers[i].prices) { - for (j = 0; j < this.data.offers[i].prices[currency].length; j++) { - partDistributor = Ext.create("PartKeepr.PartBundle.Entity.PartDistributor"); - partDistributor.setDistributor(distributor); - partDistributor.set("sku", this.data.offers[i].sku); - partDistributor.set("packagingUnit", this.data.offers[i].prices[currency][j][0]); - partDistributor.set("currency", currency); - partDistributor.set("price", this.data.offers[i].prices[currency][j][1]); - - found = null; - - for (k = 0; k < this.part.distributors().count(); k++) { - if (partDistributor.isPartiallyEqualTo( - this.part.distributors().getAt(k), - ["sku", "packagingUnit", "currency", "distributor.name"] - )) { - found = this.part.distributors().getAt(k); + for (k = 0; k < this.part.distributors().count(); k++) + { + if (partDistributor.isPartiallyEqualTo( + this.part.distributors().getAt(k), + ["sku", "packagingUnit", "currency", "distributor.name"] + )) + { + found = this.part.distributors().getAt(k); + } } - } - if (found !== null) { - found.set("price", this.data.offers[i].prices[currency][j][1]); - } else { - this.part.distributors().add(partDistributor); + if (found !== null) + { + found.set("price", this.data.offers[i].prices[currency][j][1]); + } else + { + this.part.distributors().add(partDistributor); + } } } } } - for (i in this.data.specs) { - spec = Ext.create("PartKeepr.PartBundle.Entity.PartParameter"); - spec.set("name", this.data.specs[i].metadata.name); + if (this.import.parameters) + { + for (i in this.data.specs) + { + spec = Ext.create("PartKeepr.PartBundle.Entity.PartParameter"); + spec.set("name", this.data.specs[i].metadata.name); - if (this.data.specs[i].metadata.unit !== null) { - unit = PartKeepr.getApplication().getUnitStore().findRecord("symbol", - this.data.specs[i].metadata.unit.symbol, 0, false, true, true); + if (this.data.specs[i].metadata.unit !== null) + { + unit = PartKeepr.getApplication().getUnitStore().findRecord("symbol", + this.data.specs[i].metadata.unit.symbol, 0, false, true, true); - spec.setUnit(unit); - } + spec.setUnit(unit); + } - switch (this.data.specs[i].metadata.datatype) { - case "string": - spec.set("valueType", "string"); - spec.set("stringValue", this.data.specs[i].value[0]); - break; - case "decimal": - case "integer": - spec.set("valueType", "numeric"); - - if (this.data.specs[i].min_value !== null) { - value = parseFloat(this.data.specs[i].min_value); - siPrefix = this.findSiPrefixForValueAndUnit(value, unit); - spec.set("minValue", this.applySiPrefix(value, siPrefix)); - spec.setMinSiPrefix(siPrefix); - } + switch (this.data.specs[i].metadata.datatype) + { + case "string": + spec.set("valueType", "string"); + spec.set("stringValue", this.data.specs[i].value[0]); + break; + case "decimal": + case "integer": + spec.set("valueType", "numeric"); + + if (this.data.specs[i].min_value !== null) + { + value = parseFloat(this.data.specs[i].min_value); + siPrefix = this.findSiPrefixForValueAndUnit(value, unit); + spec.set("minValue", this.applySiPrefix(value, siPrefix)); + spec.setMinSiPrefix(siPrefix); + } - if (this.data.specs[i].max_value !== null) { - value = parseFloat(this.data.specs[i].max_value); - siPrefix = this.findSiPrefixForValueAndUnit(value, unit); - spec.set("maxValue", this.applySiPrefix(value, siPrefix)); - spec.setMaxSiPrefix(siPrefix); - } + if (this.data.specs[i].max_value !== null) + { + value = parseFloat(this.data.specs[i].max_value); + siPrefix = this.findSiPrefixForValueAndUnit(value, unit); + spec.set("maxValue", this.applySiPrefix(value, siPrefix)); + spec.setMaxSiPrefix(siPrefix); + } - if (this.data.specs[i].value.length === 1) { - value = parseFloat(this.data.specs[i].value[0]); - siPrefix = this.findSiPrefixForValueAndUnit(value, unit); - spec.set("value", this.applySiPrefix(value, siPrefix)); - spec.setSiPrefix(siPrefix); - } + if (this.data.specs[i].value.length === 1) + { + value = parseFloat(this.data.specs[i].value[0]); + siPrefix = this.findSiPrefixForValueAndUnit(value, unit); + spec.set("value", this.applySiPrefix(value, siPrefix)); + spec.setSiPrefix(siPrefix); + } - break; - } + break; + } - found = null; + found = null; - for (k = 0; k < this.part.parameters().count(); k++) { - if (spec.isPartiallyEqualTo( - this.part.parameters().getAt(k), - ["name"] - )) { - found = this.part.parameters().getAt(k); + for (k = 0; k < this.part.parameters().count(); k++) + { + if (spec.isPartiallyEqualTo( + this.part.parameters().getAt(k), + ["name"] + )) + { + found = this.part.parameters().getAt(k); + } } - } - if (found === null) { - this.part.parameters().add(spec); + if (found === null) + { + this.part.parameters().add(spec); + } } } @@ -366,21 +472,24 @@ Ext.define("PartKeepr.Components.OctoPart.DataApplicator", { }, findSiPrefixForValueAndUnit: function (value, unit) { - var i = 0, prefixedValue, siPrefix; + var i, prefixedValue, siPrefix; siPrefix = PartKeepr.getApplication().getSiPrefixStore().findRecord("exponent", 0, 0, false, false, true); - if (!(unit instanceof PartKeepr.UnitBundle.Entity.Unit)) { + if (!(unit instanceof PartKeepr.UnitBundle.Entity.Unit)) + { return siPrefix; } unit.prefixes().sort("exponent", "desc"); - for (i = 0; i < unit.prefixes().getCount(); i++) { + for (i = 0; i < unit.prefixes().getCount(); i++) + { siPrefix = unit.prefixes().getAt(i); prefixedValue = Math.abs(this.applySiPrefix(value, siPrefix)); - if (prefixedValue < 1000 && prefixedValue > 0.9) { + if (prefixedValue < 1000 && prefixedValue > 0.9) + { break; } } diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/SearchPanel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/SearchPanel.js @@ -15,7 +15,7 @@ Ext.define("PartKeepr.Components.OctoPart.SearchPanel", { {name: 'mpn', type: 'string'}, {name: 'numOffers', type: 'int'}, {name: 'numDatasheets', type: 'int'}, - {name: 'numSpecs', type: 'int'}, + {name: 'numSpecs', type: 'int'} ], proxy: { type: 'ajax', @@ -52,15 +52,15 @@ Ext.define("PartKeepr.Components.OctoPart.SearchPanel", { text: i18n("Offers"), dataIndex: 'numOffers', flex: 1 - },{ + }, { text: i18n("Datasheets"), dataIndex: 'numDatasheets', flex: 1 - },{ + }, { text: i18n("Parameters"), dataIndex: 'numSpecs', flex: 1 - },{ + }, { text: i18n("Details…"), dataIndex: 'url', renderer: function (v) @@ -82,6 +82,47 @@ Ext.define("PartKeepr.Components.OctoPart.SearchPanel", { scope: this }); + this.grid.addDocked(Ext.create("Ext.toolbar.Toolbar", { + dock: 'bottom', + enableOverflow: true, + items: [{ + xtype: 'checkbox', + itemId: "importDistributors", + checked: PartKeepr.getApplication().getUserPreference("partkeepr.octopart.importDistributors", true), + boxLabel: i18n("Distributors") + }, { + xtype: 'checkbox', + itemId: "importParameters", + checked: PartKeepr.getApplication().getUserPreference("partkeepr.octopart.importParameters", true), + boxLabel: i18n("Parameters") + }, { + xtype: 'checkbox', + itemId: "importDatasheets", + checked: PartKeepr.getApplication().getUserPreference("partkeepr.octopart.importDatasheets", true), + boxLabel: i18n("Datasheets") + }, { + xtype: 'checkbox', + itemId: "importCADModels", + checked: PartKeepr.getApplication().getUserPreference("partkeepr.octopart.importCADModels", true), + boxLabel: i18n("CAD Models") + }, { + xtype: 'checkbox', + itemId: "importComplianceDocuments", + checked: PartKeepr.getApplication().getUserPreference("partkeepr.octopart.importComplianceDocuments", true), + boxLabel: i18n("Compliance Documents") + }, { + xtype: 'checkbox', + itemId: "importReferenceDesigns", + checked: PartKeepr.getApplication().getUserPreference("partkeepr.octopart.importReferenceDesigns", true), + boxLabel: i18n("Reference Designs") + }, { + xtype: 'checkbox', + itemId: "importImages", + checked: PartKeepr.getApplication().getUserPreference("partkeepr.octopart.importImages", true), + boxLabel: i18n("Images") + }] + })); + this.grid.addDocked(Ext.create("Ext.toolbar.Paging", { store: this.store, enableOverflow: true, @@ -91,6 +132,8 @@ Ext.define("PartKeepr.Components.OctoPart.SearchPanel", { items: this.addButton })); + + this.searchBar = Ext.create("Ext.form.field.Text", { region: 'north', height: 30, @@ -98,7 +141,8 @@ Ext.define("PartKeepr.Components.OctoPart.SearchPanel", { listeners: { specialkey: function (field, e) { - if (e.getKey() == e.ENTER) { + if (e.getKey() === e.ENTER) + { this.startSearch(field.getValue()); } @@ -137,8 +181,19 @@ Ext.define("PartKeepr.Components.OctoPart.SearchPanel", { applyData: function (record) { var j = Ext.create("PartKeepr.Components.OctoPart.DataApplicator"); + j.setPart(this.part); + + j.setImport("distributors", this.down("#importDistributors").getValue()); + j.setImport("parameters", this.down("#importParameters").getValue()); + j.setImport("datasheets", this.down("#importDatasheets").getValue()); + j.setImport("cadModels", this.down("#importCADModels").getValue()); + j.setImport("complianceDocuments", this.down("#importComplianceDocuments").getValue()); + j.setImport("referenceDesigns", this.down("#importReferenceDesigns").getValue()); + j.setImport("images", this.down("#importImages").getValue()); + j.loadData(record.get("uid")); + j.on("refreshData", function () { this.fireEvent("refreshData"); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/SearchWindow.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/SearchWindow.js @@ -2,7 +2,7 @@ Ext.define("PartKeepr.Components.OctoPart.SearchWindow", { extend: "Ext.window.Window", title: i18n("OctoPart Search"), iconCls: "partkeepr-icon octopart", - width: 600, + width: 750, height: 300, layout: 'fit', modal: true, diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditorWindow.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditorWindow.js @@ -13,7 +13,7 @@ Ext.define('PartKeepr.PartEditorWindow', { layout: 'fit', /* Width and height settings */ - width: 600, + width: 750, minWidth: 600, minHeight: 435, height: 435, diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsGrid.js @@ -194,7 +194,7 @@ Ext.define('PartKeepr.PartsGrid', { fn: function () { var searchBox = this.searchField; - if (Ext.get(document).activeElement != searchBox) { + if (Ext.get(document).activeElement !== searchBox) { searchBox.focus('', 10); } searchBox.setValue(''); @@ -209,7 +209,7 @@ Ext.define('PartKeepr.PartsGrid', { _updateAddTemplateButton: function () { /* Right now, we support delete on a single record only */ - if (this.getSelectionModel().getCount() == 1) { + if (this.getSelectionModel().getCount() === 1) { this.addFromTemplateButton.enable(); } else { this.addFromTemplateButton.disable(); @@ -458,7 +458,7 @@ Ext.define('PartKeepr.PartsGrid', { */ handleStockFieldEdit: function (e) { - if (PartKeepr.getApplication().getUserPreference("partkeepr.inline-stock-change.confirm") === false) { + if (PartKeepr.getApplication().getUserPreference("partkeepr.inline-stock-change.confirm", true) === false) { this.handleStockChange(e); } else { this.confirmStockChange(e); @@ -546,7 +546,7 @@ Ext.define('PartKeepr.PartsGrid', { */ afterConfirmStockChange: function (buttonId, text, opts) { - if (buttonId == "cancel") { + if (buttonId === "cancel") { opts.originalOnEdit.record.set("stockLevel", opts.originalOnEdit.originalValue); return; } diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Preferences/Panel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Preferences/Panel.js @@ -0,0 +1,93 @@ +Ext.define('PartKeepr.Components.Preferences.Panel', { + extend: 'Ext.panel.Panel', + layout: 'border', + + getSettingClasses: function () { + + }, + initComponent: function () + { + var settings = this.getSettingClasses(); + + var settingItems = [], item; + + settingItems.push(Ext.create("Ext.panel.Panel", { + layout: "center", + items: { + width: "100%", + border: false, + bodyStyle: "text-align: center;", + html: "<h1>" + i18n("Select an item to edit") + "</h1>" + } + })); + + for (var i = 0; i < settings; i++) { + item = Ext.create(settings[i]); + settingItems.push(item); + } + + this.navigation = Ext.create("PartKeepr.Components.Preferences.Tree", + { + menuItems: settings, + region: "west", + width: 200 + }); + + this.navigation.on("itemclick", function (record, item) + { + if (typeof item.data.target === "function") { + this.openSettingsItem(item.data.target.$className); + } + }, this); + + this.cards = Ext.create("Ext.panel.Panel", { + region: 'center', + layout: 'card', + items: settingItems + }); + + this.items = [ + this.navigation, + this.cards + ]; + + this.callParent(); + }, + openSettingsItem: function (target) + { + var targetClass = Ext.ClassManager.get(target); + + var config = { + title: targetClass.title, + closable: targetClass.closable, + iconCls: targetClass.iconCls, + listeners: { + editorClose: function (cmp) { + this.closeEditor(cmp); + }, + scope: this + } + }; + + for (var i = 0; i < this.cards.items.length; i++) { + if (this.cards.items.getAt(i).$className === targetClass.$className) { + this.cards.setActiveItem(this.cards.items.getAt(i)); + return; + } + } + + var j = Ext.create(target, config); + this.cards.items.add(j); + this.cards.setActiveItem(j); + + }, + closeEditor: function (cmp) { + this.cards.setActiveItem(this.cards.items.getAt(0)); + + for (var i = 0; i < this.cards.items.length; i++) { + if (this.cards.items.getAt(i).$className === cmp.$className) { + this.cards.remove(cmp); + } + } + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Preferences/PreferenceEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Preferences/PreferenceEditor.js @@ -0,0 +1,58 @@ +Ext.define('PartKeepr.Components.Preferences.PreferenceEditor', { + extend: 'Ext.form.Panel', + trackResetOnLoad: true, + bodyPadding: 10, + saveText: i18n("Save"), + cancelText: i18n("Cancel"), + layout: 'anchor', + change: false, + border: false, + scrollable: true, + autoScroll: true, + defaults: { + anchor: '100%', + labelWidth: 150 + }, + enableButtons: true, + titleProperty: 'name', + + initComponent: function () + { + if (this.enableButtons) { + this.saveButton = Ext.create("Ext.button.Button", { + text: this.saveText, + iconCls: 'fugue-icon disk', + handler: Ext.bind(this.onSave, this) + }); + + this.cancelButton = Ext.create("Ext.button.Button", { + text: this.cancelText, + iconCls: 'web-icon cancel', + handler: Ext.bind(this.onCancelEdit, this) + }); + + this.bottomToolbar = Ext.create("Ext.toolbar.Toolbar", { + enableOverflow: true, + margin: '10px', + defaults: {minWidth: 100}, + dock: 'bottom', + ui: 'footer', + items: [this.saveButton, this.cancelButton] + }); + + Ext.apply(this, { + dockedItems: [this.bottomToolbar] + }); + } + + this.callParent(); + }, + onCancelEdit: function () + { + this.fireEvent("editorClose", this); + }, + onSave: function () + { + console.log("You need to override PreferenceEditor::onSave"); + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Preferences/Tree.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Preferences/Tree.js @@ -0,0 +1,67 @@ +Ext.define('PartKeepr.Components.Preferences.Tree', { + extend: 'Ext.tree.Panel', + width: 400, + rootVisible: false, + initComponent: function (config) { + var menu = { + root: { + expanded: true, + children: [] + } + }; + + var target, menuItemIterator; + + for (menuItemIterator = 0; menuItemIterator < this.menuItems.length; menuItemIterator++) { + target = Ext.ClassManager.get(this.menuItems[menuItemIterator]); + + if (!target) { + console.log("Error: " + this.menuItems[menuItemIterator] + " not found!"); + } + + if (!target.menuPath) { + console.log("Error: " + this.menuItems[menuItemIterator] + " has no menuPath defined!"); + } + + this.createMenu(target, Ext.clone(target.menuPath), menu.root); + } + + this.store = Ext.create('Ext.data.TreeStore', menu); + + this.callParent(this, config); + }, + + createMenu: function (target, menuPath, root) { + var item = menuPath.shift(); + var newItem; + + if (item === undefined) { + newItem = {text: target.title, iconCls: target.iconCls, expanded: true, target: target, leaf: true}; + + root.children.push(newItem); + return root; + } + + var foundItem = false; + + for (var i = 0; i < root.children.length; i++) { + if (root.children[i].text === item.text) { + Ext.applyIf(root.children[i], item); + foundItem = i; + } + } + + if (foundItem === false) { + newItem = {children: [], expanded: true}; + + Ext.applyIf(newItem, item); + + var data = this.createMenu(target, menuPath, newItem); + root.children.push(data); + } else { + this.createMenu(target, menuPath, root.children[foundItem]); + } + + return root; + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Panel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Panel.js @@ -1,11 +1,9 @@ Ext.define('PartKeepr.Components.SystemPreferences.Panel', { - extend: 'Ext.panel.Panel', + extend: 'PartKeepr.Components.Preferences.Panel', title: i18n("System Preferences"), - layout: 'border', - initComponent: function () - { - var settings = [ + getSettingClasses: function () { + return [ "PartKeepr.Components.SystemPreferences.Preferences.FulltextSearch", "PartKeepr.Components.SystemPreferences.Preferences.RequiredPartFields", "PartKeepr.Components.SystemPreferences.Preferences.RequiredPartManufacturerFields", @@ -13,87 +11,6 @@ Ext.define('PartKeepr.Components.SystemPreferences.Panel', { "PartKeepr.Components.SystemPreferences.Preferences.BarcodeScannerConfiguration", "PartKeepr.Components.SystemPreferences.Preferences.ActionsConfiguration" ]; - - var settingItems = [], item; - - settingItems.push(new Ext.create("Ext.panel.Panel", { - layout: "center", - items: { - width: "100%", - border: false, - bodyStyle: "text-align: center;", - html: "<h1>" + i18n("Select an item to edit") + "</h1>" - } - })); - - for (var i = 0; i < settings; i++) { - item = Ext.create(settings[i]); - settingItems.push(item); - } - - this.navigation = Ext.create("PartKeepr.Components.SystemPreferences.Tree", - { - menuItems: settings, - region: "west", - width: 200 - }); - - this.navigation.on("itemclick", function (record, item) - { - if (typeof item.data.target === "function") { - this.openSettingsItem(item.data.target.$className); - } - }, this); - - this.cards = Ext.create("Ext.panel.Panel", { - region: 'center', - layout: 'card', - items: settingItems - }); - - this.items = [ - this.navigation, - this.cards - ]; - - this.callParent(); - }, - openSettingsItem: function (target) - { - var targetClass = Ext.ClassManager.get(target); - - var config = { - title: targetClass.title, - closable: targetClass.closable, - iconCls: targetClass.iconCls, - listeners: { - editorClose: function (cmp) { - this.closeEditor(cmp); - }, - scope: this - } - }; - - for (var i = 0; i < this.cards.items.length; i++) { - if (this.cards.items.getAt(i).$className === targetClass.$className) { - this.cards.setActiveItem(this.cards.items.getAt(i)); - return; - } - } - - var j = Ext.create(target, config); - this.cards.items.add(j); - this.cards.setActiveItem(j); - - }, - closeEditor: function (cmp) { - this.cards.setActiveItem(this.cards.items.getAt(0)); - - for (var i = 0; i < this.cards.items.length; i++) { - if (this.cards.items.getAt(i).$className === cmp.$className) { - this.cards.remove(cmp); - } - } }, statics: { iconCls: 'fugue-icon gear', diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/PreferenceEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/PreferenceEditor.js @@ -1,58 +0,0 @@ -Ext.define('PartKeepr.Components.SystemPreferences.PreferenceEditor', { - extend: 'Ext.form.Panel', - trackResetOnLoad: true, - bodyPadding: 10, - saveText: i18n("Save"), - cancelText: i18n("Cancel"), - layout: 'anchor', - change: false, - border: false, - scrollable: true, - autoScroll: true, - defaults: { - anchor: '100%', - labelWidth: 150 - }, - enableButtons: true, - titleProperty: 'name', - - initComponent: function () - { - if (this.enableButtons) { - this.saveButton = Ext.create("Ext.button.Button", { - text: this.saveText, - iconCls: 'fugue-icon disk', - handler: Ext.bind(this.onSave, this) - }); - - this.cancelButton = Ext.create("Ext.button.Button", { - text: this.cancelText, - iconCls: 'web-icon cancel', - handler: Ext.bind(this.onCancelEdit, this) - }); - - this.bottomToolbar = Ext.create("Ext.toolbar.Toolbar", { - enableOverflow: true, - margin: '10px', - defaults: {minWidth: 100}, - dock: 'bottom', - ui: 'footer', - items: [this.saveButton, this.cancelButton] - }); - - Ext.apply(this, { - dockedItems: [this.bottomToolbar] - }); - } - - this.callParent(); - }, - onCancelEdit: function () - { - this.fireEvent("editorClose", this); - }, - onSave: function () - { - console.log("You need to override PreferenceEditor::onSave"); - } -}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/ActionsConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/ActionsConfiguration.js @@ -1,5 +1,5 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.ActionsConfiguration', { - extend: 'PartKeepr.Components.SystemPreferences.PreferenceEditor', + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', initComponent: function () { @@ -50,7 +50,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.ActionsConfigurat queryMode: 'local', editable: false, forceSelection: true, - valueField: 'model', + valueField: 'model' } }, { header: i18n("Action"), @@ -69,7 +69,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.ActionsConfigurat displayField: 'name', editable: false, forceSelection: true, - valueField: '@id', + valueField: '@id' }, renderer: this.renderBatchJob, scope: this @@ -91,7 +91,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.ActionsConfigurat ] } ] - }, + } ]; this.callParent(arguments); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/BarcodeScannerConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/BarcodeScannerConfiguration.js @@ -1,5 +1,5 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.BarcodeScannerConfiguration', { - extend: 'PartKeepr.Components.SystemPreferences.PreferenceEditor', + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', initComponent: function () { @@ -7,7 +7,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.BarcodeScannerCon { xtype: 'checkbox', boxLabel: "Ctrl", - itemId: 'barcodeScannerModifierCtrl', + itemId: 'barcodeScannerModifierCtrl' }, { xtype: 'checkbox', @@ -57,7 +57,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.BarcodeScannerCon }); this.editing = Ext.create('Ext.grid.plugin.RowEditing', { - clicksToEdit: 1, + clicksToEdit: 1 }); @@ -86,7 +86,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.BarcodeScannerCon } }, editor: { - xtype: 'barcodescannerActions', + xtype: 'barcodescannerActions' } }, { text: i18n("Description"), @@ -125,7 +125,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.BarcodeScannerCon } ] } - ], + ] }); this.barcodeScannerActionsGrid.getSelectionModel().on("select", this._onItemSelect, this); @@ -250,7 +250,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.BarcodeScannerCon _updateDeleteButton: function () { /* Right now, we support delete on a single record only */ - if (this.barcodeScannerActionsGrid.getSelectionModel().getCount() == 1) { + if (this.barcodeScannerActionsGrid.getSelectionModel().getCount() === 1) { this.deleteButton.enable(); } else { this.deleteButton.disable(); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/FulltextSearch.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/FulltextSearch.js @@ -1,5 +1,5 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.FulltextSearch', { - extend: 'PartKeepr.Components.SystemPreferences.PreferenceEditor', + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', initComponent: function () { diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartDistributorFields.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartDistributorFields.js @@ -1,5 +1,5 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.RequiredPartDistributorFields', { - extend: 'PartKeepr.Components.SystemPreferences.PreferenceEditor', + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', initComponent: function () { @@ -23,7 +23,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.RequiredPartDistr { border: false, html: "The field <strong>Distributor</strong> is always required.", - style: "padding-top: 4px; padding-bottom: 5px;", + style: "padding-top: 4px; padding-bottom: 5px;" }, this.fieldSelector ] diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartFields.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartFields.js @@ -1,5 +1,5 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.RequiredPartFields', { - extend: 'PartKeepr.Components.SystemPreferences.PreferenceEditor', + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', initComponent: function () { @@ -30,7 +30,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.RequiredPartField { border: false, html: "The fields <strong>Name</strong>, <strong>Category</strong> and <strong>Storage Location</strong> are always required.", - style: "padding-top: 4px; padding-bottom: 5px;", + style: "padding-top: 4px; padding-bottom: 5px;" }, this.fieldSelector ] diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartManufacturerFields.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartManufacturerFields.js @@ -1,5 +1,5 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.RequiredPartManufacturerFields', { - extend: 'PartKeepr.Components.SystemPreferences.PreferenceEditor', + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', initComponent: function () { @@ -23,7 +23,7 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.RequiredPartManuf { border: false, html: "The field <strong>Manufacturer</strong> is always required.", - style: "padding-top: 4px; padding-bottom: 5px;", + style: "padding-top: 4px; padding-bottom: 5px;" }, this.fieldSelector ] diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Tree.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Tree.js @@ -1,67 +0,0 @@ -Ext.define('PartKeepr.Components.SystemPreferences.Tree', { - extend: 'Ext.tree.Panel', - width: 400, - rootVisible: false, - initComponent: function (config) { - var menu = { - root: { - expanded: true, - children: [] - } - }; - - var target, menuItemIterator; - - for (menuItemIterator = 0; menuItemIterator < this.menuItems.length; menuItemIterator++) { - target = Ext.ClassManager.get(this.menuItems[menuItemIterator]); - - if (!target) { - console.log("Error: " + this.menuItems[menuItemIterator] + " not found!"); - } - - if (!target.menuPath) { - console.log("Error: " + this.menuItems[menuItemIterator] + " has no menuPath defined!"); - } - - this.createMenu(target, Ext.clone(target.menuPath), menu.root); - } - - this.store = Ext.create('Ext.data.TreeStore', menu); - - this.callParent(this, config); - }, - - createMenu: function (target, menuPath, root) { - var item = menuPath.shift(); - var newItem; - - if (item === undefined) { - newItem = {text: target.title, iconCls: target.iconCls, expanded: true, target: target, leaf: true}; - - root.children.push(newItem); - return root; - } - - var foundItem = false; - - for (var i = 0; i < root.children.length; i++) { - if (root.children[i].text == item.text) { - Ext.applyIf(root.children[i], item); - foundItem = i; - } - } - - if (foundItem === false) { - newItem = {children: [], expanded: true}; - - Ext.applyIf(newItem, item); - - var data = this.createMenu(target, menuPath, newItem); - root.children.push(data); - } else { - this.createMenu(target, menuPath, root.children[foundItem]); - } - - return root; - } -});- \ No newline at end of file diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/DisplayPreferencesPanel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/DisplayPreferencesPanel.js @@ -1,76 +0,0 @@ -Ext.define('PartKeepr.DisplayPreferencesPanel', { - extend: 'Ext.form.FormPanel', - title: i18n("Display"), - bodyStyle: 'background:#DBDBDB;padding: 10px;', - initComponent: function () - { - this.showDescriptionsCheckbox = Ext.create("Ext.form.field.Checkbox", { - labelWidth: 120, - hideEmptyLabel: false, - boxLabel: i18n("Show category descriptions"), - handler: Ext.bind(this.showDescriptionsHandler, this) - }); - - if (PartKeepr.getApplication().getUserPreference("partkeepr.categorytree.showdescriptions") == false) { - this.showDescriptionsCheckbox.setValue(false); - } else { - this.showDescriptionsCheckbox.setValue(true); - } - - this.compactLayout = Ext.create("Ext.form.field.Radio", { - boxLabel: i18n( - "Compact Layout") + '<br/> <span class="partkeepr-part-manager-compact"/>', - name: 'rb', - inputValue: 'compact' - }); - - this.standardLayout = Ext.create("Ext.form.field.Radio", { - boxLabel: i18n( - "Standard Layout") + '<br/> <span class="partkeepr-part-manager-standard"/>', - name: 'rb', - inputValue: 'standard' - }); - - if (PartKeepr.getApplication().getUserPreference("partkeepr.partmanager.compactlayout", false) == true) { - this.compactLayout.setValue(true); - } else { - this.standardLayout.setValue(true); - } - this.compactLayoutChooser = Ext.create("Ext.form.RadioGroup", { - fieldLabel: i18n("Part Manager Layout"), - labelWidth: 120, - columns: 2, - width: 400, - vertical: true, - listeners: { - change: function (field, newValue) - { - if (newValue.rb == "standard") { - value = false; - } else { - value = true; - } - - PartKeepr.getApplication().setUserPreference("partkeepr.partmanager.compactlayout", value); - PartKeepr.getApplication().recreatePartManager(); - } - }, - items: [ - this.compactLayout, - this.standardLayout - ] - }); - - this.items = [this.showDescriptionsCheckbox, this.compactLayoutChooser]; - - this.callParent(); - }, - /** - * Handler when the "show descriptions" checkbox is clicked. - */ - showDescriptionsHandler: function (checkbox, checked) - { - PartKeepr.getApplication().setUserPreference("partkeepr.categorytree.showdescriptions", checked); - } -}); - diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/FormattingPreferences.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/FormattingPreferences.js @@ -1,109 +0,0 @@ -/** - * Contains the formatting preferences for various places throughout the system - */ -Ext.define('PartKeepr.FormattingPreferencesPanel', { - extend: 'Ext.form.Panel', - title: i18n("Formatting"), - bodyStyle: 'background:#DBDBDB;padding: 10px;', - - buttonAlign: 'left', - - initComponent: function () - { - - this.createWidgets(); - this.loadDefaults(); - - - this.buttons = [ - { - text: i18n("Save"), - handler: "saveSettings", - scope: this - } - ]; - this.items = [ - this.priceNumDecimalsField, - this.useThousandSeparatorCheckbox, - this.currencySymbolField, - this.currencyAtEndCheckbox - ]; - - this.callParent(); - }, - saveSettings: function () - { - PartKeepr.getApplication().setUserPreference("partkeepr.formatting.currency.numdecimals", - this.priceNumDecimalsField.getValue()); - - PartKeepr.getApplication().setUserPreference("partkeepr.formatting.currency.thousandsSeparator", - this.useThousandSeparatorCheckbox.getValue()); - - PartKeepr.getApplication().setUserPreference("partkeepr.formatting.currency.symbol", - this.currencySymbolField.getValue()); - - PartKeepr.getApplication().setUserPreference( - "partkeepr.formatting.currency.currencySymbolAtEnd", this.currencyAtEndCheckbox.getValue()); - - }, - /** - * Loads the defaults for the user preferences - * - * @param none - * @return nothing - */ - loadDefaults: function () - { - var numDecimals = PartKeepr.getApplication().getUserPreference("partkeepr.formatting.currency.numdecimals", 2); - this.priceNumDecimalsField.setValue(numDecimals); - - var useThousandsSeparator = PartKeepr.getApplication().getUserPreference( - "partkeepr.formatting.currency.thousandsSeparator", true); - this.useThousandSeparatorCheckbox.setValue(useThousandsSeparator); - - - var currencyAtEnd = PartKeepr.getApplication().getUserPreference( - "partkeepr.formatting.currency.currencySymbolAtEnd", true); - this.currencyAtEndCheckbox.setValue(currencyAtEnd); - - var currencySymbol = PartKeepr.getApplication().getUserPreference("partkeepr.formatting.currency.symbol", "€"); - this.currencySymbolField.setValue(currencySymbol); - }, - /** - * Creates the widgets used in this form. - * - * @param none - * @return nothing - * - */ - createWidgets: function () - { - this.priceNumDecimalsField = Ext.create("Ext.form.field.Number", { - name: 'priceNumDecimalsField', - fieldLabel: i18n('Decimal precision'), - labelWidth: 120, - columnWidth: 0.5, - minValue: 0, - maxValue: 4, - allowDecimals: false - }); - - this.useThousandSeparatorCheckbox = Ext.create("Ext.form.field.Checkbox", { - boxLabel: i18n("Separate thousands"), - labelWidth: 120, - hideEmptyLabel: false - }); - - this.currencySymbolField = Ext.create("Ext.form.field.Text", { - fieldLabel: i18n("Currency Symbol"), - labelWidth: 120, - maxLength: 5 - }); - - this.currencyAtEndCheckbox = Ext.create("Ext.form.field.Checkbox", { - boxLabel: i18n("Currency Symbol after value"), - labelWidth: 120, - hideEmptyLabel: false - }); - } -}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/StockPreferences.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/StockPreferences.js @@ -1,27 +0,0 @@ -Ext.define('PartKeepr.StockPreferencesPanel', { - extend: 'Ext.form.FormPanel', - title: i18n("Stock Preferences"), - bodyStyle: 'background:#DBDBDB;padding: 10px;', - initComponent: function () { - this.confirmInlineStockLevelChangesCheckbox = Ext.create("Ext.form.field.Checkbox", { - boxLabel: i18n("Confirm in-line stock level changes from the parts grid"), - handler: Ext.bind(this.confirmInlineStockLevelChangesHandler, this) - }); - - if (PartKeepr.getApplication().getUserPreference("partkeepr.inline-stock-change.confirm") == false) { - this.confirmInlineStockLevelChangesCheckbox.setValue(false); - } else { - this.confirmInlineStockLevelChangesCheckbox.setValue(true); - } - - this.items = [ this.confirmInlineStockLevelChangesCheckbox ]; - - this.callParent(); - }, - /** - * Handler when the "confirm changes" checkbox was clicked. - */ - confirmInlineStockLevelChangesHandler: function (checkbox, checked) { - PartKeepr.getApplication().setUserPreference("partkeepr.inline-stock-change.confirm", checked); - } -}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/TipOfTheDayPreferences.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/TipOfTheDayPreferences.js @@ -1,51 +0,0 @@ -Ext.define('PartKeepr.TipOfTheDayPreferencesPanel', { - extend: 'Ext.form.FormPanel', - title: i18n("Tip of the Day"), - bodyStyle: 'background:#DBDBDB;padding: 10px;', - initComponent: function () - { - this.displayTipsOnLoginCheckbox = Ext.create("Ext.form.field.Checkbox", { - boxLabel: i18n("Display tips on login"), - handler: Ext.bind(this.showTipsHandler, this) - }); - - if (PartKeepr.getApplication().getUserPreference("partkeepr.tipoftheday.showtips") == false) { - this.displayTipsOnLoginCheckbox.setValue(false); - } else { - this.displayTipsOnLoginCheckbox.setValue(true); - } - - - this.resetTipsButton = Ext.create("Ext.button.Button", { - text: i18n("Mark all tips unread"), - handler: this.onMarkAllTipsUnreadClick, - scope: this - }); - - this.items = [ - this.displayTipsOnLoginCheckbox, - this.resetTipsButton - ]; - - this.callParent(); - }, - /** - * Handler when the "show tips" checkbox was clicked. - */ - showTipsHandler: function (checkbox, checked) - { - PartKeepr.getApplication().setUserPreference("partkeepr.tipoftheday.showtips", checked); - }, - /** - * Marks all tips as unread - */ - onMarkAllTipsUnreadClick: function () - { - PartKeepr.TipOfTheDayBundle.Entity.TipOfTheDay.callPostCollectionAction("markAllTipsAsUnread", {}, function () - { - var msg = i18n("All tips have been marked as unread"); - Ext.Msg.alert(msg, msg); - } - ); - } -}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/UserPasswordChangePanel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/Preferences/UserPasswordChangePanel.js @@ -1,100 +0,0 @@ -Ext.define('PartKeepr.UserPasswordChangePanel', { - extend: 'Ext.form.FormPanel', - title: i18n("Change Password"), - bodyStyle: 'background:#DBDBDB;padding: 10px;', - layout: 'card', - initComponent: function () - { - - this.oldPassword = Ext.create("Ext.form.field.Text", { - inputType: "password", - name: 'password', - labelWidth: 150, - style: 'border-bottom: 1px solid grey; padding-bottom: 10px;', - width: 300, - fieldLabel: i18n("Current Password") - }); - - this.newPassword = Ext.create("Ext.form.field.Text", { - style: 'margin-top: 10px', - inputType: "password", - name: 'password', - labelWidth: 150, - width: 300, - fieldLabel: i18n("New Password") - }); - - this.newPasswordConfirm = Ext.create("Ext.form.field.Text", { - inputType: "password", - name: 'password', - labelWidth: 150, - width: 300, - validator: Ext.bind(this.validatePassword, this), - fieldLabel: i18n("New Password (Confirm)") - }); - - this.items = [ - { - border: false, - bodyStyle: 'background:#DBDBDB;padding: 10px;', - items: [ - this.oldPassword, - this.newPassword, - this.newPasswordConfirm, - { - xtype: 'fieldcontainer', - hideEmptyLabel: false, - width: 300, - labelWidth: 150, - items: { - xtype: 'button', - handler: this.onChangePassword, - scope: this, - width: 145, - iconCls: 'web-icon accept', - text: i18n("Change Password") - }}] - },{ - border: false, - bodyStyle: 'background:#DBDBDB;padding: 10px;', - html: i18n("You are authenticated via an external user provider, password changing is not available.") - } - ]; - - this.callParent(); - - if (PartKeepr.getApplication().getLoginManager().getUser().getProvider().get("editable") === false) { - this.layout.setActiveItem(1); - } - }, - onChangePassword: function () - { - if (this.getForm().isValid()) { - - var user = PartKeepr.getApplication().getLoginManager().getUser(); - - user.callPutAction("changePassword", { - "oldpassword": this.oldPassword.getValue(), - "newpassword": this.newPassword.getValue() - }, Ext.bind(this.onAfterPasswordChange, this)); - } - }, - onAfterPasswordChange: function (opts, success, response) - { - if (success) { - Ext.MessageBox.alert(i18n("Password successfully changed"), i18n("You need to re-login with the new password. Click OK to re-login."), this.relogin, this); - } - }, - relogin: function () { - PartKeepr.getApplication().getLoginManager().logout(); - PartKeepr.getApplication().getLoginManager().login(); - }, - validatePassword: function () - { - if (this.newPassword.getValue() != this.newPasswordConfirm.getValue()) { - return i18n("Passwords don't match"); - } - - return true; - } -}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserPreferences.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserPreferences.js @@ -1,35 +0,0 @@ -Ext.define('PartKeepr.UserPreferencePanel', { - extend: 'Ext.tab.Panel', - title: i18n("User Preferences"), - tabPosition: 'bottom', - //bodyStyle: 'background:#DBDBDB;padding: 10px;', - initComponent: function () - { - - this.passwordChangePanel = Ext.create("PartKeepr.UserPasswordChangePanel"); - this.tipsPanel = Ext.create("PartKeepr.TipOfTheDayPreferencesPanel"); - this.formattingPanel = Ext.create("PartKeepr.FormattingPreferencesPanel"); - this.displayPreferencesPanel = Ext.create("PartKeepr.DisplayPreferencesPanel"); - this.stockPanel = Ext.create("PartKeepr.StockPreferencesPanel"); - this.items = [ - this.tipsPanel, - this.formattingPanel, - this.displayPreferencesPanel, - this.passwordChangePanel, - this.stockPanel - ]; - - if (PartKeepr.getApplication().getParameter("password_change") === false) { - Ext.Array.remove(this.items, this.passwordChangePanel); - } - this.callParent(); - }, - statics: { - iconCls: 'fugue-icon gear', - title: i18n('User Preferences'), - closable: true, - menuPath: [{text: i18n("System")}] - } - -}); - diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Panel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Panel.js @@ -0,0 +1,22 @@ +Ext.define('PartKeepr.Components.UserPreferences.Panel', { + extend: 'PartKeepr.Components.Preferences.Panel', + title: i18n("System Preferences"), + + getSettingClasses: function () + { + return [ + "PartKeepr.Components.UserPreferences.Preferences.TipOfTheDayConfiguration", + "PartKeepr.Components.UserPreferences.Preferences.FormattingConfiguration", + "PartKeepr.Components.UserPreferences.Preferences.DisplayConfiguration", + "PartKeepr.Components.UserPreferences.Preferences.StockConfiguration", + "PartKeepr.Components.UserPreferences.Preferences.PasswordConfiguration", + "PartKeepr.Components.UserPreferences.Preferences.OctoPartConfiguration" + ]; + }, + statics: { + iconCls: 'fugue-icon gear', + title: i18n('User Preferences'), + closable: true, + menuPath: [{text: i18n("System")}] + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/DisplayConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/DisplayConfiguration.js @@ -0,0 +1,80 @@ +Ext.define('PartKeepr.Components.UserPreferences.Preferences.DisplayConfiguration', { + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', + + initComponent: function () + { + this.showDescriptionsCheckbox = Ext.create("Ext.form.field.Checkbox", { + labelWidth: 120, + hideEmptyLabel: false, + boxLabel: i18n("Show category descriptions (requires reload)") + }); + + if (PartKeepr.getApplication().getUserPreference("partkeepr.categorytree.showdescriptions") === false) { + this.showDescriptionsCheckbox.setValue(false); + } else { + this.showDescriptionsCheckbox.setValue(true); + } + + this.compactLayout = Ext.create("Ext.form.field.Radio", { + boxLabel: i18n( + "Compact Layout") + '<br/> <span class="partkeepr-part-manager-compact"/>', + name: 'rb', + inputValue: 'compact' + }); + + this.standardLayout = Ext.create("Ext.form.field.Radio", { + boxLabel: i18n( + "Standard Layout") + '<br/> <span class="partkeepr-part-manager-standard"/>', + name: 'rb', + inputValue: 'standard' + }); + + if (PartKeepr.getApplication().getUserPreference("partkeepr.partmanager.compactlayout", false) === true) { + this.compactLayout.setValue(true); + } else { + this.standardLayout.setValue(true); + } + + this.compactLayoutChooser = Ext.create("Ext.form.RadioGroup", { + fieldLabel: i18n("Part Manager Layout"), + labelWidth: 120, + columns: 2, + width: 400, + vertical: true, + items: [ + this.compactLayout, + this.standardLayout + ] + }); + + this.items = [this.showDescriptionsCheckbox, this.compactLayoutChooser]; + + this.callParent(); + }, + onSave: function () + { + PartKeepr.getApplication().setUserPreference("partkeepr.categorytree.showdescriptions", + this.showDescriptionsCheckbox.getValue()); + + var layout = this.compactLayoutChooser.getValue(); + + var compactLayout = false; + + if (layout.rb === "compact") { + compactLayout = true; + } + + var oldCompactLayout = PartKeepr.getApplication().getUserPreference("partkeepr.partmanager.compactlayout", false); + PartKeepr.getApplication().setUserPreference("partkeepr.partmanager.compactlayout", compactLayout); + + if (oldCompactLayout !== compactLayout) { + PartKeepr.getApplication().recreatePartManager(); + } + + }, + statics: { + iconCls: 'fugue-icon monitor', + title: i18n('Display'), + menuPath: [{iconCls: 'fugue-icon ui-scroll-pane-image', text: i18n("User Interface")}] + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/FormattingConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/FormattingConfiguration.js @@ -0,0 +1,93 @@ +Ext.define('PartKeepr.Components.UserPreferences.Preferences.FormattingConfiguration', { + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', + + initComponent: function () + { + this.createWidgets(); + this.loadDefaults(); + + this.items = [ + this.priceNumDecimalsField, + this.useThousandSeparatorCheckbox, + this.currencySymbolField, + this.currencyAtEndCheckbox + ]; + + + this.callParent(); + }, + /** + * Loads the defaults for the user preferences + */ + loadDefaults: function () + { + var numDecimals = PartKeepr.getApplication().getUserPreference("partkeepr.formatting.currency.numdecimals", 2); + this.priceNumDecimalsField.setValue(numDecimals); + + var useThousandsSeparator = PartKeepr.getApplication().getUserPreference( + "partkeepr.formatting.currency.thousandsSeparator", true); + this.useThousandSeparatorCheckbox.setValue(useThousandsSeparator); + + + var currencyAtEnd = PartKeepr.getApplication().getUserPreference( + "partkeepr.formatting.currency.currencySymbolAtEnd", true); + this.currencyAtEndCheckbox.setValue(currencyAtEnd); + + var currencySymbol = PartKeepr.getApplication().getUserPreference("partkeepr.formatting.currency.symbol", "€"); + this.currencySymbolField.setValue(currencySymbol); + }, + + /** + * Creates the widgets used in this form. + */ + createWidgets: function () + { + this.priceNumDecimalsField = Ext.create("Ext.form.field.Number", { + name: 'priceNumDecimalsField', + fieldLabel: i18n('Decimal precision'), + labelWidth: 120, + columnWidth: 0.5, + minValue: 0, + maxValue: 4, + allowDecimals: false + }); + + this.useThousandSeparatorCheckbox = Ext.create("Ext.form.field.Checkbox", { + boxLabel: i18n("Separate thousands"), + labelWidth: 120, + hideEmptyLabel: false + }); + + this.currencySymbolField = Ext.create("Ext.form.field.Text", { + fieldLabel: i18n("Currency Symbol"), + labelWidth: 120, + maxLength: 5 + }); + + this.currencyAtEndCheckbox = Ext.create("Ext.form.field.Checkbox", { + boxLabel: i18n("Currency Symbol after value"), + labelWidth: 120, + hideEmptyLabel: false + }); + }, + + onSave: function () + { + PartKeepr.getApplication().setUserPreference("partkeepr.formatting.currency.numdecimals", + this.priceNumDecimalsField.getValue()); + + PartKeepr.getApplication().setUserPreference("partkeepr.formatting.currency.thousandsSeparator", + this.useThousandSeparatorCheckbox.getValue()); + + PartKeepr.getApplication().setUserPreference("partkeepr.formatting.currency.symbol", + this.currencySymbolField.getValue()); + + PartKeepr.getApplication().setUserPreference( + "partkeepr.formatting.currency.currencySymbolAtEnd", this.currencyAtEndCheckbox.getValue()); + }, + statics: { + iconCls: 'fugue-icon ui-text-field-format', + title: i18n('Formatting'), + menuPath: [{iconCls: 'fugue-icon ui-scroll-pane-image', text: i18n("User Interface")}] + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/OctoPartConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/OctoPartConfiguration.js @@ -0,0 +1,106 @@ +Ext.define('PartKeepr.Components.UserPreferences.Preferences.OctoPartConfiguration', { + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', + + items: [ + { + xtype: 'checkbox', + plugins: [{ + ptype: 'preference', + preferenceKey: 'partkeepr.octopart.importDistributors', + preferenceScope: 'user', + preferenceDefault: true + }], + itemId: 'importDistributors', + boxLabel: i18n("Distributors") + }, { + xtype: 'checkbox', + plugins: [{ + ptype: 'preference', + preferenceKey: 'partkeepr.octopart.importParameters', + preferenceScope: 'user', + preferenceDefault: true + }], + itemId: 'importParameters', + boxLabel: i18n("Parameters") + }, { + xtype: 'checkbox', + plugins: [{ + ptype: 'preference', + preferenceKey: 'partkeepr.octopart.importDatasheets', + preferenceScope: 'user', + preferenceDefault: true + }], + itemId: 'importDatasheets', + boxLabel: i18n("Datasheets") + }, { + xtype: 'checkbox', + plugins: [{ + ptype: 'preference', + preferenceKey: 'partkeepr.octopart.importCADModels', + preferenceScope: 'user', + preferenceDefault: true + }], + itemId: 'importCADModels', + boxLabel: i18n("CAD Models") + }, { + xtype: 'checkbox', + plugins: [{ + ptype: 'preference', + preferenceKey: 'partkeepr.octopart.importComplianceDocuments', + preferenceScope: 'user', + preferenceDefault: true + }], + itemId: 'importComplianceDocuments', + boxLabel: i18n("Compliance Documents") + }, { + xtype: 'checkbox', + plugins: [{ + ptype: 'preference', + preferenceKey: 'partkeepr.octopart.importReferenceDesigns', + preferenceScope: 'user', + preferenceDefault: true + }], + itemId: 'importReferenceDesigns', + boxLabel: i18n("Reference Designs") + }, { + xtype: 'checkbox', + plugins: [{ + ptype: 'preference', + preferenceKey: 'partkeepr.octopart.importImages', + preferenceScope: 'user', + preferenceDefault: true + }], + itemId: 'importImages', + boxLabel: i18n("Import Images") + } + ], + initComponent: function () + { + this.callParent(); + }, + onSave: function () + { + var item, preference, items, i; + + items = this.query(); + + for (i = 0; i < items.length; i++) { + item = items[i]; + + if (!item instanceof Ext.Component) { + continue; + } + + preference = item.getPlugin("preference"); + + if (preference instanceof PartKeepr.Components.Widgets.PreferencePlugin) { + preference.savePreference(); + } + } + }, + statics: { + iconCls: 'partkeepr-icon octopart', + title: i18n('OctoPart'), + menuPath: [{iconCls: 'fugue-icon ui-scroll-pane-image', text: i18n("User Interface")}] + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/PasswordConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/PasswordConfiguration.js @@ -0,0 +1,92 @@ +Ext.define('PartKeepr.Components.UserPreferences.Preferences.PasswordConfiguration', { + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', + + layout: 'card', + + initComponent: function () + { + this.oldPassword = Ext.create("Ext.form.field.Text", { + inputType: "password", + name: 'password', + labelWidth: 150, + style: 'border-bottom: 1px solid grey; padding-bottom: 10px;', + width: 300, + fieldLabel: i18n("Current Password") + }); + + this.newPassword = Ext.create("Ext.form.field.Text", { + style: 'margin-top: 10px', + inputType: "password", + name: 'password', + labelWidth: 150, + width: 300, + fieldLabel: i18n("New Password") + }); + + this.newPasswordConfirm = Ext.create("Ext.form.field.Text", { + inputType: "password", + name: 'password', + labelWidth: 150, + width: 300, + validator: Ext.bind(this.validatePassword, this), + fieldLabel: i18n("New Password (Confirm)") + }); + + this.items = [ + { + border: false, + items: [ + this.oldPassword, + this.newPassword, + this.newPasswordConfirm + ] + }, { + border: false, + html: i18n("You are authenticated via an external user provider, password changing is not available.") + } + ]; + + this.callParent(); + + if (PartKeepr.getApplication().getLoginManager().getUser().getProvider().get("editable") === false) { + this.layout.setActiveItem(1); + } + }, + onSave: function () + { + if (this.getForm().isValid()) { + + var user = PartKeepr.getApplication().getLoginManager().getUser(); + + user.callPutAction("changePassword", { + "oldpassword": this.oldPassword.getValue(), + "newpassword": this.newPassword.getValue() + }, Ext.bind(this.onAfterPasswordChange, this)); + } + }, + onAfterPasswordChange: function (opts, success) + { + if (success) { + Ext.MessageBox.alert(i18n("Password successfully changed"), + i18n("You need to re-login with the new password. Click OK to re-login."), this.relogin, this); + } + }, + relogin: function () + { + PartKeepr.getApplication().getLoginManager().logout(); + PartKeepr.getApplication().getLoginManager().login(); + }, + validatePassword: function () + { + if (this.newPassword.getValue() !== this.newPasswordConfirm.getValue()) { + return i18n("Passwords don't match"); + } + + return true; + }, + statics: { + iconCls: 'fugue-icon ui-text-field-password-green', + title: i18n('Password'), + menuPath: [] + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/StockConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/StockConfiguration.js @@ -0,0 +1,30 @@ +Ext.define('PartKeepr.Components.UserPreferences.Preferences.StockConfiguration', { + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', + + initComponent: function () + { + this.confirmInlineStockLevelChangesCheckbox = Ext.create("Ext.form.field.Checkbox", { + boxLabel: i18n("Confirm in-line stock level changes from the parts grid") + }); + + if (PartKeepr.getApplication().getUserPreference("partkeepr.inline-stock-change.confirm", true) === false) { + this.confirmInlineStockLevelChangesCheckbox.setValue(false); + } else { + this.confirmInlineStockLevelChangesCheckbox.setValue(true); + } + + this.items = [ this.confirmInlineStockLevelChangesCheckbox ]; + + this.callParent(); + }, + onSave: function () + { + PartKeepr.getApplication().setUserPreference("partkeepr.inline-stock-change.confirm", + this.confirmInlineStockLevelChangesCheckbox.getValue()); + }, + statics: { + iconCls: 'web-icon brick', + title: i18n('Stock'), + menuPath: [{iconCls: 'fugue-icon ui-scroll-pane-image', text: i18n("User Interface")}] + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/TipOfTheDayConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/TipOfTheDayConfiguration.js @@ -0,0 +1,52 @@ +Ext.define('PartKeepr.Components.UserPreferences.Preferences.TipOfTheDayConfiguration', { + extend: 'PartKeepr.Components.Preferences.PreferenceEditor', + + initComponent: function () + { + this.displayTipsOnLoginCheckbox = Ext.create("Ext.form.field.Checkbox", { + boxLabel: i18n("Display tips on login") + }); + + if (PartKeepr.getApplication().getUserPreference("partkeepr.tipoftheday.showtips") === false) { + this.displayTipsOnLoginCheckbox.setValue(false); + } else { + this.displayTipsOnLoginCheckbox.setValue(true); + } + + + this.resetTipsButton = Ext.create("Ext.button.Button", { + text: i18n("Mark all tips unread"), + handler: this.onMarkAllTipsUnreadClick, + scope: this + }); + + this.items = [ + this.displayTipsOnLoginCheckbox, + this.resetTipsButton + ]; + + this.callParent(); + }, + /** + * Marks all tips as unread + */ + onMarkAllTipsUnreadClick: function () + { + PartKeepr.TipOfTheDayBundle.Entity.TipOfTheDay.callPostCollectionAction("markAllTipsAsUnread", {}, function () + { + var msg = i18n("All tips have been marked as unread"); + Ext.Msg.alert(msg, msg); + } + ); + }, + onSave: function () + { + PartKeepr.getApplication().setUserPreference("partkeepr.tipoftheday.showtips", + this.displayTipsOnLoginCheckbox.getValue()); + }, + statics: { + iconCls: 'fugue-icon light-bulb', + title: i18n('Tip of the Day'), + menuPath: [{iconCls: 'fugue-icon ui-scroll-pane-image', text: i18n("User Interface")}] + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/PreferencePlugin.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Widgets/PreferencePlugin.js @@ -0,0 +1,49 @@ +Ext.define('PartKeepr.Components.Widgets.PreferencePlugin', { + extend: 'Ext.plugin.Abstract', + alias: 'plugin.preference', + + /** + * @var {String} Specifies the preference key to bind the component to. + */ + preferenceKey: null, + + /** + * @var {String} Specifies if the preference is a system or user preference. Allowed values are "system" or "user". + */ + preferenceScope: "system", + + preferenceDefault: null, + + pluginId: 'preference', + + init: function (cmp) + { + this.setCmp(cmp); + + cmp.on("beforerender", this.loadPreference, this); + }, + loadPreference: function () + { + if (this.preferenceScope === "system") + { + this.getCmp().setValue( + PartKeepr.getApplication().getSystemPreference(this.preferenceKey, this.preferenceDefault) + ); + } else + { + this.getCmp().setValue( + PartKeepr.getApplication().getUserPreference(this.preferenceKey, this.preferenceDefault) + ); + } + }, + savePreference: function () + { + if (this.preferenceScope === "system") + { + PartKeepr.getApplication().setSystemPreference(this.preferenceKey, this.getCmp().getValue()); + } else + { + PartKeepr.getApplication().setUserPreference(this.preferenceKey, this.getCmp().getValue()); + } + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/views/index.html.twig b/src/PartKeepr/FrontendBundle/Resources/views/index.html.twig @@ -110,6 +110,7 @@ '@PartKeeprFrontendBundle/Resources/public/js/Util/Filter.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Auth/LoginManager.js' '@PartKeeprFrontendBundle/Resources/public/js/ExtJS/Bugfixes/Ext.grid.feature.Summary-selectorFix.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/Widgets/PreferencePlugin.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Auth/AuthenticationProvider.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Auth/HTTPBasicAuthenticationProvider.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Auth/WSSEAuthenticationProvider.js' @@ -206,12 +207,6 @@ '@PartKeeprFrontendBundle/Resources/public/js/Components/TimeDisplay.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Menu.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Widgets/UrlTextField.js' - '@PartKeeprFrontendBundle/Resources/public/js/Components/User/Preferences/DisplayPreferencesPanel.js' - '@PartKeeprFrontendBundle/Resources/public/js/Components/User/Preferences/UserPasswordChangePanel.js' - '@PartKeeprFrontendBundle/Resources/public/js/Components/User/Preferences/StockPreferences.js' - '@PartKeeprFrontendBundle/Resources/public/js/Components/User/Preferences/FormattingPreferences.js' - '@PartKeeprFrontendBundle/Resources/public/js/Components/User/Preferences/TipOfTheDayPreferences.js' - '@PartKeeprFrontendBundle/Resources/public/js/Components/User/UserPreferences.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Widgets/RemotePartComboBox.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Widgets/FadingButton.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Widgets/SystemNoticeButton.js' @@ -282,15 +277,23 @@ '@PartKeeprFrontendBundle/Resources/public/js/Components/CategoryEditor/CategoryEditorForm.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Picker/CharPicker.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/Widgets/StorageLocationPicker.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/Preferences/Panel.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/SystemPreferences/Panel.js' - '@PartKeeprFrontendBundle/Resources/public/js/Components/SystemPreferences/Tree.js' - '@PartKeeprFrontendBundle/Resources/public/js/Components/SystemPreferences/PreferenceEditor.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/UserPreferences/Panel.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/Preferences/Tree.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/Preferences/PreferenceEditor.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/FulltextSearch.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartFields.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartManufacturerFields.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/RequiredPartDistributorFields.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/BarcodeScannerConfiguration.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/ActionsConfiguration.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/TipOfTheDayConfiguration.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/FormattingConfiguration.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/DisplayConfiguration.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/StockConfiguration.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/PasswordConfiguration.js' + '@PartKeeprFrontendBundle/Resources/public/js/Components/UserPreferences/Preferences/OctoPartConfiguration.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/ProjectRun/ProjectRunEditor.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/ProjectRun/ProjectRunGrid.js' '@PartKeeprFrontendBundle/Resources/public/js/Components/ProjectRun/ProjectRunEditorComponent.js' diff --git a/src/PartKeepr/ImportBundle/Configuration/Configuration.php b/src/PartKeepr/ImportBundle/Configuration/Configuration.php @@ -77,10 +77,13 @@ class Configuration extends BaseConfiguration return true; } - public function import($row) + public function import($row, $obj = null) { - $obj = new $this->baseEntity(); - $this->persist($obj); + if ($obj === null) { + $obj = new $this->baseEntity(); + $this->persist($obj); + } + $accessor = PropertyAccess::createPropertyAccessor(); foreach ($this->fields as $field) { diff --git a/src/PartKeepr/ImportBundle/Configuration/EntityConfiguration.php b/src/PartKeepr/ImportBundle/Configuration/EntityConfiguration.php @@ -0,0 +1,155 @@ +<?php + +namespace PartKeepr\ImportBundle\Configuration; + +use Doctrine\ORM\QueryBuilder; + +class EntityConfiguration extends Configuration +{ + const IMPORTBEHAVIOUR_ALWAYSIMPORT = "alwaysImport"; + const IMPORTBEHAVIOUR_MATCHDATA = "matchData"; + + const importBehaviours = [ + self::IMPORTBEHAVIOUR_ALWAYSIMPORT, + self::IMPORTBEHAVIOUR_MATCHDATA, + ]; + + const UPDATEBEHAVIOUR_DONTUPDATE = "dontUpdate"; + const UPDATEBEHAVIOUR_UPDATEDATA = "update"; + + const updateBehaviours = [self::UPDATEBEHAVIOUR_DONTUPDATE, self::UPDATEBEHAVIOUR_UPDATEDATA]; + + protected $importBehaviour; + + protected $updateBehaviour; + + protected $matchers = []; + + public function parseConfiguration($importConfiguration) + { + if (!property_exists($importConfiguration, "importBehaviour")) { + throw new \Exception("The key importBehaviour does not exist!"); + } + + if (!in_array($importConfiguration->importBehaviour, self::importBehaviours)) { + throw new \Exception("The key importBehaviour contains an invalid value!"); + } + + $this->importBehaviour = $importConfiguration->importBehaviour; + + switch ($this->importBehaviour) { + case self::IMPORTBEHAVIOUR_MATCHDATA: + if (!property_exists($importConfiguration, "matchers")) { + throw new \Exception("No matchers defined"); + } + + if (!is_array($importConfiguration->matchers)) { + throw new \Exception("matchers must be an array"); + } + + foreach ($importConfiguration->matchers as $matcher) { + if (!property_exists($matcher, "matchField") || !property_exists( + $matcher, + "importField" + ) || $matcher->importField === "" + ) { + throw new \Exception("matcher configuration error"); + } + } + + $this->matchers = $importConfiguration->matchers; + + if (!property_exists($importConfiguration, "updateBehaviour")) { + throw new \Exception("The key updateBehaviour does not exist for mode matchData!"); + } + + if (!in_array($importConfiguration->updateBehaviour, self::updateBehaviours)) { + throw new \Exception("Invalid value for updateBehaviour"); + } + + $this->updateBehaviour = $importConfiguration->updateBehaviour; + + break; + default: + break; + } + + return parent::parseConfiguration($importConfiguration); + } + + public function import($row, $obj = null) + { + $descriptions = []; + switch ($this->importBehaviour) { + case self::IMPORTBEHAVIOUR_ALWAYSIMPORT: + $obj = new $this->baseEntity(); + $this->persist($obj); + break; + case self::IMPORTBEHAVIOUR_MATCHDATA: + $configuration = []; + + foreach ($this->matchers as $matcher) { + $foo = new \stdClass(); + $foo->property = $matcher->matchField; + $foo->operator = "="; + $foo->value = $row[$matcher->importField]; + + $descriptions[] = sprintf("%s = %s", $matcher->matchField, $row[$matcher->importField]); + $configuration[] = $foo; + } + + $configuration = $this->advancedSearchFilter->extractConfiguration($configuration, []); + + $filters = $configuration['filters']; + $sorters = $configuration['sorters']; + $qb = new QueryBuilder($this->em); + $qb->select("o")->from($this->baseEntity, "o"); + + $this->advancedSearchFilter->filter($qb, $filters, $sorters); + + try { + $result = $qb->getQuery()->getArrayResult(); + + if (count($result) === 0) { + $this->log( + sprintf( + "No item of type %s for the configured matcher (%s) found, creating a new one", + $this->baseEntity, + implode($descriptions, ", ") + ) + ); + + return parent::import($row); + } + + if (count($result) === 1) { + $this->log( + sprintf( + "Found item of type %s for the configured matcher (%s)", + $this->baseEntity, + implode($descriptions, ", ") + ) + ); + + return parent::import($row, $result[0]); + } + + if (count($result) > 1) { + $this->log( + sprintf( + "Found %d items of type %s for the configured matcher (%s). Can't continue since we don't know which item to use. Configure the matcher to narrow the results", + count($result), + $this->baseEntity, + implode($descriptions, ", ") + ) + ); + + return null; + } + } catch (\Exception $e) { + } + } + + return null; + } +} diff --git a/src/PartKeepr/ImportBundle/Configuration/ManyToOneConfiguration.php b/src/PartKeepr/ImportBundle/Configuration/ManyToOneConfiguration.php @@ -2,6 +2,8 @@ namespace PartKeepr\ImportBundle\Configuration; +use Doctrine\ORM\QueryBuilder; + class ManyToOneConfiguration extends Configuration { const IMPORTBEHAVIOUR_DONTSET = "dontSet"; @@ -120,7 +122,7 @@ class ManyToOneConfiguration extends Configuration return parent::parseConfiguration($importConfiguration); } - public function import($row) + public function import($row, $obj = null) { $descriptions = []; switch ($this->importBehaviour) { @@ -147,7 +149,7 @@ class ManyToOneConfiguration extends Configuration $filters = $configuration['filters']; $sorters = $configuration['sorters']; - $qb = new \Doctrine\ORM\QueryBuilder($this->em); + $qb = new QueryBuilder($this->em); $qb->select("o")->from($this->baseEntity, "o"); $this->advancedSearchFilter->filter($qb, $filters, $sorters); @@ -185,6 +187,8 @@ class ManyToOneConfiguration extends Configuration break; } + + return null; } /** diff --git a/src/PartKeepr/ImportBundle/Configuration/OneToManyConfiguration.php b/src/PartKeepr/ImportBundle/Configuration/OneToManyConfiguration.php @@ -31,11 +31,11 @@ class OneToManyConfiguration extends Configuration return parent::parseConfiguration($importConfiguration); } - public function import($row) + public function import($row, $obj = null) { switch ($this->importBehaviour) { case self::IMPORTBEHAVIOUR_IGNORE: - return; + return null; break; case self::IMPORTBEHAVIOUR_CREATENEW: $this->log(sprintf("Would create a new entity of type %s for relation %s", $this->baseEntity, $this->getAssociationName())); @@ -43,6 +43,8 @@ class OneToManyConfiguration extends Configuration return parent::import($row); break; } + + return null; } /** diff --git a/src/PartKeepr/ImportBundle/Controller/ImportController.php b/src/PartKeepr/ImportBundle/Controller/ImportController.php @@ -69,12 +69,6 @@ class ImportController extends Controller $importService->setImportData($data); list($entities, $logs) = $importService->import(); - foreach ($entities as $entity) { - $this->get("doctrine")->getManager()->persist($entity); - } - - $this->get("doctrine")->getManager()->flush(); - return new JsonResponse(["logs" => $logs]); } diff --git a/src/PartKeepr/ImportBundle/Service/ImporterService.php b/src/PartKeepr/ImportBundle/Service/ImporterService.php @@ -8,7 +8,7 @@ use Doctrine\ORM\UnitOfWork; use Dunglas\ApiBundle\Api\IriConverter; use PartKeepr\DoctrineReflectionBundle\Filter\AdvancedSearchFilter; use PartKeepr\DoctrineReflectionBundle\Services\ReflectionService; -use PartKeepr\ImportBundle\Configuration\Configuration; +use PartKeepr\ImportBundle\Configuration\EntityConfiguration; use Symfony\Component\PropertyAccess\PropertyAccessor; class ImporterService @@ -68,15 +68,30 @@ class ImporterService $configuration = $this->parseConfiguration(); + $this->em->beginTransaction(); + foreach ($this->importData as $row) { + $this->em->beginTransaction(); $entity = $configuration->import($row); - $entities[] = $entity; + + if ($entity !== null) { + $entities[] = $entity; + } $logs[] = implode("<br/>", ["data" => implode(",", $row), '<p style="text-indent: 50px;">', "log" => " ".implode("<br/> ", $configuration->getLog()), '</p>']); $configuration->clearLog(); + + foreach ($configuration->getPersistEntities() as $entity) { + $this->em->persist($entity); + } + + $this->em->flush(); + $this->em->commit(); } + $this->em->commit(); + return [$configuration->getPersistEntities(), implode("<br/>", $logs)]; } @@ -84,7 +99,7 @@ class ImporterService { $cm = $this->em->getClassMetadata($this->baseEntity); - $configuration = new Configuration($cm, $this->baseEntity, $this->reflectionService, $this->em, + $configuration = new EntityConfiguration($cm, $this->baseEntity, $this->reflectionService, $this->em, $this->advancedSearchFilter, $this->iriConverter); $configuration->parseConfiguration($this->importConfiguration); diff --git a/src/PartKeepr/PartBundle/Controller/PartController.php b/src/PartKeepr/PartBundle/Controller/PartController.php @@ -108,7 +108,7 @@ class PartController extends FOSRestController */ public function getParameterNamesAction() { - $dql = "SELECT p.name, p.description, p.valueType, u.name AS unitName, u.symbol AS unitSymbol FROM PartKeepr\PartBundle\Entity\PartParameter p LEFT JOIN p.unit u GROUP BY p.name, p.description, p.valueType, u.name"; + $dql = "SELECT p.name, p.description, p.valueType, u.name AS unitName, u.symbol AS unitSymbol FROM PartKeepr\PartBundle\Entity\PartParameter p LEFT JOIN p.unit u GROUP BY p.name, p.description, p.valueType, u.name, u.symbol"; $query = $this->get("doctrine.orm.default_entity_manager")->createQuery($dql); diff --git a/src/PartKeepr/ProjectBundle/Entity/ProjectPart.php b/src/PartKeepr/ProjectBundle/Entity/ProjectPart.php @@ -101,6 +101,7 @@ class ProjectPart extends BaseEntity { $this->setOverageType(self::OVERAGE_TYPE_ABSOLUTE); $this->setOverage(0); + $this->setLotNumber(""); } /** diff --git a/web/setup/css/AllowCopy.css b/web/setup/css/AllowCopy.css @@ -0,0 +1,4 @@ +.x-unselectable { + -moz-user-select: text; + cursor: auto; +}+ \ No newline at end of file diff --git a/web/setup/css/BreadCrumbWizard.css b/web/setup/css/BreadCrumbWizard.css diff --git a/web/setup/index.html b/web/setup/index.html @@ -8,7 +8,7 @@ <link rel="icon" href="../bundles/partkeeprfrontend/images/favicon.ico"/> <link rel="stylesheet" href="../js/packages/extjs6/build/classic/theme-classic/resources/theme-classic-all.css"/> <link rel="stylesheet" href="../atelierspierrot/famfamfam-silk-sprite/silk-icons-sprite.css"/> - <link rel="stylesheet" href="css/BreadCrumbWizard.css"/> + <link rel="stylesheet" href="css/AllowCopy.css"/> <script type="text/javascript" src="../js/packages/extjs6/build/ext-all-debug.js"></script>