Skip to content

Commit

Permalink
Merge pull request #140 from n7consulting/dev
Browse files Browse the repository at this point in the history
Prepare Jeyser 2.1.2

 * Translation on Personne Bundle
 * Add Mgate to contributors
 * Fix installation
 * New tested AP
 * Code passes Style CI
  • Loading branch information
Stoakes authored Aug 27, 2017
2 parents 3a809ff + b566de5 commit 8d8a341
Show file tree
Hide file tree
Showing 214 changed files with 3,002 additions and 2,743 deletions.
20 changes: 20 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

$header = <<<'EOF'
Code style for Jeyser CRM project
EOF;

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'concat_space' => ['spacing' => 'one'],
'ordered_imports' => true
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('tests/Fixtures')
->in(__DIR__)
)
;
2 changes: 1 addition & 1 deletion app/AppCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

require_once __DIR__.'/AppKernel.php';
require_once __DIR__ . '/AppKernel.php';

use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;

Expand Down
7 changes: 3 additions & 4 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
$bundles = [
/****************************************
* Symfony *
*****************************************/
Expand All @@ -42,7 +42,6 @@ public function registerBundles()
new FOS\CommentBundle\FOSCommentBundle(),
new FOS\RestBundle\FOSRestBundle(),


new Ob\HighchartsBundle\ObHighchartsBundle(),
new Genemu\Bundle\FormBundle\GenemuFormBundle(),
new JMS\SerializerBundle\JMSSerializerBundle($this),
Expand All @@ -62,9 +61,9 @@ public function registerBundles()
new JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle(),
new N7consulting\RhBundle\N7consultingRhBundle(),
new N7consulting\DevcoBundle\N7consultingDevcoBundle(),
);
];

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
if (in_array($this->getEnvironment(), ['dev', 'test'])) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/TwigBundle/views/Exception/error.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="panel-body">
<code>{{ status_code }} {{ status_text }}</code>
<p>{{ exception.message }}</p>
Si le problème persiste, tu peux m'envoyer un petit rapport d'erreur à <a href="mailto:[email protected]">[email protected]</a> <br>
Si le problème persiste, tu peux m'envoyer un petit rapport d'erreur à <a href="mailto:{{ technical_to }}">{{ technical_to }}</a><br>
Explique bien le contexte et mets des petites images et tout et tout ;)
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/Resources/TwigBundle/views/Exception/error500.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

<div class="error-content">
<h3><i class="fa fa-warning text-red"></i> T'as tout cassé !</h3>

<p>
Si le problème persiste, tu nous envoyer un petit rapport d'erreur à <a href="mailto:[email protected]">[email protected]</a> <br>
Explique bien le contexte et mets des petites images et tout et tout ;)
Si le problème persiste, tu peux nous envoyer un petit rapport d'erreur à <a href="mailto:{{ technical_to }}">{{ technical_to }}</a><br>
Pour que le problème soit rapidement pris en compte et traité, le mieux serait de nous faire un rapport directement sur <a href="https://github.com/n7consulting/Incipio/issues/new">GitHub</a><br>
C'est très simple: explique un peu le contexte, ajoute des petites images si tu peux et nous pourrons te répondre ;)
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ along with Incipio as the file LICENSE. If not, see <http://www.gnu.org/license
{# It is illegal (cf licence) to remove the link to github #}
{# And dishonest to remove the reference to Jeyser's main contributors.#}
<p class="text-muted" style="text-align: center">
<i>© Jeyser CRM 2017 &#124; N7 Consulting - AB</i>
<i>© Jeyser CRM 2017 &#124; M-GaTE & N7 Consulting</i>
&#124;
<a href="https://github.com/n7consulting/Incipio">Get it on Github</a>
</p>
Expand Down
1 change: 1 addition & 0 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ twig:
globals:
role_voir_confidentiel: "%role_voir_confidentiel%"
authorizedStorageSize: "%junior_authorizedstoragesize%"
technical_to: "%technical_to%"
# Assetic Configuration
assetic:
debug: "%kernel.debug%"
Expand Down
13 changes: 6 additions & 7 deletions app/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,23 @@
* file that was distributed with this source code.
*/


// This script is very conservative in what it uses to avoid breaks at all costs

use Sensio\Bundle\DistributionBundle\Upgrade\Upgrade;
use Symfony\Component\Console\Output\ConsoleOutput;

// We don't use the app autoloader in case it is not up to date
require_once __DIR__.'/../vendor/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';

$upgrade = new Upgrade();
$output = new ConsoleOutput();

$skeletonDir = __DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton';
$skeletonDir = __DIR__ . '/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton';

$files = array(
__DIR__.'/console' => $skeletonDir.'/app/console',
__DIR__.'/autoload.php' => $skeletonDir.'/app/autoload.php',
);
$files = [
__DIR__ . '/console' => $skeletonDir . '/app/console',
__DIR__ . '/autoload.php' => $skeletonDir . '/app/autoload.php',
];

foreach ($files as $file => $skeleton) {
$upgrade->outputConsoleDiff($output, $file, $skeleton);
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
"php bin/console doctrine:cache:clear-query",
"php bin/console doctrine:cache:clear-metadata"
],
"mysql-reload": [
"php bin/console doctrine:schema:drop --force",
"php bin/console doctrine:schema:update --force",
"php bin/console doctrine:fixtures:load -n"
],
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
Expand Down
113 changes: 0 additions & 113 deletions copyright.sh

This file was deleted.

46 changes: 18 additions & 28 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<?php

use Mgate\DashboardBundle\Command\CreateDataCommand;
use Mgate\UserBundle\DataFixtures\ORM\LoadAdminData;
use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\AfterScenarioScope;
use Behat\Behat\Hook\Scope\AfterStepScope;
use Behat\MinkExtension\Context\MinkContext;
use Behat\Symfony2Extension\Context\KernelDictionary;
use Behat\Testwork\Hook\Scope\BeforeSuiteScope;
use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\ORM\Tools\SchemaTool;
use Symfony\Bundle\FrameworkBundle\Console\Application;
Expand All @@ -22,9 +18,9 @@ class FeatureContext extends MinkContext implements Context
{
use KernelDictionary;

const DEFAULT_USERS = array(
'admin' => array('username' => 'Load', 'password' => 'admin', 'roles'=> array('ROLE_ADMIN')),
);
const DEFAULT_USERS = [
'admin' => ['username' => 'Load', 'password' => 'admin', 'roles' => ['ROLE_ADMIN']],
];

/**
* @var array
Expand All @@ -51,14 +47,15 @@ class FeatureContext extends MinkContext implements Context
*/
private $kernel;

public $username_password = array('admin' => 'admin', 'moderateur' => 'moderateur', 'user' => 'user');
public $username_password = ['admin' => 'admin', 'moderateur' => 'moderateur', 'user' => 'user'];

/**
* Initializes context.
*
* Every scenario gets its own context instance.
* You can also pass arbitrary arguments to the
* context constructor through behat.yml.
*
* @param ManagerRegistry $doctrine
* @param KernelInterface $kernel
*/
Expand All @@ -81,15 +78,13 @@ public function createDatabase()
$application = new Application($this->kernel);
$application->setAutoExit(false);


$input = new ArrayInput(array(
$input = new ArrayInput([
'command' => 'doctrine:fixtures:load',
'-n' => true,
'-e' => 'test',
));
]);
$output = new BufferedOutput();
$application->run($input, $output);

}

/**
Expand All @@ -101,7 +96,6 @@ public function dropDatabase()
$this->schemaTool->dropSchema($this->classes);
}


/** @AfterStep */
public function afterStep(AfterStepScope $event)
{
Expand All @@ -115,10 +109,10 @@ public function afterStep(AfterStepScope $event)
*/
public function iAmLoggedInAs($username)
{
$this->visit("/login");
$this->fillField("_username", $username);
$this->fillField("_password", self::DEFAULT_USERS[$username]['password']);
$this->pressButton("Connexion");
$this->visit('/login');
$this->fillField('_username', $username);
$this->fillField('_password', self::DEFAULT_USERS[$username]['password']);
$this->pressButton('Connexion');
}

/**
Expand All @@ -130,11 +124,11 @@ public function iSeeTheEtudePage($name)

$repository = $doctrine->getRepository('Mgate\EtudeBundle\Entity\Etude');

$etude = $repository->findOneBy(array(
'nom' => $name
));
$etude = $repository->findOneBy([
'nom' => $name,
]);

$this->visit($this->getContainer()->get('router')->generate('MgateSuivi_etude_voir', array('nom' => $etude->getNom())));
$this->visit($this->getContainer()->get('router')->generate('MgateSuivi_etude_voir', ['nom' => $etude->getNom()]));
}

/**
Expand All @@ -145,15 +139,11 @@ public function theUserIsActive($username)
$doctrine = $this->getContainer()->get('doctrine');
$repository = $doctrine->getRepository('Mgate\UserBundle\Entity\User');

$user = $repository->findOneBy(array(
'username' => $username
));
$user = $repository->findOneBy([
'username' => $username,
]);
$user->setEnabled(true);

$doctrine->getManager()->flush();
}


}


6 changes: 3 additions & 3 deletions src/Mgate/CommentBundle/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public function maintenanceAction()
$etudes = $em->getRepository('MgateSuiviBundle:Etude')->findAll();

foreach ($etudes as $entity) {
if (!$em->getRepository('MgateCommentBundle:Thread')->findBy(array('id' => $entity))) {
$this->container->get('Mgate_comment.thread')->creerThread('etude_', $this->container->get('router')->generate('MgatePersonne_prospect_voir', array('id' => $entity->getId())), $entity);
if (!$em->getRepository('MgateCommentBundle:Thread')->findBy(['id' => $entity])) {
$this->container->get('Mgate_comment.thread')->creerThread('etude_', $this->container->get('router')->generate('MgatePersonne_prospect_voir', ['id' => $entity->getId()]), $entity);
}
}

return $this->render('MgateCommentBundle:Default:index.html.twig', array('name' => 'rien'));
return $this->render('MgateCommentBundle:Default:index.html.twig', ['name' => 'rien']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function load(array $configs, ContainerBuilder $container)
$configuration = new Configuration();
$this->processConfiguration($configuration, $configs);

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yml');
}
}
Loading

0 comments on commit 8d8a341

Please sign in to comment.