<commit_before><?php
use Symfony\Component\HttpFoundation\Request;
use sasCC\Company\Company;
use sasCC\CompanyManagment\Form\CompanyType;
use sasCC\App;

// Print company list
$app->match('/pupils/list/print', function (Request $r, App $app){  
    $pupils = $app['em']->getRepository('sasCC\Pupil\Pupil')
                           ->findAll(); 
    $app['logger.actions']->addInfo(sprintf('User %s (%d) accessed /pupils/list/print', $app->user()->getUserName(), $app->user()->getId()));
    return $app['twig']->render('pupil/pupil.list.print.twig', array("title" => "Schülerliste", "pupils" => $pupils));
})
->bind('pupil_list_print')
->secure('ROLE_WIRTSCHAFT_ADMIN');

// Print company details
$app->match('/pupils/details/{id}/print', function (Request $r, App $app, $id){
    $pupil = $app['em']->find("sasCC\Pupil\Pupil", (int)$id);
    if($pupil === null) return 'Company not Found';
    
    $app['logger.actions']->addInfo(sprintf('User %s (%d) printed details of pupil with id %d', $app->user()->getUserName(), $app->user()->getId(), $pupil->getId()));
    return $app['twig']->render('pupil/pupil.print.twig', array("title" => "Schülerdetails", "pupil" => $pupil));
    
})
->bind('pupil_detail_print')
->secure('ROLE_WIRTSCHAFT_ADMIN');
?><commit_msg>pupil list now alphabetical<commit_after><?php
use Symfony\Component\HttpFoundation\Request;
use sasCC\Company\Company;
use sasCC\CompanyManagment\Form\CompanyType;
use sasCC\App;

// Print company list
$app->match('/pupils/list/print', function (Request $r, App $app){  
    $query = $app['em']->createQuery("SELECT u FROM sasCC\Pupil\Pupil u ORDER BY u.lastName ASC");  
    $pupils = $query->getResult();
    
    $app['logger.actions']->addInfo(sprintf('User %s (%d) accessed /pupils/list/print', $app->user()->getUserName(), $app->user()->getId()));
    return $app['twig']->render('pupil/pupil.list.print.twig', array("title" => "Schülerliste", "pupils" => $pupils));
})
->bind('pupil_list_print')
->secure('ROLE_WIRTSCHAFT_ADMIN');

// Print company details
$app->match('/pupils/details/{id}/print', function (Request $r, App $app, $id){
    $pupil = $app['em']->find("sasCC\Pupil\Pupil", (int)$id);
    if($pupil === null) return 'Company not Found';
    
    $app['logger.actions']->addInfo(sprintf('User %s (%d) printed details of pupil with id %d', $app->user()->getUserName(), $app->user()->getId(), $pupil->getId()));
    return $app['twig']->render('pupil/pupil.print.twig', array("title" => "Schülerdetails", "pupil" => $pupil));
    
})
->bind('pupil_detail_print')
->secure('ROLE_WIRTSCHAFT_ADMIN');
?>
{'fraction_non_alphanumeric': 0.225531914893617, 'fraction_numerical': 0.0, 'mean_word_length': 5.042056074766355, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '221368', 'n_tokens_mistral': 967, 'n_tokens_neox': 968, 'n_words': 164}