<?xml version="1.0" encoding="UTF-8"?>
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
  <classes>
    <class id="MobilePhone" _delta="must_exist">
      <fields>
        <field id="ipaddress_id" xsi:type="AttributeExternalKey" _delta="define">
          <filter><![CDATA[SELECT IPAddress AS ip WHERE (ip.status NOT IN ('allocated', 'reserved') OR ip.id = :this->ipaddress_id) AND ip.org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
         </dependencies>
          <sql>ipaddress_id</sql>
          <is_null_allowed>true</is_null_allowed>
          <target_class>IPAddress</target_class>
          <on_target_delete>DEL_MANUAL</on_target_delete>
        </field>
        <field id="ipaddress_name" xsi:type="AttributeExternalField" _delta="define">
          <extkey_attcode>ipaddress_id</extkey_attcode>
          <target_attcode>fqdn</target_attcode>
        </field>
      </fields>
      <methods>
        <method id="AfterInsert" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function AfterInsert()
    {
		parent::AfterInsert();
		
		$iIpId = $this->Get('ipaddress_id');
		IPAddress::SetStatusOnAttachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId);

	}]]></code>
        </method>
        <method id="AfterUpdate" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function AfterUpdate()
    {
		parent::AfterUpdate();
		
		$iIpId = $this->Get('ipaddress_id');
		$iPreviousIpId = $this->GetOriginal('ipaddress_id');
		IPAddress::SetStatusOnAttachment($iIpId, $iPreviousIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId, $iPreviousIpId);

	}]]></code>
        </method>
        <method id="OnDelete" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function OnDelete()
    {
		parent::OnDelete();
		
		$iIpId = $this->Get('ipaddress_id');
		IPAddress::SetStatusOnDetachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), '', $iIpId);

	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="ipaddress_id" _delta="define">
              <rank>105</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
             <item id="ipaddress_id" _delta="define">
              <rank>105</rank>
            </item>
          </items>
        </search>
      </presentation>
    </class>
    <class id="IPPhone" _delta="must_exist">
      <fields>
        <field id="ipaddress_id" xsi:type="AttributeExternalKey" _delta="define">
          <filter><![CDATA[SELECT IPAddress AS ip WHERE (ip.status  NOT IN ('allocated', 'reserved') OR ip.id = :this->ipaddress_id) AND ip.org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
         </dependencies>
          <sql>ipaddress_id</sql>
          <is_null_allowed>true</is_null_allowed>
          <target_class>IPAddress</target_class>
          <on_target_delete>DEL_MANUAL</on_target_delete>
        </field>
        <field id="ipaddress_name" xsi:type="AttributeExternalField" _delta="define">
          <extkey_attcode>ipaddress_id</extkey_attcode>
          <target_attcode>fqdn</target_attcode>
        </field>
      </fields>
      <methods>
        <method id="AfterInsert" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function AfterInsert()
    {
		parent::AfterInsert();
		
		$iIpId = $this->Get('ipaddress_id');
		IPAddress::SetStatusOnAttachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId);

	}]]></code>
        </method>
        <method id="AfterUpdate" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function AfterUpdate()
    {
		parent::AfterUpdate();
		
		$iIpId = $this->Get('ipaddress_id');
		$iPreviousIpId = $this->GetOriginal('ipaddress_id');
		IPAddress::SetStatusOnAttachment($iIpId, $iPreviousIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId, $iPreviousIpId);

	}]]></code>
        </method>
        <method id="OnDelete" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function OnDelete()
    {
		parent::OnDelete();
		
		$iIpId = $this->Get('ipaddress_id');
		IPAddress::SetStatusOnDetachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), '', $iIpId);

	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="ipaddress_id" _delta="define">
              <rank>85</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
             <item id="ipaddress_id" _delta="define">
              <rank>85</rank>
            </item>
          </items>
        </search>
      </presentation>
    </class>
    <class id="Tablet" _delta="must_exist">
      <fields>
        <field id="ipaddress_id" xsi:type="AttributeExternalKey" _delta="define">
          <filter><![CDATA[SELECT IPAddress AS ip WHERE (ip.status  NOT IN ('allocated', 'reserved') OR ip.id = :this->ipaddress_id) AND ip.org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
         </dependencies>
          <sql>ipaddress_id</sql>
          <is_null_allowed>true</is_null_allowed>
          <target_class>IPAddress</target_class>
          <on_target_delete>DEL_MANUAL</on_target_delete>
        </field>
        <field id="ipaddress_name" xsi:type="AttributeExternalField" _delta="define">
          <extkey_attcode>ipaddress_id</extkey_attcode>
          <target_attcode>fqdn</target_attcode>
        </field>
      </fields>
      <methods>
        <method id="AfterInsert" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function AfterInsert()
    {
		parent::AfterInsert();
		
		$iIpId = $this->Get('ipaddress_id');
		IPAddress::SetStatusOnAttachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId);

	}]]></code>
        </method>
        <method id="AfterUpdate" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function AfterUpdate()
    {
		parent::AfterUpdate();
		
		$iIpId = $this->Get('ipaddress_id');
		$iPreviousIpId = $this->GetOriginal('ipaddress_id');
		IPAddress::SetStatusOnAttachment($iIpId, $iPreviousIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId, $iPreviousIpId);

	}]]></code>
        </method>
        <method id="OnDelete" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function OnDelete()
    {
		parent::OnDelete();
		
		$iIpId = $this->Get('ipaddress_id');
		IPAddress::SetStatusOnDetachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), '', $iIpId);

	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="ipaddress_id" _delta="define">
              <rank>75</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
             <item id="ipaddress_id" _delta="define">
              <rank>75</rank>
            </item>
          </items>
        </search>
      </presentation>
    </class>
    <class id="Peripheral" _delta="must_exist">
      <fields>
        <field id="ipaddress_id" xsi:type="AttributeExternalKey" _delta="define">
          <filter><![CDATA[SELECT IPAddress AS ip WHERE (ip.status  NOT IN ('allocated', 'reserved') OR ip.id = :this->ipaddress_id) AND ip.org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
         </dependencies>
          <sql>ipaddress_id</sql>
          <is_null_allowed>true</is_null_allowed>
          <target_class>IPAddress</target_class>
          <on_target_delete>DEL_MANUAL</on_target_delete>
        </field>
        <field id="ipaddress_name" xsi:type="AttributeExternalField" _delta="define">
          <extkey_attcode>ipaddress_id</extkey_attcode>
          <target_attcode>fqdn</target_attcode>
        </field>
      </fields>
      <methods>
        <method id="AfterInsert" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[  public function AfterInsert()
    {
        parent::AfterInsert();
      
        $iIpId = $this->Get('ipaddress_id');
        IPAddress::SetStatusOnAttachment($iIpId);
    	IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId);

   }]]></code>
        </method>
        <method id="AfterUpdate" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[  public function AfterUpdate()
    {
        parent::AfterUpdate();
      
        $iIpId = $this->Get('ipaddress_id');
        $iPreviousIpId = $this->GetOriginal('ipaddress_id');
        IPAddress::SetStatusOnAttachment($iIpId, $iPreviousIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId, $iPreviousIpId);

   }]]></code>
        </method>
        <method id="OnDelete" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[  public function OnDelete()
    {
        parent::OnDelete();
      
        $iIpId = $this->Get('ipaddress_id');
        IPAddress::SetStatusOnDetachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), '', $iIpId);

   }]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="ipaddress_id" _delta="define">
              <rank>75</rank>
            </item>
          </items>
        </details>
        <search>
          <items>
             <item id="ipaddress_id" _delta="define">
              <rank>75</rank>
            </item>
          </items>
        </search>
      </presentation>
    </class>
    <class id="PC" _delta="must_exist">
      <fields>
        <field id="ipaddress_id" xsi:type="AttributeExternalKey" _delta="define">
          <filter><![CDATA[SELECT IPAddress AS ip WHERE (ip.status  NOT IN ('allocated', 'reserved') OR ip.id = :this->ipaddress_id) AND ip.org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
         </dependencies>
          <sql>ipaddress_id</sql>
          <is_null_allowed>true</is_null_allowed>
          <target_class>IPAddress</target_class>
          <on_target_delete>DEL_MANUAL</on_target_delete>
        </field>
        <field id="ipaddress_name" xsi:type="AttributeExternalField" _delta="define">
          <extkey_attcode>ipaddress_id</extkey_attcode>
          <target_attcode>fqdn</target_attcode>
        </field>
      </fields>
      <methods>
        <method id="AfterInsert" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function AfterInsert()
    {
		parent::AfterInsert();
		
		$iIpId = $this->Get('ipaddress_id');
		IPAddress::SetStatusOnAttachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId);

	}]]></code>
        </method>
        <method id="AfterUpdate" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function AfterUpdate()
    {
		parent::AfterUpdate();
		
		$iIpId = $this->Get('ipaddress_id');
		$iPreviousIpId = $this->GetOriginal('ipaddress_id');
		IPAddress::SetStatusOnAttachment($iIpId, $iPreviousIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId, $iPreviousIpId);

	}]]></code>
        </method>
        <method id="OnDelete" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function OnDelete()
    {
		parent::OnDelete();
		
		$iIpId = $this->Get('ipaddress_id');
		IPAddress::SetStatusOnDetachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), '', $iIpId);

	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="col:col1" _delta="must_exist">
              <items>
                <item id="fieldset:Server:moreinfo" _delta="must_exist">
                  <items>
                    <item id="ipaddress_id" _delta="define">
                      <rank>75</rank>
                    </item>
                  </items>
                </item>
              </items>
            </item>
          </items> 
        </details>
        <search>
          <items>
             <item id="ipaddress_id" _delta="define">
              <rank>75</rank>
            </item>
          </items>
        </search>
      </presentation>
    </class>
    <class id="Printer" _delta="must_exist">
      <fields>
        <field id="ipaddress_id" xsi:type="AttributeExternalKey" _delta="define">
          <filter><![CDATA[SELECT IPAddress AS ip WHERE (ip.status  NOT IN ('allocated', 'reserved') OR ip.id = :this->ipaddress_id) AND ip.org_id = :this->org_id]]></filter>
          <dependencies>
            <attribute id="org_id"/>
         </dependencies>
          <sql>ipaddress_id</sql>
          <is_null_allowed>true</is_null_allowed>
          <target_class>IPAddress</target_class>
          <on_target_delete>DEL_MANUAL</on_target_delete>
        </field>
        <field id="ipaddress_name" xsi:type="AttributeExternalField" _delta="define">
          <extkey_attcode>ipaddress_id</extkey_attcode>
          <target_attcode>fqdn</target_attcode>
        </field>
      </fields>
      <methods>
        <method id="AfterInsert" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function AfterInsert()
    {
		parent::AfterInsert();
		
		$iIpId = $this->Get('ipaddress_id');
		IPAddress::SetStatusOnAttachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId);

	}]]></code>
        </method>
        <method id="AfterUpdate" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function AfterUpdate()
    {
		parent::AfterUpdate();
		
		$iIpId = $this->Get('ipaddress_id');
		$iPreviousIpId = $this->GetOriginal('ipaddress_id');
		IPAddress::SetStatusOnAttachment($iIpId, $iPreviousIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), $this->Get('name'), $iIpId, $iPreviousIpId);

	}]]></code>
        </method>
        <method id="OnDelete" _delta="define">
          <comment/>
          <static>false</static>
          <access>public</access>
          <type>Overload-DBObject</type>
          <code><![CDATA[	public function OnDelete()
    {
		parent::OnDelete();
		
		$iIpId = $this->Get('ipaddress_id');
		IPAddress::SetStatusOnDetachment($iIpId);
		IPAddress::SetShortNameOnAttachment ($this->Get('org_id'), '', $iIpId);

	}]]></code>
        </method>
      </methods>
      <presentation>
        <details>
          <items>
            <item id="col:col1" _delta="must_exist">
              <items>
                <item id="fieldset:Server:moreinfo" _delta="must_exist">
                  <items>
                    <item id="ipaddress_id" _delta="define">
                      <rank>25</rank>
                    </item>
                  </items>
                </item>
              </items>
            </item>
          </items> 
        </details>
        <search>
          <items>
             <item id="ipaddress_id" _delta="define">
              <rank>75</rank>
            </item>
          </items>
        </search>
      </presentation>
    </class>
  </classes>
</itop_design>
