mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-01 19:09:27 +00:00
- arbeitsbeschreibung bei projekten und phasen
This commit is contained in:
@@ -48,6 +48,7 @@ class projekt extends basis_db
|
||||
public $anzahl_ma; // integer
|
||||
public $aufwand_pt; // integer
|
||||
public $zeitaufzeichnung; //bool
|
||||
public $arbeitsbeschreibung; //bool
|
||||
public $sap_project_id;
|
||||
|
||||
|
||||
@@ -88,6 +89,7 @@ class projekt extends basis_db
|
||||
$this->anzahl_ma = $row->anzahl_ma;
|
||||
$this->aufwand_pt = $row->aufwand_pt;
|
||||
$this->zeitaufzeichnung = $this->db_parse_bool($row->zeitaufzeichnung);
|
||||
$this->arbeitsbeschreibung = $this->db_parse_bool($row->arbeitsbeschreibung);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -143,6 +145,7 @@ class projekt extends basis_db
|
||||
$obj->anzahl_ma = $row->anzahl_ma;
|
||||
$obj->aufwand_pt = $row->aufwand_pt;
|
||||
$obj->zeitaufzeichnung = $this->db_parse_bool($row->zeitaufzeichnung);
|
||||
$obj->arbeitsbeschreibung = $this->db_parse_bool($row->arbeitsbeschreibung);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -187,6 +190,7 @@ class projekt extends basis_db
|
||||
$obj->anzahl_ma = $row->anzahl_ma;
|
||||
$obj->aufwand_pt = $row->aufwand_pt;
|
||||
$obj->zeitaufzeichnung = $this->db_parse_bool($row->zeitaufzeichnung);
|
||||
$obj->arbeitsbeschreibung = $this->db_parse_bool($row->arbeitsbeschreibung);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -230,6 +234,7 @@ class projekt extends basis_db
|
||||
$obj->anzahl_ma = $row->anzahl_ma;
|
||||
$obj->aufwand_pt = $row->aufwand_pt;
|
||||
$obj->zeitaufzeichnung = $this->db_parse_bool($row->zeitaufzeichnung);
|
||||
$obj->arbeitsbeschreibung = $this->db_parse_bool($row->arbeitsbeschreibung);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -297,7 +302,7 @@ class projekt extends basis_db
|
||||
{
|
||||
//Neuen Datensatz einfuegen
|
||||
|
||||
$qry = 'INSERT INTO fue.tbl_projekt (projekt_kurzbz, nummer, titel,beschreibung, beginn, ende, budget, farbe, oe_kurzbz, aufwand_pt, anzahl_ma, aufwandstyp_kurzbz, zeitaufzeichnung) VALUES('.
|
||||
$qry = 'INSERT INTO fue.tbl_projekt (projekt_kurzbz, nummer, titel,beschreibung, beginn, ende, budget, farbe, oe_kurzbz, aufwand_pt, anzahl_ma, aufwandstyp_kurzbz, zeitaufzeichnung, arbeitsbeschreibung) VALUES('.
|
||||
$this->db_add_param($this->projekt_kurzbz).', '.
|
||||
$this->db_add_param($this->nummer).', '.
|
||||
$this->db_add_param($this->titel).', '.
|
||||
@@ -310,7 +315,8 @@ class projekt extends basis_db
|
||||
$this->db_add_param($this->aufwand_pt).','.
|
||||
$this->db_add_param($this->anzahl_ma).','.
|
||||
$this->db_add_param($this->aufwandstyp_kurzbz).', '.
|
||||
$this->db_add_param($this->zeitaufzeichnung,FHC_BOOLEAN).');';
|
||||
$this->db_add_param($this->zeitaufzeichnung, FHC_BOOLEAN).', '.
|
||||
$this->db_add_param($this->arbeitsbeschreibung, FHC_BOOLEAN).');';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -329,7 +335,8 @@ class projekt extends basis_db
|
||||
'anzahl_ma='.$this->db_add_param($this->anzahl_ma).', '.
|
||||
'aufwand_pt='.$this->db_add_param($this->aufwand_pt).', '.
|
||||
'aufwandstyp_kurzbz='.$this->db_add_param($this->aufwandstyp_kurzbz).', '.
|
||||
'zeitaufzeichnung='.$this->db_add_param($this->zeitaufzeichnung,FHC_BOOLEAN).' '.
|
||||
'zeitaufzeichnung='.$this->db_add_param($this->zeitaufzeichnung, FHC_BOOLEAN).', '.
|
||||
'arbeitsbeschreibung='.$this->db_add_param($this->arbeitsbeschreibung, FHC_BOOLEAN).' '.
|
||||
'WHERE projekt_kurzbz='.$this->db_add_param($this->projekt_kurzbz).';';
|
||||
}
|
||||
|
||||
@@ -429,6 +436,7 @@ class projekt extends basis_db
|
||||
$obj->ende = $row->ende;
|
||||
$obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
$obj->zeitaufzeichnung = $this->db_parse_bool($row->zeitaufzeichnung);
|
||||
$obj->arbeitsbeschreibung = $this->db_parse_bool($row->arbeitsbeschreibung);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -583,6 +591,7 @@ class projekt extends basis_db
|
||||
$this->anzahl_ma = $row->anzahl_ma;
|
||||
$this->aufwand_pt = $row->aufwand_pt;
|
||||
$this->zeitaufzeichnung = $this->db_parse_bool($row->zeitaufzeichnung);
|
||||
$this->arbeitsbeschreibung = $this->db_parse_bool($row->arbeitsbeschreibung);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ class projektphase extends basis_db
|
||||
public $updateamum; // timestamp
|
||||
public $updatevon; // bigint
|
||||
public $zeitaufzeichnung; // bool
|
||||
public $arbeitsbeschreibung; // bool
|
||||
public $project_task_id;
|
||||
|
||||
|
||||
@@ -103,6 +104,7 @@ class projektphase extends basis_db
|
||||
$this->updateamum = $row->updateamum;
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->zeitaufzeichnung = $this->db_parse_bool($row->zeitaufzeichnung);
|
||||
$this->arbeitsbeschreibung = $this->db_parse_bool($row->arbeitsbeschreibung);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -161,6 +163,7 @@ class projektphase extends basis_db
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$obj->zeitaufzeichnung = $this->db_parse_bool($row->zeitaufzeichnung);
|
||||
$obj->arbeitsbeschreibung = $this->db_parse_bool($row->arbeitsbeschreibung);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -216,6 +219,7 @@ class projektphase extends basis_db
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$obj->zeitaufzeichnung = $this->db_parse_bool($row->zeitaufzeichnung);
|
||||
$obj->arbeitsbeschreibung = $this->db_parse_bool($row->arbeitsbeschreibung);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -263,6 +267,7 @@ class projektphase extends basis_db
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$obj->zeitaufzeichnung = $this->db_parse_bool($row->zeitaufzeichnung);
|
||||
$obj->arbeitsbeschreibung = $this->db_parse_bool($row->arbeitsbeschreibung);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -323,7 +328,7 @@ class projektphase extends basis_db
|
||||
{
|
||||
//Neuen Datensatz einfuegen
|
||||
$qry='BEGIN; INSERT INTO fue.tbl_projektphase (projekt_kurzbz, projektphase_fk, bezeichnung, typ,
|
||||
beschreibung, start, ende, budget, ressource_id, insertvon, insertamum, updatevon, updateamum, farbe, personentage, zeitaufzeichnung) VALUES ('.
|
||||
beschreibung, start, ende, budget, ressource_id, insertvon, insertamum, updatevon, updateamum, farbe, personentage, zeitaufzeichnung, arbeitsbeschreibung) VALUES ('.
|
||||
$this->db_add_param($this->projekt_kurzbz).', '.
|
||||
$this->db_add_param($this->projektphase_fk).', '.
|
||||
$this->db_add_param($this->bezeichnung).', '.
|
||||
@@ -337,7 +342,8 @@ class projektphase extends basis_db
|
||||
$this->db_add_param($this->updatevon).', now(), '.
|
||||
$this->db_add_param($this->farbe).', '.
|
||||
$this->db_add_param($this->personentage).', '.
|
||||
$this->db_add_param($this->zeitaufzeichnung,FHC_BOOLEAN).');';
|
||||
$this->db_add_param($this->zeitaufzeichnung, FHC_BOOLEAN).', '.
|
||||
$this->db_add_param($this->arbeitsbeschreibung, FHC_BOOLEAN).');';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -357,7 +363,8 @@ class projektphase extends basis_db
|
||||
'personentage='.$this->db_add_param($this->personentage).', '.
|
||||
'updateamum= now(), '.
|
||||
'updatevon='.$this->db_add_param($this->updatevon).', '.
|
||||
'zeitaufzeichnung='.$this->db_add_param($this->zeitaufzeichnung,FHC_BOOLEAN).' '.
|
||||
'zeitaufzeichnung='.$this->db_add_param($this->zeitaufzeichnung, FHC_BOOLEAN).', '.
|
||||
'arbeitsbeschreibung='.$this->db_add_param($this->arbeitsbeschreibung,FHC_BOOLEAN).' '.
|
||||
'WHERE projektphase_id='.$this->db_add_param($this->projektphase_id, FHC_INTEGER).';';
|
||||
}
|
||||
|
||||
@@ -819,6 +826,7 @@ class projektphase extends basis_db
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$obj->arbeitsbeschreibung = $row->arbeitsbeschreibung;
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
|
||||
@@ -222,36 +222,63 @@ class zeitaufzeichnung_import {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $phase The Projektphase ID
|
||||
* @return void
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function checkPhaseBebuchbar($phase)
|
||||
{
|
||||
if ($this->phase->getPhasenZA($phase) == 'f')
|
||||
/**
|
||||
* @param string $phase The Projektphase ID
|
||||
* @return void
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function checkPhaseBebuchbar($phase)
|
||||
{
|
||||
throw new Exception($this->p->t("global/fehlerBeimSpeichernDerDaten") . ': Dieses Arbeitspaket darf nicht bebucht werden!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $phase The Projektphase ID
|
||||
* @return void
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function checkIfArbeitspaketZuWaehlen($projekt_kurzbz, $phase)
|
||||
{
|
||||
if ($projekt_kurzbz != '')
|
||||
{
|
||||
$this->project->load($projekt_kurzbz);
|
||||
if (!$this->project->zeitaufzeichnung && !$phase)
|
||||
if ($this->phase->getPhasenZA($phase) == 'f')
|
||||
{
|
||||
throw new Exception($this->p->t("global/fehlerBeimSpeichernDerDaten") . ': Bitte ein Arbeitspaket wählen!');
|
||||
throw new Exception($this->p->t("global/fehlerBeimSpeichernDerDaten") . ': Dieses Arbeitspaket darf nicht bebucht werden!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $phase The Projektphase ID
|
||||
* @return void
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function checkIfArbeitspaketZuWaehlen($projekt_kurzbz, $phase)
|
||||
{
|
||||
if ($projekt_kurzbz != '')
|
||||
{
|
||||
$this->project->load($projekt_kurzbz);
|
||||
|
||||
if (!$this->project->zeitaufzeichnung && !$phase)
|
||||
{
|
||||
throw new Exception($this->p->t("global/fehlerBeimSpeichernDerDaten") . ': Bitte ein Arbeitspaket wählen!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function checkIfArbeitsbeschreibungRequired($projekt_kurzbz, $beschreibung)
|
||||
{
|
||||
if ($projekt_kurzbz != '')
|
||||
{
|
||||
$this->project->load($projekt_kurzbz);
|
||||
|
||||
if ($this->project->arbeitsbeschreibung && empty(trim($beschreibung)))
|
||||
{
|
||||
throw new Exception($this->p->t("global/fehlerBeimSpeichernDerDaten") . ': Bitte eine Beschreibung angeben!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function checkIfArbeitsbeschreibungRequiredPhase($phase, $beschreibung)
|
||||
{
|
||||
if ($phase != '')
|
||||
{
|
||||
$this->phase->load($phase);
|
||||
|
||||
if ($this->phase->arbeitsbeschreibung && empty(trim($beschreibung)))
|
||||
{
|
||||
throw new Exception($this->p->t("global/fehlerBeimSpeichernDerDaten") . ': Bitte eine Beschreibung angeben!');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -174,6 +174,10 @@ class zeitaufzeichnung_import_csv extends zeitaufzeichnung_import {
|
||||
if(empty($data[self::PHASE]))
|
||||
$this->checkProjectInterval($data[self::PROJEKT], $data[self::STARTDT], $data[self::ENDEDT]);
|
||||
$this->checkPhaseInterval($data[self::PHASE], $data[self::STARTDT], $data[self::ENDEDT]);
|
||||
if ($data[self::PHASE] !== "")
|
||||
$this->checkIfArbeitsbeschreibungRequiredPhase($data[self::PHASE], $data[self::BESCHREIBUNG]);
|
||||
else
|
||||
$this->checkIfArbeitsbeschreibungRequired($data[self::PROJEKT], $data[self::BESCHREIBUNG]);
|
||||
$this->checkVals($data[self::OE],$data[self::PROJEKT],$data[self::PHASE],$data[self::SERVICE]);
|
||||
$this->mapLehreIntern($data);
|
||||
$this->prepareZeitaufzeichnung($data);
|
||||
|
||||
@@ -74,6 +74,10 @@ class zeitaufzeichnung_import_post extends zeitaufzeichnung_import {
|
||||
$this->processPause($this->data['von_pause'], $this->data['bis_pause']);
|
||||
$this->checkPhaseBebuchbar($this->data['projektphase_id']);
|
||||
$this->checkIfArbeitspaketZuWaehlen($this->data['projekt_kurzbz'], $this->data['projektphase_id']);
|
||||
if ($this->data['projektphase_id'] !== "")
|
||||
$this->checkIfArbeitsbeschreibungRequiredPhase($this->data['projektphase_id'], $this->data['beschreibung']);
|
||||
else
|
||||
$this->checkIfArbeitsbeschreibungRequired($this->data['projekt_kurzbz'], $this->data['beschreibung']);
|
||||
$this->saveZeit();
|
||||
} catch (Exception $ex) {
|
||||
$this->addError($ex->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user