Skip to content

Commit

Permalink
fixed textpage admin
Browse files Browse the repository at this point in the history
  • Loading branch information
dutow committed May 11, 2012
1 parent 808dc6b commit 53cc8c3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
13 changes: 13 additions & 0 deletions Controller/Admin/TextPageController.php
Expand Up @@ -160,13 +160,26 @@ public function newAction()
$textpage = $form->getData();

$em->persist($textpage);

if ("section" == $subtype) {
$em->persist($textpage->getSection());
}
if ("round" == $subtype) {
$em->persist($textpage->getRound());
}

$em->flush();
if ("section" == $subtype) {
$section = $textpage->getSection();
$section->setPage($textpage);
$em->persist($section);
}
if ("round" == $subtype) {
$round = $textpage->getRound();
$round->setPage($textpage);
$em->persist($round);
}

$em->flush();

return $this->redirect($this->generateUrl('admin_textpage_index'));
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Mod/RegistrationModCompilerPass.php
Expand Up @@ -16,7 +16,7 @@ public function process(ContainerBuilder $container)
$registry = $container->getDefinition('eotvos.versenyr.registrationregistry');

foreach ($container->findTaggedServiceIds('eotvos.versenyr.registrationtype') as $id => $attributes) {
$registry->addMethodCall('register', array(new Reference($id)));
$registry->addMethodCall('register', array($id, new Reference($id)));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Mod/RoundModCompilerPass.php
Expand Up @@ -15,7 +15,7 @@ public function process(ContainerBuilder $container)
$registry = $container->getDefinition('eotvos.versenyr.roundregistry');

foreach ($container->findTaggedServiceIds('eotvos.versenyr.roundtype') as $id => $attributes) {
$registry->addMethodCall('register', array(new Reference($id)));
$registry->addMethodCall('register', array($id, new Reference($id)));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions DependencyInjection/Registry/ModuleRegistry.php
Expand Up @@ -10,9 +10,9 @@ public function __construct()
$this->modules = array();
}

public function register($service_id)
public function register($service_name, $service_type)
{
$this->modules[] = $service_id;
$this->modules[$service_name] = $service_type;
}

public function getModuleList()
Expand Down
1 change: 1 addition & 0 deletions Form/Type/RoundType.php
Expand Up @@ -48,6 +48,7 @@ public function buildForm(FormBuilder $builder, array $options)
$types[$service] = $obj->getDisplayName();
}


$builder->add('start', 'date', array('widget' => 'single_text', 'format' => 'yyyy-MM-dd'));
$builder->add('stop', 'date', array('widget' => 'single_text', 'format' => 'yyyy-MM-dd'));
$builder->add('advanceNo', 'number');
Expand Down

0 comments on commit 53cc8c3

Please sign in to comment.