# HG changeset patch # User clebeaupin # Date 1269430090 -3600 # Node ID a4385e32235609e4ddd56f3b8e9e9bbe38d4173f # Parent b40169630952ca4e0973810c279d90e97e4c1798 Add production_countries field on film model diff -r b40169630952 -r a4385e322356 web/thdProject/apps/frontend/modules/homepage/actions/components.class.php --- a/web/thdProject/apps/frontend/modules/homepage/actions/components.class.php Wed Mar 24 11:47:38 2010 +0100 +++ b/web/thdProject/apps/frontend/modules/homepage/actions/components.class.php Wed Mar 24 12:28:10 2010 +0100 @@ -1,4 +1,4 @@ -tag = Array('score' => 3); } - + public function executeRandomFilm() { - + // FIXME: Dummy value + $this->tag = Array('score' => 3); } - + public function executeLastTaggedList() { $query = Doctrine_Query::create() ->from('ThdFilm F') @@ -26,7 +28,7 @@ ->limit(0,10); $this->lastTaggedFilms = $query->execute(); $this->videoPath = sfConfig::get('app_player_videoPath'); - + } public function executeMostTaggedList() { $query = Doctrine_Query::create() @@ -39,18 +41,18 @@ $this->mostTaggedFilms = $query->execute(); $this->videoPath = sfConfig::get('app_player_videoPath'); } - + public function executeResultList(sfWebRequest $request) { - + $text = $request->getParameter('text'); - + $event = $this->dispatcher->notify(new sfEvent($this, 'uvmc_solr.search', array('query' => $text))); $response = $event->getReturnValue(); // solr is configured to give you back a serialized php array $rawResp = $response->getRawResponse(); $results = unserialize($rawResp); - + $primaryKeys = array(); foreach($results['response']['docs'] as $doc) @@ -71,8 +73,8 @@ $this->searchResult = array(); $this->searchCount = 0; } - - + + /*$query = Doctrine_Query::create() ->from('ThdFilm F') ->leftJoin('F.images I ') diff -r b40169630952 -r a4385e322356 web/thdProject/apps/frontend/modules/homepage/templates/_randomFilm.php --- a/web/thdProject/apps/frontend/modules/homepage/templates/_randomFilm.php Wed Mar 24 11:47:38 2010 +0100 +++ b/web/thdProject/apps/frontend/modules/homepage/templates/_randomFilm.php Wed Mar 24 12:28:10 2010 +0100 @@ -18,19 +18,19 @@ }); } -

Regardez et annotez des extraits :

+

Regardez et annotez des extraits :

Anna M
De Michel Spinosa
-
+
Tags liés au film : -
- + + diff -r b40169630952 -r a4385e322356 web/thdProject/apps/frontend/modules/homepage/templates/_tagList.php --- a/web/thdProject/apps/frontend/modules/homepage/templates/_tagList.php Wed Mar 24 11:47:38 2010 +0100 +++ b/web/thdProject/apps/frontend/modules/homepage/templates/_tagList.php Wed Mar 24 12:28:10 2010 +0100 @@ -1,6 +1,6 @@

Navigation par tag :

