mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-12 17:49:28 +00:00
Fehler behoben bei dem die Projekt im Planner beim Starten nicht korrekt geladen wurden
This commit is contained in:
@@ -22,22 +22,27 @@ require_once('../../config/vilesci.config.inc.php');
|
||||
|
||||
?>
|
||||
|
||||
var global_year;
|
||||
var global_url;
|
||||
var global_year;
|
||||
var global_url;
|
||||
|
||||
function getProperties()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var tree=document.getElementById('tree-projektmenue');
|
||||
|
||||
|
||||
// Wenn auf die Ueberschrift geklickt wird, soll nix passieren
|
||||
if(tree.currentIndex==-1)
|
||||
{
|
||||
alert("Kein gültiges Projekt ausgewählt!");
|
||||
return;
|
||||
}
|
||||
projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex);
|
||||
|
||||
if(typeof(ProjektSelectKurzbz)!='undefined')
|
||||
projekt_kurzbz = ProjektSelectKurzbz;
|
||||
else
|
||||
{
|
||||
alert("Kein gültiges Projekt ausgewählt!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex);
|
||||
}
|
||||
|
||||
function showStudienjahr()
|
||||
@@ -47,27 +52,35 @@ function showStudienjahr()
|
||||
{
|
||||
var datumAktuell = new Date();
|
||||
var jahrAktuell = datumAktuell.getFullYear();
|
||||
global_year = jahrAktuell;
|
||||
global_year = jahrAktuell;
|
||||
}
|
||||
|
||||
var tree=document.getElementById('tree-projektmenue');
|
||||
// Wenn auf die Ueberschrift geklickt wird, soll nix passieren
|
||||
if(tree.currentIndex==-1)
|
||||
{
|
||||
alert("Kein gültiges Projekt ausgewählt!");
|
||||
return;
|
||||
}
|
||||
projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex);
|
||||
if(typeof(ProjektSelectKurzbz)!='undefined')
|
||||
projekt_kurzbz = ProjektSelectKurzbz;
|
||||
else
|
||||
{
|
||||
alert("Kein gültiges Projekt ausgewählt!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex);
|
||||
}
|
||||
if(projekt_kurzbz == '')
|
||||
{
|
||||
oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex);
|
||||
oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex);
|
||||
var url = 'projekt/gantt.svg.php?oe='+oe_kurzbz+'&studienjahr='+(global_year-1)+'&ansicht=studienjahr';
|
||||
global_url=url;
|
||||
global_url=url;
|
||||
}
|
||||
else
|
||||
{
|
||||
var url = 'projekt/gantt.svg.php?projekt='+projekt_kurzbz+'&studienjahr='+(global_year-1)+'&ansicht=studienjahr';
|
||||
global_url = url;
|
||||
global_url = url;
|
||||
}
|
||||
|
||||
document.getElementById('iframe-gant-projekt').contentWindow.location.href=url;
|
||||
@@ -79,33 +92,40 @@ function showKalenderjahr()
|
||||
{
|
||||
var datumAktuell = new Date();
|
||||
var jahrAktuell = datumAktuell.getFullYear();
|
||||
global_year = jahrAktuell;
|
||||
global_year = jahrAktuell;
|
||||
}
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var tree=document.getElementById('tree-projektmenue');
|
||||
|
||||
|
||||
// Wenn auf die Ueberschrift geklickt wird, soll nix passieren
|
||||
if(tree.currentIndex==-1)
|
||||
{
|
||||
alert("Kein gültiges Projekt ausgewählt!");
|
||||
return;
|
||||
}
|
||||
projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex);
|
||||
if(typeof(ProjektSelectKurzbz)!='undefined')
|
||||
projekt_kurzbz = ProjektSelectKurzbz;
|
||||
else
|
||||
{
|
||||
alert("Kein gültiges Projekt ausgewählt!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex);
|
||||
|
||||
if(projekt_kurzbz == '')
|
||||
{
|
||||
oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex);
|
||||
oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex);
|
||||
var url = 'projekt/gantt.svg.php?oe='+oe_kurzbz+'&studienjahr='+global_year+'&ansicht=kalenderjahr';
|
||||
global_url = url;
|
||||
global_url = url;
|
||||
}
|
||||
else
|
||||
{
|
||||
var url = 'projekt/gantt.svg.php?projekt='+projekt_kurzbz+'&studienjahr='+global_year+'&ansicht=kalenderjahr';
|
||||
global_url = url;
|
||||
global_url = url;
|
||||
}
|
||||
|
||||
global_url = url;
|
||||
document.getElementById('iframe-gant-projekt').contentWindow.location.href=url;
|
||||
document.getElementById('iframe-gant-projekt').contentWindow.location.href=url;
|
||||
}
|
||||
|
||||
function showZeitraum(beginn, ende)
|
||||
@@ -114,36 +134,36 @@ function showZeitraum(beginn, ende)
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var tree=document.getElementById('tree-projektmenue');
|
||||
|
||||
|
||||
// Wenn auf die Ueberschrift geklickt wird, soll nix passieren
|
||||
if(tree.currentIndex==-1)
|
||||
{
|
||||
alert("Kein gültiges Projekt ausgewählt!");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
projekt_kurzbz=getTreeCellText(tree, "treecol-projektmenue-projekt_kurzbz", tree.currentIndex);
|
||||
if(projekt_kurzbz == '')
|
||||
{
|
||||
oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex);
|
||||
oe_kurzbz = getTreeCellText(tree, "treecol-projektmenue-oe", tree.currentIndex);
|
||||
var url = 'projekt/gantt.svg.php?oe='+oe_kurzbz+'&beginn='+beginn+'&ende='+ende;
|
||||
global_url = url;
|
||||
global_url = url;
|
||||
}
|
||||
|
||||
global_url = url;
|
||||
document.getElementById('iframe-gant-projekt').contentWindow.location.href=url;
|
||||
document.getElementById('iframe-gant-projekt').contentWindow.location.href=url;
|
||||
}
|
||||
else
|
||||
alert('kein gültiges Datum eingetragen');
|
||||
|
||||
|
||||
}
|
||||
|
||||
function showYear()
|
||||
{
|
||||
var datumAktuell = new Date();
|
||||
var jahrAktuell = datumAktuell.getFullYear();
|
||||
global_year = jahrAktuell;
|
||||
|
||||
global_year = jahrAktuell;
|
||||
|
||||
foo = document.getElementById('toolbarbutton-menuitem-gantt-kalenderjahr');
|
||||
checked=foo.getAttribute('checked');
|
||||
// kalenderjahr checked
|
||||
@@ -207,7 +227,7 @@ function showYearPlus()
|
||||
}
|
||||
|
||||
function printGantt()
|
||||
{
|
||||
{
|
||||
foo = window.open(global_url);
|
||||
foo.onload = function ()
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/projektdetail.overlay.xul.
|
||||
<!-- ************* -->
|
||||
<!-- Bem.: style="visibility:collapse" versteckt eine Spalte -->
|
||||
<tree id="tree-projekt" seltype="single" hidecolumnpicker="false" flex="1"
|
||||
datasources="../../rdf/projekt.rdf.php?foo=<?php echo time(); ?>" ref="http://www.technikum-wien.at/projekt/alle-projekte"
|
||||
datasources="../rdf/projekt.rdf.php?nocache=<?php echo time(); ?>" ref="http://www.technikum-wien.at/projekt/alle-projekte"
|
||||
style="margin:0px;height:250px" enableColumnDrag="true"
|
||||
onselect="onselectProjekt(this);"
|
||||
persist="height"
|
||||
@@ -154,5 +154,5 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/projekt/projektdetail.overlay.xul.
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</overlay>
|
||||
|
||||
+79
-78
@@ -43,7 +43,7 @@ class mantis extends basis_db
|
||||
public $issue_summary; //Zusammendassung
|
||||
public $issue_reproducibility; //Reproduzierbar
|
||||
public $issue_date_submitted; //Meldungsdatum
|
||||
public $issue_sponsorship_total;
|
||||
public $issue_sponsorship_total;
|
||||
public $issue_projection; //Projektion
|
||||
public $issue_eta; //Aufwand
|
||||
public $issue_resolution; //Lösung
|
||||
@@ -52,10 +52,11 @@ class mantis extends basis_db
|
||||
public $issue_due_date;
|
||||
public $issue_steps_to_reproduce;
|
||||
public $issue_additional_information;
|
||||
public $issue_tags;
|
||||
|
||||
public $issue_tags;
|
||||
|
||||
public $soapClient;
|
||||
public $errormsg;
|
||||
public $result=array();
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
@@ -71,61 +72,61 @@ class mantis extends basis_db
|
||||
*/
|
||||
public function initSoapClient()
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->soapClient = new SoapClient(MANTIS_PFAD);
|
||||
try
|
||||
{
|
||||
$this->soapClient = new SoapClient(MANTIS_PFAD);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
{
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param type $issue_tags
|
||||
* @return type
|
||||
*/
|
||||
public function setTags($issue_tags)
|
||||
{
|
||||
|
||||
$tags = array();
|
||||
|
||||
$tags = array();
|
||||
$tags_array = explode(',', $issue_tags);
|
||||
|
||||
// Hole alle Tags
|
||||
$params_tags=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT, 'page_number'=>1, 'per_page'=>20);
|
||||
$result_tags = $this->soapClient->__soapCall('mc_tag_get_all',$params_tags);
|
||||
|
||||
|
||||
$test = array();
|
||||
$test = $result_tags->results;
|
||||
|
||||
|
||||
|
||||
$test = array();
|
||||
$test = $result_tags->results;
|
||||
|
||||
|
||||
foreach($tags_array as $t)
|
||||
{
|
||||
$tags_help = new stdClass();
|
||||
$tags_help->name = trim($t);
|
||||
|
||||
$tags_help->name = trim($t);
|
||||
|
||||
foreach($result_tags->results as $rt)
|
||||
{
|
||||
|
||||
if($rt->name == $tags_help->name)
|
||||
{
|
||||
$tags_help->id = $rt->id;
|
||||
$tags_help->id = $rt->id;
|
||||
}
|
||||
|
||||
}
|
||||
//$tags_help->id = 10;
|
||||
$tags[] = $tags_help;
|
||||
//$tags_help->id = 10;
|
||||
$tags[] = $tags_help;
|
||||
}
|
||||
|
||||
|
||||
$params=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT,'issue_id' =>$this->issue_id, $tags);
|
||||
$result = $this->soapClient->__soapCall('mc_issue_set_tags',$params);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Ticket Update
|
||||
*/
|
||||
@@ -140,13 +141,13 @@ class mantis extends basis_db
|
||||
'priority'=>array('id'=>$this->issue_priority->id),
|
||||
'additional_information'=>$this->issue_additional_information,
|
||||
'reporter'=>array('id'=>$this->issue_reporter_id),
|
||||
);
|
||||
);
|
||||
|
||||
$params=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT,'issueId' => $this->issue_id, $issue);
|
||||
$result = $this->soapClient->__soapCall('mc_issue_update',$params);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Neues Ticket anlegen
|
||||
*/
|
||||
@@ -161,84 +162,84 @@ class mantis extends basis_db
|
||||
'priority'=>array('id'=>$this->issue_priority->id),
|
||||
'additional_information'=>$this->issue_additional_information,
|
||||
);
|
||||
|
||||
|
||||
$params=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT, $issue);
|
||||
$result = $this->soapClient->__soapCall('mc_issue_add',$params);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ticket holen
|
||||
*/
|
||||
public function getIssue($issue_id=1)
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
$params=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT,'issue_id' => $issue_id);
|
||||
$result = $this->soapClient->__soapCall('mc_issue_get',$params);
|
||||
|
||||
$this->issue_id = $result->id;
|
||||
|
||||
$this->issue_id = $result->id;
|
||||
$this->issue_view_state = new stdclass();
|
||||
$this->issue_view_state->id = $result->view_state->id;
|
||||
$this->issue_view_state->name = $result->view_state->name;
|
||||
$this->issue_last_updated = $result->last_updated;
|
||||
$this->issue_view_state->id = $result->view_state->id;
|
||||
$this->issue_view_state->name = $result->view_state->name;
|
||||
$this->issue_last_updated = $result->last_updated;
|
||||
$this->issue_project = new stdclass();
|
||||
$this->issue_project->id = $result->project->id;
|
||||
$this->issue_project->name = $result->project->name;
|
||||
$this->issue_category = $result->category;
|
||||
$this->issue_project->id = $result->project->id;
|
||||
$this->issue_project->name = $result->project->name;
|
||||
$this->issue_category = $result->category;
|
||||
$this->issue_priority = new stdclass();
|
||||
$this->issue_priority->id = $result->priority->id;
|
||||
$this->issue_priority->name = $result->priority->name;
|
||||
$this->issue_priority->name = $result->priority->name;
|
||||
$this->issue_severity = new stdclass();
|
||||
$this->issue_severity->id = $result->severity->id;
|
||||
$this->issue_severity->name = $result->severity->name;
|
||||
$this->issue_severity->id = $result->severity->id;
|
||||
$this->issue_severity->name = $result->severity->name;
|
||||
$this->issue_status = new stdclass();
|
||||
$this->issue_status->id = $result->status->id;
|
||||
$this->issue_status->name = $result->status->name;
|
||||
$this->issue_status->id = $result->status->id;
|
||||
$this->issue_status->name = $result->status->name;
|
||||
$this->issue_reporter = new stdclass();
|
||||
$this->issue_reporter->id = $result->reporter->id;
|
||||
$this->issue_reporter->name = $result->reporter->name;
|
||||
$this->issue_reporter->real_name = $result->reporter->real_name;
|
||||
$this->issue_reporter->email = $result->reporter->email;
|
||||
$this->issue_summary = $result->summary;
|
||||
$this->issue_reporter->id = $result->reporter->id;
|
||||
$this->issue_reporter->name = $result->reporter->name;
|
||||
$this->issue_reporter->real_name = $result->reporter->real_name;
|
||||
$this->issue_reporter->email = $result->reporter->email;
|
||||
$this->issue_summary = $result->summary;
|
||||
$this->issue_reproducibility = new stdclass();
|
||||
$this->issue_reproducibility->id = $result->reproducibility->id;
|
||||
$this->issue_reproducibility->name = $result->reproducibility->name;
|
||||
$this->issue_date_submitted = $result->date_submitted;
|
||||
$this->issue_sponsorship_total = $result->sponsorship_total;
|
||||
$this->issue_reproducibility->name = $result->reproducibility->name;
|
||||
$this->issue_date_submitted = $result->date_submitted;
|
||||
$this->issue_sponsorship_total = $result->sponsorship_total;
|
||||
$this->issue_projection = new stdclass();
|
||||
$this->issue_projection->id = $result->projection->id;
|
||||
$this->issue_projection->name = $result->projection->name;
|
||||
$this->issue_projection->id = $result->projection->id;
|
||||
$this->issue_projection->name = $result->projection->name;
|
||||
$this->issue_eta = new stdclass();
|
||||
$this->issue_eta->id = $result->eta->id;
|
||||
$this->issue_eta->id = $result->eta->id;
|
||||
$this->issue_eta->name = $result->eta->name;
|
||||
$this->issue_resolution = new stdclass();
|
||||
$this->issue_resolution->id = $result->resolution->id;
|
||||
$this->issue_resolution->name = $result->resolution->name;
|
||||
$this->issue_tags = new stdclass();
|
||||
$anzTags = count($result->tags);
|
||||
$i = 1;
|
||||
$this->issue_resolution->id = $result->resolution->id;
|
||||
$this->issue_resolution->name = $result->resolution->name;
|
||||
$this->issue_tags = new stdclass();
|
||||
$anzTags = count($result->tags);
|
||||
$i = 1;
|
||||
foreach($result->tags as $r)
|
||||
{
|
||||
if($i == $anzTags)
|
||||
$this->issue_tags->name.= $r->name;
|
||||
$this->issue_tags->name.= $r->name;
|
||||
else
|
||||
$this->issue_tags->name.=$r->name.',';
|
||||
|
||||
$i++;
|
||||
$this->issue_tags->name.=$r->name.',';
|
||||
|
||||
$i++;
|
||||
}
|
||||
if($anzTags == 0)
|
||||
$this->issue_tags->name = '';
|
||||
$this->issue_tags->name = '';
|
||||
|
||||
$this->issue_description = $result->description;
|
||||
//$this->issue_attachments = $result->attachments;
|
||||
$this->issue_due_date = $result->due_date;
|
||||
$this->issue_description = $result->description;
|
||||
//$this->issue_attachments = $result->attachments;
|
||||
$this->issue_due_date = $result->due_date;
|
||||
$this->issue_steps_to_reproduce = (isset($result->steps_to_reproduce)?$result->steps_to_reproduce:'');
|
||||
$this->issue_additional_information = (isset($result->additional_information)?$result->additional_information:'');
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (SoapFault $fault)
|
||||
}
|
||||
catch (SoapFault $fault)
|
||||
{
|
||||
$this->errormsg="SOAP-Fehler: ".$fault->faultstring;
|
||||
return false;
|
||||
@@ -254,7 +255,7 @@ class mantis extends basis_db
|
||||
try
|
||||
{
|
||||
$params=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT);
|
||||
|
||||
|
||||
$result = $this->soapClient->__soapCall('mc_projects_get_user_accessible',$params);
|
||||
|
||||
foreach($result as $row)
|
||||
@@ -265,7 +266,7 @@ class mantis extends basis_db
|
||||
$obj->issue_project->id = $row->id;
|
||||
|
||||
$this->result[] = $obj;
|
||||
|
||||
|
||||
if(isset($row->subprojects))
|
||||
{
|
||||
foreach($row->subprojects as $row_sub)
|
||||
@@ -274,15 +275,15 @@ class mantis extends basis_db
|
||||
$obj->issue_project = new stdclass();
|
||||
$obj->issue_project->name = $row_sub->name;
|
||||
$obj->issue_project->id = $row_sub->id;
|
||||
|
||||
|
||||
$this->result[] = $obj;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (SoapFault $fault)
|
||||
}
|
||||
catch (SoapFault $fault)
|
||||
{
|
||||
$this->errormsg="SOAP-Fehler: ".$fault->faultstring;
|
||||
return false;
|
||||
@@ -307,8 +308,8 @@ class mantis extends basis_db
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (SoapFault $fault)
|
||||
}
|
||||
catch (SoapFault $fault)
|
||||
{
|
||||
$this->errormsg="SOAP-Fehler: ".$fault->faultstring;
|
||||
return false;
|
||||
|
||||
+110
-111
@@ -17,7 +17,7 @@
|
||||
*
|
||||
* Authors: Karl Burkhart <burkhart@technikum-wien.at>.
|
||||
*/
|
||||
|
||||
|
||||
require_once(dirname(__FILE__).'/basis_db.class.php');
|
||||
|
||||
class ressource extends basis_db
|
||||
@@ -31,13 +31,13 @@ class ressource extends basis_db
|
||||
public $beschreibung; //string
|
||||
public $mitarbeiter_uid; //string
|
||||
public $student_uid; //string
|
||||
public $betriebsmittel_id; //integer
|
||||
public $firma_id; //integer
|
||||
public $betriebsmittel_id; //integer
|
||||
public $firma_id; //integer
|
||||
public $insertamum; //timestamp
|
||||
public $insertvon; //string
|
||||
public $updateamum; //timestamp
|
||||
public $updatevon; //string
|
||||
|
||||
|
||||
// zwischentabelle projekt_ressource
|
||||
public $projekt_ressource_id;
|
||||
public $projektphase_id;
|
||||
@@ -53,7 +53,7 @@ class ressource extends basis_db
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if($ressource_id != null)
|
||||
if($ressource_id != null)
|
||||
$this->load($ressource_id);
|
||||
}
|
||||
|
||||
@@ -69,9 +69,9 @@ class ressource extends basis_db
|
||||
$this->errormsg = 'Ressource_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$qry = "SELECT * FROM fue.tbl_ressource WHERE ressource_id=".$this->db_add_param($ressource_id, FHC_INTEGER);
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object())
|
||||
@@ -90,13 +90,13 @@ class ressource extends basis_db
|
||||
$this->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Datensatz wurde nicht gefunden';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
@@ -105,21 +105,21 @@ class ressource extends basis_db
|
||||
|
||||
/**
|
||||
* Laedt alle Ressourcen
|
||||
* @param $projekt_kurzbz, wenn null -> werden alle ressourcen geladen
|
||||
* @param $projekt_kurzbz, wenn null -> werden alle ressourcen geladen
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function getAllRessourcen()
|
||||
{
|
||||
$qry = "SELECT * FROM fue.tbl_ressource order by bezeichnung";
|
||||
|
||||
|
||||
$this->result=array();
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$obj = new ressource();
|
||||
|
||||
|
||||
$obj->ressource_id = $row->ressource_id;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
@@ -131,21 +131,20 @@ class ressource extends basis_db
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$obj->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
//var_dump($this->result);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Lädt alle Ressourcen zu einem Projekt
|
||||
* @param $project_kurzbz
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
@@ -153,17 +152,17 @@ class ressource extends basis_db
|
||||
public function getProjectRessourcen($project_kurzbz)
|
||||
{
|
||||
$qry = "SELECT ressource.*, project.projekt_ressource_id, project.aufwand, project.funktion_kurzbz FROM fue.tbl_ressource as ressource
|
||||
JOIN fue.tbl_projekt_ressource project ON(project.ressource_id = ressource.ressource_id)
|
||||
JOIN fue.tbl_projekt_ressource project ON(project.ressource_id = ressource.ressource_id)
|
||||
WHERE project.projekt_kurzbz =".$this->db_add_param($project_kurzbz).";";
|
||||
|
||||
|
||||
$this->result=array();
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$obj = new ressource();
|
||||
|
||||
|
||||
$obj->ressource_id = $row->ressource_id;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
@@ -178,22 +177,22 @@ class ressource extends basis_db
|
||||
$obj->aufwand = $row->aufwand;
|
||||
$obj->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
$obj->projekt_ressource_id= $row->projekt_ressource_id;
|
||||
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
//var_dump($this->result);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Lädt die Projektressource
|
||||
* @param $project_ressource_id
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
@@ -202,7 +201,7 @@ class ressource extends basis_db
|
||||
{
|
||||
$qry = "select * from fue.tbl_projekt_ressource where projekt_ressource_id = ".$this->db_add_param($projekt_ressource_id);
|
||||
$this->result=array();
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object())
|
||||
@@ -213,13 +212,13 @@ class ressource extends basis_db
|
||||
$this->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
$this->projekt_ressource_id= $row->projekt_ressource_id;
|
||||
$this->projekt_kurzbz = $row->projekt_kurzbz;
|
||||
$this->projektphase_id = $row->projektphase_id;
|
||||
$this->projektphase_id = $row->projektphase_id;
|
||||
return true;
|
||||
}
|
||||
//var_dump($this->result);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
@@ -227,7 +226,7 @@ class ressource extends basis_db
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Lädt alle Ressourcen zu einer Phase
|
||||
* @param $project_kurzbz
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
@@ -235,17 +234,17 @@ class ressource extends basis_db
|
||||
public function getPhaseRessourcen($projektphase_id)
|
||||
{
|
||||
$qry = "SELECT ressource.*, project.aufwand, project.funktion_kurzbz, project.projekt_ressource_id FROM fue.tbl_ressource as ressource
|
||||
JOIN fue.tbl_projekt_ressource project ON(project.ressource_id = ressource.ressource_id)
|
||||
JOIN fue.tbl_projekt_ressource project ON(project.ressource_id = ressource.ressource_id)
|
||||
WHERE project.projektphase_id =".$this->db_add_param($projektphase_id, FHC_INTEGER).";";
|
||||
|
||||
|
||||
$this->result=array();
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$obj = new ressource();
|
||||
|
||||
|
||||
$obj->ressource_id = $row->ressource_id;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
@@ -265,13 +264,13 @@ class ressource extends basis_db
|
||||
//var_dump($this->result);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Speichert den aktuellen Datensatz in die Datenbank
|
||||
* Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt
|
||||
@@ -279,14 +278,14 @@ class ressource extends basis_db
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function saveProjektRessource($new=null)
|
||||
{
|
||||
{
|
||||
if($new==null)
|
||||
$new = $this->new;
|
||||
|
||||
|
||||
if($new)
|
||||
{
|
||||
//Neuen Datensatz einfuegen
|
||||
$qry='BEGIN; INSERT INTO fue.tbl_projekt_ressource (projektphase_id, projekt_kurzbz,
|
||||
$qry='BEGIN; INSERT INTO fue.tbl_projekt_ressource (projektphase_id, projekt_kurzbz,
|
||||
ressource_id, funktion_kurzbz, beschreibung, aufwand) VALUES ('.
|
||||
$this->db_add_param($this->projektphase_id, FHC_INTEGER).', '.
|
||||
$this->db_add_param($this->projekt_kurzbz).', '.
|
||||
@@ -307,7 +306,7 @@ class ressource extends basis_db
|
||||
'aufwand='.$this->db_add_param($this->aufwand).' '.
|
||||
'WHERE projekt_ressource_id='.$this->db_add_param($this->projekt_ressource_id, FHC_INTEGER).';';
|
||||
}
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($new)
|
||||
@@ -322,21 +321,21 @@ class ressource extends basis_db
|
||||
$this->db_query('COMMIT');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Auslesen der Sequence';
|
||||
$this->db_query('ROLLBACK;');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Auslesen der Sequence';
|
||||
$this->db_query('ROLLBACK;');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -344,7 +343,7 @@ class ressource extends basis_db
|
||||
$this->errormsg = $qry;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichert den aktuellen Datensatz in die Datenbank
|
||||
@@ -353,14 +352,14 @@ class ressource extends basis_db
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function save($new=null)
|
||||
{
|
||||
{
|
||||
if($new==null)
|
||||
$new = $this->new;
|
||||
|
||||
|
||||
if($new)
|
||||
{
|
||||
//Neuen Datensatz einfuegen
|
||||
$qry='BEGIN; INSERT INTO fue.tbl_ressource (bezeichnung, beschreibung,
|
||||
$qry='BEGIN; INSERT INTO fue.tbl_ressource (bezeichnung, beschreibung,
|
||||
mitarbeiter_uid, student_uid, betriebsmittel_id, firma_id, insertvon, insertamum, updatevon, updateamum) VALUES ('.
|
||||
$this->db_add_param($this->bezeichnung).', '.
|
||||
$this->db_add_param($this->beschreibung).', '.
|
||||
@@ -385,7 +384,7 @@ class ressource extends basis_db
|
||||
'updatevon='.$this->db_add_param($this->updatevon).' '.
|
||||
'WHERE ressource_id='.$this->db_add_param($this->ressource_id, FHC_INTEGER).';';
|
||||
}
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($new)
|
||||
@@ -400,21 +399,21 @@ class ressource extends basis_db
|
||||
$this->db_query('COMMIT');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Auslesen der Sequence';
|
||||
$this->db_query('ROLLBACK;');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Auslesen der Sequence';
|
||||
$this->db_query('ROLLBACK;');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -423,8 +422,8 @@ class ressource extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Laedt die Ressource mit der ID $ressource_id
|
||||
* @param $ressource_id ID der zu ladenden Ressource
|
||||
@@ -437,9 +436,9 @@ class ressource extends basis_db
|
||||
$this->errormsg = 'Ressource_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$qry = "SELECT * FROM fue.tbl_projekt_ressource WHERE projekt_ressource_id=".$this->db_add_param($projekt_ressource_id, FHC_INTEGER);
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object())
|
||||
@@ -453,13 +452,13 @@ class ressource extends basis_db
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Datensatz wurde nicht gefunden';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
@@ -468,26 +467,26 @@ class ressource extends basis_db
|
||||
|
||||
/**
|
||||
* Liefert die Ressourcen aller Projekte die zu einem bestimmten Datum aktiv sind
|
||||
*
|
||||
*
|
||||
* @param $datum
|
||||
*/
|
||||
public function getProjektRessourceDatum($datum, $endedatum)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
SELECT
|
||||
distinct
|
||||
tbl_projekt_ressource.*, tbl_projekt.beginn as start, tbl_projekt.ende,
|
||||
tbl_ressource.student_uid, tbl_ressource.mitarbeiter_uid, tbl_ressource.betriebsmittel_id, tbl_ressource.firma_id,
|
||||
tbl_projekt_ressource.*, tbl_projekt.beginn as start, tbl_projekt.ende,
|
||||
tbl_ressource.student_uid, tbl_ressource.mitarbeiter_uid, tbl_ressource.betriebsmittel_id, tbl_ressource.firma_id,
|
||||
tbl_ressource.bezeichnung, tbl_ressource.beschreibung
|
||||
FROM
|
||||
FROM
|
||||
fue.tbl_ressource
|
||||
JOIN fue.tbl_projekt_ressource USING(ressource_id)
|
||||
JOIN fue.tbl_projekt USING(projekt_kurzbz)
|
||||
WHERE
|
||||
(tbl_projekt.beginn<=".$this->db_add_param($endedatum)." OR tbl_projekt.beginn is null) AND
|
||||
(tbl_projekt.ende>=".$this->db_add_param($datum)." OR tbl_projekt.ende is null)
|
||||
(tbl_projekt.beginn<=".$this->db_add_param($endedatum)." OR tbl_projekt.beginn is null) AND
|
||||
(tbl_projekt.ende>=".$this->db_add_param($datum)." OR tbl_projekt.ende is null)
|
||||
ORDER BY bezeichnung";
|
||||
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
@@ -498,7 +497,7 @@ class ressource extends basis_db
|
||||
$obj->projektphase_id = $row->projektphase_id;
|
||||
$obj->start = $row->start;
|
||||
$obj->ende = $row->ende;
|
||||
|
||||
|
||||
$obj->ressource_id = $row->ressource_id;
|
||||
$obj->student_uid = $row->student_uid;
|
||||
$obj->mitarbeiter_uid = $row->mitarbeiter_uid;
|
||||
@@ -507,39 +506,39 @@ class ressource extends basis_db
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
$obj->aufwand = $row->aufwand;
|
||||
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Liefert die Ressourcen aller Projektphasen die zu einem bestimmten Datum aktiv sind
|
||||
*
|
||||
*
|
||||
* @param $datum
|
||||
*/
|
||||
public function getProjektphaseRessourceDatum($datum, $endedatum, $projekt_kurzbz=null)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
SELECT
|
||||
distinct
|
||||
tbl_projekt_ressource.*, tbl_projektphase.start, tbl_projektphase.ende,
|
||||
tbl_ressource.student_uid, tbl_ressource.mitarbeiter_uid, tbl_ressource.betriebsmittel_id, tbl_ressource.firma_id,
|
||||
tbl_projekt_ressource.*, tbl_projektphase.start, tbl_projektphase.ende,
|
||||
tbl_ressource.student_uid, tbl_ressource.mitarbeiter_uid, tbl_ressource.betriebsmittel_id, tbl_ressource.firma_id,
|
||||
tbl_ressource.bezeichnung, tbl_ressource.beschreibung
|
||||
FROM
|
||||
FROM
|
||||
fue.tbl_ressource
|
||||
JOIN fue.tbl_projekt_ressource USING(ressource_id)
|
||||
JOIN fue.tbl_projektphase USING(projektphase_id)
|
||||
WHERE
|
||||
(tbl_projektphase.start<=".$this->db_add_param($endedatum)." OR tbl_projektphase.start is null) AND
|
||||
(tbl_projektphase.ende>=".$this->db_add_param($datum)." OR tbl_projektphase.ende is null)
|
||||
(tbl_projektphase.start<=".$this->db_add_param($endedatum)." OR tbl_projektphase.start is null) AND
|
||||
(tbl_projektphase.ende>=".$this->db_add_param($datum)." OR tbl_projektphase.ende is null)
|
||||
";
|
||||
if(!is_null($projekt_kurzbz))
|
||||
{
|
||||
$qry.=" AND tbl_projektphase.projekt_kurzbz=".$this->db_add_param($projekt_kurzbz);
|
||||
}
|
||||
$qry.=" ORDER BY tbl_ressource.bezeichnung";
|
||||
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
@@ -550,7 +549,7 @@ class ressource extends basis_db
|
||||
$obj->projektphase_id = $row->projektphase_id;
|
||||
$obj->start = $row->start;
|
||||
$obj->ende = $row->ende;
|
||||
|
||||
|
||||
$obj->ressource_id = $row->ressource_id;
|
||||
$obj->student_uid = $row->student_uid;
|
||||
$obj->mitarbeiter_uid = $row->mitarbeiter_uid;
|
||||
@@ -559,7 +558,7 @@ class ressource extends basis_db
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
$obj->aufwand = $row->aufwand;
|
||||
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
}
|
||||
@@ -569,7 +568,7 @@ class ressource extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Liefert die Ressourcen aller Projektphasen die zu einem bestimmten Datum aktiv sind
|
||||
*
|
||||
@@ -594,12 +593,12 @@ class ressource extends basis_db
|
||||
((tbl_projektphase.ende>=".$this->db_add_param($datum)." OR tbl_projektphase.ende is null) AND
|
||||
(tbl_projekttask.ende>=".$this->db_add_param($datum)." OR tbl_projekttask.ende is null))
|
||||
";
|
||||
|
||||
|
||||
if(!is_null($projekt_kurzbz))
|
||||
{
|
||||
$qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz);
|
||||
}
|
||||
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
@@ -610,7 +609,7 @@ class ressource extends basis_db
|
||||
$obj->projektphase_id = $row->projektphase_id;
|
||||
$obj->start = $row->start;
|
||||
$obj->ende = $row->ende;
|
||||
|
||||
|
||||
$obj->ressource_id = $row->ressource_id;
|
||||
$obj->student_uid = $row->student_uid;
|
||||
$obj->mitarbeiter_uid = $row->mitarbeiter_uid;
|
||||
@@ -619,7 +618,7 @@ class ressource extends basis_db
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
$obj->aufwand = $row->aufwand;
|
||||
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
}
|
||||
@@ -629,64 +628,64 @@ class ressource extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Löscht eine Ressource zu Projekt Zuordnung
|
||||
* @param type $ressource_id
|
||||
* @param type $projekt_kurzbz
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public function deleteFromProjekt($ressource_id, $projekt_kurzbz)
|
||||
{
|
||||
if($ressource_id == '' || !is_numeric($ressource_id))
|
||||
{
|
||||
$this->errormsg = 'Ressource Id ist keine gültige Zahl';
|
||||
return false;
|
||||
$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 WHERE ressource_id =".$this->db_add_param($ressource_id, FHC_INTEGER, false)."
|
||||
AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz, FHC_STRING, false).';';
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Löschen der Daten';
|
||||
return false;
|
||||
$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
|
||||
* @return boolean
|
||||
*/
|
||||
public function deleteFromPhase($ressource_id, $projektphase_id)
|
||||
{
|
||||
if($ressource_id == '' || !is_numeric($ressource_id))
|
||||
{
|
||||
$this->errormsg = 'Ressource Id ist keine gültige Zahl';
|
||||
return false;
|
||||
$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).';';
|
||||
|
||||
$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;
|
||||
return true;
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Löschen der Daten';
|
||||
return false;
|
||||
$this->errormsg = 'Fehler beim Löschen der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user