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:
Cris
2021-02-02 13:50:32 +01:00
committed by cris-technikum
parent da3720e65d
commit 8fc338ccb4
6 changed files with 381 additions and 38 deletions
@@ -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'],
+13 -1
View File
@@ -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();
+59
View File
@@ -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>
+46 -2
View File
@@ -230,14 +230,36 @@ $(function(){
);
});
// Dont recommend Anrechnungen
// Dont recommend Anrechnungen (Overview GUI)
$("#dont-recommend-anrechnungen").click(function(){
// Get selected rows data
let begruendung_panel = $('#reviewAnrechnungUebersicht-begruendung-panel');
let begruendung = $('#reviewAnrechnungUebersicht-begruendung').val();
if (begruendung_panel.is(":hidden"))
{
// Show begruendung panel if is hidden
begruendung_panel.slideDown('slow');
return;
}
else
{
// Check if begruendung is given
if (!begruendung.trim()) // empty or white spaces only
{
FHC_DialogLib.alertInfo('Bitte tragen Sie eine Begründung ein.');
return;
}
}
// Get selected rows data and add begruendung
let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData')
.map(function(data){
// reduce to necessary fields
return {
'anrechnung_id' : data.anrechnung_id,
'begruendung' : begruendung
}
});
@@ -259,6 +281,9 @@ $(function(){
'data': selected_data
};
// Hide begruendung panel again
$(begruendung_panel).slideUp('slow');
FHC_AjaxClient.ajaxCallPost(
FHC_JS_DATA_STORAGE_OBJECT.called_path + "/dontRecommend",
data,
@@ -288,6 +313,17 @@ $(function(){
);
});
// Break Begruendung abgeben
$('#reviewAnrechnungUebersicht-begruendung-abbrechen').click(function(){
$('#reviewAnrechnungUebersicht-begruendung').val('');
$('#reviewAnrechnungUebersicht-begruendung-panel').slideUp('slow');
})
// Copy Begruendung into textarea
$(".btn-copyIntoTextarea").click(function(){
reviewAnrechnung.copyIntoTextarea(this);
})
});
var reviewAnrechnung = {
@@ -307,5 +343,13 @@ var reviewAnrechnung = {
default:
$('#reviewAnrechnung-status_kurzbz').closest('div').addClass('alert-warning');
}
},
copyIntoTextarea: function(elem){
// Find closest textarea
let textarea = $(elem).closest('div').find('textarea');
// Copy begruendung into textarea
textarea.val($.trim($(elem).parent().text()));
}
}
+180
View File
@@ -8788,6 +8788,186 @@ Any unusual occurrences
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'anrechnung',
'phrase' => 'empfehlungPositiv',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Anrechnung wird empfohlen, weil die Kenntnisse inhaltlich und umfangmäßig gleichwertig sind.',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Recommendation date',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'anrechnung',
'phrase' => 'empfehlungNegativPruefungNichtMoeglich',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Anrechnung wird nicht empfohlen, weil die Prüfung der Gleichwertigkeit aus formalen Gründen (z.B. mangelhafte Unterlagen) nicht möglich war.',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => '',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'anrechnung',
'phrase' => 'empfehlungNegativKenntnisseNichtGleichwertig',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Anrechnung wird nicht empfohlen, weil die Kenntnisse inhaltlich und umfangmäßig nicht gleichwertig sind.',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => '',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'anrechnung',
'phrase' => 'empfehlungdatum',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Empfehlungsdatum',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => '',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'textUebernehmen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Text &uuml;bernehmen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Use this text',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'anrechnung',
'phrase' => 'bitteBegruendungAngeben',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Bitte geben Sie eine Begründung für die Ablehnung an',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Please give a reason why you do not recommend to approve this applications',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'anrechnung',
'phrase' => 'moeglicheBegruendungen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Mögliche Begründungen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Possible reasons',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'anrechnung',
'phrase' => 'andereBegruendung',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Andere Begründung',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Other reason',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'anrechnung',
'phrase' => 'begruendungWirdFuerAlleUebernommen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Die Begründung wird für alle gewählten Anträge übernommen.',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'This reason will be used for all of the selected applications.',
'description' => '',
'insertvon' => 'system'
)
)
)
);