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-03-15 12:08:23 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
Jim
2016-03-15 12:08:23 +0300
Commit
8f2eff8c1bd6e9f94440f33c212d47a10627be10
8f2eff8c
1 parent
2da2f12a
tasks#47916
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
7 deletions
genpdf/genpdf.php
genpdf/genpdf.php
View file @
8f2eff8
...
...
@@ -185,7 +185,7 @@ if (isset($_GET['signer-serialized'])) {
@
$user
->
oauth
=
$user_oauth
;
@
$user
->
login
=
$login
;
print_r
(
$user
);
$_GET
[
'signer-appointment-id'
]
=
empty
(
$_GET
[
'force-appointment-id'
])
?
$user
->
employee
->
WORKPOSITIONS
[
0
]
->
w_id
:
$_GET
[
'force-appointment
_
id'
];
$_GET
[
'signer-appointment-id'
]
=
empty
(
$_GET
[
'force-appointment-id'
])
?
$user
->
employee
->
WORKPOSITIONS
[
0
]
->
w_id
:
$_GET
[
'force-appointment
-
id'
];
}
}
...
...
@@ -203,7 +203,7 @@ if (isset($_GET['signer-serialized'])) {
}
if
(
is_null
(
$appointment
))
{
die
(
'Wrong appointment ID'
);
die
(
'Wrong appointment ID
('
.
$_GET
[
'signer-appointment-id'
]
.
')
'
);
}
...
...
@@ -358,7 +358,7 @@ function redmine_login2id ($login) {
static
$login2id
=
array
();
if
(
empty
(
$login2id
))
{
$lines
=
split
(
"
\n
"
,
file_get_contents
(
'/
home/xaionaro
/redmine_users.csv'
));
$lines
=
split
(
"
\n
"
,
file_get_contents
(
'/
opt
/redmine_users.csv'
));
foreach
(
$lines
as
&
$line
)
{
$words
=
split
(
"
\t
"
,
$line
);
...
...
@@ -375,7 +375,7 @@ function redmine_proj_identifier2id ($ident) {
static
$ident2id
=
array
();
if
(
empty
(
$ident2id
))
{
$lines
=
split
(
"
\n
"
,
file_get_contents
(
'/
home/xaionaro
/redmine_projects.csv'
));
$lines
=
split
(
"
\n
"
,
file_get_contents
(
'/
opt
/redmine_projects.csv'
));
foreach
(
$lines
as
&
$line
)
{
$words
=
split
(
"
\t
"
,
$line
);
...
...
@@ -738,12 +738,20 @@ foreach ($files as $file) {
$memo_subject
=
'Заявка на модернизацию ЛВС'
;
break
;
case
'request/custom'
:
//print_r($_GET);die();
$project_id
=
redmine_proj_identifier2id
(
$_GET
[
'recipient-login'
]);
$memo_subject
=
'Служебная записка'
;
$me
[
'id'
]
=
$user_redmine
[
'user'
][
'id'
];
$replacement_is_already_done
=
true
;
break
;
case
'request/forhire'
:
$project_id
=
15927
;
$memo_subject
=
'Заявка на подбор персонала'
;
break
;
default
:
die
(
'unknown memo-type'
);
}
...
...
@@ -991,9 +999,19 @@ foreach ($files as $file) {
$header
=
'\mmheader{'
.
my_mb_ucfirst
(
$_GET
[
'to-recipient-appointment-w-fullsubdiv-cap'
])
.
'}{'
.
my_mb_ucfirst
(
$_GET
[
'to-recipient-name'
])
.
'}'
;
$body
=
latexSpecialChars1
(
str_replace
(
"
\n
"
,
"
\n\n
"
,
$body
));
$footer
=
'\mmfooter{'
.
my_mb_ucfirst
(
$_GET
[
'signer-appointment'
])
.
'}{'
.
$_GET
[
'signer-name'
]
.
'}{'
.
$_GET
[
'current-date'
]
.
'}{}'
;
// $footer = '\mmfooter{'.my_mb_ucfirst($_GET['signer-appointment']).'}{'.$_GET['current-date'].'}{'.$_GET['signer-name'].'}{}';
break
;
case
'request/forhire'
:
$header
=
''
;
$footer
=
'\mmfooter{'
.
my_mb_ucfirst
(
$_GET
[
'signer-appointment'
])
.
'}{'
.
$_GET
{
'signer-name'
}
.
'}{'
.
$_GET
[
'current-date'
]
.
'}{}'
;
break
;
default
:
$header
=
'\mmheader{Начальнику управления информатизации}{Н. Н. Романову}'
;
$footer
=
'\mmfooter{'
.
my_mb_ucfirst
(
$_GET
[
'signer-appointment'
])
.
'}{'
.
$_GET
{
'signer-name'
}
.
'}{'
.
$_GET
[
'current-date'
]
.
'}{}'
;
...
...
@@ -1102,6 +1120,16 @@ foreach ($files as $file) {
'description'
=>
"<pre>"
.
$text
.
"</pre>"
,
);
break
;
case
'request/forhire'
:
$issue_props
=
array
(
'assigned_to_id'
=>
USERID_EGMAKSIMOVA
,
'project_id'
=>
$project_id
,
'subject'
=>
'Заявка на подбор персонала'
,
);
break
;
default
:
$issue_props
=
...
...
@@ -1119,7 +1147,7 @@ foreach ($files as $file) {
if
(
!
empty
(
$_GET
[
'category_id'
]))
$issue_props
[
'category_id'
]
=
$_GET
[
'category_id'
];
// print_r ($issue_props);
error_log
(
base64_encode
(
serialize
(
$issue_props
)));
$result
=
$redmine
->
api
(
'issue'
)
->
create
(
$issue_props
);
...
...
@@ -1128,8 +1156,10 @@ foreach ($files as $file) {
$issue
=
$issue
->
issue
;
error_log
(
base64_encode
(
serialize
(
$issue
)));
error_log
(
'issue: '
.
$issue
->
id
);
if
(
empty
(
$issue
->
id
))
error
(
'Wrong parameters: '
.
$result
);
if
(
empty
(
$issue
->
id
))
{
//print_r($issue);
error
(
'Wrong parameters: '
.
serialize
(
$result
));
}
$issue_id
=
$issue
->
id
;
...
...
@@ -1148,6 +1178,7 @@ foreach ($files as $file) {
file_put_contents
(
'responsible.tex'
,
'\mmresponsible{'
.
$_GET
[
'contact-name'
]
.
'}{'
.
$_GET
{
'contact-phonenumber'
}
.
'}{'
.
$_GET
[
'contact-email'
]
.
'}'
);
$redmine_admin
->
api
(
'issue'
)
->
addWatcher
(
$issue_id
,
USERID_AAANIKEEV
);
$redmine_admin
->
api
(
'issue'
)
->
addWatcher
(
$issue_id
,
USERID_BIRCOPH
);
break
;
case
'request/cps'
:
case
'request/voip3'
:
case
'request/voip-softphone'
:
...
...
@@ -1164,12 +1195,16 @@ foreach ($files as $file) {
case
'request/php'
:
case
'request/itsupport'
:
case
'request/custom'
:
case
'request/forhire'
:
case
'request/customform'
:
break
;
default
:
file_put_contents
(
'responsible.tex'
,
'\mmresponsible{'
.
$_GET
[
'contact-name'
]
.
'}{'
.
$_GET
{
'contact-phonenumber'
}
.
'}{'
.
$_GET
[
'contact-email'
]
.
'}'
);
}
exec
(
'make'
);
$pdf_content
=
file_get_contents
(
'memo.pdf'
);
...
...
Please
register
or
login
to post a comment