There is still no parameter for this. It requires the development of a DoCheckToWrite procedure. Such a handler should be injected by the mean of a custom module, so as to preserve the capability to upgrade iTop when a new version becomes available.
Here is an example of such a handler, found into core/userrights.class.inc.php:
public function DoCheckToWrite()
{
parent::DoCheckToWrite();
$aChanges=$this->ListChanges();if(array_key_exists('login',$aChanges)){if(strcasecmp($this->Get('login'),$this->GetOriginal('login'))!==0){$sNewLogin=$aChanges['login'];$oSearch=DBObjectSearch::FromOQL_AllData("SELECT User WHERE login = :newlogin");if(!$this->IsNew()){$oSearch->AddCondition('id',$this->GetKey(),'!=');}$oSet=newDBObjectSet($oSearch,array(),array('newlogin'=>$sNewLogin));if($oSet->Count()>0){$this->m_aCheckIssues[]=Dict::Format('Class:User/Error:LoginMustBeUnique',$sNewLogin);}}}
}
Regards,
Romain
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi..!! I need to prevent the serial number for a CI (like PC/Laptop) to be duplicated and can not find where to configure this feature.
Can anyone help me?
Thanks, Daniel
Hi,
There is still no parameter for this. It requires the development of a DoCheckToWrite procedure. Such a handler should be injected by the mean of a custom module, so as to preserve the capability to upgrade iTop when a new version becomes available.
Here is an example of such a handler, found into core/userrights.class.inc.php:
public function DoCheckToWrite()
{
parent::DoCheckToWrite();
}
Regards,
Romain
Hi i am also facing the same issue can anybody help me how should i restrict Duplicate Serial number
Nowadays you'd need to create an extension which puts a uniqueness rule on the class, so serial number has to be unique.
Thank you for replying....can you please share any sample files which are working.
As i am new to the system not getting exactly in which files i have to do the changes.
Hello,
Wassim please next time open a dedicated thread instead of adding a reply in an old one !
Jeffrey : yes exactly !
See this wiki page to learn everything about uniqueness rules : Prevent duplicates [iTop Documentation]
Sure Pierre will create a new thread..