You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <?php
  2. require_once("redmine.php");
  3. $redmine_url = 'https://tracker.a-real.ru/';
  4. $redmine_key = '68692662158cb38c8fddb8e084b6dfd55d77b85c';
  5. //tester of redmine api
  6. //$myCurl = curl_init();
  7. //curl_setopt_array($myCurl, array(
  8. // CURLOPT_URL => 'https://tracker.a-real.ru/contacts/2906.json?include=issues',
  9. // //CURLOPT_URL => 'https://tracker.a-real.ru/issues/10259.json?include=contact',
  10. // CURLOPT_RETURNTRANSFER => true,
  11. // CURLOPT_POST => true,
  12. // CURLOPT_USERNAME => 'mix',
  13. // CURLOPT_PASSWORD => 'CC35U8TXwgztS',
  14. // CURLOPT_CUSTOMREQUEST => 'GET'
  15. // // CURLOPT_POSTFIELDS => http_build_query(array(/*здесь массив параметров запроса*/))
  16. //));
  17. //$response = curl_exec($myCurl);
  18. //curl_close($myCurl);
  19. //
  20. //var_dump($response)
  21. $obj_redmine = new class_bitrix_to_redmine();
  22. $test_contact = array("contact" => array("first_name" => "Test testing",
  23. "project_id" => "managers",
  24. //"is_company" => false,
  25. "phone" => "+79997994838",
  26. "email" => "mvg@a-real.ru"
  27. )
  28. );
  29. //$data = array("last_name"=> "Тестер тестович",
  30. // "webtolead_email1" => "mail@a-real.ru",
  31. // "phone_work" => "333333333333",
  32. // "campaign_id" => "50c0d2a6-bbb7-fad1-640d-4c77b63b39e1",
  33. // "lead_source" => "Web Site",
  34. // "lead_source_description" => $ext_referer,
  35. // "lead_source_description_to" => $ext_referer_to,
  36. // "redirect_url" => "http://xserver.a-real.ru",
  37. // "assign_user_id" => "e3eb89ec-9d10-1aba-ccbb-4b580a4cdb34",
  38. // "req_id" => "last_name;webtolead_email1;"
  39. //);
  40. // $res = $obj_redmine->send_contact($data);
  41. //$res = $obj_redmine->get_contact_id("3373", true);
  42. //var_dump($res);
  43. $inc=array(0 => "contacts");
  44. $res = $obj_redmine->get_issue($issue_id="10442", '', $inc);
  45. //var_dump($res);
  46. $res = $obj_redmine->create_ticket("3373", "One more test", "test test one more");
  47. var_dump($res);
  48. //$filecontent = file_get_contents("screenshot.png");
  49. //$token = $obj_redmine->get_upload_token($filecontent);
  50. //$token = $token->upload->token;
  51. //var_dump($token);
  52. //$filecontent = file_get_contents("screenshot.png");
  53. // echo($obj_redmine->upload_attachment('10314', 'screenshot.png', 'image/png', $filecontent));
  54. //$inc = array( 0 => "journals",
  55. // 1 => "attachments"
  56. // );
  57. //$res = $obj_redmine->get_issue('10314', '', $inc);
  58. //var_dump($res);
  59. //$res = $obj_redmine->download_attachment('5152', true);
  60. //file_put_contents('screenshot_eskiz.png', $res);
  61. ?>

Powered by TurnKey Linux.