|
|
<?php
|
|
|
|
require_once("redmine.php");
|
|
$redmine_url = 'https://tracker.a-real.ru/';
|
|
$redmine_key = '68692662158cb38c8fddb8e084b6dfd55d77b85c';
|
|
|
|
//tester of redmine api
|
|
//$myCurl = curl_init();
|
|
//curl_setopt_array($myCurl, array(
|
|
// CURLOPT_URL => 'https://tracker.a-real.ru/contacts/2906.json?include=issues',
|
|
// //CURLOPT_URL => 'https://tracker.a-real.ru/issues/10259.json?include=contact',
|
|
// CURLOPT_RETURNTRANSFER => true,
|
|
// CURLOPT_POST => true,
|
|
// CURLOPT_USERNAME => 'mix',
|
|
// CURLOPT_PASSWORD => 'CC35U8TXwgztS',
|
|
// CURLOPT_CUSTOMREQUEST => 'GET'
|
|
// // CURLOPT_POSTFIELDS => http_build_query(array(/*здесь массив параметров запроса*/))
|
|
//));
|
|
//$response = curl_exec($myCurl);
|
|
//curl_close($myCurl);
|
|
//
|
|
//var_dump($response)
|
|
|
|
$obj_redmine = new class_bitrix_to_redmine();
|
|
|
|
$test_contact = array("contact" => array("first_name" => "Test testing",
|
|
"project_id" => "managers",
|
|
//"is_company" => false,
|
|
"phone" => "+79997994838",
|
|
"email" => "mvg@a-real.ru"
|
|
)
|
|
);
|
|
|
|
//$data = array("last_name"=> "Тестер тестович",
|
|
// "webtolead_email1" => "mail@a-real.ru",
|
|
// "phone_work" => "333333333333",
|
|
// "campaign_id" => "50c0d2a6-bbb7-fad1-640d-4c77b63b39e1",
|
|
// "lead_source" => "Web Site",
|
|
// "lead_source_description" => $ext_referer,
|
|
// "lead_source_description_to" => $ext_referer_to,
|
|
// "redirect_url" => "http://xserver.a-real.ru",
|
|
// "assign_user_id" => "e3eb89ec-9d10-1aba-ccbb-4b580a4cdb34",
|
|
// "req_id" => "last_name;webtolead_email1;"
|
|
//);
|
|
|
|
|
|
// $res = $obj_redmine->send_contact($data);
|
|
//$res = $obj_redmine->get_contact_id("3373", true);
|
|
//var_dump($res);
|
|
|
|
//$inc[]= "contacts";
|
|
//$inc[]= "relations";
|
|
//$res = $obj_redmine->get_issue($issue_id="11380", "",$inc=$inc);
|
|
$res = $obj_redmine->get_contact_id("3373", true);
|
|
var_dump($res);
|
|
// $res = $obj_redmine->create_ticket("besco@yabesco.ru", "One more test", "test test one more");
|
|
|
|
// var_dump($res);
|
|
|
|
//$filecontent = file_get_contents("screenshot.png");
|
|
//$token = $obj_redmine->get_upload_token($filecontent);
|
|
|
|
//$token = $token->upload->token;
|
|
|
|
//var_dump($token);
|
|
|
|
//$filecontent = file_get_contents("screenshot.png");
|
|
|
|
// echo($obj_redmine->upload_attachment('10314', 'screenshot.png', 'image/png', $filecontent));
|
|
|
|
//$inc = array( 0 => "journals",
|
|
// 1 => "attachments"
|
|
// );
|
|
|
|
//$res = $obj_redmine->get_issue('10314', '', $inc);
|
|
//var_dump($res);
|
|
|
|
//$res = $obj_redmine->download_attachment('5152', true);
|
|
//file_put_contents('screenshot_eskiz.png', $res);
|
|
|
|
?>
|
Powered by TurnKey Linux.