IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

jQuery Discussion :

fullcalendar, les événements sont visibles en mode MOIS et non en mode SEMAINE et JOUR


Sujet :

jQuery

  1. #1
    Membre habitué
    Profil pro
    Inscrit en
    Novembre 2005
    Messages
    653
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2005
    Messages : 653
    Points : 183
    Points
    183
    Par défaut fullcalendar, les événements sont visibles en mode MOIS et non en mode SEMAINE et JOUR
    Bonsoir a tous,

    J'utilise depuis des années fullcalendar et aujourd'hui j'ai souhaité tester le mode affichage en semaine et la surprise, en fait rien est possible, ni voir les evenements déja enregistrés en mode MOIS ni en saisir de nouveau en cliquant sur une cellule de l'heure choisie, au mieux il faut cliquer sur le haut de la colonne "journée" pour pouvoir enregistrer un nouvel evenement.

    Avez vous deja eu ce problème s'il vous plait?

    Je précise que j'ai fais des recherches sur GG et que toutes les solutions trouvées sur stackoverflow.com notamment n'ont rien changés.

    Merci milles fois pour votre aide .

    Voici mon code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
     
    <script type="application/javascript">
    var Calendar = function () {
        //function to initiate Full CAlendar
        var runCalendar = function () {
            var $modal = $('#event-management');
            $('#event-categories div.event-category').each(function () {
                var eventObject = {
                    title: $.trim($(this).text())
                };
                $(this).data('eventObject', eventObject);
                $(this).draggable({
                    zIndex: 999,
                    revert: true, // will cause the event to go back to its
                    revertDuration: 50 //  original position after the drag
                });
            });
            /* initialize the calendar
    				 -----------------------------------------------------------------*/
            var date = new Date();
            var d = date.getDate();
            var m = date.getMonth();
            var y = date.getFullYear();
            var form = '';
     
            var calendar = $('#calendar').fullCalendar({
    	//		weekends: false,
     
                buttonText: {
                    prev: '<i class="fa fa-chevron-left"></i>',
                    next: '<i class="fa fa-chevron-right"></i>'
                },
      			firstDay:1, //premier jour de la semaine => Lundi
              header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'month,agendaWeek,agendaDay'
                },
     
              defaultDate: $('#calendar').fullCalendar('today'),
    	  defaultView: 'agendaWeek',
    	  allDayDefault: false,
    	  disableResizing: true,
     
    	  events: "http://<?php  echo $url_index.'/'.$rep_extranet;?>/events.php?idUT=<?php  echo $MB_idUT;?>",
     
              editable: true,
              droppable: true, // this allows things to be dropped onto the calendar !!!
              eventDrop: function(event, delta) {
                        start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss");
                        end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss");
     				    if (end=='0000-00-00 00:00:00'){end=start}
                        $.ajax({
                            url: 'http://<?php  echo $url_index.'/'.$rep_extranet;?>/mod_events.php',
                            data: 'idUT=<?php  echo $MB_idUT;?>&droprdv=change&title='+ event.title+'&start='+ start +'&end='+ end +'&id='+ event.id ,
                            type: "GET",
                            success: function(json) {}
                        });
                    },
              eventResize: function(event) {
                        start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss");
                        end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss");
                        $.ajax({
                            url: 'http://<?php  echo $url_index.'/'.$rep_extranet;?>/mod_events.php',
                            data: 'idUT=<?php  echo $MB_idUT;?>&droprdv=change&title='+ event.title+'&start='+ start +'&end='+ end +'&id='+ event.id ,
                            type: "GET",
                            success: function(json) {}
                        });
                    },
     
              selectable: true,
              selectHelper: true,
              select: function (start, end, allDay) {
                    $modal.modal({
                        backdrop: 'static'
                    });
                    form = $("<form></form>");
                    form.append("<div class='modal-header'><button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&times;</button><h4 class='modal-title'>Nouveau Rendez-Vous</h4></div><br><div class='row'></div>");
                    form.find(".row").append("<div class='col-md-6' style='background-color:#FFE7FF'><div class='form-group'><div class='col-md-6'><label class='control-label'>Heure Début</label></div><div class='col-md-6'><select class='form-control' name='start_heure'></select></div></div></div>").find("select[name='start_heure']").append("<option value='00:00'></option>").append("<option value='08:00'>8H</option>").append("<option value='08:30'>8H30</option>").append("<option value='09:00'>9H</option>").append("<option value='09:30'>9H30</option>").append("<option value='10:00'>10H</option>").append("<option value='10:30'>10H30</option>").append("<option value='11:00'>11H</option>").append("<option value='11:30'>11H30</option>").append("<option value='12:00'>12H</option>").append("<option value='12:30'>12H30</option>").append("<option value='13:00'>13H</option>").append("<option value='13:30'>13H30</option>").append("<option value='14:00'>14H</option>").append("<option value='14:30'>14H30</option>").append("<option value='15:00'>15H</option>").append("<option value='15:30'>15H30</option>").append("<option value='16:00'>16H</option>").append("<option value='16:30'>16H30</option>").append("<option value='17:00'>17H</option>").append("<option value='17:30'>17H30</option>").append("<option value='18:00'>18H</option>").append("<option value='18:30'>18H30</option>").append("<option value='19:00'>19H</option>").append("<option value='19:30'>19H30</option>").append("<option value='20:00'>20H</option>");
     
                    form.find(".row").append("<div class='col-md-6' style='background-color:#E7E8FF'><div class='form-group'><div class='col-md-6'><label class='control-label'>Heure Fin</label></div><div class='col-md-6'><select class='form-control' name='end_heure'></select></div></div></div>").find("select[name='end_heure']").append("<option value='00:00'></option>").append("<option value='08:00'>8H</option>").append("<option value='08:30'>8H30</option>").append("<option value='09:00'>9H</option>").append("<option value='09:30'>9H30</option>").append("<option value='10:00'>10H</option>").append("<option value='10:30'>10H30</option>").append("<option value='11:00'>11H</option>").append("<option value='11:30'>11H30</option>").append("<option value='12:00'>12H</option>").append("<option value='12:30'>12H30</option>").append("<option value='13:00'>13H</option>").append("<option value='13:30'>13H30</option>").append("<option value='14:00'>14H</option>").append("<option value='14:30'>14H30</option>").append("<option value='15:00'>15H</option>").append("<option value='15:30'>15H30</option>").append("<option value='16:00'>16H</option>").append("<option value='16:30'>16H30</option>").append("<option value='17:00'>17H</option>").append("<option value='17:30'>17H30</option>").append("<option value='18:00'>18H</option>").append("<option value='18:30'>18H30</option>").append("<option value='19:00'>19H</option>").append("<option value='19:30'>19H30</option>").append("<option value='20:00'>20H</option>");
     
                    form.find(".row").append("<div class='col-md-12' style='display:none'><div class='form-group'><label class='control-label'>Titre Rendez-vous</label><input class='form-control' value='Rendez-vous Enregistré' type=text name='title'/></div></div>");
                    form.find(".row").append("<div class='col-md-12'><div class='form-group'><label class='control-label'>Description (optionnelle)</label><input class='form-control' placeholder='' type=text name='description'/></div></div>");
    $modal.find('.remove-event').hide().end().find('.save-event').show().end().find('.modal-body').empty().prepend(form).end().find('.save-event').unbind('click').click(function () {
                        form.submit();
                    });
     
                    $modal.find('form').on('submit', function () {
                        title = form.find("input[name='title']").val();
                        description = form.find("input[name='description']").val();
                        start_heure = form.find("select[name='start_heure'] option:checked").val();
                        end_heure = form.find("select[name='end_heure'] option:checked").val();
                        $categoryClass = "label-orange";
                         if (title) {
                        	   if (end_heure=='00:00'){end_heure=start_heure}
                               start = $.fullCalendar.formatDate(start, "yyyy-MM-dd");
                               start = start +' '+ start_heure;
                               end = $.fullCalendar.formatDate(end, "yyyy-MM-dd");
                               end = end +' '+ end_heure;
                                 $.ajax({
                                   url: 'http://<?php  echo $url_index.'/'.$rep_extranet;?>/add_events.php', data: 'title='+ title +'&description='+ description +'&start='+ start +'&end='+ end,
                                   type: "GET",
                                   success: function(json) {}
                                 });
                          }
    		    if (title !== null) {
                            calendar.fullCalendar('renderEvent', {
                                    title: title,
                                    start: start,
                                    end: end,
                                    allDay: allDay,
                                    className: $categoryClass
                                }, true // make the event "stick"
                            );
                        }
                        $modal.modal('hide');
    		    Calendar.init();
                        return false;
                    });
                    calendar.fullCalendar('unselect');
                },
     
    		eventClick: function (calEvent, jsEvent, view) {
    		calEvent.start = $.fullCalendar.formatDate(calEvent.start, "yyyy-MM-dd HH:mm");
    		calEvent.end = $.fullCalendar.formatDate(calEvent.end, "yyyy-MM-dd HH:mm");
     
     
                    var form = $("<form></form>");
                   form.append("<div class='modal-header'><button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&times;</button><h4 class='modal-title'>Modifier Rendez-Vous</h4></div><br><div class='row'></div>");
                    form.find(".row").append("<div class='col-md-6' style='background-color:#FFE7FF'><div class='form-group'><label class='control-label'><b>DEBUT Rendez-vous</b></label></div></div><div class='col-md-6' style='background-color:#E7E8FF'><div class='form-group'><label class='control-label'><b>FIN Rendez-vous</b></label></div></div>");
                    form.find(".row").append("<div class='col-md-6' style='background-color:#FFE7FF'><div class='form-group'><div class='col-md-2'><label class='control-label'>Date</label></div><div class='col-md-10'><input class='form-control' type=text name='start' value='" + calEvent.start + "'/></div></div></div>");
                    form.find(".row").append("<div class='col-md-6' style='background-color:#E7E8FF'><div class='form-group'><div class='col-md-2'><label class='control-label'>Date</label></div><div class='col-md-10'><input class='form-control' type=text name='end' value='" + calEvent.end + "'/></div></div></div>");
                    form.find(".row").append("<div class='col-md-12' style='display:none'><div class='form-group'><label class='control-label'>Titre Rendez-vous</label><input class='form-control' type=text name='title' value='" + calEvent.title + "'/></div></div>");
                    form.find(".row").append("<div class='col-md-12'><div class='form-group'><label class='control-label'>Description (optionnelle)</label><input class='form-control' type=text name='description' value='" + calEvent.description + "'/></div></div>");
                    form.find(".row").append("<div class='col-md-12'><div class='form-group'><label class='control-label'><b>Info Prescripteur</b> : </label>" + calEvent.info_presc + "</div></div>");
                    form.append("<center><button type='submit' class='btn btn-success'><i class='fa fa-check'></i> Enregistrer les Modifications</button></center>");
                    $modal.modal({ backdrop: 'static' });
                    $modal.find('.remove-event').show().end().find('.save-event').hide().end().find('.modal-body').empty().prepend(form).end().find('.remove-event').unbind('click').click(function () {
                    calendar.fullCalendar('removeEvents', function (ev) { 
    			$.ajax({
                            url: 'http://<?php  echo $url_index.'/'.$rep_extranet;?>/mod_events.php',
                            data: 'supp=1&id='+ calEvent.id ,
                            type: "GET",
                            success: function(json) {}
                             });
    		});
                    $modal.modal('hide');
                    });
     
    		$modal.find('form').on('submit', function () {
    		calEvent.title = form.find("input[name=title]").val();
    	        calEvent.description = form.find("input[name=description]").val();
    		calEvent.start = form.find("input[name=start]").val();
    		calEvent.end = form.find("input[name=end]").val();
     
                       $.ajax({
                            url: 'http://<?php  echo $url_index.'/'.$rep_extranet;?>/mod_events.php',
                            data: 'description='+ calEvent.description+'&title='+ calEvent.title+'&start='+ calEvent.start +'&end='+ calEvent.end +'&id='+ calEvent.id ,
                            type: "GET",
                            success: function(json) {}
                             });
    		calendar.fullCalendar('updateEvent', calEvent);
                    $modal.modal('hide');
    					Calendar.init();
    					return false;
                    });
                }
            });
        };
     
        return {init: function () {runCalendar();}};
    }();
    </script>
    <script>jQuery(document).ready(function() {Calendar.init();});</script>

  2. #2
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 637
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 637
    Points : 66 656
    Points
    66 656
    Billets dans le blog
    1
    Ma page Developpez - Mon Blog Developpez
    Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
    Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
    Votre post est résolu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de Développez !

  3. #3
    Membre habitué
    Profil pro
    Inscrit en
    Novembre 2005
    Messages
    653
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2005
    Messages : 653
    Points : 183
    Points
    183
    Par défaut
    merci beaucoup

    Effectivement, j'ai remplacé puis viré d'autre syntaxe et cela fonctionne parfaitement

    encore merci a toi

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 2
    Dernier message: 05/05/2015, 14h25
  2. Problème de texture : les arêtes sont visible
    Par baton dans le forum OpenGL
    Réponses: 36
    Dernier message: 03/02/2013, 18h41
  3. Réponses: 1
    Dernier message: 14/05/2007, 19h35
  4. Tous les fichiers sont visibles ?? que faire
    Par titouille dans le forum Apache
    Réponses: 3
    Dernier message: 29/11/2005, 17h08
  5. Comment savoir si les ScrollBar sont visibles sur un TRichEdit ?
    Par vanquish dans le forum Composants VCL
    Réponses: 2
    Dernier message: 16/10/2003, 10h28

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo