Full Calendar integrado com Adianti Seguindo o tutorial do Danilo Monteiro, fiz a integração do full calendar com a o Adianti. https://groups.google.com/forum/#!topic/adianti-tools-pt/mKo9U9G0Fgs...
MR
Full Calendar integrado com Adianti  
Seguindo o tutorial do Danilo Monteiro, fiz a integração do full calendar com a o Adianti.

https://groups.google.com/forum/#!topic/adianti-tools-pt/mKo9U9G0Fgs

Curso Dominando o Adianti Framework

O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado!


Dominando o Adianti Framework Quero me inscrever agora!

Comentários (3)


MS

Marcos,
eu tentei e não obtive sucesso usando theme3 poderia informar a como utilizou?
MR

Copie os arquivos dentro de app/lib/include. Em librares.html coloque:
<link href="app/lib/include/fullcalendar/fullcalendar.css" rel="stylesheet"/> <link href="app/lib/include/fullcalendar/fullcalendar.print.css" rel="stylesheet" media="print"/> <script src="app/lib/include/fullcalendar/lib/moment.min.js"></script> <script src="app/lib/include/fullcalendar/lib/jquery.min.js"></script> <script src="app/lib/include/fullcalendar/fullcalendar.min.js"></script> <script src="app/lib/include/fullcalendar/locale/pt-br.js"></script>


E criei:

 
  1. <?php
 
  1. <?php
  2. class JqueryAgendaView extends TPage
  3. {
  4. function __construct()
  5. {
  6. parent::__construct();
  7. $table = new TTable;
  8. $calendar = new TElement('div');
  9. $calendar->id = 'calendar';
  10. $table->addRow()->addCell($calendar);
  11. try
  12. {
  13. TTransaction::open('samples');
  14. $repository = new TRepository('Event');
  15. $events = $repository->load();
  16. $script =new TElement('script');
  17. $script->type = 'text/javascript';
  18. $script->add("
  19. $(document).ready(function() {
  20. $('#calendar').fullCalendar({
  21. locale: 'pt-br',
  22. timezone: 'America/Sao_Paulo',
  23. header: {
  24. left: 'prev,next today',
  25. center: 'title',
  26. right: 'month,agendaWeek,agendaDay'
  27. },
  28. events: [
  29. ");
  30. foreach($events as $event)
  31. {
  32. $script->add("
  33. {
  34. id: ".$event->id.",
  35. title: '".$event->title."',
  36. start: new Date(".date('Y', strtotime($event->event_date)).", ".date('m', strtotime('-1 months',strtotime($event->event_date)) ).", ".date('d', strtotime($event->event_date)).", ".str_replace(':',',',$event->start_hour)."),
  37. end: new Date(".date('Y', strtotime($event->event_date)).", ".date('m', strtotime('-1 months',strtotime($event->event_date)) ).", ".date('d', strtotime($event->event_date)).", ".($event->start_hour + $event->duration)."),
  38. backgroundColor: '".$event->color."',
  39. borderColor: '".$event->color."',
  40. url: \"index.php?class=EventForm&method=onEdit&key=".$event->id."&event_date=".date('d', strtotime($event->event_date))."&start_hour=".$event->start_hour."\",
  41. status: false
  42. },
  43. ");
  44. }
  45. $script->add("
  46. ],
  47. eventRender: function(event, eventElement)
  48. {
  49. if(event.status == true)
  50. {
  51. eventElement.find('div.fc-content').prepend(\"<i class='fa fa-check'></i> \");
  52. }
  53. else
  54. {
  55. eventElement.find('div.fc-content').prepend(\"<i class='fa fa-clock-o'></i> \");
  56. }
  57. },
  58. dayClick: function(date, jsEvent, view) {
  59. if (view.name === 'month') {
  60. $('#calendar').fullCalendar('gotoDate', date);
  61. $('#calendar').fullCalendar('changeView', 'agendaDay');
  62. $('.fc-event-container').children('a').attr('generator', 'adianti');
  63. $('.fc-widget-content').mouseover(function(){
  64. $(this).css('cursor','pointer');
  65. });
  66. }
  67. else if(view.name === 'agendaDay' || view.name === 'agendaWeek')
  68. {
  69. $(this).append('<a></a>');
  70. $(this).children('a').attr('generator', 'adianti');
  71. var href = $(this).children('a').attr('href', 'index.php?class=EventForm&method=onStartEdit&event_date='+date.format('DD/MM/YYYY')+'&start_hour='+date.format('hh:mm'));
  72. $(this).children('a').click();
  73. }
  74. },
  75. });
  76. $('.fc-content').click(function(){
  77. $(this).parent('a').attr('generator', 'adianti');
  78. });
  79. $('.fc-widget-content').mouseover(function(){
  80. $(this).css('cursor','pointer');
  81. });
  82. $('body').on('click', ':button.fc-button', function(event){
  83. event.preventDefault();
  84. $('.fc-content').parent('a').attr('generator', 'adianti');
  85. $('.fc-widget-content').mouseover(function(){
  86. $(this).css('cursor','pointer');
  87. });
  88. });
  89. $(':button.fc-today-button').click(function(){
  90. $('.fc-content').parent('a').attr('generator', 'adianti');
  91. $('.fc-widget-content').mouseover(function(){
  92. $(this).css('cursor','pointer');
  93. });
  94. });
  95. });
  96. ");
  97. $table->addRow()->addCell($script);
  98. TTransaction::close();
  99. }
  100. catch (Exception $e)
  101. {
  102. new TMessage('error', $e->getMessage());
  103. }
  104. $vbox = new TVBox;
  105. $vbox->add($table);
  106. parent::add($vbox);
  107. }
  108. public function onDelete( $param )
  109. {
  110. $action = new TAction(array($this, 'Delete'));
  111. $action->setParameters($param);
  112. new TQuestion('Do you really want to delete ?', $action);
  113. }
  114. public function Delete( $param )
  115. {
  116. try
  117. {
  118. if (isset($param['id']))
  119. {
  120. $key=$param['id'];
  121. TTransaction::open('samples');
  122. $object = new Event($key);
  123. $object->delete();
  124. TTransaction::close();
  125. $posAction = new TAction(array('JqueryAgendaView', 'reload'));
  126. new TMessage('info', 'Record deleted', $posAction);
  127. }
  128. }
  129. catch (Exception $e)
  130. {
  131. new TMessage('error', '<b>Error</b> ' . $e->getMessage());
  132. TTransaction::rollback();
  133. }
  134. }
  135. public function reload()
  136. {
  137. }
  138. }
  139. ?>
AV

Marcos, obrigado pela contribuição me ajudou d+ em um projeto aqui. Valeu