Browse Source

Evolution #738: Playlist

Bastien Sevajol 11 years ago
parent
commit
c79c2c1509

+ 74 - 73
composer.lock View File

8
             "source": {
8
             "source": {
9
                 "type": "git",
9
                 "type": "git",
10
                 "url": "https://github.com/symfony2admingenerator/AdmingeneratorGeneratorBundle.git",
10
                 "url": "https://github.com/symfony2admingenerator/AdmingeneratorGeneratorBundle.git",
11
-                "reference": "294adb5a1766445e2f2fd3f28c28279084c38435"
11
+                "reference": "e9372a26ff8e84d20d37657aa0e9ea6d6d3d9387"
12
             },
12
             },
13
             "dist": {
13
             "dist": {
14
                 "type": "zip",
14
                 "type": "zip",
15
-                "url": "https://api.github.com/repos/symfony2admingenerator/AdmingeneratorGeneratorBundle/zipball/294adb5a1766445e2f2fd3f28c28279084c38435",
16
-                "reference": "294adb5a1766445e2f2fd3f28c28279084c38435",
15
+                "url": "https://api.github.com/repos/symfony2admingenerator/AdmingeneratorGeneratorBundle/zipball/e9372a26ff8e84d20d37657aa0e9ea6d6d3d9387",
16
+                "reference": "e9372a26ff8e84d20d37657aa0e9ea6d6d3d9387",
17
                 "shasum": ""
17
                 "shasum": ""
18
             },
18
             },
19
             "require": {
19
             "require": {
33
                 "avalanche123/imagine-bundle": "Image manipulation using Imagine and Twig Filters",
33
                 "avalanche123/imagine-bundle": "Image manipulation using Imagine and Twig Filters",
34
                 "cedriclombardot/admingenerator-user-bundle": "Help you to overwrite the base layout of FOSUserBundle or others giving a parameter key of the container"
34
                 "cedriclombardot/admingenerator-user-bundle": "Help you to overwrite the base layout of FOSUserBundle or others giving a parameter key of the container"
35
             },
35
             },
36
-            "time": "2013-05-14 12:00:41",
36
+            "time": "2013-06-01 07:47:44",
37
             "type": "symfony-bundle",
37
             "type": "symfony-bundle",
