From 0618c84af73fa597cb69c244657391e5239b7216 Mon Sep 17 00:00:00 2001 From: xaionaro Date: Mon, 4 Dec 2017 16:04:28 +0300 Subject: [PATCH] Some updates --- genpdf/genpdf.php | 5 +++-- genpdf/genpdf2.php | 46 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/genpdf/genpdf.php b/genpdf/genpdf.php index 70d99ad..b6ee1c5 100644 --- a/genpdf/genpdf.php +++ b/genpdf/genpdf.php @@ -1306,7 +1306,7 @@ foreach ($files as $file) { case 'request/forhire': $issue_props = array( - 'assigned_to_id' => USERID_EGMAKSIMOVA, + 'assigned_to_id' => USERID_EGMAKSIMOVA, 'project_id' => $project_id, 'subject' => 'Заявка на подбор персонала', @@ -1326,7 +1326,7 @@ foreach ($files as $file) { default: $issue_props = array( - 'assigned_to_id' => USERID_DYOKUNEV, + 'assigned_to_id' => USERID_AATRUTTSE, 'project_id' => $project_id, 'subject' => $memo_subject, 'description' => $text, @@ -1407,6 +1407,7 @@ foreach ($files as $file) { case 'request/voip-softphone': $redmine_admin->api('issue')->addWatcher($issue_id, USERID_AMGLADTSIN); $redmine_admin->api('issue')->addWatcher($issue_id, USERID_DYOKUNEV); + $redmine_admin->api('issue')->addWatcher($issue_id, USERID_AATRUTTSE); break; case 'request/lanmodern': // $redmine_admin->api('issue')->addWatcher($issue_id, USERID_PVMAKAROV); diff --git a/genpdf/genpdf2.php b/genpdf/genpdf2.php index 54e37a4..fa6d0f4 100644 --- a/genpdf/genpdf2.php +++ b/genpdf/genpdf2.php @@ -195,7 +195,7 @@ switch ($file) { //print_r($themes);die(); function newFormularData($stfCardId) { - global $themes; + global $themes, $inflect; $salaries = array( '1-1' => 7800, @@ -290,17 +290,53 @@ switch ($file) { $account = '_____________'; $account_manager = '_________________'; + if (!empty($_GET['account'])) { + $account = $_GET['account']; + } + + if (!empty($_GET['account-manager'])) { + $account_manager = $_GET['account-manager']; + } + if (!empty($themes[$a['Code']])) { //$account = $themes[$a['Code']]['theme']; } - $prorector_appointment = json_decode(file_get_contents('https://voip.mephi.ru/appointments/'.$_GET['prorector-appointment-id'].'.json'), 1)['appointment_selected']; + $prorector_appointment_id = @$_GET['prorector-appointment-id']; + + $prorector_appointment = json_decode(file_get_contents('https://voip.mephi.ru/appointments/'.$prorector_appointment_id.'.json'), 1)['appointment_selected']; + + $attorney_date = '«___» __________ 20___г'; + $attorney_code = '_____________'; + switch ((int)$prorector_appointment_id) { + case 155472: // Нагорнов + $attorney_code = '329-17-001/17'; + $attorney_date = '«30» декабря 2016г'; + break; + case 155480: // Ужва + $attorney_code = '329-17-009/17'; + $attorney_date = '«30» декабря 2016г'; + break; + case 155706: // Весна + $attorney_code = '329-17-008/17'; + $attorney_date = '«30» декабря 2016г'; + break; + case 158626: // Каргин + case -27400500: + $attorney_code = '329-17-002/17'; + $attorney_date = '«30» декабря 2016г'; + break; + } + + if (empty($prorector_appointment['Name']) || $prorector_appointment['Name'] == '-') { + $prorector_appointment['Name'] = $prorector_appointment['Description']; + } return array( - 'of-prorector' => '_________________', + 'of-prorector' => $inflect->getInflectNoun($prorector_appointment['Name'], 0).' '.explode(' ', $inflect->getInflectName($prorector_appointment['Subscriber']['Fullname'], 0))[0].' '.mb_substr($prorector_appointment['Subscriber']['Firstname'], 0, 1).'.'.mb_substr($prorector_appointment['Subscriber']['Patronymic'], 0, 1).'.', 'prorector' => $prorector_appointment['Subscriber']['Lastname'].' '.mb_substr($prorector_appointment['Subscriber']['Firstname'], 0, 1).'.'.mb_substr($prorector_appointment['Subscriber']['Patronymic'], 0, 1).'.', - 'attorney-date' => '«___» __________ 20___г', - 'attorney-code' => '_____________', + 'attorney-date' => $attorney_date, + 'attorney-code' => $attorney_code, 'of-unit' => $unitName, 'unit-head' => $unitHead, -- libgit2 0.24.0