Réécriture de CFGPCMN pour utiliser ManageTable
This commit is contained in:
parent
7049a96ab5
commit
73c99f6c6e
8 changed files with 124 additions and 101 deletions
|
|
@ -83,6 +83,14 @@ class Acc_Plan_SQL extends Data_SQL
|
|||
public function delete()
|
||||
{
|
||||
$obj=new Tmp_Pcmn_SQL($this->cn,$this->id);
|
||||
if ( $this->cn->get_value("select count(*) from jrnx where j_poste=$1",[$obj->pcm_val]) > 0)
|
||||
{
|
||||
throw new Exception(_("Impossible d'effacer : ce poste est utilisé"));
|
||||
}
|
||||
if ( $this->cn->get_value("select count(*) from tmp_pcmn where pcm_val_parent=$1",[$obj->pcm_val]) > 0)
|
||||
{
|
||||
throw new Exception(_("Impossible d'effacer : ce poste est utilisé"));
|
||||
}
|
||||
return $obj->delete();
|
||||
|
||||
}
|
||||
|
|
@ -103,7 +111,10 @@ class Acc_Plan_SQL extends Data_SQL
|
|||
$obj->insert();
|
||||
$this->id=$obj->id;
|
||||
}
|
||||
|
||||
public function get_pk_value()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
public function load()
|
||||
{
|
||||
$pk=$this->primary_key;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue