Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
ut-tex
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
redmine
2016-04-01 09:40:19 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fbc8dc2468cb3af374cd4be734ac0aff421d7813
fbc8dc24
1 parent
da4161a9
Considered
https://tasks.mephi.ru/issues/49157
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
5 deletions
genpdf/genpdf.php
genpdf/lib/3dparty/Inflect
genpdf/genpdf.php
View file @
fbc8dc2
...
...
@@ -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
...
...
Please
register
or
login
to post a comment