当前位置: 首页>>代码示例>>PHP>>正文


PHP Planning::showPlanningFilter方法代码示例

本文整理汇总了PHP中Planning::showPlanningFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP Planning::showPlanningFilter方法的具体用法?PHP Planning::showPlanningFilter怎么用?PHP Planning::showPlanningFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Planning的用法示例。


在下文中一共展示了Planning::showPlanningFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showPlanning

 /**
  * Show the planning
  *
  * Function name change since version 0.84 show() => showPlanning
  * Function prototype changes in 9.1 (no more parameters)
  *
  * @return Nothing (display function)
  **/
 static function showPlanning($fullview = true)
 {
     global $CFG_GLPI, $DB;
     if (!static::canView()) {
         return false;
     }
     $fullview_str = $fullview ? "true" : "false";
     $pl_height = "\$(document).height()-280";
     if ($_SESSION['glpilayout'] == "vsplit") {
         $pl_height = "\$('.ui-tabs-panel').height()-30";
     }
     $date_formats = array(0 => __('YYYY MMM DD'), 1 => __('DD MMM YYYY'), 2 => __('MMM DD YYYY'));
     $date_format = $date_formats[$_SESSION["glpidate_format"]];
     self::initSessionForCurrentUser();
     if ($fullview) {
         Planning::showPlanningFilter();
         $default_view = "agendaWeek";
         $header = "{\n            left:   'prev,next,today',\n            center: 'title',\n            right:  'month,agendaWeek,agendaDay'\n         }";
     } else {
         $default_view = "basicDay";
         $header = "false";
         $pl_height = "400";
     }
     echo "<div id='planning'></div>";
     echo Html::scriptBlock("\n      \$(document).ready(function() {\n         var disable_qtip = false,\n             disable_edit = false;\n         \$('html')\n            .mousedown(function() {\n               disable_qtip = true;\n               \$('.qtip').hide();\n            })\n            .mouseup(function() {\n               disable_qtip = false;\n            });\n\n         var window_focused = true;\n         window.onblur = function() { window_focused = false; }\n         window.onfocus = function() { window_focused = true; }\n\n         \$('#planning').fullCalendar({\n            height:      {$pl_height},\n            theme:       true,\n            weekNumbers: " . ($fullview ? 'true' : 'false') . ",\n            defaultView: '{$default_view}',\n            timeFormat:  'H:mm',\n            eventLimit:  true, // show 'more' button when too mmany events\n            minTime:     '" . $CFG_GLPI['planning_begin'] . "',\n            maxTime:     '" . $CFG_GLPI['planning_end'] . "',\n            windowResize: function(view) {\n               \$(this).fullCalendar('option', 'height', {$pl_height});\n            },\n            header: {$header},\n            views: {\n               month: {\n                  titleFormat: '{$date_format}'\n               },\n               agendaWeek: {\n                  titleFormat: '{$date_format}'\n               },\n               agendaDay: {\n                  titleFormat: '{$date_format}'\n               }\n            },\n            viewRender: function(view){ // on date changes, replicate to datepicker\n               var currentdate = view.intervalStart;\n               \$('#planning_datepicker').datepicker('setDate', new Date(currentdate));\n            },\n            eventRender: function(event, element, view) {\n               element.find('.fc-content')\n                  .after('<span class=\"event_type\" style=\"background-color: '+event.typeColor+'\">&nbsp;</span>');\n\n               var content = event.content;\n               if(view.name !== 'month' && !event.allDay){\n                  element\n                     .append('<div class=\"content\">'+content+'</div>');\n               }\n\n               // add tooltip to event\n               if (!disable_qtip) {\n                  element.qtip({\n                     position: {\n                        viewport: \$(window)\n                     },\n                     content: content,\n                     style: {\n                        classes: 'qtip-shadow qtip-bootstrap'\n                     },\n                     show: {\n                        solo: true,\n                        delay: 400\n                     },\n                     hide: {\n                        fixed: true,\n                        delay: 100\n                     },\n                     events: {\n                        show: function(event, api) {\n                           if(!window_focused) {\n                              event.preventDefault();\n                           }\n                        }\n                     }\n                  });\n               }\n            },\n            eventSources: [{\n               url:  '" . $CFG_GLPI['root_doc'] . "/ajax/planning.php',\n               type: 'POST',\n               data: {\n                  action: 'get_events'\n               },\n               success: function(data) {\n                  if (!{$fullview_str} && data.length == 0) {\n                     \$('#planning').fullCalendar('option', 'height', 0);\n                  }\n               },\n               error: function() {\n                  console.log('there was an error while fetching events!');\n               }\n            }],\n\n            // EDIT EVENTS\n            editable: true, // we can drag and resize events\n            eventResize: function(event, delta, revertFunc) {\n               editEventTimes(event, revertFunc);\n            },\n            eventResizeStart: function() {\n               disable_edit = true;\n            },\n            eventResizeStop: function() {\n               setTimeout(function(){\n                  disable_edit = false;\n               }, 300);\n            },\n            eventDrop: function(event, delta, revertFunc) {\n               editEventTimes(event, revertFunc);\n            },\n            eventClick: function(event) {\n               if (event.ajaxurl && !disable_edit) {\n                  \$('<div>')\n                     .dialog({\n                        modal:  true,\n                        width:  'auto',\n                        height: 'auto'\n                     })\n                     .load(event.ajaxurl, function() {\n                        \$(this).dialog('option', 'position', ['center', 'center'] );\n                     });\n                  return false;\n               };\n            },\n\n\n            // ADD EVENTS\n            selectable: true,\n            /*selectHelper: function(start, end) {\n               return \$('<div class=\"planning-select-helper\" />').text(start+' '+end);\n            },*/ // doesn't work anymore: see https://github.com/fullcalendar/fullcalendar/issues/2832\n            select: function(start, end, jsEvent) {\n               \$('<div>').dialog({\n                  modal:  true,\n                  width:  'auto',\n                  height: 'auto',\n                  open: function () {\n                      \$(this).load(\n                        '" . $CFG_GLPI['root_doc'] . "/ajax/planning.php?action=add_event_fromselect',\n                        {\n                           begin: start.format(),\n                           end:   end.format()\n                        },\n                        function() {\n                           \$(this).dialog('option', 'position', ['center', 'center'] );\n                        }\n                      );\n                  },\n                  position: {\n                     my: 'center',\n                     at: 'center',\n                     viewport: \$(window)\n                  }\n               });\n\n               \$('#planning').fullCalendar('unselect');\n            }\n         });\n\n\n         // send ajax for event storage (on event drag/resize)\n         var editEventTimes = function(event, revertFunc) {\n            if (event._allDay) {\n               var start = event.start.format()+'T00:00:00';\n               var end = start;\n               if (typeof event.end != 'undefined') {\n                  if (event.end == null) {\n                     end = \$.fullCalendar.moment(event.start)\n                              .add(1, 'days')\n                              .format()+'T00:00:00';\n                  } else {\n                     end = event.end.format()+'T00:00:00';\n                  }\n               }\n\n            } else {\n               var start = event.start.format();\n               if (event.end == null) {\n                  var end = \$.fullCalendar.moment(event.start)\n                              .add(2, 'hours')\n                              .format();\n               } else {\n                  var end = event.end.format();\n               }\n            }\n\n            \$.ajax({\n               url:  '" . $CFG_GLPI['root_doc'] . "/ajax/planning.php',\n               type: 'POST',\n               data: {\n                  action:   'update_event_times',\n                  start:    start,\n                  end:      end,\n                  itemtype: event.itemtype,\n                  items_id: event.items_id\n               },\n               success: function(html) {\n                  if (!html) {\n                     revertFunc();\n                  }\n                  \$('#planning').fullCalendar('updateEvent', event);\n                  displayAjaxMessageAfterRedirect();\n               },\n               error: function() {\n                  revertFunc();\n               }\n            });\n         };\n\n         // attach button (planning and refresh) in planning header\n         \$('#planning .fc-toolbar .fc-center h2')\n            .after(\n               \$('<img id=\"refresh_planning\" class=\"pointer\" src=\"" . $CFG_GLPI['root_doc'] . "/pics/refresh.png\">')\n            ).after(\n               \$('<input type=\"hidden\" id=\"planning_datepicker\">')\n            );\n\n         \$('#refresh_planning').click(function() {\n            \$('#planning').fullCalendar('refetchEvents')\n         })\n\n         // datepicker behavior\n         \$('#planning_datepicker').datepicker({\n            changeMonth:     true,\n            changeYear:      true,\n            numberOfMonths:  3,\n            showOn:          'button',\n            buttonImage:     '" . $CFG_GLPI['root_doc'] . "/pics/calendar.png',\n            buttonImageOnly: true,\n            dateFormat:      'DD, d MM, yy',\n            onSelect: function(dateText, inst) {\n               var selected_date = \$(this).datepicker('getDate');\n               \$('#planning').fullCalendar('gotoDate', selected_date);\n            }\n         });\n      });");
     return;
 }
