Skip to content

Commit

Permalink
Finish V0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
RignonNoel committed Sep 25, 2015
2 parents 122b65e + 5a37b24 commit 9c7f8c5
Show file tree
Hide file tree
Showing 212 changed files with 15,095 additions and 11,826 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
./tmp/*
./logs/*
tmp/*
logs/*
.idea/*
*~
composer.lock
Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ before_script:
script:
- phpunit --coverage-clover build/logs/clover.xml -v
- php vendor/bin/coveralls -c .coveralls.yml -v
- sh -c "vendor/bin/phpcs -p --config-set show_warnings 0 --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src/Model ./src/Controller ./tests/TestCase"
- sh -c "vendor/bin/phpcs -p --config-set show_warnings 0 --extensions=php ./src/Model ./src/Controller ./tests/TestCase"
- sh -c "vendor/bin/phpcs -p --config-set show_warnings 0"
- sh -c "vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src/Model ./src/Controller ./tests/TestCase"
- sh -c "vendor/bin/phpcs -p --extensions=php ./src/Model ./src/Controller ./tests/TestCase"


6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Stories in Ready](https://badge.waffle.io/MaisonLogicielLibre/Website.svg?label=ready&title=Ready)](http://waffle.io/MaisonLogicielLibre/Website)
[![Licence GPL](http://img.shields.io/badge/license-GPL-green.svg)](http://www.gnu.org/licenses/quick-guide-gplv3.fr.html)
[![Coverage Status](https://coveralls.io/repos/MaisonLogicielLibre/Site/badge.svg?branch=master&service=github)](https://coveralls.io/github/MaisonLogicielLibre/Website?branch=master)
[![Build Status](https://travis-ci.org/MaisonLogicielLibre/Website.svg?branch=develop)](https://travis-ci.org/MaisonLogicielLibre/Website)
[![Coverage Status](https://coveralls.io/repos/MaisonLogicielLibre/Website/badge.svg?branch=master&service=github)](https://coveralls.io/github/MaisonLogicielLibre/Website?branch=master)
[![Build Status](https://travis-ci.org/MaisonLogicielLibre/Website.svg?branch=master)](https://travis-ci.org/MaisonLogicielLibre/Website)

# Site
Site internet de la Maison du Logiciel Libre (MLL) codé à l'aide du framework [CakePHP](http://cakephp.org/) 3.0.
Expand All @@ -12,7 +12,7 @@ Ce site est destiné à la communauté étudiante, il permet l'intégration et l

Les fonctionnalités à venir sont reportées essentiellement dans le [*bugtraker*](https://github.com/MaisonLogicielLibre/TableauDeBord/issues).

Vous pouvez suivre l'avancé du projet sur notre [dashboard](https://waffle.io/MaisonLogicielLibre/Site) héberger sur Waffle.io.
Vous pouvez suivre l'avancé du projet sur notre [dashboard](https://waffle.io/MaisonLogicielLibre/Website) héberger sur Waffle.io.

# Prototype

Expand Down
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@
"homepage": "http://cakephp.org",
"type": "project",
"license": "MIT",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/MaisonLogicielLibre/API_SVN"
}
],
"require": {
"php": ">=5.4.16",
"cakephp/cakephp": "~3.0",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*"
"cakephp/plugin-installer": "*",
"elboletaire/twbs-cake-plugin": "dev-master",
"mll/apisvn": "1.0-alpha"
},
"require-dev": {
"psy/psysh": "@stable",
Expand Down
18 changes: 18 additions & 0 deletions config/Migrations/20150916173706_modify_gender_to_boolean.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
use Migrations\AbstractMigration;

class ModifyGenderToBoolean extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('users');
$table->changeColumn('gender', 'boolean');
}
}
22 changes: 22 additions & 0 deletions config/Migrations/20150918173125_modify_users_nullables.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
use Migrations\AbstractMigration;

class ModifyUsersNullables extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('users');
$table->changeColumn('universitie_id', 'integer', ['null' => true]);
$table->changeColumn('gender', 'boolean' , ['null' => true]);
$table->changeColumn('phone', 'string', ['limit' => 25, 'null' => true]);
$table->changeColumn('firstName', 'string', ['limit' => 50, 'null' => true]);
$table->changeColumn('lastName' , 'string' , ['limit' => 50, 'null' => true]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
use Migrations\AbstractMigration;

class AddIsValidatedToOrganizations extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('organizations');
$table->addColumn('isValidated', 'boolean', [
'default' => null,
'null' => false,
]);
$table->update();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
use Migrations\AbstractMigration;

class AddIsRejectedToOrganizations extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('organizations');
$table->addColumn('isRejected', 'boolean', [
'default' => null,
'null' => false,
]);
$table->update();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
use Migrations\AbstractMigration;

class ModifyOrganizationsProjectFieldOrganization extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('organizations_projects');
$table->renameColumn('organization', 'organization_id');
}
}
17 changes: 17 additions & 0 deletions config/Migrations/20150922195349_drop_projects_users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
use Migrations\AbstractMigration;
class DropProjectsUsers extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('projects_users');
$table->drop();
}
}
17 changes: 17 additions & 0 deletions config/Migrations/20150922195414_drop_projects_users_missions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
use Migrations\AbstractMigration;
class DropProjectsUsersMissions extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('projects_users_missions');
$table->drop();
}
}
17 changes: 17 additions & 0 deletions config/Migrations/20150922195649_create_projects_mentors.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
use Migrations\AbstractMigration;
class CreateProjectsMentors extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('projects_mentors');
$table->create();
}
}
18 changes: 18 additions & 0 deletions config/Migrations/20150922195705_create_projects_contributors.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

<?php
use Migrations\AbstractMigration;
class CreateProjectsContributors extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('projects_contributors');
$table->create();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
use Migrations\AbstractMigration;
class AddProjectIdToProjectsMentors extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('projects_mentors');
$table->addColumn('project_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('user_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->update();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
use Migrations\AbstractMigration;
class AddUserIdToProjectsContributors extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('projects_contributors');
$table->addColumn('user_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('project_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->update();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
use Migrations\AbstractMigration;

class RemoveProjectsUserIdFromComments extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('comments');
$table->removeColumn('projects_user_id');
$table->update();
}
}
1 change: 1 addition & 0 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
*/

