Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correção de Issues e erro na Clonagem de Processo #150

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added docs/CASOSDEUSOSDD.docx
Binary file not shown.
10 changes: 6 additions & 4 deletions src/composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"name": "ufg/sdd-ufg",
"description": "Class distribution system of Federal University of the Goias",
"description": "Class distribution system of Federal University of Goias",
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.4.16",
"cakephp/cakephp": "~3.1",
"cakephp/cakephp": "3.1.0",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*"
"cakephp/plugin-installer": "*",
"friendsofcake/bootstrap-ui": "~0.3",
"lowg33kdev/cakephp-gravatar-plugin": "~1.1.0"
},
"require-dev": {
"psy/psysh": "@stable",
"cakephp/debug_kit": "~3.2",
"cakephp/debug_kit": "~3.0",
"cakephp/bake": "~1.1"
},
"suggest": {
Expand Down
Binary file added src/composer.phar
Binary file not shown.
55 changes: 55 additions & 0 deletions src/config/Migrations/20160127110840_CreateCourses.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
use Cake\ORM\TableRegistry;
use Migrations\AbstractMigration;

class CreateCourses extends AbstractMigration
{
protected $courses = [
[
"name" => "Ciências da Computação"
],
[
"name" => "Sistemas de Informação"
],
[
"name" => "Engenharia de Software"
]
];

public function up()
{
$table = $this->table('courses');
$table
->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
])
->create();

/** Seed roles table by default data */
$courseTable = TableRegistry::get('Courses');
foreach ($this->courses as $course) {
$course = $courseTable->newEntity($course);
$courseTable->save($course);
}
}

public function down()
{
$this->dropTable('courses');
}

public function after($direction) {
if ($direction === 'up') {
$courseTable = TableRegistry::get('Courses');
$course = $courseTable->newEntity();

$course->name = 'Engenharia de software';
$courseTable->save($course);

$course->name = 'Sistemas de informação';
$courseTable->save($course);
}
}
}
72 changes: 72 additions & 0 deletions src/config/Migrations/20160127110841_CreateLocals.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php
use Cake\ORM\TableRegistry;
use Migrations\AbstractMigration;

class CreateLocals extends AbstractMigration
{
protected $locals = [
[
"name" => "101",
"address" => "Instituto de informática",
"capacity" => 40
],
[
"name" => "102",
"address" => "Instituto de informática",
"capacity" => 40
],
[
"name" => "103",
"address" => "Instituto de informática",
"capacity" => 40
],
[
"name" => "101",
"address" => "Centro de aulas B",
"capacity" => 40
],
[
"name" => "102",
"address" => "Centro de aulas B",
"capacity" => 60
],
[
"name" => "103",
"address" => "Centro de aulas B",
"capacity" => 60
]
];

public function up()
{
$table = $this->table('locals');
$table
->addColumn('name', 'string', [
'default' => null,
'limit' => 100,
'null' => false,
])
->addColumn('address', 'text', [
'default' => null,
'null' => true,
])
->addColumn('capacity', 'integer', [
'default' => 0,
'limit' => 11,
'null' => false,
])
->create();

/** Seed roles table by default data */
$localsTable = TableRegistry::get('Locals');
foreach ($this->locals as $local) {
$local = $localsTable->newEntity($local);
$localsTable->save($local);
}
}

public function down()
{
$this->dropTable('locals');
}
}
62 changes: 62 additions & 0 deletions src/config/Migrations/20160127110843_CreateSchedules.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
use Cake\ORM\TableRegistry;
use Migrations\AbstractMigration;

class CreateSchedules extends AbstractMigration
{
protected $schedules = [
[
"start_time" => "08:00",
"end_time" => "09:40"
],
[
"start_time" => "10:00",
"end_time" => "11:40"
],
[
"start_time" => "14:00",
"end_time" => "15:40"
],
[
"start_time" => "16:00",
"end_time" => "17:40"
],
[
"start_time" => "18:50",
"end_time" => "20:10"
],
[
"start_time" => "20:20",
"end_time" => "22:00"
]
];

public function up()
{
$table = $this->table('schedules');
$table
->addColumn('start_time', 'time', [
'default' => null,
'limit' => null,
'null' => false,
])
->addColumn('end_time', 'time', [
'default' => null,
'limit' => null,
'null' => false,
])
->create();

/** Seed roles table by default data */
$schedulesTable = TableRegistry::get('Schedules');
foreach ($this->schedules as $schedule) {
$schedule = $schedulesTable->newEntity($schedule);
$schedulesTable->save($schedule);
}
}

public function down()
{
$this->dropTable('schedules');
}
}
42 changes: 42 additions & 0 deletions src/config/Migrations/20160127110844_CreateUsers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
use Migrations\AbstractMigration;

class CreateUsers extends AbstractMigration
{
public function up()
{
$table = $this->table('users');
$table
->addColumn('name', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
])
->addColumn('email', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
])
->addColumn('login', 'string', [
'default' => null,
'limit' => 50,
'null' => false,
])
->addColumn('password', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
])
->addColumn('is_admin', 'boolean', [
'default' => 0,
'limit' => null,
'null' => false,
])
->create();
}

public function down()
{
$this->dropTable('users');
}
}
Loading