mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-17 20:19:28 +00:00
Added GUI/functionality to add begruendung for 'NICHT EMPFEHLEN' in lectors overview
. Begruendung is added as Notiz . GUI to attach begruendung will slide down the moment 'Nicht Empfehlen' is clicked . added phrases Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
@@ -159,7 +159,8 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
foreach ($data as $item)
|
||||
{
|
||||
// Approve Anrechnung
|
||||
if(getData($this->anrechnunglib->dontRecommendAnrechnung($item['anrechnung_id'])))
|
||||
if(getData($this->anrechnunglib
|
||||
->dontRecommendAnrechnung($item['anrechnung_id'], $item['begruendung'])))
|
||||
{
|
||||
$json[]= array(
|
||||
'anrechnung_id' => $item['anrechnung_id'],
|
||||
|
||||
@@ -10,6 +10,9 @@ class AnrechnungLib
|
||||
const ANRECHNUNGSTATUS_APPROVED = 'approved';
|
||||
const ANRECHNUNGSTATUS_REJECTED = 'rejected';
|
||||
|
||||
const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR = 'AnrechnungNotizLektor';
|
||||
const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL = 'AnrechnungNotizSTGL';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci =& get_instance();
|
||||
@@ -442,7 +445,7 @@ class AnrechnungLib
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function dontRecommendAnrechnung($anrechnung_id)
|
||||
public function dontRecommendAnrechnung($anrechnung_id, $begruendung)
|
||||
{
|
||||
// Check last Anrechnungstatus
|
||||
if (!$result = getData($this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id))[0])
|
||||
@@ -476,6 +479,15 @@ class AnrechnungLib
|
||||
)
|
||||
);
|
||||
|
||||
// Add begruendung as notiz
|
||||
$this->ci->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->ci->NotizModel->addNotizForAnrechnung(
|
||||
$anrechnung_id,
|
||||
self::ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR,
|
||||
$begruendung,
|
||||
$lektor_uid
|
||||
);
|
||||
|
||||
// Transaction complete
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
|
||||
@@ -158,6 +158,65 @@ class Notiz_model extends DB_Model
|
||||
|
||||
return $this->loadWhere(array('person_id' => $person_id, 'titel LIKE' => $titel));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Notiz for a given Anrechnung
|
||||
* @param $anrechnung_id
|
||||
* @param $titel
|
||||
* @param $text
|
||||
* @param $verfasser_uid
|
||||
* @return array
|
||||
*/
|
||||
public function addNotizForAnrechnung($anrechnung_id, $titel, $text, $verfasser_uid)
|
||||
{
|
||||
// Loads model Notizzuordnung_model
|
||||
$this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
|
||||
|
||||
// Start DB transaction
|
||||
$this->db->trans_start(false);
|
||||
|
||||
$result = $this->insert(array(
|
||||
'titel' => $titel,
|
||||
'text' => $text,
|
||||
'erledigt' => true,
|
||||
'verfasser_uid' => $verfasser_uid,
|
||||
"insertvon" => $verfasser_uid
|
||||
));
|
||||
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$notiz_id = $result->retval;
|
||||
$result = $this->NotizzuordnungModel->insert(array('notiz_id' => $notiz_id, 'anrechnung_id' => $anrechnung_id));
|
||||
}
|
||||
|
||||
// Transaction complete!
|
||||
$this->db->trans_complete();
|
||||
|
||||
// Check if everything went ok during the transaction
|
||||
if ($this->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$result = error($result->msg, EXIT_ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->trans_commit();
|
||||
$result = success($notiz_id);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all Notizen for a person
|
||||
* @param $person_id
|
||||
*/
|
||||
public function getNotizByAnrechnung($anrechnung_id)
|
||||
{
|
||||
$this->addJoin('public.tbl_notizzuordnung', 'notiz_id');
|
||||
|
||||
return $this->loadWhere(array('anrechnung' => $anrechnung_id));
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
||||
@@ -12,14 +12,14 @@ $this->load->view(
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'begruendung'
|
||||
),
|
||||
'anrechnung' => array(
|
||||
'nachweisdokumente',
|
||||
'empfehlung',
|
||||
'herkunft'
|
||||
),
|
||||
'global' => array(
|
||||
'begruendung'
|
||||
),
|
||||
'anrechnung' => array(
|
||||
'nachweisdokumente',
|
||||
'empfehlung',
|
||||
'herkunft'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
@@ -34,15 +34,15 @@ $this->load->view(
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'ja',
|
||||
'nein',
|
||||
'nichtSelektierbarAufgrundVon'
|
||||
'ja',
|
||||
'nein',
|
||||
'nichtSelektierbarAufgrundVon'
|
||||
),
|
||||
'person' => array(
|
||||
'student',
|
||||
'personenkennzeichen',
|
||||
'vorname',
|
||||
'nachname'
|
||||
'vorname',
|
||||
'nachname'
|
||||
),
|
||||
'lehre' => array(
|
||||
'studiensemester',
|
||||
@@ -64,7 +64,7 @@ $this->load->view(
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
)
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
@@ -76,16 +76,16 @@ $this->load->view(
|
||||
|
||||
<body>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<!-- title -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12 page-header">
|
||||
<h3>
|
||||
<div class="container-fluid">
|
||||
<!-- title -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12 page-header">
|
||||
<h3>
|
||||
<?php echo $this->p->t('anrechnung', 'anrechnungenPruefen'); ?>
|
||||
<small>| <?php echo $this->p->t('global', 'uebersicht'); ?></small>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<small>| <?php echo $this->p->t('global', 'uebersicht'); ?></small>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<!-- dropdown studiensemester -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
@@ -104,14 +104,54 @@ $this->load->view(
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default form-group"><?php echo ucfirst($this->p->t('ui', 'anzeigen')); ?></button>
|
||||
<button type="submit"
|
||||
class="btn btn-default form-group"><?php echo ucfirst($this->p->t('ui', 'anzeigen')); ?></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Tabelle -->
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<?php $this->load->view('lehre/anrechnung/reviewAnrechnungUebersichtData.php'); ?>
|
||||
<?php $this->load->view('lehre/anrechnung/reviewAnrechnungUebersichtData.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Begruendung Panel -->
|
||||
<div class="row">
|
||||
<div class="panel panel-default panel-body" style="display: none"
|
||||
id="reviewAnrechnungUebersicht-begruendung-panel">
|
||||
<div>
|
||||
<h4><?php echo $this->p->t('anrechnung', 'bitteBegruendungAngeben'); ?></h4><br>
|
||||
<label><?php echo $this->p->t('anrechnung', 'moeglicheBegruendungen'); ?></label><br>
|
||||
<ol>
|
||||
<li><?php echo $this->p->t('anrechnung', 'empfehlungNegativPruefungNichtMoeglich'); ?>
|
||||
<button class="btn btn-sm btn-copyIntoTextarea" data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
</button>
|
||||
</li>
|
||||
<li><?php echo $this->p->t('anrechnung', 'empfehlungNegativKenntnisseNichtGleichwertig'); ?>
|
||||
<button class="btn btn-sm btn-copyIntoTextarea" data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'textUebernehmen'); ?>">
|
||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
||||
</button>
|
||||
</li>
|
||||
<li><?php echo $this->p->t('anrechnung', 'andereBegruendung'); ?></li>
|
||||
</ol>
|
||||
<br>
|
||||
<span class="text-danger">
|
||||
<b><?php echo $this->p->t('anrechnung', 'begruendungWirdFuerAlleUebernommen'); ?></b>
|
||||
</span><br><br>
|
||||
<textarea class="form-control" name="begruendung" id="reviewAnrechnungUebersicht-begruendung"
|
||||
rows="2" required></textarea>
|
||||
</div>
|
||||
<br>
|
||||
<!-- Action Button 'Abbrechen'-->
|
||||
<div class="pull-right">
|
||||
<button id="reviewAnrechnungUebersicht-begruendung-abbrechen" class="btn btn-default btn-w200">
|
||||
<?php echo ucfirst($this->p->t('ui', 'abbrechen')); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -123,37 +163,44 @@ $this->load->view(
|
||||
<div class="btn-group" role="group">
|
||||
<button id="show-need-recommendation" class="btn btn-default btn-clearfilter" type="button"
|
||||
data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'nurFehlendeEmpfehlungenAnzeigen'); ?>"><i class='fa fa-eye'></i>
|
||||
title="<?php echo $this->p->t('ui', 'nurFehlendeEmpfehlungenAnzeigen'); ?>"><i
|
||||
class='fa fa-eye'></i>
|
||||
</button>
|
||||
<button id="show-recommended" class="btn btn-default btn-clearfilter" type="button"
|
||||
data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'nurEmpfohleneAnzeigen'); ?>"><i class='fa fa-thumbs-o-up'></i>
|
||||
title="<?php echo $this->p->t('ui', 'nurEmpfohleneAnzeigen'); ?>"><i
|
||||
class='fa fa-thumbs-o-up'></i>
|
||||
</button>
|
||||
<button id="show-not-recommended" class="btn btn-default btn-clearfilter" type="button"
|
||||
data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'nurNichtEmpfohleneAnzeigen'); ?>"><i class='fa fa-thumbs-o-down'></i>
|
||||
title="<?php echo $this->p->t('ui', 'nurNichtEmpfohleneAnzeigen'); ?>"><i
|
||||
class='fa fa-thumbs-o-down'></i>
|
||||
</button>
|
||||
<button id="show-approved" class="btn btn-default btn-clearfilter" type="button"
|
||||
data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'nurGenehmigteAnzeigen'); ?>"><i class='fa fa-check'></i>
|
||||
title="<?php echo $this->p->t('ui', 'nurGenehmigteAnzeigen'); ?>"><i
|
||||
class='fa fa-check'></i>
|
||||
</button>
|
||||
<button id="show-rejected" class="btn btn-default btn-clearfilter" type="button"
|
||||
data-toggle="tooltip" data-placement="left"
|
||||
title="<?php echo $this->p->t('ui', 'nurAbgelehnteAnzeigen'); ?>"><i class='fa fa-times'></i>
|
||||
title="<?php echo $this->p->t('ui', 'nurAbgelehnteAnzeigen'); ?>"><i
|
||||
class='fa fa-times'></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Action Buttons 'Empfehlen', 'Nicht empfehlen'-->
|
||||
<div class="col-xs-7 col-md-8">
|
||||
<div class="pull-right">
|
||||
<button id="dont-recommend-anrechnungen" class="btn btn-danger btn-w200"><?php echo ucfirst($this->p->t('anrechnung', 'nichtEmpfehlen')); ?></button>
|
||||
<button id="recommend-anrechnungen" class="btn btn-primary btn-w200"><?php echo ucfirst($this->p->t('anrechnung', 'empfehlen')); ?></button>
|
||||
<button id="dont-recommend-anrechnungen"
|
||||
class="btn btn-danger btn-w200"><?php echo ucfirst($this->p->t('anrechnung', 'nichtEmpfehlen')); ?></button>
|
||||
<button id="recommend-anrechnungen"
|
||||
class="btn btn-primary btn-w200"><?php echo ucfirst($this->p->t('anrechnung', 'empfehlen')); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user