Plugin::load('Migrations');
Plugin::load('Bootstrap', ['bootstrap' => true]);

// Only try to load DebugKit in development mode
// Debug Kit should not be installed on a production system
Expand Down
30 changes: 30 additions & 0 deletions src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

use Cake\Controller\Controller;
use Cake\Event\Event;
use Cake\I18n\I18n;

/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
Expand All @@ -34,9 +35,18 @@
* @link http://cakephp.org CakePHP(tm) Project
* @since 0.2.9
*/

class AppController extends Controller
{

public $helpers = [
'Less.Less', // required for parsing less files
'BootstrapUI.Form',
'BootstrapUI.Html',
'BootstrapUI.Flash',
'BootstrapUI.Paginator'
];

/**
* Initialization hook method.
*
Expand All @@ -60,13 +70,33 @@ public function initialize()
);
}

/**
* Check for browser language and set website language to it
*
* @return void
*/
protected function checkBrowserLanguage()
{
$browserLanguage = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);

//available languages
if ($browserLanguage == 'en') {
I18n::locale('en_US');
} elseif ($browserLanguage == 'fr') {
I18n::locale('fr_CA');
} else {
I18n::locale('en_US');
}
}

/**
* Filter preparation
* @param Event $event event
* @return void
*/
public function beforeFilter(Event $event)
{
$this->checkBrowserLanguage();
$this->Auth->allow(['display']);
}
}
Loading

0 comments on commit 9c7f8c5

Please sign in to comment.