Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 7194 | Rev 7197 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
4113 efrain 1
<?php
2
 
3
$routeEvents = $this->url('calendar/events');
7187 efrain 4
$routeNextEvents = $this->url('helpers/next-events');
4113 efrain 5
 
6
 
7187 efrain 7
$this->inlineScript()->appendFile($this->basePath('vendors/moment/moment-with-locales.js'));
7184 efrain 8
 
9
$this->inlineScript()->appendFile($this->basePath('vendors/nprogress/nprogress.js'));
10
$this->headLink()->appendStylesheet($this->basePath('vendors/nprogress/nprogress.css'));
11
 
4113 efrain 12
$this->headLink()->appendStylesheet($this->basePath('vendors/fullcalendar/fullcalendar.css'));
7178 efrain 13
//$this->headLink()->appendStylesheet($this->basePath('vendors/fullcalendar-scheduler/dist/scheduler.css'));
14
//$this->headLink()->appendStylesheet($this->basePath('vendors/iCheck/skins/flat/green.css'));
4113 efrain 15
 
7178 efrain 16
 
4113 efrain 17
$this->inlineScript()->appendFile($this->basePath('vendors/fullcalendar/lib/moment.min.js'));
18
$this->inlineScript()->appendFile($this->basePath('vendors/fullcalendar/fullcalendar.js'));
19
$this->inlineScript()->appendFile($this->basePath('vendors/fullcalendar/locale/es-us.js'));
7178 efrain 20
//$this->inlineScript()->appendFile($this->basePath('vendors/fullcalendar-scheduler/dist/scheduler.js'));
21
//$this->inlineScript()->appendFile($this->basePath('vendors/iCheck/icheck.min.js'));
4113 efrain 22
$this->inlineScript()->appendFile($this->basePath('vendors/popper/umd/popper.js'));
23
 
24
 
4692 stevensc 25
$defaultDate = date('Y-m-d');
4113 efrain 26
 
27
$this->inlineScript()->captureStart();
28
echo <<<JS
29
jQuery( document ).ready(function( $ ) {
30
 
31
    var data_resources  = new Array();
32
    var data_events = new Array();
33
 
7187 efrain 34
    $.fn.reloadHelper = function() {
35
 
36
 
37
        NProgress.start();
38
        $.ajax({
39
            'dataType'  : 'json',
40
            'method'    : 'get',
41
            'url'       :  '$routeNextEvents',
42
            'data'      :  {
43
                t : moment().unix()
44
            },
45
        }).done(function(response) {
46
            if(response['success']) {
47
 
48
            } else {
49
                $.fn.showError(response['data']);
50
            }
51
        }).fail(function( jqXHR, textStatus, errorThrown) {
52
            $.fn.showError(textStatus);
53
        }).always(function() {
54
            NProgress.done();
55
        });
56
    }
57
 
7180 efrain 58
    $.fn.openBackend = function(url) {
59
        NProgress.start();
60
        $.ajax({
61
            'dataType'  : 'json',
62
            'method'    : 'get',
7185 efrain 63
            'url'       :  url,
7180 efrain 64
            'data'      :  $('#form').serialize(),
65
        }).done(function(response) {
66
            if(response['success']) {
67
              window.open(response['data'], '_backend')
68
            } else {
69
                $.fn.showError(response['data']);
70
            }
71
        }).fail(function( jqXHR, textStatus, errorThrown) {
72
            $.fn.showError(textStatus);
73
        }).always(function() {
74
            NProgress.done();
75
        });
76
 
77
    }
78
 
4113 efrain 79
    $('#calendar').fullCalendar({
80
        header: {
7178 efrain 81
            left: 'prev,next today',
82
            center: 'title',
83
            right: 'month,agendaWeek,agendaDay,listWeek'
4113 efrain 84
          },
85
          defaultDate: '$defaultDate',
86
          editable: true,
87
          navLinks: true, // can click day/week names to navigate views
88
          eventLimit: true, // allow "more" link when too many events
89
          events: {
90
            url: '$routeEvents',
91
            error: function() {
92
              $('#script-warning').show();
93
            }
7182 efrain 94
          },
95
          eventClick: function(event) {
7180 efrain 96
            if (event.url) {
97
                setTimeout(() => {
98
                  $.fn.openBackend(event.url)
99
                }, 200);
100
                return false;
101
            }
102
          },
7183 efrain 103
          eventRender: function(eventObj, \$el) {
4113 efrain 104
            $('.popover').remove();
105
            \$el.popover({
4148 efrain 106
                title: eventObj.title,
4141 efrain 107
                content: eventObj.agenda,
7179 efrain 108
                trigger: 'click', //'hover',
4113 efrain 109
                placement: 'top',
110
                container: 'body',
111
                popperOptions : {
112
                    removeOnDestroy: true
113
                },
114
                options : {
115
                    removeOnDestroy: true
116
                },
117
                 html: true
118
            });
4141 efrain 119
        },
4113 efrain 120
 
121
    });
122
 
7180 efrain 123
    $('body').on('click', 'a.goto-backend', function(e) {
124
        e.preventDefault();
125
        var action = $(this).attr('href');
126
 
127
 
128
        $.fn.openBackend(action)
129
    });
130
 
7188 efrain 131
     $.fn.reloadHelper();
7187 efrain 132
 
4131 efrain 133
 
134
 
4113 efrain 135
});
136
JS;
137
$this->inlineScript()->captureEnd();
7178 efrain 138
 
7194 efrain 139
$this->headLink()->appendStylesheet('/css/calendar.css');
140
$this->headLink()->appendStylesheet('/look-and-field/calendar.css');
141
 
4113 efrain 142
?>
143
<section class="info-page">
7193 efrain 144
	<div class="container">
145
		<div class="row">
146
			<div id="calendar" class="col-12 col-md-8"></div>
147
 
148
   			<div id="calendar-events" class="col-12 col-md-4">
149
				<div class="task-widget">
150
					<div class="sd-title d-flex align-items-center justify-content-between"
151
						><h3>Eventos y Tareas</h3>
152
					</div>
153
					<div class="d-flex flex-column" style="gap: 0.5rem; max-height: 500px; overflow: hidden scroll;">
154
						<a href="" target="_blank" rel="noreferrer">
155
							<div class="calendar-event" style="color: rgb(0, 0, 0); background: rgb(128, 128, 255);">
156
								<h4><b>Evento: </b> Vendedor Senior LMS</h4><span><b>Inicio: </b>8/19/2023, 8:00:00 PM</span>
157
							</div>
158
						</a>
159
   					</div>
160
   				</div>
161
   			</div>
162
   		</div>
163
	</div>
7178 efrain 164
</section>