redmine
... ... @@ -206,7 +206,6 @@ if (isset($_GET['signer-serialized'])) {
die('Wrong appointment ID ('.$_GET['signer-appointment-id'].')');
}
@$appointment->employee = $user->employee;
considerAppointment('signer', $appointment);
... ... @@ -266,10 +265,14 @@ $dont_inflect_patterns = array(
);
$inflect_cut_patterns = array(
'/^(.*)[иы]й[ ]/',
//'/^(.*)[иы]й[ ]/', // Commented due to task: https://tasks.mephi.ru/issues/49157
'/^\[\d+\] /',
);
$inflect_appointment_abj_patterns = array(
'/^(.*)[иы]й[ ]/', // https://tasks.mephi.ru/issues/49157
);
$inflect_ignore_ending_patterns = array(
'[ ].*',
);
... ... @@ -511,8 +514,19 @@ foreach (array('signer', 'contact', 'user', 'recipient') as $key) {
$appointments = split(', ', $_GET[$key.'-appointment'.$postfix]);
foreach ($appointments as &$appointment) {
$matches = NULL;
$prefix = '';
$ignored_ending = '';
foreach($inflect_appointment_abj_patterns as $inflect_appointment_abj_pattern) {
if (preg_match($inflect_appointment_abj_pattern, $appointment, $matches, PREG_OFFSET_CAPTURE)) {
foreach ($matches as &$match) {
$prefix .= $inflect->getInflectAbjective($match[0], $case);
$appointment = mb_substr($appointment, mb_strlen($match[0]));
break;
}
}
}
$appointment = preg_replace($inflect_cut_patterns, '', $appointment);
error_log('Appointment'.$postfix.': '.$appointment);
... ... @@ -526,8 +540,7 @@ foreach (array('signer', 'contact', 'user', 'recipient') as $key) {
}
$appointment = $inflect->getInflectNoun($appointment, $case);
$appointment .= $ignored_ending;
$appointment = $prefix . $appointment . $ignored_ending;
$_GET[$key_prefix.'-'.$key.'-appointment'.$postfix] = $appointment;
}
... ... @@ -536,6 +549,11 @@ foreach (array('signer', 'contact', 'user', 'recipient') as $key) {
}
}
/*if (!empty($_COOKIE['debug'])) {
print 'TEST: ';
print_r($_GET);die();
}*/
foreach (array('signer', 'contact', 'user', 'recipient') as $key) {
foreach (array('', 'of-', 'to-') as $key_prefix) {
$appointment_w_fullsubdiv = array();
... ... @@ -998,6 +1016,9 @@ foreach ($files as $file) {
switch ($file) {
case 'request/vacation':
if (!empty($_COOKIE['debug'])) {
//print_r($_GET);die();
}
$header = '\mmheaderstatement{В Дирекцию по управлению персоналом НИЯУ МИФИ}{от '.$_GET['of-signer-appointment-w-fullsubdiv'].' '.$_GET{'of-signer-fullname'}.'}';
$footer = '';
break;
... ...
Inflect @ a60c8e42
Subproject commit 754ec13a3789333e9c0a2f858116d0aec7edd238
Subproject commit a60c8e42622081bce1e8a04c0d18eef53791418b
... ...