开发者ID:korial29,项目名称:glpi,代码行数:35,代码来源:planning.class.php

示例2:

if ($_REQUEST["action"] == "add_planning_form") {
    Planning::showAddPlanningForm();
}
if ($_REQUEST["action"] == "add_user_form") {
    Planning::showAddUserForm();
}
if ($_REQUEST["action"] == "add_group_users_form") {
    Planning::showAddGroupUsersForm();
}
if ($_REQUEST["action"] == "add_group_form") {
    Planning::showAddGroupForm();
}
if ($_REQUEST["action"] == "add_event_classic_form") {
    Planning::showAddEventClassicForm($_REQUEST);
}
if ($_REQUEST["action"] == "edit_event_form") {
    Planning::editEventForm($_REQUEST);
}
if ($_REQUEST["action"] == "get_filters_form") {
    Planning::showPlanningFilter();
}
if ($_REQUEST["action"] == "toggle_filter") {
    Planning::toggleFilter($_REQUEST);
}
if ($_REQUEST["action"] == "color_filter") {
    Planning::colorFilter($_REQUEST);
}
if ($_REQUEST["action"] == "delete_filter") {
    Planning::deleteFilter($_REQUEST);
}
Html::ajaxFooter();
开发者ID:glpi-project,项目名称:glpi,代码行数:31,代码来源:planning.php


注:本文中的Planning::showPlanningFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。