From 460323cf3b63abf3ccc6c2d48f151544883e5cd7 Mon Sep 17 00:00:00 2001 From: Dmitry Yu Okunev Date: Tue, 5 Apr 2016 09:48:24 +0300 Subject: [PATCH] Added short appointment to custom note --- genpdf/genpdf.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/genpdf/genpdf.php b/genpdf/genpdf.php index e564c6c..ebe4f79 100644 --- a/genpdf/genpdf.php +++ b/genpdf/genpdf.php @@ -110,8 +110,10 @@ function stfcardid2login($stfcardid) { function considerAppointment($key, &$appointment) { global $inflect; - $appointment_name = preg_replace('/ [0-9]*.[0-9]$/', '', $appointment->name); + $appointment_name = preg_replace('/ [0-9]*.[0-9]$/', '', $appointment->name); + $appointment_short = preg_replace('/ [0-9]\.[0-9]$/', '', trim($appointment->shortname)); $appointments = $appointment_name.' '.mb_strtoupper($appointment->subdivision->shortname); + $appointment_short_full = trim($appointment_short.' '.mb_strtoupper($appointment->subdivision->shortname)); $appointment_ofsubdivfull = $inflect->getInflectNoun($appointment->subdivision->name, 0); $appointment_name_words = explode(' ', $appointment_name); $appointment_ofsubdivfull_words = explode(' ', $appointment_ofsubdivfull); @@ -133,8 +135,11 @@ function considerAppointment($key, &$appointment) { $_GET[$key.'-name'] = mb_substr($fullname_words[1], 0, 1).'. '.mb_substr($fullname_words[2], 0, 1).'. '.$fullname_words[0]; $_GET[$key.'-appointment'] = $appointments_full; $_GET[$key.'-appointment-wosubdiv'] = $appointments_wosubdiv; + $_GET[$key.'-appointment-short'] = $appointment_short_full; + $_GET[$key.'-appointment-short-wosubdiv'] = $appointment_short; $_GET[$key.'-subdivs'] = $signer_subdivs; $_GET[$key.'-subdivs-full'] = $signer_subdivs_full; + //print_r($appointment); } @@ -803,7 +808,9 @@ foreach ($files as $file) { $memo_subject = 'Заявка на модернизацию ЛВС'; break; case 'request/custom': - //print_r($_GET);die(); + if (!empty($_COOKIE['debug'])) { + //print_r($_GET);die(); + } if ($_GET['user-appointment-id'] != $_GET['signer-appointment-id']) { $project_id = 15971; $_GET['recipient-redmine-id'] = redmine_login2id($_GET['recipient-login']); @@ -1281,8 +1288,9 @@ foreach ($files as $file) { \begin{flushleft} {\small \begin{tabular}{ r l } - \multicolumn{2}{ l }{ Подготовлено: } \\\\ + \multicolumn{2}{ l }{ Подготовлено: } \\\\ ФИО: & '.$_GET['signer-name'].' \\\\ + Должн.: & '.$_GET['signer-appointment-short'].' \\\\ Тел.: & '.$_GET['signer-phonenumber'].' \\\\ Email: & '.$_GET['signer-email'].' \\\\ \end{tabular} -- libgit2 0.24.0