Commit 9c721ead authored by Marc Ducobu's avatar Marc Ducobu
Browse files

first commit

parents
<?php
namespace Chill\ICPC2Bundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillICPC2Bundle extends Bundle
{
}
<?php
namespace Chill\ICPC2Bundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
public function indexAction($name)
{
return $this->render('ChillICPC2Bundle:Default:index.html.twig', array('name' => $name));
}
}
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ICPC2Bundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Chill\ICPC2Bundle\Entity\Chapter;
/**
* Load Chapter into database
*/
class LoadChapter extends AbstractFixture implements OrderedFixtureInterface
{
public function getOrder()
{
return 17001;
}
public function load(ObjectManager $manager)
{
echo "loading Chapters...\n";
$chapters = [
array("en" => "Process codes", "slug" => "-"),
array("en" => "General and Unspecified", "slug" => "A"),
array("en" => "Blood, Blood Forming, Organs and Immune Mechanism", "slug" => "B"),
array("en" => "Digestive", "slug" => "D"),
array("en" => "Eye", "slug" => "F"),
array("en" => "Ear", "slug" => "H"),
array("en" => "Cardiovascular", "slug" => "K"),
array("en" => "Musculoskeletal", "slug" => "K"),
array("en" => "Neurological", "slug" => "N"),
array("en" => "Psychological", "slug" => "P"),
array("en" => "Respiratory", "slug" => "R"),
array("en" => "Skin", "slug" => "S"),
array("en" => "Endocrine/Metabolic and Nutritional", "slug" => "T"),
array("en" => "Urological", "slug" => "U"),
array("en" => "Pregnancy, Childbearing, Family Planning", "slug" => "W"),
array("en" => "Female Genital", "slug" => "X"),
array("en" => "Male Genital", "slug" => "Y"),
array("en" => "Social Problems", "slug" => "Z")
]
foreach ($chapters as $c) {
$e = (new Chapter())
->setSlug($c["slug"])
->setName(array("en" => $c["en"]));
$this->addReference($c["slug"], $e);
$manager->persist($e);
}
$manager->flush();
}
}
\ No newline at end of file
This diff is collapsed.
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ICPC2Bundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Chill\ICPC2Bundle\Entity\Component;
/**
* Load Component for Report into database
*/
class LoadChapter extends AbstractFixture implements OrderedFixtureInterface
{
public function getOrder()
{
return 17002;
}
public function load(ObjectManager $manager)
{
echo "loading Components...\n";
$components = [
array("en" => "PROCESS CODES", "slug" => "pro"),
array("en" => "SYMPTOMS/COMPLAINTS", "slug" => "sym"),
array("en" => "INFECTIONS", "slug" => "inf"),
array("en" => "NEOPLASMS", "slug" => "neo"),
array("en" => "INJURIES", "slug" => "inj"),
array("en" => "CONGENITAL ANOMALIES", "slug" => "con"),
array("en" => "OTHER DIAGNOSES", "slug" => "oth"),
];
foreach ($chapters as $c) {
$e = (new Component())
->setSlug($c["slug"])
->setName(array("en" => $c["en"]));
$this->addReference($c["slug"], $e);
$manager->persist($e);
}
$manager->flush();
}
}
\ No newline at end of file
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ICPC2Bundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class ChillICPC2Extension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ICPC2Bundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('chill_icpc2');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}
}
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ICPC2Bundle\Entity;
/**
* Chapter
*/
class Chapter
{
/**
* @var integer
*/
private $id;
/**
* @var array
*/
private $name;
/**
* @var string
*/
private $slug;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param array $name
*
* @return Chapter
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return array
*/
public function getName()
{
return $this->name;
}
/**
* Set slug
*
* @param string $slug
*
* @return Chapter
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
}
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ICPC2Bundle\Entity;
/**
* Code
*/
class Code
{
/**
* @var integer
*/
private $id;
/**
* @var string
*/
private $code;
/**
* @var \stdClass
*/
private $chapter;
/**
* @var \stdClass
*/
private $component;
/**
* @var array
*/
private $name;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set code
*
* @param string $code
*
* @return Code
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
/**
* Get code
*
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* Set chapter
*
* @param \stdClass $chapter
*
* @return Code
*/
public function setChapter($chapter)
{
$this->chapter = $chapter;
return $this;
}
/**
* Get chapter
*
* @return \stdClass
*/
public function getChapter()
{
return $this->chapter;
}
/**
* Set component
*
* @param \stdClass $component
*
* @return Code
*/
public function setComponent($component)
{
$this->component = $component;
return $this;
}
/**
* Get component
*
* @return \stdClass
*/
public function getComponent()
{
return $this->component;
}
/**
* Set name
*
* @param array $name
*
* @return Code
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return array
*/
public function getName()
{
return $this->name;
}
}
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ICPC2Bundle\Entity;
/**
* Component
*/
class Component
{
/**
* @var integer
*/
private $id;
/**
* @var array
*/
private $name;
/**
* @var string
*/
private $slug;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param array $name
*
* @return Component
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return array
*/
public function getName()
{
return $this->name;
}
/**
* Set slug
*
* @param string $slug
*
* @return Component
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}