38
             "extra": {
38
             "extra": {
39
                 "branch-alias": {
39
                 "branch-alias": {
546
             "source": {
546
             "source": {
547
                 "type": "git",
547
                 "type": "git",
548
                 "url": "https://github.com/FriendsOfSymfony/FOSFacebookBundle.git",
548
                 "url": "https://github.com/FriendsOfSymfony/FOSFacebookBundle.git",
549
-                "reference": "9c93669fd8f93941602d348daa58273c29be229f"
549
+                "reference": "7baeffd6b998a9e365e36ae2ff32675b32c84170"
550
             },
550
             },
551
             "dist": {
551
             "dist": {
552
                 "type": "zip",
552
                 "type": "zip",
553
-                "url": "https://api.github.com/repos/FriendsOfSymfony/FOSFacebookBundle/zipball/9c93669fd8f93941602d348daa58273c29be229f",
554
-                "reference": "9c93669fd8f93941602d348daa58273c29be229f",
553
+                "url": "https://api.github.com/repos/FriendsOfSymfony/FOSFacebookBundle/zipball/7baeffd6b998a9e365e36ae2ff32675b32c84170",
554
+                "reference": "7baeffd6b998a9e365e36ae2ff32675b32c84170",
555
                 "shasum": ""
555
                 "shasum": ""
556
             },
556
             },
557
             "require": {
557
             "require": {
558
                 "facebook/php-sdk": "3.2.*",
558
                 "facebook/php-sdk": "3.2.*",
559
                 "php": ">=5.3.2",
559
                 "php": ">=5.3.2",
560
-                "symfony/http-foundation": ">=2.1,<2.3",
561
-                "symfony/security": ">=2.1,<2.3"
560
+                "symfony/http-foundation": ">=2.1,<2.4",
561
+                "symfony/security": ">=2.1,<2.4"
562
             },
562
             },
563
             "require-dev": {
563
             "require-dev": {
564
                 "phpunit/phpunit": "3.7.*",
564
                 "phpunit/phpunit": "3.7.*",
565
-                "symfony/framework-bundle": ">=2.1,<2.3",
566
-                "symfony/security-bundle": ">=2.1,<2.3",
567
-                "symfony/twig-bundle": ">=2.1,<2.3"
565
+                "symfony/framework-bundle": ">=2.1,<2.4",
566
+                "symfony/security-bundle": ">=2.1,<2.4",
567
+                "symfony/twig-bundle": ">=2.1,<2.4"
568
             },
568
             },
569
-            "time": "2013-05-14 18:06:07",
569
+            "time": "2013-06-05 01:23:11",
570
             "type": "symfony-bundle",
570
             "type": "symfony-bundle",
571
             "extra": {
571
             "extra": {
572
                 "branch-alias": {
572
                 "branch-alias": {
666
         },
666
         },
667
         {
667
         {
668
             "name": "gedmo/doctrine-extensions",
668
             "name": "gedmo/doctrine-extensions",
669
-            "version": "v2.3.5",
669
+            "version": "v2.3.6",
670
             "source": {
670
             "source": {
671
                 "type": "git",
671
                 "type": "git",
672
                 "url": "https://github.com/l3pp4rd/DoctrineExtensions.git",
672
                 "url": "https://github.com/l3pp4rd/DoctrineExtensions.git",
673
-                "reference": "v2.3.5"
673
+                "reference": "v2.3.6"
674
             },
674
             },
675
             "dist": {
675
             "dist": {
676
                 "type": "zip",
676
                 "type": "zip",
677
-                "url": "https://api.github.com/repos/l3pp4rd/DoctrineExtensions/zipball/v2.3.5",
678
-                "reference": "v2.3.5",
677
+                "url": "https://api.github.com/repos/l3pp4rd/DoctrineExtensions/zipball/v2.3.6",
678
+                "reference": "v2.3.6",
679
                 "shasum": ""
679
                 "shasum": ""
680
             },
680
             },
681
             "require": {
681
             "require": {
683
                 "php": ">=5.3.2"
683
                 "php": ">=5.3.2"
684
             },
684
             },
685
             "require-dev": {
685
             "require-dev": {
686
-                "doctrine/dbal": ">=2.2",
687
-                "doctrine/mongodb": "1.0.1",
688
-                "doctrine/mongodb-odm": "1.0.0-BETA7",
689
-                "doctrine/orm": ">=2.2",
686
+                "doctrine/common": ">=2.4.0-BETA2",
687
+                "doctrine/dbal": ">=2.4.0-BETA2",
688
+                "doctrine/mongodb": ">=1.0.2",
689
+                "doctrine/mongodb-odm": ">=1.0.0-BETA8",
690
+                "doctrine/orm": ">=2.4.0-BETA2",
690
                 "symfony/yaml": "2.*"
691
                 "symfony/yaml": "2.*"
691
             },
692
             },
692
             "suggest": {
693
             "suggest": {
695
                 "doctrine/mongodb-odm": ">=1.0.0-BETA7",
696
                 "doctrine/mongodb-odm": ">=1.0.0-BETA7",
696
                 "doctrine/orm": ">=2.3.2"
697
                 "doctrine/orm": ">=2.3.2"
697
             },
698
             },
698
-            "time": "2013-03-05 06:32:22",
699
+            "time": "2013-05-21 12:09:55",
699
             "type": "library",
700
             "type": "library",
700
             "extra": {
701
             "extra": {
701
                 "branch-alias": {
702
                 "branch-alias": {
750
             "source": {
751
             "source": {
751
                 "type": "git",
752
                 "type": "git",
752
                 "url": "https://github.com/Gregwar/ImageBundle.git",
753
                 "url": "https://github.com/Gregwar/ImageBundle.git",
753
-                "reference": "d6d8c1aa8c4fe03a9b8470d2bf195c4dbf89643b"
754
+                "reference": "ae746b296768cc63c7f3478446dc5bf5d36812d4"
754
             },
755
             },
755
             "dist": {
756
             "dist": {
756
                 "type": "zip",
757
                 "type": "zip",
757
-                "url": "https://api.github.com/repos/Gregwar/ImageBundle/zipball/d6d8c1aa8c4fe03a9b8470d2bf195c4dbf89643b",
758
-                "reference": "d6d8c1aa8c4fe03a9b8470d2bf195c4dbf89643b",
758
+                "url": "https://api.github.com/repos/Gregwar/ImageBundle/zipball/ae746b296768cc63c7f3478446dc5bf5d36812d4",
759
+                "reference": "ae746b296768cc63c7f3478446dc5bf5d36812d4",
759
                 "shasum": ""
760
                 "shasum": ""
760
             },
761
             },
761
             "require": {
762
             "require": {
762
                 "ext-gd": "*",
763
                 "ext-gd": "*",
763
                 "php": ">=5.3.0"
764
                 "php": ">=5.3.0"
764
             },
765
             },
765
-            "time": "2013-05-09 10:44:43",
766
+            "time": "2013-06-02 20:38:56",
766
             "type": "symfony-bundle",
767
             "type": "symfony-bundle",
767
             "autoload": {
768
             "autoload": {
768
                 "psr-0": {
769
                 "psr-0": {
1158
         },
1159
         },
1159
         {
1160
         {
1160
             "name": "knplabs/knp-menu-bundle",
1161
             "name": "knplabs/knp-menu-bundle",
1161
-            "version": "v1.1.1",
1162
+            "version": "v1.1.2",
1162
             "target-dir": "Knp/Bundle/MenuBundle",
1163
             "target-dir": "Knp/Bundle/MenuBundle",
1163
             "source": {
1164
             "source": {
1164
                 "type": "git",
1165
                 "type": "git",
1165
                 "url": "https://github.com/KnpLabs/KnpMenuBundle.git",
1166
                 "url": "https://github.com/KnpLabs/KnpMenuBundle.git",
1166
-                "reference": "v1.1.1"
1167
+                "reference": "v1.1.2"
1167
             },
1168
             },
1168
             "dist": {
1169
             "dist": {
1169
                 "type": "zip",
1170
                 "type": "zip",
1170
-                "url": "https://api.github.com/repos/KnpLabs/KnpMenuBundle/zipball/v1.1.1",
1171
-                "reference": "v1.1.1",
1171
+                "url": "https://api.github.com/repos/KnpLabs/KnpMenuBundle/zipball/v1.1.2",
1172
+                "reference": "v1.1.2",
1172
                 "shasum": ""
1173
                 "shasum": ""
1173
             },
1174
             },
1174
             "require": {
1175
             "require": {
1175
-                "knplabs/knp-menu": "1.1.*",
1176
-                "symfony/framework-bundle": ">=2.0,<2.3-dev"
1176
+                "knplabs/knp-menu": ">=1.1,<2.0",
1177
+                "symfony/framework-bundle": ">=2.0,<3.0"
1177
             },
1178
             },
1178
-            "time": "2012-11-28 20:05:09",
1179
+            "time": "2013-05-25 10:20:03",
1179
             "type": "symfony-bundle",
1180
             "type": "symfony-bundle",
1180
             "autoload": {
1181
             "autoload": {
1181
                 "psr-0": {
1182
                 "psr-0": {
1207
         },
1208
         },
1208
         {
1209
         {
1209
             "name": "kriswallsmith/assetic",
1210
             "name": "kriswallsmith/assetic",
1210
-            "version": "dev-master",
1211
+            "version": "1.1.x-dev",
1211
             "source": {
1212
             "source": {
1212
                 "type": "git",
1213
                 "type": "git",
1213
                 "url": "https://github.com/kriswallsmith/assetic.git",
1214
                 "url": "https://github.com/kriswallsmith/assetic.git",
1214
-                "reference": "5441014f28b8fe024c547fb7a15cd737c6cb1a05"
1215
+                "reference": "1b4b9ab32355b0d377b8baba73d37ab9872ab60b"
1215
             },
1216
             },
1216
             "dist": {
1217
             "dist": {
1217
                 "type": "zip",
1218
                 "type": "zip",
1218
-                "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/5441014f28b8fe024c547fb7a15cd737c6cb1a05",
1219
-                "reference": "5441014f28b8fe024c547fb7a15cd737c6cb1a05",
1219
+                "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/1b4b9ab32355b0d377b8baba73d37ab9872ab60b",
1220
+                "reference": "1b4b9ab32355b0d377b8baba73d37ab9872ab60b",
1220
                 "shasum": ""
1221
                 "shasum": ""
1221
             },
1222
             },
1222
             "require": {
1223
             "require": {
1242
                 "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris",
1243
                 "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris",
1243
                 "twig/twig": "Assetic provides the integration with the Twig templating engine"
1244
                 "twig/twig": "Assetic provides the integration with the Twig templating engine"
1244
             },
1245
             },
1245
-            "time": "2013-05-18 16:31:41",
1246
+            "time": "2013-06-04 03:51:00",
1246
             "type": "library",
1247
             "type": "library",
1247
             "extra": {
1248
             "extra": {
1248
                 "branch-alias": {
1249
                 "branch-alias": {
1249
-                    "dev-master": "1.2-dev"
1250
+                    "dev-master": "1.1-dev"
1250
                 }
1251
                 }
1251
             },
1252
             },
1252
             "autoload": {
1253
             "autoload": {
1396
         },
1397
         },
1397
         {
1398
         {
1398
             "name": "sensio/distribution-bundle",
1399
             "name": "sensio/distribution-bundle",
1399
-            "version": "v2.1.10",
1400
+            "version": "v2.1.11",
1400
             "target-dir": "Sensio/Bundle/DistributionBundle",
1401
             "target-dir": "Sensio/Bundle/DistributionBundle",
1401
             "source": {
1402
             "source": {
1402
                 "type": "git",
1403
                 "type": "git",
1403
-                "url": "https://github.com/sensio/SensioDistributionBundle.git",
1404
-                "reference": "v2.1.10"
1404
+                "url": "https://github.com/sensiolabs/SensioDistributionBundle.git",
1405
+                "reference": "v2.1.11"
1405
             },
1406
             },
1406
             "dist": {
1407
             "dist": {
1407
                 "type": "zip",
1408
                 "type": "zip",
1408
-                "url": "https://api.github.com/repos/sensio/SensioDistributionBundle/zipball/v2.1.10",
1409
-                "reference": "v2.1.10",
1409
+                "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/v2.1.11",
1410
+                "reference": "v2.1.11",
1410
                 "shasum": ""
1411
                 "shasum": ""
1411
             },
1412
             },
1412
             "require": {
1413
             "require": {
1442
         },
1443
         },
1443
         {
1444
         {
1444
             "name": "sensio/framework-extra-bundle",
1445
             "name": "sensio/framework-extra-bundle",
1445
-            "version": "v2.1.10",
1446
+            "version": "v2.1.11",
1446
             "target-dir": "Sensio/Bundle/FrameworkExtraBundle",
1447
             "target-dir": "Sensio/Bundle/FrameworkExtraBundle",
1447
             "source": {
1448
             "source": {
1448
                 "type": "git",
1449
                 "type": "git",
1449
-                "url": "https://github.com/sensio/SensioFrameworkExtraBundle.git",
1450
-                "reference": "v2.1.10"
1450
+                "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git",
1451
+                "reference": "v2.1.11"
1451
             },
1452
             },
1452
             "dist": {
1453
             "dist": {
1453
                 "type": "zip",
1454
                 "type": "zip",
1454
-                "url": "https://api.github.com/repos/sensio/SensioFrameworkExtraBundle/zipball/v2.1.10",
1455
-                "reference": "v2.1.10",
1455
+                "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/v2.1.11",
1456
+                "reference": "v2.1.11",
1456
                 "shasum": ""
1457
                 "shasum": ""
1457
             },
1458
             },
1458
             "require": {
1459
             "require": {
1489
         },
1490
         },
1490
         {
1491
         {
1491
             "name": "sensio/generator-bundle",
1492
             "name": "sensio/generator-bundle",
1492
-            "version": "v2.1.10",
1493
+            "version": "v2.1.11",
1493
             "target-dir": "Sensio/Bundle/GeneratorBundle",
1494
             "target-dir": "Sensio/Bundle/GeneratorBundle",
1494
             "source": {
1495
             "source": {
1495
                 "type": "git",
1496
                 "type": "git",
1496
-                "url": "https://github.com/sensio/SensioGeneratorBundle.git",
1497
-                "reference": "v2.1.10"
1497
+                "url": "https://github.com/sensiolabs/SensioGeneratorBundle.git",
1498
+                "reference": "v2.1.11"
1498
             },
1499
             },
1499
             "dist": {
1500
             "dist": {
1500
                 "type": "zip",
1501
                 "type": "zip",
1501
-                "url": "https://api.github.com/repos/sensio/SensioGeneratorBundle/zipball/v2.1.10",
1502
-                "reference": "v2.1.10",
1502
+                "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/v2.1.11",
1503
+                "reference": "v2.1.11",
1503
                 "shasum": ""
1504
                 "shasum": ""
1504
             },
1505
             },
1505
             "require": {
1506
             "require": {
1992
         },
1993
         },
1993
         {
1994
         {
1994
             "name": "symfony/assetic-bundle",
1995
             "name": "symfony/assetic-bundle",
1995
-            "version": "v2.1.2",
1996
+            "version": "v2.1.3",
1996
             "target-dir": "Symfony/Bundle/AsseticBundle",
1997
             "target-dir": "Symfony/Bundle/AsseticBundle",
1997
             "source": {
1998
             "source": {
1998
                 "type": "git",
1999
                 "type": "git",
1999
                 "url": "https://github.com/symfony/AsseticBundle.git",
2000
                 "url": "https://github.com/symfony/AsseticBundle.git",
2000
-                "reference": "v2.1.2"
2001
+                "reference": "v2.1.3"
2001
             },
2002
             },
2002
             "dist": {
2003
             "dist": {
2003
                 "type": "zip",
2004
                 "type": "zip",
2004
-                "url": "https://api.github.com/repos/symfony/AsseticBundle/zipball/v2.1.2",
2005
-                "reference": "v2.1.2",
2005
+                "url": "https://api.github.com/repos/symfony/AsseticBundle/zipball/v2.1.3",
2006
+                "reference": "v2.1.3",
2006
                 "shasum": ""
2007
                 "shasum": ""
2007
             },
2008
             },
2008
             "require": {
2009
             "require": {
2009
-                "kriswallsmith/assetic": "1.1.*",
2010
+                "kriswallsmith/assetic": ">=1.1.0-alpha4,<1.2-dev",
2010
                 "php": ">=5.3.0",
2011
                 "php": ">=5.3.0",
2011
-                "symfony/framework-bundle": ">=2.1.0,<2.3-dev"
2012
+                "symfony/framework-bundle": ">=2.1,<3.0"
2012
             },
2013
             },
2013
             "require-dev": {
2014
             "require-dev": {
2014
-                "symfony/class-loader": ">=2.1.0,<2.3-dev",
2015
-                "symfony/console": ">=2.1.0,<2.3-dev",
2016
-                "symfony/css-selector": ">=2.1.0,<2.3-dev",
2017
-                "symfony/dom-crawler": ">=2.1.0,<2.3-dev",
2018
-                "symfony/form": ">=2.1.0,<2.3-dev",
2019
-                "symfony/twig-bundle": ">=2.1.0,<2.3-dev",
2020
-                "symfony/yaml": ">=2.1.0,<2.3-dev"
2015
+                "symfony/class-loader": ">=2.1,<3.0",
2016
+                "symfony/console": ">=2.1,<3.0",
2017
+                "symfony/css-selector": ">=2.1,<3.0",
2018
+                "symfony/dom-crawler": ">=2.1,<3.0",
2019
+                "symfony/form": ">=2.1,<3.0",
2020
+                "symfony/twig-bundle": ">=2.1,<3.0",
2021
+                "symfony/yaml": ">=2.1,<3.0"
2021
             },
2022
             },
2022
             "suggest": {
2023
             "suggest": {
2023
-                "symfony/twig-bundle": ">=2.1.0,<2.3-dev"
2024
+                "symfony/twig-bundle": "~2.1"
2024
             },
2025
             },
2025
-            "time": "2013-02-23 22:29:21",
2026
+            "time": "2013-03-25 20:16:21",
2026
             "type": "symfony-bundle",
2027
             "type": "symfony-bundle",
2027
             "extra": {
2028
             "extra": {
2028
                 "branch-alias": {
2029
                 "branch-alias": {
2114
         },
2115
         },
2115
         {
2116
         {
2116
             "name": "symfony/swiftmailer-bundle",
2117
             "name": "symfony/swiftmailer-bundle",
2117
-            "version": "v2.1.10",
2118
+            "version": "v2.1.11",
2118
             "target-dir": "Symfony/Bundle/SwiftmailerBundle",
2119
             "target-dir": "Symfony/Bundle/SwiftmailerBundle",
2119
             "source": {
2120
             "source": {
2120
                 "type": "git",
2121
                 "type": "git",
2121
                 "url": "https://github.com/symfony/SwiftmailerBundle.git",
2122
                 "url": "https://github.com/symfony/SwiftmailerBundle.git",
2122
-                "reference": "v2.1.10"
2123
+                "reference": "v2.1.11"
2123
             },
2124
             },
2124
             "dist": {
2125
             "dist": {
2125
                 "type": "zip",
2126
                 "type": "zip",
2126
-                "url": "https://api.github.com/repos/symfony/SwiftmailerBundle/zipball/v2.1.10",
2127
-                "reference": "v2.1.10",
2127
+                "url": "https://api.github.com/repos/symfony/SwiftmailerBundle/zipball/v2.1.11",
2128
+                "reference": "v2.1.11",
2128
                 "shasum": ""
2129
                 "shasum": ""
2129
             },
2130
             },
2130
             "require": {
2131
             "require": {

+ 1 - 1
src/Muzich/CoreBundle/Entity/Playlist.php View File

100
     return $this->owner;
100
     return $this->owner;
101
   }
101
   }
102
   
102
   
103
-  public function setOwner(User $owner)
103
+  public function setOwner(User $owner = null)
104
   {
104
   {
105
     $this->owner = $owner;
105
     $this->owner = $owner;
106
   }
106
   }

+ 36 - 0
src/Muzich/CoreBundle/Security/Context.php View File

19
   const ACTION_TAG_ADD = 9;
19
   const ACTION_TAG_ADD = 9;
20
   const ACTION_GET_FAVORITES_TAGS = 10;
20
   const ACTION_GET_FAVORITES_TAGS = 10;
21
   
21
   
22
+  const ACTION_PLAYLIST_SHOW = 11;
23
+  const ACTION_PLAYLIST_DATA_AUTOPLAY = 12;
24
+  const ACTION_PLAYLIST_ADD_ELEMENT = 13;
25
+  const ACTION_PLAYLIST_UPDATE_ORDER = 14;
26
+  const ACTION_PLAYLIST_REMOVE_ELEMENT = 15;
27
+  const ACTION_PLAYLIST_ADD_PROMPT = 16;
28
+  const ACTION_PLAYLIST_CREATE = 17;
29
+  const ACTION_PLAYLIST_COPY = 18;
30
+  const ACTION_PLAYLIST_DELETE = 19;
31
+  const ACTION_PLAYLIST_UNPICK = 20;
32
+  const ACTION_PLAYLIST_PICK = 21;
33
+  
22
   const AFFECT_CANT_MAKE = 0;
34
   const AFFECT_CANT_MAKE = 0;
23
   const AFFECT_NO_SCORING = 1;
35
   const AFFECT_NO_SCORING = 1;
24
   
36
   
66
       ),
78
       ),
67
       self::ACTION_GET_FAVORITES_TAGS => array(
79
       self::ACTION_GET_FAVORITES_TAGS => array(
68
         self::CONDITION_USER_NOT_CONNECTED
80
         self::CONDITION_USER_NOT_CONNECTED
81
+      ),
82
+      self::ACTION_PLAYLIST_ADD_ELEMENT => array(
83
+        self::CONDITION_USER_NOT_CONNECTED
84
+      ),
85
+      self::ACTION_PLAYLIST_UPDATE_ORDER => array(
86
+        self::CONDITION_USER_NOT_CONNECTED  
87
+      ),
88
+      self::ACTION_PLAYLIST_REMOVE_ELEMENT => array(
89
+        self::CONDITION_USER_NOT_CONNECTED  
90
+      ),
91
+      self::ACTION_PLAYLIST_CREATE => array(
92
+        self::CONDITION_USER_NOT_CONNECTED  
93
+      ),
94
+      self::ACTION_PLAYLIST_COPY => array(
95
+        self::CONDITION_USER_NOT_CONNECTED  
96
+      ),
97
+      self::ACTION_PLAYLIST_DELETE => array(
98
+        self::CONDITION_USER_NOT_CONNECTED  
99
+      ),
100
+      self::ACTION_PLAYLIST_UNPICK => array(
101
+        self::CONDITION_USER_NOT_CONNECTED  
102
+      ),
103
+      self::ACTION_PLAYLIST_PICK => array(
104
+        self::CONDITION_USER_NOT_CONNECTED  
69
       )
105
       )
70
     ),
106
     ),
71
     self::AFFECT_NO_SCORING => array(
107
     self::AFFECT_NO_SCORING => array(

+ 7 - 0
src/Muzich/CoreBundle/Tests/Controller/PlaylistControllerTest.php View File

1
+<?php
2
+
3
+/*
4
+ * To change this template, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+?>

+ 25 - 1
src/Muzich/PlaylistBundle/Controller/EditController.php View File

3
 namespace Muzich\PlaylistBundle\Controller;
3
 namespace Muzich\PlaylistBundle\Controller;
4
 
4
 
5
 use Muzich\CoreBundle\lib\Controller;
5
 use Muzich\CoreBundle\lib\Controller;
6
-use Muzich\CoreBundle\Entity\Playlist;
7
 use Symfony\Component\HttpFoundation\Request;
6
 use Symfony\Component\HttpFoundation\Request;
7
+use Muzich\CoreBundle\Security\Context as SecurityContext;
8
 
8
 
9
 class EditController extends Controller
9
 class EditController extends Controller
10
 {
10
 {
12
   // TODO: Cette méthode ET les autres: Mettre à jour avec le gestionnaire d'accès (Security)
12
   // TODO: Cette méthode ET les autres: Mettre à jour avec le gestionnaire d'accès (Security)
13
   public function updateOrderAction(Request $request, $playlist_id)
13
   public function updateOrderAction(Request $request, $playlist_id)
14
   {
14
   {
15
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_UPDATE_ORDER)) !== false)
16
+      return $this->jsonResponseError($uncondition);
17
+    
15
     $playlist_manager = $this->getPlaylistManager();
18
     $playlist_manager = $this->getPlaylistManager();
16
     if (!($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser())) || !$request->get('elements'))
19
     if (!($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser())) || !$request->get('elements'))
17
       return $this->jsonNotFoundResponse();
20
       return $this->jsonNotFoundResponse();
23
   
26
   
24
   public function removeElementAction($playlist_id, $element_id)
27
   public function removeElementAction($playlist_id, $element_id)
25
   {
28
   {
29
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_REMOVE_ELEMENT)) !== false)
30
+      return $this->jsonResponseError($uncondition);
31
+    
26
     $playlist_manager = $this->getPlaylistManager();
32
     $playlist_manager = $this->getPlaylistManager();
27
     if (!($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser())))
33
     if (!($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser())))
28
       return $this->jsonNotFoundResponse();
34
       return $this->jsonNotFoundResponse();
34
   
40
   
35
   public function addElementAction($playlist_id, $element_id)
41
   public function addElementAction($playlist_id, $element_id)
36
   {
42
   {
43
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_ADD_ELEMENT)) !== false)
44
+      return $this->jsonResponseError($uncondition);
45
+    
37
     $playlist_manager = $this->getPlaylistManager();
46
     $playlist_manager = $this->getPlaylistManager();
38
     if (!($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser()))
47
     if (!($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser()))
39
         || !($element = $this->getElementWithId($element_id)))
48
         || !($element = $this->getElementWithId($element_id)))
46
   
55
   
47
   public function addElementAndCreateAction(Request $request, $element_id)
56
   public function addElementAndCreateAction(Request $request, $element_id)
48
   {
57
   {
58
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_CREATE)) !== false)
59
+      return $this->jsonResponseError($uncondition);
60
+    
49
     if (!($element = $this->getElementWithId($element_id)))
61
     if (!($element = $this->getElementWithId($element_id)))
50
       return $this->jsonNotFoundResponse();
62
       return $this->jsonNotFoundResponse();
51
     
63
     
68
   
80
   
69
   public function addElementAndCopyAction($playlist_id, $element_id)
81
   public function addElementAndCopyAction($playlist_id, $element_id)
70
   {
82
   {
83
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_COPY)) !== false)
84
+      return $this->jsonResponseError($uncondition);
85
+    
71
     if (!($element = $this->getElementWithId($element_id)))
86
     if (!($element = $this->getElementWithId($element_id)))
72
       return $this->jsonNotFoundResponse();
87
       return $this->jsonNotFoundResponse();
73
     
88
     
84
   
99
   
85
   public function deleteAction($playlist_id)
100
   public function deleteAction($playlist_id)
86
   {
101
   {
102
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_DELETE)) !== false)
103
+      return $this->jsonResponseError($uncondition);
104
+    
87
     if (!($playlist = $this->getPlaylistManager()->findOwnedPlaylistWithId($playlist_id, $this->getUser())))
105
     if (!($playlist = $this->getPlaylistManager()->findOwnedPlaylistWithId($playlist_id, $this->getUser())))
88
       throw $this->createNotFoundException();
106
       throw $this->createNotFoundException();
89
     
107
     
95
   
113
   
96
   public function unpickAction($playlist_id)
114
   public function unpickAction($playlist_id)
97
   {
115
   {
116
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_UNPICK)) !== false)
117
+      return $this->jsonResponseError($uncondition);
118
+    
98
     $playlist_manager = $this->getPlaylistManager();
119
     $playlist_manager = $this->getPlaylistManager();
99
     
120
     
100
     if (!($playlist = $playlist_manager->findPlaylistWithId($playlist_id, $this->getUser())))
121
     if (!($playlist = $playlist_manager->findPlaylistWithId($playlist_id, $this->getUser())))
108
   
129
   
109
   public function pickAction($playlist_id)
130
   public function pickAction($playlist_id)
110
   {
131
   {
132
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_PICK)) !== false)
133
+      return $this->jsonResponseError($uncondition);
134
+    
111
     if (!($playlist = $this->getPlaylistManager()->findOneAccessiblePlaylistWithId($playlist_id)))
135
     if (!($playlist = $this->getPlaylistManager()->findOneAccessiblePlaylistWithId($playlist_id)))
112
       return $this->jsonNotFoundResponse();
136
       return $this->jsonNotFoundResponse();
113
     
137
     

+ 13 - 4
src/Muzich/PlaylistBundle/Controller/ShowController.php View File

3
 namespace Muzich\PlaylistBundle\Controller;
3
 namespace Muzich\PlaylistBundle\Controller;
4
 
4
 
5
 use Muzich\CoreBundle\lib\Controller;
5
 use Muzich\CoreBundle\lib\Controller;
6
-use Muzich\CoreBundle\Entity\Playlist;
7
 use Muzich\CoreBundle\lib\AutoplayManager;
6
 use Muzich\CoreBundle\lib\AutoplayManager;
7
+use Muzich\CoreBundle\Security\Context as SecurityContext;
8
 
8
 
9
 class ShowController extends Controller
9
 class ShowController extends Controller
10
 {
10
 {
11
   
11
   
12
   public function userAction($user_slug)
12
   public function userAction($user_slug)
13
   {
13
   {
14
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_SHOW)) !== false)
15
+      return $this->jsonResponseError($uncondition);
16
+    
14
     if (!($viewed_user = $this->findUserWithSlug($user_slug)))
17
     if (!($viewed_user = $this->findUserWithSlug($user_slug)))
15
-    {
16
       throw $this->createNotFoundException();
18
       throw $this->createNotFoundException();
17
-    }
18
     
19
     
19
     return $this->render('MuzichPlaylistBundle:Show:user.html.twig', array(
20
     return $this->render('MuzichPlaylistBundle:Show:user.html.twig', array(
20
       'viewed_user' => $viewed_user,
21
       'viewed_user' => $viewed_user,
24
   
25
   
25
   public function showAction($user_slug, $playlist_id)
26
   public function showAction($user_slug, $playlist_id)
26
   {
27
   {
28
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_SHOW)) !== false)
29
+      return $this->jsonResponseError($uncondition);
30
+    
27
     if (!($viewed_user = $this->findUserWithSlug($user_slug)))
31
     if (!($viewed_user = $this->findUserWithSlug($user_slug)))
28
       throw $this->createNotFoundException();
32
       throw $this->createNotFoundException();
29
     
33
     
38
   
42
   
39
   public function getAutoplayDataAction($playlist_id, $offset = null)
43
   public function getAutoplayDataAction($playlist_id, $offset = null)
40
   {
44
   {
41
-    $playlist_manager = $this->getPlaylistManager();
45
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_DATA_AUTOPLAY)) !== false)
46
+      return $this->jsonResponseError($uncondition);
42
     
47
     
48
+    $playlist_manager = $this->getPlaylistManager();
43
     if (!($playlist = $playlist_manager->findOneAccessiblePlaylistWithId($playlist_id, $this->getUserOrNullIfVisitor())))
49
     if (!($playlist = $playlist_manager->findOneAccessiblePlaylistWithId($playlist_id, $this->getUserOrNullIfVisitor())))
44
       throw $this->createNotFoundException();
50
       throw $this->createNotFoundException();
45
     
51
     
53
   
59
   
54
   public function getAddElementPromptAction($element_id)
60
   public function getAddElementPromptAction($element_id)
55
   {
61
   {
62
+    if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_ADD_PROMPT)) !== false)
63
+      return $this->jsonResponseError($uncondition);
64
+    
56
     return $this->jsonSuccessResponse(
65
     return $this->jsonSuccessResponse(
57
       $this->render('MuzichPlaylistBundle:Show:prompt.html.twig', array(
66
       $this->render('MuzichPlaylistBundle:Show:prompt.html.twig', array(
58
         'form'       => $this->getPlaylistForm()->createView(),
67
         'form'       => $this->getPlaylistForm()->createView(),

+ 27 - 6
web/bundles/muzichcore/css/main.css View File

455
   margin-left: 0px;
455
   margin-left: 0px;
456
 }
456
 }
457
   
457
   
458
-.elements ul.element_tags li, ul#autoplay_element ul.element_tags li
458
+.elements ul.element_tags li, ul#autoplay_element ul.element_tags li, ul.elements ul.element_tags li
459
 {
459
 {
460
   display: inline;
460
   display: inline;
461
   font-size: 90%;
461
   font-size: 90%;
493
 
493
 
494
 }
494
 }
495
 
495
 
496
-a.button.element_tag, ul.tagbox li.tag, ul.search_tag_list li, ul#favorite_tags li
496
+a.button.element_tag, ul.tagbox li.tag, ul.search_tag_list li, ul#favorite_tags li, ul.tags_cloud li
497
 {
497
 {
498
   padding: 6px;
498
   padding: 6px;
499
   border: none;
499
   border: none;
915
   padding-right: 18px;
915
   padding-right: 18px;
916
 }
916
 }
917
 
917
 
918
-ul.tagbox li.tag, ul#favorite_tags li
918
+ul.tagbox li.tag, ul#favorite_tags li, ul.tags_cloud li
919
 {
919
 {
920
   border-radius: 3px 3px 3px 3px;
920
   border-radius: 3px 3px 3px 3px;
921
   display: inline-block;
921
   display: inline-block;
1382
   padding: 0px;
1382
   padding: 0px;
1383
 }
1383
 }
1384
 
1384
 
1385
-ul#autoplay_element li
1385
+ul#autoplay_element li, ul.elements li
1386
 {
1386
 {
1387
   list-style-type: none;
1387
   list-style-type: none;
1388
 }
1388
 }
1399
 margin:0;
1399
 margin:0;
1400
 }
1400
 }
1401
 
1401
 
1402
-ul#favorite_tags
1402
+ul#favorite_tags, ul.tags_cloud
1403
 {
1403
 {
1404
   padding:0;
1404
   padding:0;
1405
   margin-top:10px;
1405
   margin-top:10px;
1408
   list-style-type:none;
1408
   list-style-type:none;
1409
 }
1409
 }
1410
 
1410
 
1411
-ul#favorite_tags li a
1411
+ul#favorite_tags li a, ul.tags_cloud li a
1412
 {
1412
 {
1413
   color: white;
1413
   color: white;
1414
 }
1414
 }
2219
 div#login_box
2219
 div#login_box
2220
 {
2220
 {
2221
   margin-top: 23px;
2221
   margin-top: 23px;
2222
+}
2223
+
2224
+ul.playlists ul.tags_cloud
2225
+{
2226
+  margin-top: 5px;
2227
+  margin-bottom: 5px;
2228
+}
2229
+
2230
+ul.playlists ul.tags_cloud li
2231
+{
2232
+  font-size: 11px;
2233
+  font-weight: normal;
2234
+  padding: 4px;
2235
+}
2236
+
2237
+div.playlists_prompt
2238
+{
2239
+  padding: 10px;
2240
+  border: 1px solid red;
2241
+  width: 320px;
2242
+  background-color: white;
2222
 }
2243
 }

+ 12 - 1
web/bundles/muzichcore/js/autoplay.js View File

73
   {
73
   {
74
     $('#autoplay_element_loader').show();
74
     $('#autoplay_element_loader').show();
75
     JQueryJson(url_element_dom_get_one_autoplay+'/'+element_id, {}, function(response){
75
     JQueryJson(url_element_dom_get_one_autoplay+'/'+element_id, {}, function(response){
76
+      
77
+      $('#autoplay_element_loader').hide();
76
       if (response.status == 'success')
78
       if (response.status == 'success')
77
       {
79
       {
78
         $('li#autoplay_element_container').html(response.data);
80
         $('li#autoplay_element_container').html(response.data);
79
-        $('#autoplay_element_loader').hide();
81
+      }
82
+      else
83
+      {
84
+        $('li#autoplay_element_container').html('');
80
       }
85
       }
81
     });
86
     });
82
   }
87
   }
139
     return false;
144
     return false;
140
   });
145
   });
141
   
146
   
147
+  $('a.autoplay_playlist').live('click', function(){
148
+    window.autoplay.start($(this));
149
+    $('html, body').animate({ scrollTop: 0 }, 'fast');
150
+    return false;
151
+  });
152
+  
142
   $('a#autoplay_previous').click(function(){window.autoplay.playPrevious()});
153
   $('a#autoplay_previous').click(function(){window.autoplay.playPrevious()});
143
   
154
   
144
   $('a#autoplay_next').click(function(){window.autoplay.playNext()});
155
   $('a#autoplay_next').click(function(){window.autoplay.playNext()});

+ 142 - 0
web/bundles/muzichcore/js/muzich.js View File

3087
    });
3087
    });
3088
    
3088
    
3089
    
3089
    
3090
+   /**
3091
+    *PLAYLISTS
3092
+    */
3093
+   
3094
+  $('ul.playlist_elements li a.open_element').live('click', function(){
3095
+    
3096
+    // Pour le moment
3097
+    return false;
3098
+    
3099
+    var line = $(this).parents('li.playlist_element');
3100
+    
3101
+    $.getJSON($(this).attr('href'), function(response) {
3102
+      
3103
+      window.ResponseController.execute(
3104
+        response,
3105
+        function(){},
3106
+        function(){}
3107
+      );
3108
+      
3109
+      if (response.status == 'success')
3110
+      {
3111
+        line.append('<ul class="elements"><li class="element">' + response.data + '</li></ul>');
3112
+      }
3113
+      
3114
+    });
3115
+    
3116
+    return false;
3117
+  });
3118
+  
3119
+  $('ul.playlist_elements').sortable({
3120
+    update: function( event, ui ) {
3121
+      
3122
+      var form = ui.item.parents('form')
3123
+      
3124
+      $.ajax({
3125
+       type: 'POST',
3126
+       url: form.attr('action'),
3127
+       data: form.serialize(),
3128
+       success: function(response) {
3129
+        
3130
+          window.ResponseController.execute(
3131
+            response,
3132
+            function(){},
3133
+            function(){}
3134
+          );
3135
+          
3136
+          
3137
+        },
3138
+       dataType: "json"
3139
+     });
3140
+      
3141
+    }
3142
+  });
3143
+  
3144
+  $('ul.elements a.add_to_playlist').live('click', function(event){
3145
+    
3146
+    $('div.playlists_prompt').remove();
3147
+    var prompt = $('<div class="playlists_prompt"><img class="loader" src="/bundles/muzichcore/img/ajax-loader.gif" alt="loading..." /></div>');
3148
+    $('body').append(prompt);
3149
+    
3150
+    prompt.position({
3151
+      my: "left+3 bottom+0",
3152
+      of: event,
3153
+      collision: "fit"
3154
+    });
3155
+    
3156
+    $.getJSON($(this).attr('href'), function(response) {
3157
+      window.ResponseController.execute(
3158
+        response,
3159
+        function(){},
3160
+        function(){}
3161
+      );
3162
+      
3163
+      prompt.find('img.loader').hide();
3164
+      if (response.status == 'success')
3165
+      {
3166
+        prompt.append(response.data);
3167
+        prompt.find('div.create_playlist form').ajaxForm(function(response){
3168
+          window.ResponseController.execute(
3169
+            response,
3170
+            function(){},
3171
+            function(){}
3172
+          );
3173
+          
3174
+          if (response.status == 'success')
3175
+          {
3176
+            $('div.playlists_prompt').remove();
3177
+          }
3178
+          
3179
+          if (response.status == 'error')
3180
+          {
3181
+            prompt.find('div.create_playlist form').html(response.data);
3182
+          }
3183
+          
3184
+        });
3185
+      }
3186
+      
3187
+    });
3188
+    
3189
+    return false;
3190
+  });
3191
+  
3192
+  $('a.add_element_to_playlist').live('click', function(){
3193
+    $.getJSON($(this).attr('href'), function(response) {
3194
+      window.ResponseController.execute(
3195
+        response,
3196
+        function(){},
3197
+        function(){}
3198
+      );
3199
+    });
3200
+    
3201
+    $(this).parents('div.playlists_prompt').remove();
3202
+    return false;
3203
+  });
3204
+  
3205
+  $('a.playlist_pick').live('click', function(){
3206
+    $.getJSON($(this).attr('href'), function(response) {
3207
+      window.ResponseController.execute(
3208
+        response,
3209
+        function(){},
3210
+        function(){}
3211
+      );
3212
+    });
3213
+    
3214
+    return false;
3215
+  });
3216
+  
3217
+  
3218
+  $('ul.playlist_elements a.remove_element').live('click', function () {
3219
+    
3220
+    $.getJSON($(this).attr('href'), function(response) {
3221
+      window.ResponseController.execute(
3222
+        response,
3223
+        function(){},
3224
+        function(){}
3225
+      );
3226
+    });
3227
+    
3228
+    $(this).parents('li.playlist_element').remove();
3229
+    return false;
3230
+  });
3231
+   
3090
 });
3232
 });
3091
 
3233
 
3092
 function open_ajax_popin(url, callback)
3234
 function open_ajax_popin(url, callback)