Beispiel #1
0
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 Genericobject plugin is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Genericobject. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
 @package   genericobject
 @author    the genericobject plugin team
 @copyright Copyright (c) 2010-2011 Order plugin team
 @license   GPLv2+
            http://www.gnu.org/licenses/gpl.txt
 @link      https://forge.indepnet.net/projects/genericobject
 @link      http://www.glpi-project.org/
 @since     2009
 ---------------------------------------------------------------------- */
include "../../../inc/includes.php";
Session::checkRight("config", "w");
if (isset($_GET['itemtype'])) {
    $type = new PluginGenericobjectType();
    $type->getFromDBByType($_GET['itemtype']);
    Html::redirect(Toolbox::getItemTypeFormURL('PluginGenericobjectType') . '?id=' . $type->getID());
} else {
    Html::header(__("Type of objects", "genericobject"), $_SERVER['PHP_SELF'], "plugins", "genericobject", "type");
    Search::Show('PluginGenericobjectType');
    Html::footer();
}
 public static function checkNecessaryFieldsDelete($itemtype, $field)
 {
     $type = new PluginGenericobjectType();
     $type->getFromDBByType($itemtype);
     if ($type->canUseNetworkPorts() && 'locations_id' == $field) {
         return false;
     }
     /*
           if ($type->fields['use_direct_connections']) {
              foreach(array('users_id','groups_id',' states_id','locations_id') as $tmp_field) {
                 if ($tmp_field == $field) {
                    return false;
                 }
              }
           }*/
     return true;
 }