• R/O
  • SSH
  • HTTPS

mantisbtmonitor: Commit


Commit MetaInfo

Revision39 (tree)
Time2018-07-20 06:12:21
Authorderekwildstar

Log Message

- Ajustes para adequação ao novo servidor de desenvolvimento

Change Summary

Incremental Difference

--- trunk/server/configurations.inc.php (revision 38)
+++ trunk/server/configurations.inc.php (revision 39)
@@ -14,14 +14,14 @@
1414
1515 if ($serverIp == '???.???.???.???' || $serverName == "www.tjpe.jus.br") {
1616 // PRODUÇÃO -----------------------------------------------------------------------------
17- $this->dbHostName = "192.168.251.19";
18- $this->dbDataBase = "mantis";
19- $this->dbUserName = "kanbanmantis";
20- $this->dbPassword = "K4nb4n!";
17+ $this->dbHostName = "A";
18+ $this->dbDataBase = "B";
19+ $this->dbUserName = "C";
20+ $this->dbPassword = "D";
2121 $this->rootMantis = $aRootMantis == null?"":$aRootMantis;;
2222 $this->mantisConnectWSDL = $aMantisConnectWSDL == null?"":$aMantisConnectWSDL;
2323 // --------------------------------------------------------------------------------------
24- } else if ($serverIp == '???.???.???.??' || $serverName == "???.???.???.???") {
24+ } else if ($serverIp == '???.???.???.??' || $serverName == "homologacao.tjpe.gov.br") {
2525 // HOMOLOGAÇÃO --------------------------------------------------------------------------
2626 $this->dbHostName = "A";
2727 $this->dbDataBase = "B";
@@ -30,14 +30,14 @@
3030 $this->rootMantis = $aRootMantis == null?"":$aRootMantis;
3131 $this->mantisConnectWSDL = $aMantisConnectWSDL == null?"":$aMantisConnectWSDL;
3232 // --------------------------------------------------------------------------------------
33- } else if ($serverIp == '192.168.251.88' || $serverName == "sdwebtjpetemp.tjpe.gov.br") {
33+ } else if ($serverIp == '???.???.???.??' || $serverName == "desenvolvimento.tjpe.gov.br") {
3434 // DESENVOLVIMENTO ----------------------------------------------------------------------
35- $this->dbHostName = "192.168.251.19";
36- $this->dbDataBase = "mantis_d";
37- $this->dbUserName = "mantis_des";
38- $this->dbPassword = "m4nt15";
39- $this->rootMantis = $aRootMantis == null?"C:\Inetpub\wwwroot\mantis":$aRootMantis;
40- $this->mantisConnectWSDL = $aMantisConnectWSDL == null?"http://192.168.251.88/mantis/api/soap/mantisconnect.php?wsdl":$aMantisConnectWSDL;
35+ $this->dbHostName = "spdbmysql01.tjpe.gov.br";
36+ $this->dbDataBase = "mantisbt";
37+ $this->dbUserName = "mnws";
38+ $this->dbPassword = "mnws123";
39+ $this->rootMantis = $aRootMantis == null?"/var/www/html/mantis":$aRootMantis;
40+ $this->mantisConnectWSDL = $aMantisConnectWSDL == null?"desenvolvimento.tjpe.gov.br/mantis/api/soap/mantisconnect.php?wsdl":$aMantisConnectWSDL;
4141 // --------------------------------------------------------------------------------------
4242 }
4343
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
--- trunk/server/index.php (revision 38)
+++ trunk/server/index.php (revision 39)
@@ -4,8 +4,8 @@
44 require_once(file_build_path(dirname(__FILE__),"configurations.inc.php"));
55 require_once(file_build_path(dirname(__FILE__),"NuSoap","nusoap.php"));
66 require_once(file_build_path($configurations->getRootMantis(),"core.php"));
7-require_once(file_build_path($configurations->getRootMantis(),"core","config_api.php"));
8-require_once(file_build_path($configurations->getRootMantis(),"custom_strings_inc.php"));
7+//require_once(file_build_path($configurations->getRootMantis(),"core","config_api.php"));
8+//require_once(file_build_path($configurations->getRootMantis(),"custom_strings_inc.php"));
99
1010
1111 $server = new soap_server();
@@ -111,33 +111,41 @@
111111 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
112112
113113 function login($pUserName, $pPassword) {
114- global $configurations;
115-
116- $query = "select * from mantis_user_table where username = \"$pUserName\" and password = md5(\"$pPassword\")";
117-
118- $result = "";
119-
120- if (($connection = mysql_connect($configurations->getDbHostName(),$configurations->getDbUserName(),$configurations->getDbPassword()))
121- && (mysql_select_db($configurations->getDbDataBase(),$connection))
122- && ($dataset = mysql_query($query,$connection))
123- && ($record = mysql_fetch_object($dataset))) {
124- $result = $record->id . "\n" . $record->realname;
125- }
114+ global $configurations;
126115
127- return $result;
116+ $query = "select * from user where username = \"$pUserName\" and password = md5(\"$pPassword\")";
117+
118+ $result = "";
119+
120+ $connection = new PDO("mysql:host={$configurations->getDbHostName()};dbname={$configurations->getDbDataBase()}", $configurations->getDbUserName(), $configurations->getDbPassword());
121+
122+ if ($connection) {
123+ if ($dataset = $connection->query($query)) {
124+ $record = $dataset->fetchObject();
125+
126+ $result = $record->id . "\n" . $record->realname;
127+
128+ $dataset = null;
129+ }
130+ $connection = null;
131+ }
132+
133+ return $result;
128134 }
129135
136+//print_r(login("cbff","d1d2f3b4"));
137+
130138 function returnsToBR($aText) {
131- $result = str_replace("\r\n","<br>",$aText);
132- $result = str_replace("\r","<br>",$result);
133- $result = str_replace("\n","<br>",$result);
134- return $result;
139+ $result = str_replace("\r\n","<br>",$aText);
140+ $result = str_replace("\r","<br>",$result);
141+ $result = str_replace("\n","<br>",$result);
142+ return $result;
135143 }
136144
137145 function getIssueInfo($aIssueId) {
138- global $configurations;
139-
140- $query = <<<EOS
146+ global $configurations;
147+
148+ $query = <<<EOS
141149 select but.id
142150 , prt.name as ProjectName
143151 , but.summary as Summary
@@ -148,314 +156,361 @@
148156 , convert(btt.description using latin1) as Description
149157 , btt.steps_to_reproduce as StepsToReproduce
150158 , btt.additional_information as AdditionalInformation
151- from mantis_bug_table but
152- join mantis_user_table ust on but.reporter_id = ust.id
153- join mantis_project_table prt on but.project_id = prt.id
154- join mantis_bug_text_table btt on but.bug_text_id = btt.id
159+ from bug but
160+ join user ust on but.reporter_id = ust.id
161+ join project prt on but.project_id = prt.id
162+ join bug_text btt on but.bug_text_id = btt.id
155163 where but.id = $aIssueId
156164 EOS;
157-
158- $result = "";
159-
160- if (($connection = mysql_connect($configurations->getDbHostName(),$configurations->getDbUserName(),$configurations->getDbPassword()))
161- && (mysql_select_db($configurations->getDbDataBase(),$connection))
162- && ($dataset = mysql_query($query,$connection))) {
163- $record = mysql_fetch_object($dataset);
165+
166+ $result = "";
167+
168+ $connection = new PDO("mysql:host={$configurations->getDbHostName()};dbname={$configurations->getDbDataBase()}", $configurations->getDbUserName(), $configurations->getDbPassword());
169+
170+ if ($connection) {
171+ if ($dataset = $connection->query($query)) {
172+ $record = $dataset->fetchObject();
173+
174+ $result .= $record->id . "¬"
175+ . $record->ProjectName . "¬"
176+ . $record->Summary . "¬"
177+ . $record->TargetVersion . "¬"
178+ . $record->Status . "¬"
179+ . $record->LastUpdated . "¬"
180+ . $record->Reporter . "¬"
181+ . returnsToBR($record->Description) . "¬"
182+ . returnsToBR($record->StepsToReproduce) . "¬"
183+ . returnsToBR($record->AdditionalInformation);
184+
185+ $dataset = null;
186+ }
187+ $connection = null;
188+ }
164189
165- $result .= $record->id . "¬"
166- . $record->ProjectName . "¬"
167- . $record->Summary . "¬"
168- . $record->TargetVersion . "¬"
169- . $record->Status . "¬"
170- . $record->LastUpdated . "¬"
171- . $record->Reporter . "¬"
172- . returnsToBR($record->Description) . "¬"
173- . returnsToBR($record->StepsToReproduce) . "¬"
174- . returnsToBR($record->AdditionalInformation);
175- }
176- return $result;
190+ return $result;
177191 }
178192
193+//print_r(getIssueInfo(80408));
194+
179195 function userIssues($pUserId) {
180- global $configurations;
181-
182- $query = <<<EOS
196+ global $configurations;
197+
198+ $query = <<<EOS
183199 select but.id
184200 , but.summary as Summary
185- , but.status as Status
186- from mantis_bug_table but
201+ , but.status as Status
202+ from bug but
187203 where but.handler_id = $pUserId
188204 EOS;
189-
190- $result = "";
191-
192- if (($connection = mysql_connect($configurations->getDbHostName(),$configurations->getDbUserName(),$configurations->getDbPassword()))
193- && (mysql_select_db($configurations->getDbDataBase(),$connection))
194- && ($dataset = mysql_query($query,$connection))) {
195- while ($record = mysql_fetch_object($dataset)) {
196- $result .= $record->id . "=" . $record->Summary . "|" . $record->Status . "\n";
197- }
198- }
199- return $result;
205+
206+ $result = "";
207+
208+ $connection = new PDO("mysql:host={$configurations->getDbHostName()};dbname={$configurations->getDbDataBase()}", $configurations->getDbUserName(), $configurations->getDbPassword());
209+
210+ if ($connection) {
211+ if ($dataset = $connection->query($query)) {
212+ while ($record = $dataset->fetchObject()) {
213+ $result .= $record->id . "=" . $record->Summary . "|" . $record->Status . "\n";
214+ }
215+
216+ $dataset = null;
217+ }
218+ $connection = null;
219+ }
220+
221+ return $result;
200222 }
201223
224+//print_r(userIssues(237));
225+
202226 function getRelatedIssues($aIssueId) {
203- global $configurations;
227+ global $configurations;
204228
205- $query = <<<EOS
229+ $query = <<<EOS
206230 select brt.relationship_type as relationshipType
207231 , if (but.id <> brt.destination_bug_id,brt.destination_bug_id,brt.source_bug_id) as issue
208- , (select but2.status from mantis_bug_table but2 where but2.id = issue) as status
209- , (select ust2.realname from mantis_bug_table but2 join mantis_user_table ust2 on but2.handler_id = ust2.id where but2.id = issue) as handler
210- , (select prt2.name from mantis_bug_table but2 join mantis_project_table prt2 on but2.project_id = prt2.id where but2.id = issue) as project
211- , (select but2.summary from mantis_bug_table but2 where but2.id = issue) as summary
232+ , (select but2.status from bug but2 where but2.id = issue) as status
233+ , (select ust2.realname from bug but2 join user ust2 on but2.handler_id = ust2.id where but2.id = issue) as handler
234+ , (select prt2.name from bug but2 join project prt2 on but2.project_id = prt2.id where but2.id = issue) as project
235+ , (select but2.summary from bug but2 where but2.id = issue) as summary
212236 , brt.destination_bug_id
213237 , brt.destination_bug_id
214- from mantis_bug_relationship_table brt
215- join mantis_bug_table but on brt.source_bug_id = but.id or brt.destination_bug_id = but.id
238+ from bug_relationship brt
239+ join bug but on brt.source_bug_id = but.id or brt.destination_bug_id = but.id
216240 where but.id = $aIssueId
217241 EOS;
218242
219- $result = "";
220-
221- /*
222- <RelatedIssues>
223- <Issue Number="xxxx">
224- <Relationship>xxx</Relationship>
225- <Status>xxxx</Status>
226- <Handler>xxxx</Handler>
227- <Project>xxxx</Project>
228- <Summary>xxxx</Summary>
229- </Issue>
230- <RelatedIssues>
231- */
232-
233- if (($connection = mysql_connect($configurations->getDbHostName(),$configurations->getDbUserName(),$configurations->getDbPassword()))
234- && (mysql_select_db($configurations->getDbDataBase(),$connection))
235- && ($dataset = mysql_query($query,$connection))) {
236- while ($record = mysql_fetch_object($dataset)) {
237-
238- switch ($record->relationshipType) {
239- case 0:
240- if ($record->destination_bug_id == $record->issue) {
241- $relationship = "é duplicata de";
242- } else {
243- $relationship = "possui esta duplicata";
244- }
245- break;
246- case 1:
247- $relationship = "está relacionado a";
248- break;
249- case 2:
250- if ($record->destination_bug_id == $record->issue) {
251- $relationship = "é pai de";
252- } else {
253- $relationship = "é filho de";
254- }
255- break;
256- }
257-
258- $result .= "<Issue Number=\"{$record->issue}\">" .
259- "<Relationship>{$relationship}</Relationship>" .
260- "<Status>{$record->status}</Status>" .
261- "<Handler>{$record->handler}</Handler>" .
262- "<Project>{$record->project}</Project>" .
263- "<Summary>{$record->summary}</Summary>" .
264- "</Issue>";
265- }
266- }
267-
268- $result = "<RelatedIssues>" . $result . "</RelatedIssues>";
269-
270- return $result;
243+ $result = "";
244+
245+ /*
246+ <RelatedIssues>
247+ <Issue Number="xxxx">
248+ <Relationship>xxx</Relationship>
249+ <Status>xxxx</Status>
250+ <Handler>xxxx</Handler>
251+ <Project>xxxx</Project>
252+ <Summary>xxxx</Summary>
253+ </Issue>
254+ <RelatedIssues>
255+ */
256+
257+ $connection = new PDO("mysql:host={$configurations->getDbHostName()};dbname={$configurations->getDbDataBase()}", $configurations->getDbUserName(), $configurations->getDbPassword());
258+
259+ if ($connection) {
260+ if ($dataset = $connection->query($query)) {
261+ while ($record = $dataset->fetchObject()) {
262+
263+ switch ($record->relationshipType) {
264+ case 0:
265+ if ($record->destination_bug_id == $record->issue) {
266+ $relationship = "é duplicata de";
267+ } else {
268+ $relationship = "possui esta duplicata";
269+ }
270+ break;
271+ case 1:
272+ $relationship = "está relacionado a";
273+ break;
274+ case 2:
275+ if ($record->destination_bug_id == $record->issue) {
276+ $relationship = "é pai de";
277+ } else {
278+ $relationship = "é filho de";
279+ }
280+ break;
281+ }
282+
283+ $result .= "<Issue Number=\"{$record->issue}\">" .
284+ "<Relationship>{$relationship}</Relationship>" .
285+ "<Status>{$record->status}</Status>" .
286+ "<Handler>{$record->handler}</Handler>" .
287+ "<Project>{$record->project}</Project>" .
288+ "<Summary>{$record->summary}</Summary>" .
289+ "</Issue>";
290+ }
291+
292+ $dataset = null;
293+ }
294+ $connection = null;
295+ }
296+
297+ $result = "<RelatedIssues>" . $result . "</RelatedIssues>";
298+
299+ return $result;
271300 }
272301
302+//print_r(getRelatedIssues(79906));
303+
273304 function getStatusColor($aStatusId,$aMode) {
274305 $color = get_status_color($aStatusId);
275- switch ($aMode) {
276- case 0:
277- $bytes = str_split(trim($color,"#"),2);
278- return "00" . $bytes[2] . $bytes[1] . $bytes[0];
279- break;
280- case 1:
281- return $color;
282- break;
283- default:
284- return getStatusColor($aStatusId,0);
285- }
306+ switch ($aMode) {
307+ case 0:
308+ $bytes = str_split(trim($color,"#"),2);
309+ return "00" . $bytes[2] . $bytes[1] . $bytes[0];
310+ break;
311+ case 1:
312+ return $color;
313+ break;
314+ default:
315+ return getStatusColor($aStatusId,0);
316+ }
286317 }
287318
319+//print_r(getStatusColor(90,1));
320+
288321 function getStatuses() {
289- $statuses = explode(",",lang_get("status_enum_string"));
290-
291- foreach ($statuses as $numberAndId) {
292- $parts = explode (":",$numberAndId);
293- $result[] = trim($parts[0]) . "=" . $parts[1] . ":" . getStatusColor($parts[0],0);
294- }
295-
296- return implode(",",$result);
322+ $statuses = explode(",",lang_get("status_enum_string"));
323+
324+ foreach ($statuses as $numberAndId) {
325+ $parts = explode (":",$numberAndId);
326+ $result[] = trim($parts[0]) . "=" . $parts[1] . ":" . getStatusColor($parts[0],0);
327+ }
328+
329+ return implode(",",$result);
297330 }
298331
332+//print_r(getStatuses());
333+
299334 function getAttachments($aIssueId) {
300- global $configurations;
335+ global $configurations;
301336
302- $query = <<<EOS
337+ $query = <<<EOS
303338 select id
304339 , filename
305340 , date_format(date_added, "%Y-%m-%dT%H:%i:%S-03:00") as date_added
306- , filesize
307- from mantis_bug_file_table
341+ , filesize
342+ from bug_file
308343 where bug_id = $aIssueId
309344 order by id desc
310345 EOS;
311346
312- $result = "";
313-
314- /*
315- <Attachments>
316- <Attachment Id="xxxx">
317- <Filename>xxx</Filename>
318- <Date>xxxx</Date>
319- <FileSize>xxxx</FileSize>
320- </Attachment>
321- <Attachments>
322- */
347+ $result = "";
348+
349+ /*
350+ <Attachments>
351+ <Attachment Id="xxxx">
352+ <Filename>xxx</Filename>
353+ <Date>xxxx</Date>
354+ <FileSize>xxxx</FileSize>
355+ </Attachment>
356+ <Attachments>
357+ */
323358
324-
325- if (($connection = mysql_connect($configurations->getDbHostName(),$configurations->getDbUserName(),$configurations->getDbPassword()))
326- && (mysql_select_db($configurations->getDbDataBase(),$connection))
327- && ($dataset = mysql_query($query,$connection))) {
328- while ($record = mysql_fetch_object($dataset)) {
329- $result .= "<Attachment Id=\"{$record->id}\">" .
330- "<Filename>{$record->filename}</Filename>" .
331- "<Date>{$record->date_added}</Date>" .
332- "<FileSize>{$record->filesize}</FileSize>" .
333- "</Attachment>";
334- }
335- }
336-
337- $result = "<Attachments>" . $result . "</Attachments>";
338-
339- return $result;
359+
360+ $connection = new PDO("mysql:host={$configurations->getDbHostName()};dbname={$configurations->getDbDataBase()}", $configurations->getDbUserName(), $configurations->getDbPassword());
361+
362+ if ($connection) {
363+ if ($dataset = $connection->query($query)) {
364+ while ($record = $dataset->fetchObject()) {
365+ $result .= "<Attachment Id=\"{$record->id}\">" .
366+ "<Filename>{$record->filename}</Filename>" .
367+ "<Date>{$record->date_added}</Date>" .
368+ "<FileSize>{$record->filesize}</FileSize>" .
369+ "</Attachment>";
370+ }
371+
372+ $dataset = null;
373+ }
374+ $connection = null;
375+ }
376+
377+ $result = "<Attachments>" . $result . "</Attachments>";
378+
379+ return $result;
340380 }
341381
382+//print_r(getAttachments(71791));
383+
342384 function getAttachmentData($aAttachmentId) {
343- global $configurations;
385+ global $configurations;
344386
345- $query = <<<EOS
387+ $query = <<<EOS
346388 select content
347- from mantis_bug_file_table
389+ from bug_file
348390 where id = $aAttachmentId
349391 EOS;
350392
351- $result = "";
352-
353- if (($connection = mysql_connect($configurations->getDbHostName(),$configurations->getDbUserName(),$configurations->getDbPassword()))
354- && (mysql_select_db($configurations->getDbDataBase(),$connection))
355- && ($dataset = mysql_query($query,$connection))) {
356- $record = mysql_fetch_object($dataset);
357- $result = $record->content;
358- }
359-
360- $result = base64_encode($result);
361-
362- return $result;
393+ $result = "";
394+
395+ $connection = new PDO("mysql:host={$configurations->getDbHostName()};dbname={$configurations->getDbDataBase()}", $configurations->getDbUserName(), $configurations->getDbPassword());
396+
397+ if ($connection) {
398+ if ($dataset = $connection->query($query)) {
399+ $record = $dataset->fetchObject();
400+
401+ $result = $record->content;
402+
403+ $dataset = null;
404+ }
405+ $connection = null;
406+ }
407+
408+ $result = base64_encode($result);
409+
410+ return $result;
363411 }
364412
413+//print_r(getAttachmentData(40732));
414+
365415 function getComments($aIssueId, $aViewingUserId) {
366- global $configurations;
416+ global $configurations;
367417
368- $query = <<<EOS
418+ $query = <<<EOS
369419 select but.id
370420 , ust.realname
371421 , date_format(but.last_modified, "%Y-%m-%dT%H:%i:%S-03:00") as last_modified
372422 , if (but.view_state = 50,1,0) as private
373423 , btt.note
374- from mantis_bugnote_table but
375- join mantis_user_table ust on but.reporter_id = ust.id
376- join mantis_bugnote_text_table btt on but.bugnote_text_id = btt.id
424+ from bugnote but
425+ join user ust on but.reporter_id = ust.id
426+ join bugnote_text btt on but.bugnote_text_id = btt.id
377427 where but.bug_id = $aIssueId
378428 and (but.reporter_id = $aViewingUserId or ust.access_level >= but.view_state)
379429 order by 1 desc
380430 EOS;
381431
382- $result = "";
383-
384- /*
385- <Comments>
386- <Comment Id="xxxx">
387- <Reporter>xxx</Reporter>
388- <Date>xxxx</Date>
389- <Private>xxxx</Private>
390- <Note>xxxx</Note>
391- </Comment>
392- </Comments>
393- */
432+ $result = "";
433+
434+ /*
435+ <Comments>
436+ <Comment Id="xxxx">
437+ <Reporter>xxx</Reporter>
438+ <Date>xxxx</Date>
439+ <Private>xxxx</Private>
440+ <Note>xxxx</Note>
441+ </Comment>
442+ </Comments>
443+ */
394444
395-
396- if (($connection = mysql_connect($configurations->getDbHostName(),$configurations->getDbUserName(),$configurations->getDbPassword()))
397- && (mysql_select_db($configurations->getDbDataBase(),$connection))
398- && ($dataset = mysql_query($query,$connection))) {
399- while ($record = mysql_fetch_object($dataset)) {
400- $note = base64_encode($record->note);
401-
402- $result .= "<Comment Id=\"{$record->id}\">" .
403- "<Reporter>{$record->realname}</Reporter>" .
404- "<Date>{$record->last_modified}</Date>" .
405- "<Private>{$record->private}</Private>" .
406- "<Note>{$note}</Note>" .
407- "</Comment>";
408- }
409- }
410-
411- $result = "<Comments>" . $result . "</Comments>";
412-
413- return $result;
445+
446+ $connection = new PDO("mysql:host={$configurations->getDbHostName()};dbname={$configurations->getDbDataBase()}", $configurations->getDbUserName(), $configurations->getDbPassword());
447+
448+ if ($connection) {
449+ if ($dataset = $connection->query($query)) {
450+ while ($record = $dataset->fetchObject()) {
451+ $note = base64_encode($record->note);
452+
453+ $result .= "<Comment Id=\"{$record->id}\">" .
454+ "<Reporter>{$record->realname}</Reporter>" .
455+ "<Date>{$record->last_modified}</Date>" .
456+ "<Private>{$record->private}</Private>" .
457+ "<Note>{$note}</Note>" .
458+ "</Comment>";
459+ }
460+
461+ $dataset = null;
462+ }
463+ $connection = null;
464+ }
465+
466+ $result = "<Comments>" . $result . "</Comments>";
467+
468+ return $result;
414469 }
415470
416-//echo getComments(66571,238);
471+//print_r(getComments(66571,238));
417472
418473 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
419474 // Funções wrapper para o webservice do mantis
420475 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
421476 function addAttachment($aUserName, $aPassword, $aIssueId, $aFileName, $aMimeType, $aBase64Contents) {
422- global $configurations;
423-
424- $client = new SoapClient($configurations->getMantisConnectWSDL(),True);
425-
426- $result = $client->call("mc_issue_attachment_add",array("username"=>$aUserName
427- ,"password"=>$aPassword
477+ global $configurations;
478+
479+ $client = new SoapClient($configurations->getMantisConnectWSDL(),True);
480+
481+ $result = $client->call("mc_issue_attachment_add",array("username"=>$aUserName
482+ ,"password"=>$aPassword
428483 ,"issue_id"=>$aIssueId
429- ,"name"=>$aFileName
430- ,"file_type"=>$aMimeType
431- ,"content"=>$aBase64Contents));
432-
433- if (!$result) {
434- $result = $client->responseData;
435- }
436-
437- return $result;
484+ ,"name"=>$aFileName
485+ ,"file_type"=>$aMimeType
486+ ,"content"=>$aBase64Contents));
487+
488+ if (!$result) {
489+ $result = $client->responseData;
490+ }
491+
492+ return $result;
438493 }
439494
440495 function removeAttachment($aUserName, $aPassword, $aIssueId, $aFileName, $aMimeType, $aBase64Contents) {
441- /*
442- global $configurations;
443-
444- $client = new SoapClient($configurations->getMantisConnectWSDL(),True);
445-
446- $result = $client->call("mc_issue_attachment_add",array("username"=>$aUserName
447- ,"password"=>$aPassword
496+ /*
497+ global $configurations;
498+
499+ $client = new SoapClient($configurations->getMantisConnectWSDL(),True);
500+
501+ $result = $client->call("mc_issue_attachment_add",array("username"=>$aUserName
502+ ,"password"=>$aPassword
448503 ,"issue_id"=>$aIssueId
449- ,"name"=>$aFileName
450- ,"file_type"=>$aMimeType
451- ,"content"=>$aBase64Contents));
452-
453- if (!$result) {
454- $result = $client->responseData;
455- }
456-
457- return $result;
458- */
504+ ,"name"=>$aFileName
505+ ,"file_type"=>$aMimeType
506+ ,"content"=>$aBase64Contents));
507+
508+ if (!$result) {
509+ $result = $client->responseData;
510+ }
511+
512+ return $result;
513+ */
459514 }
460515
461516 ?>
\ No newline at end of file
Show on old repository browser