ryxeo-glpi-git / htdocs / front / stat.tracking.php @ 1c14bcc4
Historique | Voir | Annoter | Télécharger (4,92 ko)
1 | 1c14bcc4 | Eric Seigne | <?php
|
---|---|---|---|
2 | /*
|
||
3 | * @version $Id: stat.tracking.php 7763 2009-01-06 18:44:50Z moyo $
|
||
4 | -------------------------------------------------------------------------
|
||
5 | GLPI - Gestionnaire Libre de Parc Informatique
|
||
6 | Copyright (C) 2003-2009 by the INDEPNET Development Team.
|
||
7 | |||
8 | http://indepnet.net/ http://glpi-project.org
|
||
9 | -------------------------------------------------------------------------
|
||
10 | |||
11 | LICENSE
|
||
12 | |||
13 | This file is part of GLPI.
|
||
14 | |||
15 | GLPI is free software; you can redistribute it and/or modify
|
||
16 | it under the terms of the GNU General Public License as published by
|
||
17 | the Free Software Foundation; either version 2 of the License, or
|
||
18 | (at your option) any later version.
|
||
19 | |||
20 | GLPI is distributed in the hope that it will be useful,
|
||
21 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
23 | GNU General Public License for more details.
|
||
24 | |||
25 | You should have received a copy of the GNU General Public License
|
||
26 | along with GLPI; if not, write to the Free Software
|
||
27 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||
28 | --------------------------------------------------------------------------
|
||
29 | */
|
||
30 | |||
31 | // ----------------------------------------------------------------------
|
||
32 | // Original Author of file:
|
||
33 | // Purpose of file:
|
||
34 | // ----------------------------------------------------------------------
|
||
35 | |||
36 | |||
37 | |||
38 | |||
39 | $NEEDED_ITEMS=array("user","stat","tracking"); |
||
40 | |||
41 | define('GLPI_ROOT', '..'); |
||
42 | include (GLPI_ROOT . "/inc/includes.php"); |
||
43 | |||
44 | |||
45 | commonHeader($LANG["Menu"][13],$_SERVER['PHP_SELF'],"maintain","stat"); |
||
46 | |||
47 | checkRight("statistic","1"); |
||
48 | |||
49 | |||
50 | if (isset($_GET["date1"])) $_POST["date1"] = $_GET["date1"]; |
||
51 | if (isset($_GET["date2"])) $_POST["date2"] = $_GET["date2"]; |
||
52 | if (isset($_GET["type"])) $_POST["type"] = $_GET["type"]; |
||
53 | if (empty($_POST["type"])) $_POST["type"]="user"; |
||
54 | |||
55 | if(empty($_POST["date1"])&&empty($_POST["date2"])) { |
||
56 | $year=date("Y")-1; |
||
57 | $_POST["date1"]=date("Y-m-d",mktime(1,0,0,date("m"),date("d"),$year)); |
||
58 | |||
59 | $_POST["date2"]=date("Y-m-d"); |
||
60 | } |
||
61 | |||
62 | if ($_POST["date1"]!=""&&$_POST["date2"]!=""&&strcmp($_POST["date2"],$_POST["date1"])<0){ |
||
63 | $tmp=$_POST["date1"]; |
||
64 | $_POST["date1"]=$_POST["date2"]; |
||
65 | $_POST["date2"]=$tmp; |
||
66 | } |
||
67 | |||
68 | if(!isset($_GET["start"])) $_GET["start"] = 0; |
||
69 | |||
70 | |||
71 | $items=array( |
||
72 | $LANG["job"][4]=> array( |
||
73 | "user"=>array( |
||
74 | "title"=>$LANG["common"][37], |
||
75 | "field"=>"glpi_tracking.author" |
||
76 | ), |
||
77 | "recipient"=>array( |
||
78 | "title"=>$LANG["job"][3], |
||
79 | "field"=>"glpi_tracking.recipient" |
||
80 | ), |
||
81 | "group"=>array( |
||
82 | "title"=>$LANG["common"][35], |
||
83 | "field"=>"glpi_tracking.FK_group" |
||
84 | ), |
||
85 | ), |
||
86 | $LANG["common"][32] => array( |
||
87 | "category"=>array( |
||
88 | "title"=>$LANG["common"][36], |
||
89 | "field"=>"glpi_tracking.category" |
||
90 | ), |
||
91 | "priority"=>array( |
||
92 | "title"=>$LANG["joblist"][2], |
||
93 | "field"=>"glpi_tracking.priority" |
||
94 | ), |
||
95 | "request_type"=>array( |
||
96 | "title"=>$LANG["job"][44], |
||
97 | "field"=>"glpi_tracking.request_type" |
||
98 | ), |
||
99 | ), |
||
100 | $LANG["job"][5] => array( |
||
101 | "technicien"=>array( |
||
102 | "title"=>$LANG["job"][6]." ".$LANG["stats"][48], |
||
103 | "field"=>"glpi_tracking.assign" |
||
104 | ), |
||
105 | "technicien_followup"=>array( |
||
106 | "title"=>$LANG["job"][6]." ".$LANG["stats"][49], |
||
107 | "field"=>"glpi_followup.author" |
||
108 | ), |
||
109 | "assign_group"=>array( |
||
110 | "title"=>$LANG["common"][35], |
||
111 | "field"=>"glpi_tracking.assign_group" |
||
112 | ), |
||
113 | "enterprise"=>array( |
||
114 | "title"=>$LANG["financial"][26], |
||
115 | "field"=>"glpi_tracking.assign_ent" |
||
116 | ), |
||
117 | ) |
||
118 | ); |
||
119 | $INSELECT=""; |
||
120 | foreach ($items as $label => $tab){ |
||
121 | $INSELECT.= "<optgroup label=\"$label\">"; |
||
122 | foreach ($tab as $key => $val){ |
||
123 | // Current field
|
||
124 | if ($key==$_POST["type"]){ |
||
125 | $field=$val["field"]; |
||
126 | $title=$val["title"]; |
||
127 | } |
||
128 | $INSELECT.= "<option value='$key' ".($key==$_POST["type"]?"selected":"").">".$val['title']."</option>"; |
||
129 | } |
||
130 | $INSELECT.= "</optgroup>"; |
||
131 | } |
||
132 | |||
133 | |||
134 | |||
135 | echo "<div align ='center'><p><b><span class='icon_consol'>".$title."</span></b></p></div>"; |
||
136 | |||
137 | echo "<div align='center'><form method=\"post\" name=\"form\" action=\"stat.tracking.php\">"; |
||
138 | echo "<table class='tab_cadre'><tr class='tab_bg_2'>"; |
||
139 | echo "<td rowspan='2' align='center'>"; |
||
140 | echo "<select name='type'>"; |
||
141 | echo $INSELECT; |
||
142 | echo "</td>"; |
||
143 | echo "<td align='right'>"; |
||
144 | echo $LANG["search"][8]." :</td><td>"; |
||
145 | showCalendarForm("form","date1",$_POST["date1"]); |
||
146 | echo "</td><td rowspan='2' align='center'><input type=\"submit\" class='button' name=\"submit\" Value=\"". $LANG["buttons"][7] ."\" /></td></tr>"; |
||
147 | echo "<tr class='tab_bg_2'><td align='right'>".$LANG["search"][9]." :</td><td>"; |
||
148 | showCalendarForm("form","date2",$_POST["date2"]); |
||
149 | echo "</td></tr>"; |
||
150 | echo "</table></form></div>"; |
||
151 | |||
152 | |||
153 | $val=getStatsItems($_POST["date1"],$_POST["date2"],$_POST["type"]); |
||
154 | $params=array("type"=>$_POST["type"],"field"=>$field,"date1"=>$_POST["date1"],"date2"=>$_POST["date2"],"start"=>$_GET["start"]); |
||
155 | printPager($_GET['start'],count($val),$_SERVER['PHP_SELF'],"date1=".$_POST["date1"]."&date2=".$_POST["date2"]."&type=".$_POST["type"],STAT_TYPE,$params); |
||
156 | |||
157 | displayStats($_POST["type"],$field,$_POST["date1"],$_POST["date2"],$_GET['start'],$val); |
||
158 | |||
159 | commonFooter(); |
||
160 | ?> |