-
\ No newline at end of file diff -r b40169630952 -r a4385e322356 web/thdProject/apps/frontend/modules/search/templates/_search.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/thdProject/apps/frontend/modules/search/templates/_search.php Wed Mar 24 12:28:10 2010 +0100 @@ -0,0 +1,9 @@ + \ No newline at end of file diff -r b40169630952 -r a4385e322356 web/thdProject/apps/frontend/modules/search/templates/_searchList.php --- a/web/thdProject/apps/frontend/modules/search/templates/_searchList.php Wed Mar 24 11:47:38 2010 +0100 +++ b/web/thdProject/apps/frontend/modules/search/templates/_searchList.php Wed Mar 24 12:28:10 2010 +0100 @@ -14,11 +14,11 @@ $directors = json_decode($item->getDirectors(), true); ?>
  • -
    ') no-repeat;" href=""> +
    ') no-repeat;" href="">
    De
    - +
    • diff -r b40169630952 -r a4385e322356 web/thdProject/config/doctrine/schema.yml --- a/web/thdProject/config/doctrine/schema.yml Wed Mar 24 11:47:38 2010 +0100 +++ b/web/thdProject/config/doctrine/schema.yml Wed Mar 24 12:28:10 2010 +0100 @@ -26,6 +26,9 @@ type: string(255) notnull: true original_title: string(255) + production_countries: + type: string(2147483647) + notnull: true production_year: integer(8) uniqueid: type: string(36) diff -r b40169630952 -r a4385e322356 web/thdProject/data/fixtures/data.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/thdProject/data/fixtures/data.yml Wed Mar 24 12:28:10 2010 +0100 @@ -0,0 +1,83 @@ +ThdFilm: + ThdFilm_1: + images: ThdImage_29001 + title: '17, rue Bleue' + pitch: '1967 : cinq ans après sa fuite d''Algérie, Adda vit à Paris, avec ses deux enfants et ses deux soeurs. Elle vit une aventure amoureuse avec son patron, mais ce sont les fantômes du passé qui sont les plus forts...' + duration: '95' + directors: '[{"name":"Chad Chenouga"}]' + actors: '[{"name":"Abdel Halis"},{"name":"Lysiane Meis"}]' + slug_url: 17-rue-bleue + original_title: null + production_countries: '[{"label":"France"}]' + production_year: '2000' + uniqueid: '1' + ThdFilm_2: + images: ThdImage_25001 + title: 'A travers la forêt' + pitch: 'Armelle n''arrive pas à oublier Renaud. Elle le voit, elle chante pour lui, elle l''étreint. Elle lui parle toujours. Pourtant, Renaud est mort... Mais pas pour elle. C''est un accident de moto ; Armelle n''arrive pas à l''oublier et croit que son amant continue à vivre auprès d''elle. Et puis elle rencontre Hippolyte, qui ressemble trait pour trait à Renaud.' + duration: '65' + directors: '[{"name":"Jean-Paul Civeyrac"}]' + actors: '[{"name":"Camille Berthomier"},{"name":"Aurélien Wiik"}]' + slug_url: a-travers-la-foret + original_title: null + production_countries: '[{"label":"France"}]' + production_year: '2004' + uniqueid: '2' + ThdFilm_3: + images: ThdImage_13002 + title: 'Après lui' + pitch: 'Camille voit sa vie brisée par la disparition de son fils dans un accident de la route. Incapable de faire le deuil, elle s''attache à Franck, le meilleur ami de celui-ci, qui est aussi le responsable du drame. Qu''importe le scandale, Franck devient l''objet consentant de son affection. Mais, peu à peu, il va prendre conscience que l''obsession de Camille le met en danger.' + duration: '93' + directors: '[{"name":"Gaël Morel"}]' + actors: '[{"name":"Elodie Bouchez"},{"name":"Catherine Deneuve"},{"name":"Thomas Dumerchez"},{"name":"Guy Marchand"}]' + slug_url: apres-lui + original_title: null + production_countries: '[{"label":"France"}]' + production_year: '2006' + uniqueid: '3' + ThdFilm_4: + images: ThdImage_39031 + title: 'Buenos Aires 100 km' + pitch: 'A 100 km de Buenos Aires, un village comme tant d''autres, où le temps semble suspendu. Cinq amis de toujours y passent l''été de leurs 13 ans. Ils observent, rêvent, discutent, questionnent. C''est aussi l''été des premières fois : l''amour, le sexe, les cigarettes... Les secrets du village sont leurs principales préoccupations, en même temps que l''envie d''en partir.' + duration: '93' + directors: '[{"name":"Pablo José Meza"}]' + actors: '[{"name":"Emiliano Fernández"},{"name":"Juan Ignacio Perez Roca"}]' + slug_url: buenos-aires-100-km + original_title: 'Buenos Aires 100 kilómetros' + production_countries: '[{"label":"Argentine"},{"label":"France"},{"label":"Espagne"}]' + production_year: '2004' + uniqueid: '4' +ThdImage: + ThdImage_1: + ThdFilm: ThdFilm_39031 + type: '1' + file: 1482b3f8-7c56-11de-94a8-99b39278c804 + ThdImage_2: + ThdFilm: ThdFilm_13002 + type: '1' + file: 2b95e3dc-7c56-11de-b8e9-8d849c1c2c06 + ThdImage_3: + ThdFilm: ThdFilm_25001 + type: '1' + file: 0625c797-7c56-11de-bfb5-5b02eae1fc54 + ThdImage_4: + ThdFilm: ThdFilm_29001 + type: '1' + file: 0c45e138-7c56-11de-a235-375dca301e99 +ThdVideo: + ThdVideo_1: + ThdFilm: ThdFilm_29001 + file: 029001_17-rue-bleue + title: 'Trailer 17 rue bleue' + ThdVideo_2: + ThdFilm: ThdFilm_25001 + file: 025001_a-travers-la-foret + title: 'Trailer à travers la forêt' + ThdVideo_3: + ThdFilm: ThdFilm_39031 + file: 039031_buenos-aires-100-km + title: 'Trailer Buenos Aires 100km' + ThdVideo_4: + ThdFilm: ThdFilm_13002 + file: 013002_apres-lui + title: 'Trailer Après lui' diff -r b40169630952 -r a4385e322356 web/thdProject/data/fixtures/fixtures.yml --- a/web/thdProject/data/fixtures/fixtures.yml Wed Mar 24 11:47:38 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -# # Populate this file with data to be loaded by your ORM's *:data-load task. -# # You can create multiple files in this directory (i.e. 010_users.yml, -# # 020_articles.yml, etc) which will be loaded in alphabetical order. -# # -# # See documentation for your ORM's *:data-load task for more information. -# -# User: -# fabien: -# username: fabien -# password: changeme -# name: Fabien Potencier -# email: fabien.potencier@symfony-project.com -# kris: -# username: Kris.Wallsmith -# password: changeme -# name: Kris Wallsmith -# email: kris.wallsmith@symfony-project.com diff -r b40169630952 -r a4385e322356 web/thdProject/data/sql/schema.sql --- a/web/thdProject/data/sql/schema.sql Wed Mar 24 11:47:38 2010 +0100 +++ b/web/thdProject/data/sql/schema.sql Wed Mar 24 12:28:10 2010 +0100 @@ -1,4 +1,4 @@ -CREATE TABLE thd_film (id INT, ref INT NOT NULL, title VARCHAR(255) NOT NULL, pitch TEXT NOT NULL, duration INT NOT NULL, directors TEXT NOT NULL, actors TEXT NOT NULL, slug_url VARCHAR(255) NOT NULL, original_title VARCHAR(255), production_year BIGINT, uniqueid VARCHAR(36) NOT NULL, UNIQUE INDEX uniqueidindex_idx (uniqueid), PRIMARY KEY(id)) ENGINE = INNODB; +CREATE TABLE thd_film (id INT, ref INT NOT NULL, title VARCHAR(255) NOT NULL, pitch TEXT NOT NULL, duration INT NOT NULL, directors TEXT NOT NULL, actors TEXT NOT NULL, slug_url VARCHAR(255) NOT NULL, original_title VARCHAR(255), production_countries TEXT NOT NULL, production_year BIGINT, uniqueid VARCHAR(36) NOT NULL, UNIQUE INDEX uniqueidindex_idx (uniqueid), PRIMARY KEY(id)) ENGINE = INNODB; CREATE TABLE thd_image (id INT AUTO_INCREMENT, film_ref INT NOT NULL, type TINYINT NOT NULL, file VARCHAR(255) NOT NULL, INDEX film_ref_idx (film_ref), PRIMARY KEY(id)) ENGINE = INNODB; CREATE TABLE thd_video (id INT AUTO_INCREMENT, ref INT NOT NULL, film_ref INT NOT NULL, file VARCHAR(255) NOT NULL, title VARCHAR(255), INDEX film_ref_idx (film_ref), PRIMARY KEY(id)) ENGINE = INNODB; CREATE TABLE thd_segment (id INT AUTO_INCREMENT, title VARCHAR(255), tags TEXT, description TEXT, video_ref INT NOT NULL, start DOUBLE NOT NULL, end DOUBLE NOT NULL, user_id INT NOT NULL, creation_date DATETIME NOT NULL, uniqueid VARCHAR(36) NOT NULL, UNIQUE INDEX uniqueidindex_idx (uniqueid), INDEX video_ref_idx (video_ref), PRIMARY KEY(id)) ENGINE = INNODB; diff -r b40169630952 -r a4385e322356 web/thdProject/lib/filter/doctrine/base/BaseThdFilmFormFilter.class.php --- a/web/thdProject/lib/filter/doctrine/base/BaseThdFilmFormFilter.class.php Wed Mar 24 11:47:38 2010 +0100 +++ b/web/thdProject/lib/filter/doctrine/base/BaseThdFilmFormFilter.class.php Wed Mar 24 12:28:10 2010 +0100 @@ -14,29 +14,31 @@ public function setup() { $this->setWidgets(array( - 'ref' => new sfWidgetFormDoctrineChoice(array('model' => 'ThdImage', 'add_empty' => true)), - 'title' => new sfWidgetFormFilterInput(), - 'pitch' => new sfWidgetFormFilterInput(), - 'duration' => new sfWidgetFormFilterInput(), - 'directors' => new sfWidgetFormFilterInput(), - 'actors' => new sfWidgetFormFilterInput(), - 'slug_url' => new sfWidgetFormFilterInput(), - 'original_title' => new sfWidgetFormFilterInput(), - 'production_year' => new sfWidgetFormFilterInput(), - 'uniqueid' => new sfWidgetFormFilterInput(), + 'ref' => new sfWidgetFormDoctrineChoice(array('model' => 'ThdImage', 'add_empty' => true)), + 'title' => new sfWidgetFormFilterInput(), + 'pitch' => new sfWidgetFormFilterInput(), + 'duration' => new sfWidgetFormFilterInput(), + 'directors' => new sfWidgetFormFilterInput(), + 'actors' => new sfWidgetFormFilterInput(), + 'slug_url' => new sfWidgetFormFilterInput(), + 'original_title' => new sfWidgetFormFilterInput(), + 'production_countries' => new sfWidgetFormFilterInput(), + 'production_year' => new sfWidgetFormFilterInput(), + 'uniqueid' => new sfWidgetFormFilterInput(), )); $this->setValidators(array( - 'ref' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'ThdImage', 'column' => 'id')), - 'title' => new sfValidatorPass(array('required' => false)), - 'pitch' => new sfValidatorPass(array('required' => false)), - 'duration' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))), - 'directors' => new sfValidatorPass(array('required' => false)), - 'actors' => new sfValidatorPass(array('required' => false)), - 'slug_url' => new sfValidatorPass(array('required' => false)), - 'original_title' => new sfValidatorPass(array('required' => false)), - 'production_year' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))), - 'uniqueid' => new sfValidatorPass(array('required' => false)), + 'ref' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'ThdImage', 'column' => 'id')), + 'title' => new sfValidatorPass(array('required' => false)), + 'pitch' => new sfValidatorPass(array('required' => false)), + 'duration' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))), + 'directors' => new sfValidatorPass(array('required' => false)), + 'actors' => new sfValidatorPass(array('required' => false)), + 'slug_url' => new sfValidatorPass(array('required' => false)), + 'original_title' => new sfValidatorPass(array('required' => false)), + 'production_countries' => new sfValidatorPass(array('required' => false)), + 'production_year' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))), + 'uniqueid' => new sfValidatorPass(array('required' => false)), )); $this->widgetSchema->setNameFormat('thd_film_filters[%s]'); @@ -54,17 +56,18 @@ public function getFields() { return array( - 'id' => 'Number', - 'ref' => 'ForeignKey', - 'title' => 'Text', - 'pitch' => 'Text', - 'duration' => 'Number', - 'directors' => 'Text', - 'actors' => 'Text', - 'slug_url' => 'Text', - 'original_title' => 'Text', - 'production_year' => 'Number', - 'uniqueid' => 'Text', + 'id' => 'Number', + 'ref' => 'ForeignKey', + 'title' => 'Text', + 'pitch' => 'Text', + 'duration' => 'Number', + 'directors' => 'Text', + 'actors' => 'Text', + 'slug_url' => 'Text', + 'original_title' => 'Text', + 'production_countries' => 'Text', + 'production_year' => 'Number', + 'uniqueid' => 'Text', ); } } \ No newline at end of file diff -r b40169630952 -r a4385e322356 web/thdProject/lib/form/doctrine/base/BaseThdFilmForm.class.php --- a/web/thdProject/lib/form/doctrine/base/BaseThdFilmForm.class.php Wed Mar 24 11:47:38 2010 +0100 +++ b/web/thdProject/lib/form/doctrine/base/BaseThdFilmForm.class.php Wed Mar 24 12:28:10 2010 +0100 @@ -12,31 +12,33 @@ public function setup() { $this->setWidgets(array( - 'id' => new sfWidgetFormInputHidden(), - 'ref' => new sfWidgetFormDoctrineChoice(array('model' => 'ThdImage', 'add_empty' => false)), - 'title' => new sfWidgetFormInput(), - 'pitch' => new sfWidgetFormTextarea(), - 'duration' => new sfWidgetFormInput(), - 'directors' => new sfWidgetFormTextarea(), - 'actors' => new sfWidgetFormTextarea(), - 'slug_url' => new sfWidgetFormInput(), - 'original_title' => new sfWidgetFormInput(), - 'production_year' => new sfWidgetFormInput(), - 'uniqueid' => new sfWidgetFormInput(), + 'id' => new sfWidgetFormInputHidden(), + 'ref' => new sfWidgetFormDoctrineChoice(array('model' => 'ThdImage', 'add_empty' => false)), + 'title' => new sfWidgetFormInput(), + 'pitch' => new sfWidgetFormTextarea(), + 'duration' => new sfWidgetFormInput(), + 'directors' => new sfWidgetFormTextarea(), + 'actors' => new sfWidgetFormTextarea(), + 'slug_url' => new sfWidgetFormInput(), + 'original_title' => new sfWidgetFormInput(), + 'production_countries' => new sfWidgetFormTextarea(), + 'production_year' => new sfWidgetFormInput(), + 'uniqueid' => new sfWidgetFormInput(), )); $this->setValidators(array( - 'id' => new sfValidatorDoctrineChoice(array('model' => 'ThdFilm', 'column' => 'id', 'required' => false)), - 'ref' => new sfValidatorDoctrineChoice(array('model' => 'ThdImage')), - 'title' => new sfValidatorString(array('max_length' => 255)), - 'pitch' => new sfValidatorString(array('max_length' => 2147483647)), - 'duration' => new sfValidatorInteger(), - 'directors' => new sfValidatorString(array('max_length' => 2147483647)), - 'actors' => new sfValidatorString(array('max_length' => 2147483647)), - 'slug_url' => new sfValidatorString(array('max_length' => 255)), - 'original_title' => new sfValidatorString(array('max_length' => 255, 'required' => false)), - 'production_year' => new sfValidatorInteger(array('required' => false)), - 'uniqueid' => new sfValidatorString(array('max_length' => 36)), + 'id' => new sfValidatorDoctrineChoice(array('model' => 'ThdFilm', 'column' => 'id', 'required' => false)), + 'ref' => new sfValidatorDoctrineChoice(array('model' => 'ThdImage')), + 'title' => new sfValidatorString(array('max_length' => 255)), + 'pitch' => new sfValidatorString(array('max_length' => 2147483647)), + 'duration' => new sfValidatorInteger(), + 'directors' => new sfValidatorString(array('max_length' => 2147483647)), + 'actors' => new sfValidatorString(array('max_length' => 2147483647)), + 'slug_url' => new sfValidatorString(array('max_length' => 255)), + 'original_title' => new sfValidatorString(array('max_length' => 255, 'required' => false)), + 'production_countries' => new sfValidatorString(array('max_length' => 2147483647)), + 'production_year' => new sfValidatorInteger(array('required' => false)), + 'uniqueid' => new sfValidatorString(array('max_length' => 36)), )); $this->validatorSchema->setPostValidator( diff -r b40169630952 -r a4385e322356 web/thdProject/lib/model/doctrine/base/BaseThdFilm.class.php --- a/web/thdProject/lib/model/doctrine/base/BaseThdFilm.class.php Wed Mar 24 11:47:38 2010 +0100 +++ b/web/thdProject/lib/model/doctrine/base/BaseThdFilm.class.php Wed Mar 24 12:28:10 2010 +0100 @@ -52,6 +52,11 @@ 'type' => 'string', 'length' => '255', )); + $this->hasColumn('production_countries', 'string', 2147483647, array( + 'type' => 'string', + 'notnull' => true, + 'length' => '2147483647', + )); $this->hasColumn('production_year', 'integer', 8, array( 'type' => 'integer', 'length' => '8',