0001-Rename-files-to-respect-singular-form-needed-for-GLP.patch

elacour, 06/16/2011 11:44 AM

Download (13.3 KB)

View differences:

ajax/connectionrate.tabs.php
1
<?php
2
/*
3
 * @version $Id: HEADER 1 2010-02-24 00:12 Tsmr $
4
 -------------------------------------------------------------------------
5
 GLPI - Gestionnaire Libre de Parc Informatique
6
 Copyright (C) 2003-2010 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
// Original Author of file: CAILLAUD Xavier, GRISARD Jean Marc
31
// Purpose of file: plugin connections v1.6.0 - GLPI 0.78
32
// ----------------------------------------------------------------------
33
 */
34

  
35
define('GLPI_ROOT', '../../..');
36
include (GLPI_ROOT . "/inc/includes.php");
37

  
38
$dropdown = new PluginConnectionsConnectionRates();
39
include (GLPI_ROOT . "/ajax/dropdown.common.tabs.php");
40

  
41
?>
ajax/connectionrates.tabs.php
1
<?php
2
/*
3
 * @version $Id: HEADER 1 2010-02-24 00:12 Tsmr $
4
 -------------------------------------------------------------------------
5
 GLPI - Gestionnaire Libre de Parc Informatique
6
 Copyright (C) 2003-2010 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
// Original Author of file: CAILLAUD Xavier, GRISARD Jean Marc
31
// Purpose of file: plugin connections v1.6.0 - GLPI 0.78
32
// ----------------------------------------------------------------------
33
 */
34

  
35
define('GLPI_ROOT', '../../..');
36
include (GLPI_ROOT . "/inc/includes.php");
37

  
38
$dropdown = new PluginConnectionsConnectionRates();
39
include (GLPI_ROOT . "/ajax/dropdown.common.tabs.php");
40

  
41
?>
front/connectionrate.form.php
1
<?php
2
/*
3
 * @version $Id: HEADER 1 2010-02-24 00:12 Tsmr $
4
 -------------------------------------------------------------------------
5
 GLPI - Gestionnaire Libre de Parc Informatique
6
 Copyright (C) 2003-2010 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
// Original Author of file: CAILLAUD Xavier, GRISARD Jean Marc
31
// Purpose of file: plugin connections v1.6.0 - GLPI 0.78
32
// ----------------------------------------------------------------------
33
 */
34

  
35
define('GLPI_ROOT', '../../..');
36
include (GLPI_ROOT . "/inc/includes.php");
37

  
38
$dropdown = new PluginConnectionsConnectionRates();
39
include (GLPI_ROOT . "/front/dropdown.common.form.php");
40

  
41
?>
front/connectionrates.form.php
1
<?php
2
/*
3
 * @version $Id: HEADER 1 2010-02-24 00:12 Tsmr $
4
 -------------------------------------------------------------------------
5
 GLPI - Gestionnaire Libre de Parc Informatique
6
 Copyright (C) 2003-2010 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
// Original Author of file: CAILLAUD Xavier, GRISARD Jean Marc
31
// Purpose of file: plugin connections v1.6.0 - GLPI 0.78
32
// ----------------------------------------------------------------------
33
 */
34

  
35
define('GLPI_ROOT', '../../..');
36
include (GLPI_ROOT . "/inc/includes.php");
37

  
38
$dropdown = new PluginConnectionsConnectionRates();
39
include (GLPI_ROOT . "/front/dropdown.common.form.php");
40

  
41
?>
inc/connectionrate.class.php
1
<?php
2
/*
3
 * @version $Id: HEADER 1 2010-02-24 00:12 Tsmr $
4
 -------------------------------------------------------------------------
5
 GLPI - Gestionnaire Libre de Parc Informatique
6
 Copyright (C) 2003-2010 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
// Original Author of file: CAILLAUD Xavier, GRISARD Jean Marc
31
// Purpose of file: plugin connections v1.6.0 - GLPI 0.78
32
// ----------------------------------------------------------------------
33
 */
34

  
35
if (!defined('GLPI_ROOT')) {
36
	die("Sorry. You can't access directly to this file");
37
}
38

  
39
// Class for a Dropdown
40
class PluginConnectionsConnectionRates extends CommonDropdown {
41
   
42
   static function getTypeName() {
43
      global $LANG;
44

  
45
      return $LANG['plugin_connections']['setup'][3];
46
   }
47
   
48
   function canCreate() {
49
      return plugin_connections_haveRight('connections', 'w');
50
   }
51

  
52
   function canView() {
53
      return plugin_connections_haveRight('connections', 'r');
54
   }
55
   
56
   static function transfer($ID, $entity) {
57
      global $DB;
58

  
59
      $temp = new self();
60
      if ($ID<=0 || !$temp->getFromDB($ID)) {
61
         return 0;
62
      }
63
      $query = "SELECT `id`
64
                FROM `".$temp->getTable()."`
65
                WHERE `entities_id` = '$entity'
66
                  AND `name` = '".addslashes($temp->fields['name'])."'";
67
      foreach ($DB->request($query) as $data) {
68
         return $data['id'];
69
      }
70
      $input = $temp->fields;
71
      $input['entities_id'] = $entity;
72
      unset($input['id']);
73
      return $temp->add($input);
74
   }
75
}
76

  
77
?>
inc/connectionrates.class.php
1
<?php
2
/*
3
 * @version $Id: HEADER 1 2010-02-24 00:12 Tsmr $
4
 -------------------------------------------------------------------------
5
 GLPI - Gestionnaire Libre de Parc Informatique
6
 Copyright (C) 2003-2010 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
// Original Author of file: CAILLAUD Xavier, GRISARD Jean Marc
31
// Purpose of file: plugin connections v1.6.0 - GLPI 0.78
32
// ----------------------------------------------------------------------
33
 */
34

  
35
if (!defined('GLPI_ROOT')) {
36
	die("Sorry. You can't access directly to this file");
37
}
38

  
39
// Class for a Dropdown
40
class PluginConnectionsConnectionRates extends CommonDropdown {
41
   
42
   static function getTypeName() {
43
      global $LANG;
44

  
45
      return $LANG['plugin_connections']['setup'][3];
46
   }
47
   
48
   function canCreate() {
49
      return plugin_connections_haveRight('connections', 'w');
50
   }
51

  
52
   function canView() {
53
      return plugin_connections_haveRight('connections', 'r');
54
   }
55
   
56
   static function transfer($ID, $entity) {
57
      global $DB;
58

  
59
      $temp = new self();
60
      if ($ID<=0 || !$temp->getFromDB($ID)) {
61
         return 0;
62
      }
63
      $query = "SELECT `id`
64
                FROM `".$temp->getTable()."`
65
                WHERE `entities_id` = '$entity'
66
                  AND `name` = '".addslashes($temp->fields['name'])."'";
67
      foreach ($DB->request($query) as $data) {
68
         return $data['id'];
69
      }
70
      $input = $temp->fields;
71
      $input['entities_id'] = $entity;
72
      unset($input['id']);
73
      return $temp->add($input);
74
   }
75
}
76

  
77
?>
78
-