parent
7eb9af9053
commit
49271d84b3
@ -0,0 +1,32 @@ |
||||
<?php |
||||
/** |
||||
* This file is part of the <name> project. |
||||
* |
||||
* (c) <yourname> <youremail> |
||||
* |
||||
* For the full copyright and license information, please view the LICENSE |
||||
* file that was distributed with this source code. |
||||
*/ |
||||
|
||||
namespace Chamilo\TimelineBundle; |
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle; |
||||
|
||||
/** |
||||
* This file has been generated by the EasyExtends bundle ( https://sonata-project.org/easy-extends ) |
||||
* |
||||
* References : |
||||
* bundles : http://symfony.com/doc/current/book/bundles.html |
||||
* |
||||
* @author <yourname> <youremail> |
||||
*/ |
||||
class ChamiloTimelineBundle extends Bundle |
||||
{ |
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function getParent() |
||||
{ |
||||
return 'SonataTimelineBundle'; |
||||
} |
||||
} |
@ -0,0 +1,42 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* This file is part of the <name> project. |
||||
* |
||||
* (c) <yourname> <youremail> |
||||
* |
||||
* For the full copyright and license information, please view the LICENSE |
||||
* file that was distributed with this source code. |
||||
*/ |
||||
|
||||
namespace Chamilo\TimelineBundle\Entity; |
||||
|
||||
use Sonata\TimelineBundle\Entity\Action as BaseAction; |
||||
|
||||
/** |
||||
* This file has been generated by the Sonata EasyExtends bundle. |
||||
* |
||||
* @link https://sonata-project.org/bundles/easy-extends |
||||
* |
||||
* References : |
||||
* working with object : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-objects/en |
||||
* |
||||
* @author <yourname> <youremail> |
||||
*/ |
||||
class Action extends BaseAction |
||||
{ |
||||
/** |
||||
* @var int $id |
||||
*/ |
||||
protected $id; |
||||
|
||||
/** |
||||
* Get id |
||||
* |
||||
* @return int $id |
||||
*/ |
||||
public function getId() |
||||
{ |
||||
return $this->id; |
||||
} |
||||
} |
@ -0,0 +1,42 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* This file is part of the <name> project. |
||||
* |
||||
* (c) <yourname> <youremail> |
||||
* |
||||
* For the full copyright and license information, please view the LICENSE |
||||
* file that was distributed with this source code. |
||||
*/ |
||||
|
||||
namespace Chamilo\TimelineBundle\Entity; |
||||
|
||||
use Sonata\TimelineBundle\Entity\ActionComponent as BaseActionComponent; |
||||
|
||||
/** |
||||
* This file has been generated by the Sonata EasyExtends bundle. |
||||
* |
||||
* @link https://sonata-project.org/bundles/easy-extends |
||||
* |
||||
* References : |
||||
* working with object : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-objects/en |
||||
* |
||||
* @author <yourname> <youremail> |
||||
*/ |
||||
class ActionComponent extends BaseActionComponent |
||||
{ |
||||
/** |
||||
* @var int $id |
||||
*/ |
||||
protected $id; |
||||
|
||||
/** |
||||
* Get id |
||||
* |
||||
* @return int $id |
||||
*/ |
||||
public function getId() |
||||
{ |
||||
return $this->id; |
||||
} |
||||
} |
@ -0,0 +1,42 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* This file is part of the <name> project. |
||||
* |
||||
* (c) <yourname> <youremail> |
||||
* |
||||
* For the full copyright and license information, please view the LICENSE |
||||
* file that was distributed with this source code. |
||||
*/ |
||||
|
||||
namespace Chamilo\TimelineBundle\Entity; |
||||
|
||||
use Sonata\TimelineBundle\Entity\Component as BaseComponent; |
||||
|
||||
/** |
||||
* This file has been generated by the Sonata EasyExtends bundle. |
||||
* |
||||
* @link https://sonata-project.org/bundles/easy-extends |
||||
* |
||||
* References : |
||||
* working with object : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-objects/en |
||||
* |
||||
* @author <yourname> <youremail> |
||||
*/ |
||||
class Component extends BaseComponent |
||||
{ |
||||
/** |
||||
* @var int $id |
||||
*/ |
||||
protected $id; |
||||
|
||||
/** |
||||
* Get id |
||||
* |
||||
* @return int $id |
||||
*/ |
||||
public function getId() |
||||
{ |
||||
return $this->id; |
||||
} |
||||
} |
@ -0,0 +1,42 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* This file is part of the <name> project. |
||||
* |
||||
* (c) <yourname> <youremail> |
||||
* |
||||
* For the full copyright and license information, please view the LICENSE |
||||
* file that was distributed with this source code. |
||||
*/ |
||||
|
||||
namespace Chamilo\TimelineBundle\Entity; |
||||
|
||||
use Sonata\TimelineBundle\Entity\Timeline as BaseTimeline; |
||||
|
||||
/** |
||||
* This file has been generated by the Sonata EasyExtends bundle. |
||||
* |
||||
* @link https://sonata-project.org/bundles/easy-extends |
||||
* |
||||
* References : |
||||
* working with object : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-objects/en |
||||
* |
||||
* @author <yourname> <youremail> |
||||
*/ |
||||
class Timeline extends BaseTimeline |
||||
{ |
||||
/** |
||||
* @var int $id |
||||
*/ |
||||
protected $id; |
||||
|
||||
/** |
||||
* Get id |
||||
* |
||||
* @return int $id |
||||
*/ |
||||
public function getId() |
||||
{ |
||||
return $this->id; |
||||
} |
||||
} |
@ -0,0 +1,21 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> |
||||
<!-- |
||||
This file has been generated by the EasyExtends bundle ( https://sonata-project.org/easy-extends ) |
||||
|
||||
References : |
||||
xsd : https://github.com/doctrine/doctrine2/blob/master/doctrine-mapping.xsd |
||||
xml mapping : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/xml-mapping/en |
||||
association mapping : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en |
||||
--> |
||||
<entity |
||||
name="Chamilo\TimelineBundle\Entity\Action" |
||||
table="timeline__action" |
||||
repository-class="Doctrine\ORM\EntityRepository"> |
||||
|
||||
<id name="id" type="integer" column="id"> |
||||
<generator strategy="AUTO"/> |
||||
</id> |
||||
|
||||
</entity> |
||||
</doctrine-mapping> |
@ -0,0 +1,21 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> |
||||
<!-- |
||||
This file has been generated by the EasyExtends bundle ( https://sonata-project.org/easy-extends ) |
||||
|
||||
References : |
||||
xsd : https://github.com/doctrine/doctrine2/blob/master/doctrine-mapping.xsd |
||||
xml mapping : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/xml-mapping/en |
||||
association mapping : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en |
||||
--> |
||||
<entity |
||||
name="Chamilo\TimelineBundle\Entity\ActionComponent" |
||||
table="timeline__action_component" |
||||
repository-class="Doctrine\ORM\EntityRepository"> |
||||
|
||||
<id name="id" type="integer" column="id"> |
||||
<generator strategy="AUTO"/> |
||||
</id> |
||||
|
||||
</entity> |
||||
</doctrine-mapping> |
@ -0,0 +1,21 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> |
||||
<!-- |
||||
This file has been generated by the EasyExtends bundle ( https://sonata-project.org/easy-extends ) |
||||
|
||||
References : |
||||
xsd : https://github.com/doctrine/doctrine2/blob/master/doctrine-mapping.xsd |
||||
xml mapping : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/xml-mapping/en |
||||
association mapping : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en |
||||
--> |
||||
<entity |
||||
name="Chamilo\TimelineBundle\Entity\Component" |
||||
table="timeline__component" |
||||
repository-class="Doctrine\ORM\EntityRepository"> |
||||
|
||||
<id name="id" type="integer" column="id"> |
||||
<generator strategy="AUTO"/> |
||||
</id> |
||||
|
||||
</entity> |
||||
</doctrine-mapping> |
@ -0,0 +1,21 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> |
||||
<!-- |
||||
This file has been generated by the EasyExtends bundle ( https://sonata-project.org/easy-extends ) |
||||
|
||||
References : |
||||
xsd : https://github.com/doctrine/doctrine2/blob/master/doctrine-mapping.xsd |
||||
xml mapping : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/xml-mapping/en |
||||
association mapping : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en |
||||
--> |
||||
<entity |
||||
name="Chamilo\TimelineBundle\Entity\Timeline" |
||||
table="timeline__timeline" |
||||
repository-class="Doctrine\ORM\EntityRepository"> |
||||
|
||||
<id name="id" type="integer" column="id"> |
||||
<generator strategy="AUTO"/> |
||||
</id> |
||||
|
||||
</entity> |
||||
</doctrine-mapping> |
@ -0,0 +1,14 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<serializer> |
||||
<!-- |
||||
This file has been generated by the EasyExtends bundle ( https://sonata-project.org/bundles/easy-extends ) |
||||
|
||||
@author <yourname> <youremail> |
||||
--> |
||||
|
||||
<class name="Chamilo\TimelineBundle\Entity\Action" exclusion-policy="all" xml-root-name="_action"> |
||||
|
||||
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search" /> |
||||
|
||||
</class> |
||||
</serializer> |
@ -0,0 +1,14 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<serializer> |
||||
<!-- |
||||
This file has been generated by the EasyExtends bundle ( https://sonata-project.org/bundles/easy-extends ) |
||||
|
||||
@author <yourname> <youremail> |
||||
--> |
||||
|
||||
<class name="Chamilo\TimelineBundle\Entity\ActionComponent" exclusion-policy="all" xml-root-name="_action_component"> |
||||
|
||||
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search" /> |
||||
|
||||
</class> |
||||
</serializer> |
@ -0,0 +1,14 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<serializer> |
||||
<!-- |
||||
This file has been generated by the EasyExtends bundle ( https://sonata-project.org/bundles/easy-extends ) |
||||
|
||||
@author <yourname> <youremail> |
||||
--> |
||||
|
||||
<class name="Chamilo\TimelineBundle\Entity\Component" exclusion-policy="all" xml-root-name="_component"> |
||||
|
||||
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search" /> |
||||
|
||||
</class> |
||||
</serializer> |
@ -0,0 +1,14 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<serializer> |
||||
<!-- |
||||
This file has been generated by the EasyExtends bundle ( https://sonata-project.org/bundles/easy-extends ) |
||||
|
||||
@author <yourname> <youremail> |
||||
--> |
||||
|
||||
<class name="Chamilo\TimelineBundle\Entity\Timeline" exclusion-policy="all" xml-root-name="_timeline"> |
||||
|
||||
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search" /> |
||||
|
||||
</class> |
||||
</serializer> |
@ -0,0 +1,62 @@ |
||||
{% extends sonata_block.templates.block_base %} |
||||
|
||||
{% block block %} |
||||
<div class="box box-primary"> |
||||
{% if settings.title is not empty %} |
||||
<div class="box-header with-border"> |
||||
<h4 class="box-title"> |
||||
<i class="fa fa-clock-o fa-fw"></i> {{ settings.title }} |
||||
</h4> |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<div class="box-body"> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<ul class="timeline"> |
||||
{% for entry in entries %} |
||||
|
||||
{% if currentDay is not defined or currentDay != entry.createdAt|format_date %} |
||||
{% set currentDay = entry.createdAt|format_date %} |
||||
<li class="time-label"> |
||||
<span class="bg-red">{{ currentDay }}</span> |
||||
</li> |
||||
{% endif %} |
||||
|
||||
{% set subject = entry.getComponent('subject') %} |
||||
{% set target = entry.getComponent('target') %} |
||||
{% set target_text_component = entry.getComponent('target_text') %} |
||||
|
||||
{% if subject.data %} |
||||
{% set subject_text = sonata_timeline_generate_link(subject, entry) %} |
||||
{% else %} |
||||
{% set subject_text = '<abbr title="' ~ 'element_reference_deleted'|trans({'%reference%': target.hash}, "SonataTimelineBundle") ~ '">' ~ 'element_deleted'|trans({}, "SonataTimelineBundle") ~ '</abbr>' %} |
||||
{% endif %} |
||||
|
||||
{% if target.data is defined and target.data is not empty %} |
||||
{% set target_text = sonata_timeline_generate_link(target, entry) %} |
||||
{% elseif target_text_component %} |
||||
{% set target_text = '<abbr title="' ~ 'element_deleted'|trans({}, "SonataTimelineBundle") ~ '">'~target_text_component~'</abbr>' %} |
||||
{% else %} |
||||
{% set target_text = '<abbr title="' ~ 'element_reference_deleted'|trans({'%reference%': target.hash}, "SonataTimelineBundle") ~ '">' ~ 'element_deleted'|trans({}, "SonataTimelineBundle") ~ '</abbr>' %} |
||||
{% endif %} |
||||
|
||||
{% set verb = "actions."~entry.verb %} |
||||
{% set icon = "actions.icon."~entry.verb %} |
||||
|
||||
<li> |
||||
<i class="{{ icon|trans({}, "SonataTimelineBundle") }}"></i> |
||||
<div class="timeline-item" style="background: #f3f4f5;"> |
||||
<span class="time"><i class="fa fa-clock-o"></i> {{ entry.createdAt|format_time }}</span> |
||||
<div class="timeline-body" style="border-bottom: none;">{{ verb|trans({'%subject%': subject_text, '%target%': target_text}, "SonataTimelineBundle")|raw }}</div> |
||||
</div> |
||||
</li> |
||||
{% else %} |
||||
{{ 'no_action'|trans({}, "SonataTimelineBundle") }} |
||||
{% endfor %} |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
Loading…
Reference in new issue