- Added method getStudienplan to the controller Studienplan

- Introduced parameter new in method postPrestudentstatus of the controller Prestudentstatus
This commit is contained in:
paolo
2016-05-24 12:28:49 +02:00
parent c6efbac308
commit bb3f8ef617
2 changed files with 25 additions and 12 deletions
@@ -55,27 +55,24 @@ class Prestudentstatus extends APIv1_Controller
*/
public function postPrestudentstatus()
{
$prestudentstatus = $this->_parseData($this->post());
$this->response($prestudentstatus);
$prestudentstatus = $this->_parseData($this->post());
if ($this->_validate($prestudentstatus))
{
if (isset($prestudentstatus['ausbildungssemester']) && isset($prestudentstatus['studiensemester_kurzbz']) &&
isset($prestudentstatus['status_kurzbz']) && isset($prestudentstatus['prestudent_id']))
if(isset($prestudentstatus['new']) && $prestudentstatus['new'] == true)
{
$result = $this->PrestudentstatusModel->insert($prestudentstatus);
}
else
{
$pksArray = array($prestudentstatus['ausbildungssemester'],
$prestudentstatus['studiensemester_kurzbz'],
$prestudentstatus['status_kurzbz'],
$prestudentstatus['prestudent_id']
);
$result = $this->PrestudentstatusModel->update($pksArray, $prestudentstatus);
}
else
{
$result = $this->PrestudentstatusModel->insert($prestudentstatus);
}
$this->response($result, REST_Controller::HTTP_OK);
}
@@ -85,7 +82,7 @@ class Prestudentstatus extends APIv1_Controller
}
}
private function _validate($prestudentstatus = NULL)
private function _validate($prestudentstatus = null)
{
return true;
}
@@ -28,6 +28,22 @@ class Studienplan extends APIv1_Controller
$this->StudienplanModel->setUID($this->_getUID());
}
public function getStudienplan()
{
$studienplan_id = $this->get('studienplan_id');
if (isset($studienplan_id))
{
$result = $this->StudienplanModel->load($studienplan_id);
$this->response($result, REST_Controller::HTTP_OK);
}
else
{
$this->response();
}
}
public function getStudienplaene()
{
$studiengang_kz = $this->get('studiengang_kz');