mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
fix bug when deleting ressource from project
This commit is contained in:
+77
-11
@@ -86,7 +86,7 @@ class ressource extends basis_db
|
||||
$this->insertamum = $row->insertamum;
|
||||
$this->insertvon = $row->insertvon;
|
||||
$this->updateamum = $row->updateamum;
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
return true;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ class ressource extends basis_db
|
||||
$obj->insertamum = $row->insertamum;
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
//var_dump($this->result);
|
||||
@@ -174,7 +174,7 @@ class ressource extends basis_db
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$obj->aufwand = $row->aufwand;
|
||||
$obj->aufwand = $row->aufwand;
|
||||
$obj->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
$obj->projekt_ressource_id= $row->projekt_ressource_id;
|
||||
|
||||
@@ -189,8 +189,8 @@ class ressource extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Lädt die Projektressource
|
||||
@@ -203,15 +203,15 @@ class ressource extends basis_db
|
||||
$this->result=array();
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
{
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->ressource_id = $row->ressource_id;
|
||||
$this->beschreibung = $row->beschreibung;
|
||||
$this->aufwand = $row->aufwand;
|
||||
$this->aufwand = $row->aufwand;
|
||||
$this->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
$this->projekt_ressource_id= $row->projekt_ressource_id;
|
||||
$this->projekt_kurzbz = $row->projekt_kurzbz;
|
||||
$this->projekt_ressource_id= $row->projekt_ressource_id;
|
||||
$this->projekt_kurzbz = $row->projekt_kurzbz;
|
||||
$this->projektphase_id = $row->projektphase_id;
|
||||
return true;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ class ressource extends basis_db
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -256,7 +256,7 @@ class ressource extends basis_db
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$obj->aufwand = $row->aufwand;
|
||||
$obj->aufwand = $row->aufwand;
|
||||
$obj->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
$obj->projekt_ressource_id = $row->projekt_ressource_id;
|
||||
$this->result[] = $obj;
|
||||
@@ -688,5 +688,71 @@ class ressource extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Löscht eine Ressource zu Projekt Zuordnung
|
||||
* @param type $ressource_id
|
||||
* @param type $projekt_kurzbz
|
||||
* @return boolean
|
||||
*/
|
||||
public function deleteFromProjektWithProjektRessourceId($ressource_id, $projekt_kurzbz, $project_ressource_id)
|
||||
{
|
||||
if($ressource_id == '' || !is_numeric($ressource_id))
|
||||
{
|
||||
$this->errormsg = 'Ressource Id ist keine gültige Zahl';
|
||||
return false;
|
||||
}
|
||||
/*$qry="DELETE FROM fue.tbl_projekt_ressource WHERE ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, false)."
|
||||
AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz, FHC_STRING, false).';';
|
||||
*/
|
||||
$qry="
|
||||
DELETE FROM fue.tbl_projekt_ressource pr
|
||||
USING fue.tbl_ressource r
|
||||
WHERE r.ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, false). "
|
||||
AND pr.projekt_ressource_id=".$this->db_add_param($project_ressource_id, FHC_INTEGER, false). "
|
||||
AND pr.projekt_kurzbz=".$this->db_add_param($projekt_kurzbz, FHC_STRING, false).';';
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Löschen der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Löscht eine Ressource zu Phase Zuordnung
|
||||
* @param type $ressource_id
|
||||
* @param type $projekt_kurzbz
|
||||
* @return boolean
|
||||
*/
|
||||
public function deleteFromPhaseWithProjektRessourceId($ressource_id, $projektphase_id, $project_ressource_id)
|
||||
{
|
||||
if($ressource_id == '' || !is_numeric($ressource_id))
|
||||
{
|
||||
$this->errormsg = 'Ressource Id ist keine gültige Zahl';
|
||||
return false;
|
||||
}
|
||||
|
||||
if($projektphase_id == '' || !is_numeric($projektphase_id))
|
||||
{
|
||||
$this->errormsg = 'Ressource Id ist keine gültige Zahl';
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry="DELETE FROM fue.tbl_projekt_ressource WHERE ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, false)."
|
||||
AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER, false).';';
|
||||
|
||||
if($this->db_query($qry))
|
||||
return true;
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Löschen der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user