"php": ">=5.4.16",
"cakephp/cakephp": "~3.1",
"mobiledetect/mobiledetectlib": "2.*",
- "cakephp/migrations": "~1.0",
+ "cakephp/migrations": "@stable",
"cakephp/plugin-installer": "*",
"friendsofcake/crud": "~4.2",
"bcrowe/cakephp-api-pagination": "^1.0",
- "CakePHP/datasource": "^3.1"
+ "CakePHP/datasource": "^3.1",
+ "josegonzalez/cakephp-upload": "^3.4",
+ "cakephp/elastic-search": "@stable"
},
"require-dev": {
"psy/psysh": "@stable",
- "cakephp/debug_kit": "~3.2",
+ "cakephp/debug_kit": "~3.0",
"cakephp/bake": "~1.1",
"phpunit/phpunit": "4.8"
},
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "686c55e1e983a03c000269dbf833dd70",
+ "hash": "52c65bcac843b70683c3c5dca2368e10",
"packages": [
{
"name": "aura/installer-default",
],
"time": "2015-12-23 16:07:38"
},
+ {
+ "name": "cakephp/elastic-search",
+ "version": "0.3.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/cakephp/elastic-search.git",
+ "reference": "3148fef00362cf35368fefd97839f7e62301993a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/cakephp/elastic-search/zipball/3148fef00362cf35368fefd97839f7e62301993a",
+ "reference": "3148fef00362cf35368fefd97839f7e62301993a",
+ "shasum": ""
+ },
+ "require": {
+ "cakephp/cakephp": "~3.1",
+ "ruflin/elastica": "~2.2"
+ },
+ "require-dev": {
+ "cakephp/cakephp-codesniffer": "dev-master",
+ "phpunit/phpunit": "~4.0",
+ "psr/log": "~1.0"
+ },
+ "type": "cakephp-plugin",
+ "autoload": {
+ "psr-4": {
+ "Cake\\ElasticSearch\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "CakePHP Community",
+ "homepage": "https://github.com/cakephp/elastic-search/graphs/contributors"
+ }
+ ],
+ "description": "An Elastic Search datasource and data mapper for CakePHP 3.0",
+ "homepage": "https://github.com/cakephp/elastic-search",
+ "keywords": [
+ "cakephp",
+ "elasticsearch"
+ ],
+ "time": "2016-02-14 16:39:44"
+ },
{
"name": "cakephp/migrations",
- "version": "1.5.1",
+ "version": "1.5.6",
"source": {
"type": "git",
"url": "https://github.com/cakephp/migrations.git",
- "reference": "800d4f783987954627f45201eb09686b0318cbce"
+ "reference": "7ac1946a5322bb1ec7399c0f1a98eb34b0677afb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/cakephp/migrations/zipball/800d4f783987954627f45201eb09686b0318cbce",
- "reference": "800d4f783987954627f45201eb09686b0318cbce",
+ "url": "https://api.github.com/repos/cakephp/migrations/zipball/7ac1946a5322bb1ec7399c0f1a98eb34b0677afb",
+ "reference": "7ac1946a5322bb1ec7399c0f1a98eb34b0677afb",
"shasum": ""
},
"require": {
- "cakephp/cakephp": "~3.1",
+ "cakephp/cakephp": "~3.1 || 3.2.*",
"php": ">=5.4",
"robmorgan/phinx": "~0.5.0"
},
"cakephp",
"migrations"
],
- "time": "2015-12-01 20:29:21"
+ "time": "2016-02-09 21:41:10"
},
{
"name": "cakephp/plugin-installer",
],
"time": "2014-11-20 16:49:30"
},
+ {
+ "name": "josegonzalez/cakephp-upload",
+ "version": "3.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/josegonzalez/cakephp-upload.git",
+ "reference": "c2985689318a1b01bc117c2f55fd67ff9dafa2a2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/josegonzalez/cakephp-upload/zipball/c2985689318a1b01bc117c2f55fd67ff9dafa2a2",
+ "reference": "c2985689318a1b01bc117c2f55fd67ff9dafa2a2",
+ "shasum": ""
+ },
+ "require": {
+ "cakephp/orm": "3.*",
+ "league/flysystem": "*",
+ "php": ">=5.5"
+ },
+ "require-dev": {
+ "cakephp/cakephp": "~3.0",
+ "cakephp/cakephp-codesniffer": "dev-master",
+ "league/flysystem-vfs": "*",
+ "phpunit/phpunit": "4.1.*",
+ "satooshi/php-coveralls": "dev-master"
+ },
+ "type": "cakephp-plugin",
+ "autoload": {
+ "psr-4": {
+ "Josegonzalez\\Upload\\": "src",
+ "Josegonzalez\\Upload\\Test\\Fixture\\": "tests\\Fixture"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jose Diaz-Gonzalez",
+ "email": "cakephp+upload@josediazgonzalez.com"
+ }
+ ],
+ "description": "CakePHP plugin to handle file uploading sans ridiculous automagic",
+ "homepage": "https://github.com/josegonzalez/cakephp-upload",
+ "keywords": [
+ "Behavior",
+ "cakephp",
+ "files",
+ "orm",
+ "upload"
+ ],
+ "time": "2016-03-26 21:42:22"
+ },
+ {
+ "name": "league/flysystem",
+ "version": "1.0.20",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/flysystem.git",
+ "reference": "e87a786e3ae12a25cf78a71bb07b4b384bfaa83a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/e87a786e3ae12a25cf78a71bb07b4b384bfaa83a",
+ "reference": "e87a786e3ae12a25cf78a71bb07b4b384bfaa83a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0"
+ },
+ "conflict": {
+ "league/flysystem-sftp": "<1.0.6"
+ },
+ "require-dev": {
+ "ext-fileinfo": "*",
+ "mockery/mockery": "~0.9",
+ "phpspec/phpspec": "^2.2",
+ "phpunit/phpunit": "~4.8 || ~5.0"
+ },
+ "suggest": {
+ "ext-fileinfo": "Required for MimeType",
+ "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
+ "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
+ "league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
+ "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
+ "league/flysystem-copy": "Allows you to use Copy.com storage",
+ "league/flysystem-dropbox": "Allows you to use Dropbox storage",
+ "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
+ "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
+ "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
+ "league/flysystem-webdav": "Allows you to use WebDAV storage",
+ "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "League\\Flysystem\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Frank de Jonge",
+ "email": "info@frenky.net"
+ }
+ ],
+ "description": "Filesystem abstraction: Many filesystems, one API.",
+ "keywords": [
+ "Cloud Files",
+ "WebDAV",
+ "abstraction",
+ "aws",
+ "cloud",
+ "copy.com",
+ "dropbox",
+ "file systems",
+ "files",
+ "filesystem",
+ "filesystems",
+ "ftp",
+ "rackspace",
+ "remote",
+ "s3",
+ "sftp",
+ "storage"
+ ],
+ "time": "2016-03-14 21:54:11"
+ },
{
"name": "mobiledetect/mobiledetectlib",
"version": "2.8.17",
],
"time": "2015-11-30 15:21:12"
},
+ {
+ "name": "ruflin/elastica",
+ "version": "2.3.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ruflin/Elastica.git",
+ "reference": "0df1d7b513960ba11d3075652dcd71fcab8dd37a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ruflin/Elastica/zipball/0df1d7b513960ba11d3075652dcd71fcab8dd37a",
+ "reference": "0df1d7b513960ba11d3075652dcd71fcab8dd37a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "psr/log": "~1.0"
+ },
+ "require-dev": {
+ "guzzlehttp/guzzle": "5.3.*",
+ "munkie/elasticsearch-thrift-php": "1.4.*"
+ },
+ "suggest": {
+ "egeloen/http-adapter": "Allow using httpadapter transport",
+ "guzzlehttp/guzzle": "Allow using guzzle 5.3.x as the http transport (Requires php 5.4)",
+ "monolog/monolog": "Logging request",
+ "munkie/elasticsearch-thrift-php": "Allow using thrift transport"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Elastica\\": "lib/Elastica/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Ruflin",
+ "homepage": "http://ruflin.com/"
+ }
+ ],
+ "description": "Elasticsearch Client",
+ "homepage": "http://elastica.io/",
+ "keywords": [
+ "client",
+ "search"
+ ],
+ "time": "2015-10-19 07:09:10"
+ },
{
"name": "symfony/config",
"version": "v2.8.0",
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/f21c97aec1b5302d2dc0d17047ea8f4e4ff93aae",
+ "url": "https://api.github.com/repos/symfony/config/zipball/cc75e0cf582c412e49ad4cd5f83bd0d8e6ff2b33",
"reference": "f21c97aec1b5302d2dc0d17047ea8f4e4ff93aae",
"shasum": ""
},
},
{
"name": "cakephp/debug_kit",
- "version": "3.2.2",
+ "version": "3.2.7",
"source": {
"type": "git",
"url": "https://github.com/cakephp/debug_kit.git",
- "reference": "61e838edf26fc4df1becf59afb77ba10e5400924"
+ "reference": "c0694370a2e87cb705f9766cd69705d3ed09116b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/61e838edf26fc4df1becf59afb77ba10e5400924",
- "reference": "61e838edf26fc4df1becf59afb77ba10e5400924",
+ "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/c0694370a2e87cb705f9766cd69705d3ed09116b",
+ "reference": "c0694370a2e87cb705f9766cd69705d3ed09116b",
"shasum": ""
},
"require": {
- "cakephp/cakephp": "3.1.*",
+ "cakephp/cakephp": ">=3.1.0 <4.0",
"jdorn/sql-formatter": "~1.2"
},
"require-dev": {
"debug",
"kit"
],
- "time": "2015-10-21 19:57:25"
+ "time": "2016-03-06 12:51:13"
},
{
"name": "dnoegel/php-xdg-base-dir",
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
+ "cakephp/migrations": 0,
+ "cakephp/elastic-search": 0,
"psy/psysh": 0
},
"prefer-stable": true,
--- /dev/null
+<?php
+use Migrations\AbstractMigration;
+
+class AddPhotoToSoftwares 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('softwares');
+ $table->addColumn('photo', 'text', [
+ 'default' => null,
+ 'null' => true,
+ ]);
+ $table->update();
+ }
+}
--- /dev/null
+<?php
+use Migrations\AbstractMigration;
+
+class AddPhotoToScreenshots 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('screenshots');
+ $table->addColumn('photo', 'string', [
+ 'default' => null,
+ 'limit' => 255,
+ 'null' => false,
+ ]);
+ $table->update();
+ }
+}
--- /dev/null
+<?php
+use Migrations\AbstractMigration;
+
+class AddUrlDirectoryToScreenshots 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('screenshots');
+ $table->addColumn('url_directory', 'string', [
+ 'default' => null,
+ 'limit' => 255,
+ 'null' => true,
+ ]);
+ $table->update();
+ }
+}
--- /dev/null
+<?php
+use Migrations\AbstractMigration;
+
+class Migrate 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()
+ {
+ }
+}
--- /dev/null
+<?php
+use Migrations\AbstractMigration;
+
+class RemoveUrlToScreenshots 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()
+ {
+ }
+}
--- /dev/null
+<?php
+use Migrations\AbstractMigration;
+
+class RemoveUrlFromScreenshots 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('screenshots');
+ $table->removeColumn('url');
+ $table->update();
+ }
+}
/**
* Connect middleware/dispatcher filters.
- */
\ No newline at end of file
+ */
+Plugin::load('Josegonzalez/Upload');
+
+Plugin::load('DebugKit');
+
+Plugin::load('Cake/ElasticSearch', ['bootstrap' => true]);
+
+Plugin::load('Migrations');
namespace App\Controller;
use App\Controller\AppController;
+use Cake\ORM\TableRegistry;
/**
* Softwares Controller
public function view($id = null)
{
$software = $this->Softwares->get($id, [
- 'contain' => ['Licenses']
+ 'contain' => ['Licenses', 'Reviews', 'Screenshots']
]);
$this->set('software', $software);
$this->set('_serialize', ['software']);
*/
public function edit($id = null)
{
+
+
$software = $this->Softwares->get($id, [
'contain' => []
]);
+// $screenshot = $this->Softwares->Screenshots->newEntity();
+// debug($screenshot);
if ($this->request->is(['patch', 'post', 'put'])) {
$software = $this->Softwares->patchEntity($software, $this->request->data);
+
+
+
if ($this->Softwares->save($software)) {
$this->Flash->success(__('The software has been saved.'));
+
+ $screenshot_ = $this->Softwares->Screenshots->get($software['screenshots'][0]['id'], [
+ 'contain' => []
+ ]);
+
+ // Upload the screenshot
+ $screenshotsTable = TableRegistry::get('Screenshots');
+ $screenshot = $this->Softwares->Screenshots->patchEntity($screenshot_,$this->request->data['screenshots']);
+ $screenshotsTable->save($screenshot);
return $this->redirect(['action' => 'index']);
+
} else {
$this->Flash->error(__('The software could not be saved. Please, try again.'));
}
* @property int $id
* @property int $software_id
* @property \App\Model\Entity\Software $software
- * @property string $url
* @property \Cake\I18n\Time $created
* @property \Cake\I18n\Time $modified
* @property string $name
+ * @property string $photo
+ * @property string $url_directory
*/
class Screenshot extends Entity
{
* @property \App\Model\Entity\License $license
* @property \Cake\I18n\Time $created
* @property \Cake\I18n\Time $modified
+ * @property string $photo
+ * @property string $logo_directory
+ * @property \App\Model\Entity\Review[] $reviews
+ * @property \App\Model\Entity\Screenshot[] $screenshots
*/
class Software extends Entity
{
protected $_accessible = [
'*' => true,
'id' => false,
- 'softwarename' => true,
];
}
$this->addBehavior('Timestamp');
+ //For upload file -> avatar
+ $this->addBehavior('Josegonzalez/Upload.Upload', [
+ 'photo' => [
+ 'fields' => [
+ 'dir' => 'url_directory',
+ ],
+ 'path' => 'webroot{DS}files{DS}{model}{DS}{primaryKey}{DS}',
+ ],
+ ]);
+
$this->belongsTo('Softwares', [
'foreignKey' => 'software_id'
]);
->allowEmpty('id', 'create');
$validator
- ->allowEmpty('url');
+ ->allowEmpty('name');
+
+// $validator
+// ->requirePresence('photo', 'create')
+// ->notEmpty('photo');
$validator
- ->allowEmpty('name');
+ ->allowEmpty('url_directory');
return $validator;
}
* Softwares Model
*
* @property \Cake\ORM\Association\BelongsTo $Licenses
+ * @property \Cake\ORM\Association\HasMany $Reviews
+ * @property \Cake\ORM\Association\HasMany $Screenshots
*/
class SoftwaresTable extends Table
{
$this->table('softwares');
$this->displayField('id');
- $this->primaryKey(['id']);
+ $this->primaryKey('id');
$this->addBehavior('Timestamp');
+ //For upload file -> avatar
+ $this->addBehavior('Josegonzalez/Upload.Upload', [
+ 'photo' => [
+ 'fields' => [
+ 'dir' => 'logo_directory',
+ ],
+ 'path' => 'webroot{DS}files{DS}{model}{DS}{field}{DS}{primaryKey}{DS}avatar',
+ ],
+ ]);
+
+
$this->belongsTo('Licenses', [
'foreignKey' => 'licence_id'
]);
+ $this->hasMany('Reviews', [
+ 'foreignKey' => 'software_id'
+ ]);
+ $this->hasMany('Screenshots', [
+ 'foreignKey' => 'software_id'
+ ]);
+
+
}
/**
->allowEmpty('id', 'create');
$validator
- ->requirePresence('softwarename', 'create')
- ->notEmpty('softwarename');
-
+ ->allowEmpty('softwarename', 'create');
+
$validator
->requirePresence('url_repository', 'create')
->notEmpty('url_repository')
$validator
->allowEmpty('description');
+ $validator
+ ->allowEmpty('photo');
+
+ $validator
+ ->allowEmpty('logo_directory');
+
return $validator;
}
$this->table('users');
$this->displayField('id');
- $this->primaryKey(['id']);
+ $this->primaryKey('id');
$this->addBehavior('Timestamp');
+ //For upload file -> avatar
+ $this->addBehavior('Josegonzalez/Upload.Upload', [
+ 'photo' => [
+ 'fields' => [
+ 'dir' => 'logo_directory',
+ ],
+ 'path' => 'webroot{DS}files{DS}{model}{DS}{field}{DS}{primaryKey}{DS}avatar',
+ ],
+ ]);
+
+
$this->belongsTo('UserTypes', [
'foreignKey' => 'user_type_id',
'joinType' => 'INNER'
--- /dev/null
+<nav class="large-3 medium-4 columns" id="actions-sidebar">
+ <ul class="side-nav">
+ <li class="heading"><?= __('Actions') ?></li>
+ <li><?= $this->Html->link(__('List Screenshots'), ['action' => 'index']) ?></li>
+ <li><?= $this->Html->link(__('List Softwares'), ['controller' => 'Softwares', 'action' => 'index']) ?></li>
+ <li><?= $this->Html->link(__('New Software'), ['controller' => 'Softwares', 'action' => 'add']) ?></li>
+ </ul>
+</nav>
+<div class="screenshots form large-9 medium-8 columns content">
+ <?= $this->Form->create($screenshot) ?>
+ <fieldset>
+ <legend><?= __('Add Screenshot') ?></legend>
+ <?php
+ echo $this->Form->input('software_id', ['options' => $softwares, 'empty' => true]);
+ //echo $this->Form->input('name');
+ //echo $this->Form->input('photo');
+ //echo $this->Form->input('url_directory');
+ echo $this->Form->input('photo', ['type' => 'file',"label"=>"screenshots"]);
+
+ ?>
+ </fieldset>
+ <?= $this->Form->button(__('Submit')) ?>
+ <?= $this->Form->end() ?>
+</div>
--- /dev/null
+<nav class="large-3 medium-4 columns" id="actions-sidebar">
+ <ul class="side-nav">
+ <li class="heading"><?= __('Actions') ?></li>
+ <li><?= $this->Form->postLink(
+ __('Delete'),
+ ['action' => 'delete', $screenshot->id],
+ ['confirm' => __('Are you sure you want to delete # {0}?', $screenshot->id)]
+ )
+ ?></li>
+ <li><?= $this->Html->link(__('List Screenshots'), ['action' => 'index']) ?></li>
+ <li><?= $this->Html->link(__('List Softwares'), ['controller' => 'Softwares', 'action' => 'index']) ?></li>
+ <li><?= $this->Html->link(__('New Software'), ['controller' => 'Softwares', 'action' => 'add']) ?></li>
+ </ul>
+</nav>
+<div class="screenshots form large-9 medium-8 columns content">
+ <?= $this->Form->create($screenshot) ?>
+ <fieldset>
+ <legend><?= __('Edit Screenshot') ?></legend>
+ <?php
+ echo $this->Form->input('software_id', ['options' => $softwares, 'empty' => true]);
+ echo $this->Form->input('name');
+ echo $this->Form->input('photo');
+ echo $this->Form->input('url_directory');
+ ?>
+ </fieldset>
+ <?= $this->Form->button(__('Submit')) ?>
+ <?= $this->Form->end() ?>
+</div>
--- /dev/null
+<nav class="large-3 medium-4 columns" id="actions-sidebar">
+ <ul class="side-nav">
+ <li class="heading"><?= __('Actions') ?></li>
+ <li><?= $this->Html->link(__('New Screenshot'), ['action' => 'add']) ?></li>
+ <li><?= $this->Html->link(__('List Softwares'), ['controller' => 'Softwares', 'action' => 'index']) ?></li>
+ <li><?= $this->Html->link(__('New Software'), ['controller' => 'Softwares', 'action' => 'add']) ?></li>
+ </ul>
+</nav>
+<div class="screenshots index large-9 medium-8 columns content">
+ <h3><?= __('Screenshots') ?></h3>
+ <table cellpadding="0" cellspacing="0">
+ <thead>
+ <tr>
+ <th><?= $this->Paginator->sort('id') ?></th>
+ <th><?= $this->Paginator->sort('software_id') ?></th>
+ <th><?= $this->Paginator->sort('created') ?></th>
+ <th><?= $this->Paginator->sort('modified') ?></th>
+ <th><?= $this->Paginator->sort('photo') ?></th>
+ <th><?= $this->Paginator->sort('url_directory') ?></th>
+ <th class="actions"><?= __('Actions') ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach ($screenshots as $screenshot): ?>
+ <tr>
+ <td><?= $this->Number->format($screenshot->id) ?></td>
+ <td><?= $screenshot->has('software') ? $this->Html->link($screenshot->software->id, ['controller' => 'Softwares', 'action' => 'view', $screenshot->software->id]) : '' ?></td>
+ <td><?= h($screenshot->created) ?></td>
+ <td><?= h($screenshot->modified) ?></td>
+ <td><?= h($screenshot->photo) ?></td>
+ <td><?= h($screenshot->url_directory) ?></td>
+ <td class="actions">
+ <?= $this->Html->link(__('View'), ['action' => 'view', $screenshot->id]) ?>
+ <?= $this->Html->link(__('Edit'), ['action' => 'edit', $screenshot->id]) ?>
+ <?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $screenshot->id], ['confirm' => __('Are you sure you want to delete # {0}?', $screenshot->id)]) ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ <div class="paginator">
+ <ul class="pagination">
+ <?= $this->Paginator->prev('< ' . __('previous')) ?>
+ <?= $this->Paginator->numbers() ?>
+ <?= $this->Paginator->next(__('next') . ' >') ?>
+ </ul>
+ <p><?= $this->Paginator->counter() ?></p>
+ </div>
+</div>
--- /dev/null
+<nav class="large-3 medium-4 columns" id="actions-sidebar">
+ <ul class="side-nav">
+ <li class="heading"><?= __('Actions') ?></li>
+ <li><?= $this->Html->link(__('Edit Screenshot'), ['action' => 'edit', $screenshot->id]) ?> </li>
+ <li><?= $this->Form->postLink(__('Delete Screenshot'), ['action' => 'delete', $screenshot->id], ['confirm' => __('Are you sure you want to delete # {0}?', $screenshot->id)]) ?> </li>
+ <li><?= $this->Html->link(__('List Screenshots'), ['action' => 'index']) ?> </li>
+ <li><?= $this->Html->link(__('New Screenshot'), ['action' => 'add']) ?> </li>
+ <li><?= $this->Html->link(__('List Softwares'), ['controller' => 'Softwares', 'action' => 'index']) ?> </li>
+ <li><?= $this->Html->link(__('New Software'), ['controller' => 'Softwares', 'action' => 'add']) ?> </li>
+ </ul>
+</nav>
+<div class="screenshots view large-9 medium-8 columns content">
+ <h3><?= h($screenshot->name) ?></h3>
+ <table class="vertical-table">
+ <tr>
+ <th><?= __('Software') ?></th>
+ <td><?= $screenshot->has('software') ? $this->Html->link($screenshot->software->id, ['controller' => 'Softwares', 'action' => 'view', $screenshot->software->id]) : '' ?></td>
+ </tr>
+ <tr>
+ <th><?= __('Photo') ?></th>
+ <td><?= h($screenshot->photo) ?></td>
+ </tr>
+ <tr>
+ <th><?= __('Url Directory') ?></th>
+ <td><?= h($screenshot->url_directory) ?></td>
+ </tr>
+ <tr>
+ <th><?= __('Id') ?></th>
+ <td><?= $this->Number->format($screenshot->id) ?></td>
+ </tr>
+ <tr>
+ <th><?= __('Created') ?></th>
+ <td><?= h($screenshot->created) ?></td>
+ </tr>
+ <tr>
+ <th><?= __('Modified') ?></th>
+ <td><?= h($screenshot->modified) ?></td>
+ </tr>
+ </table>
+ <div class="row">
+ <h4><?= __('Name') ?></h4>
+ <?= $this->Text->autoParagraph(h($screenshot->name)); ?>
+ </div>
+</div>
echo $this->Form->input('softwarename', ["label"=> __("Project's name")]);
echo $this->Form->input('url_repository');
echo $this->Form->input('description');
+ echo $this->Form->input('submittedfile', ['type' => 'file','label'=>'url_logo']);
echo $this->Form->input('licence_id', ['options' => $licenses, 'empty' => true]);
?>
</fieldset>
</ul>
</nav>
<div class="softwares form large-9 medium-8 columns content">
- <?= $this->Form->create($software) ?>
+ <?= $this->Form->create($software,['type' => 'file']) ?>
<fieldset>
<legend><?= __('Edit Software') ?></legend>
<?php
+ echo $this->Form->input('softwarename');
echo $this->Form->input('url_repository');
echo $this->Form->input('description');
+ echo $this->Form->input('photo', ['type' => 'file',"label"=>"Avatar"]);
+ echo $this->Form->input('screenshots.photo', ['type' => 'file',"label"=>"screenshots"]);
+ //echo $this->Form->input('screenshots.0.name',['label'=>'screenshotName']);
+ //echo $this->Form->input('screenshots.0.software_id',['type'=>'hidden' ,'value'=>$software->id]);
+
echo $this->Form->input('licence_id', ['options' => $licenses, 'empty' => true]);
?>
</fieldset>
</ul>
</nav>
<div class="users form large-9 medium-8 columns content">
- <?= $this->Form->create($user) ?>
+ <?= $this->Form->create($user,['type' => 'file']) ?>
<fieldset>
<legend><?= __('Add User') ?></legend>
<?php
echo $this->Form->input('username');
echo $this->Form->input('email');
- echo $this->Form->input('logo_url');
- echo $this->Form->input('url');
- echo $this->Form->input('description');
- echo $this->Form->input('UserTypes',["name"=>"user_type_id"]);
echo $this->Form->input('role');
+ echo $this->Form->input('$userTypes', ['name'=>'user_type_id','value' => '2','type'=>'hidden']);
echo $this->Form->input('password');
?>
+
+
+
</fieldset>
<?= $this->Form->button(__('Submit')) ?>
<?= $this->Form->end() ?>
+
+
</div>
</ul>
</nav>
<div class="users form large-9 medium-8 columns content">
- <?= $this->Form->create($user) ?>
+ <?= $this->Form->create($user,['type' => 'file']) ?>
<fieldset>
<legend><?= __('Edit User') ?></legend>
<?php
echo $this->Form->input('username');
echo $this->Form->input('logo_url');
+ echo $this->Form->input('photo', ['type' => 'file',"label"=>"Avatar"]);
echo $this->Form->input('url');
echo $this->Form->input('description');
echo $this->Form->input('role');
public $fields = [
'id' => ['type' => 'biginteger', 'length' => 20, 'default' => null, 'null' => false, 'comment' => null, 'precision' => null, 'unsigned' => null, 'autoIncrement' => null],
'software_id' => ['type' => 'biginteger', 'length' => 20, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null, 'unsigned' => null, 'autoIncrement' => null],
- 'url' => ['type' => 'text', 'length' => null, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null],
'created' => ['type' => 'timestamp', 'length' => null, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null],
'modified' => ['type' => 'timestamp', 'length' => null, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null],
'name' => ['type' => 'text', 'length' => null, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null],
+ 'photo' => ['type' => 'string', 'length' => 255, 'default' => null, 'null' => false, 'comment' => null, 'precision' => null, 'fixed' => null],
+ 'url_directory' => ['type' => 'string', 'length' => 255, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null, 'fixed' => null],
'_indexes' => [
'idx_17610_fk_screens_software_idx' => ['type' => 'index', 'columns' => ['software_id'], 'length' => []],
],
[
'id' => '',
'software_id' => '',
- 'url' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
- 'created' => 1459435671,
- 'modified' => 1459435671,
- 'name' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.'
+ 'created' => 1459956075,
+ 'modified' => 1459956075,
+ 'name' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
+ 'photo' => 'Lorem ipsum dolor sit amet',
+ 'url_directory' => 'Lorem ipsum dolor sit amet'
],
];
}
'licence_id' => ['type' => 'biginteger', 'length' => 20, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null, 'unsigned' => null, 'autoIncrement' => null],
'created' => ['type' => 'timestamp', 'length' => null, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null],
'modified' => ['type' => 'timestamp', 'length' => null, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null],
+ 'photo' => ['type' => 'text', 'length' => null, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null],
+ 'logo_directory' => ['type' => 'text', 'length' => null, 'default' => null, 'null' => true, 'comment' => null, 'precision' => null],
'_indexes' => [
'idx_17618_fk_software_licence_idx' => ['type' => 'index', 'columns' => ['licence_id'], 'length' => []],
],
'url_repository' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
'description' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
'licence_id' => '',
- 'created' => 1459435671,
- 'modified' => 1459435671
+ 'created' => 1459951405,
+ 'modified' => 1459951405,
+ 'photo' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
+ 'logo_directory' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.'
],
];
}
'app.screenshots',
'app.softwares',
'app.licenses',
- 'app.licence_types'
+ 'app.licence_types',
+ 'app.reviews',
+ 'app.users',
+ 'app.user_types'
];
/**
public $fixtures = [
'app.softwares',
'app.licenses',
- 'app.licence_types'
+ 'app.licence_types',
+ 'app.reviews',
+ 'app.users',
+ 'app.user_types',
+ 'app.screenshots'
];
/**