/lib_easyredmine_api

Library for Joomla CMS to handle communication with Redmine / EasyRedmine REST API (XML format)

Primary LanguagePHPGNU Lesser General Public License v3.0LGPL-3.0

lib_easyredmine_api

  • Joomla library for using EasyRedmine / Redmine REST API to create or manage issues, projects and many more from within Joomla! extensions.

OBSOLETE / DEPRECATED / NOT MAINTAINED => GOTO:

About

Requirements

  • SimpleXML extension installed and enabled in PHP

Basic usage

Importing library

if (!jimport('easyredmine_api.rest'))
{
	die('Missing EasyRedmine Rest Api library');
}

Getting API instance

$api = EasyRedmineRestApi::getInstance('issues', 'https://example.com', 'XXXXXXXXXXX');

Get list of issues

$filters = array('assigned_to_id' => 27);
$list    = $api->getList($filters)

if ($list !== false)
{
	print_r($list);
}
else
{
	echo 'Error occurred, message = ' . $api->getError();
}

Get detail of issue

$id    = 123;
$issue = $api->get($id)

if ($issue !== false)
{
	print_r($issue);
}
else
{
	echo 'Error occurred, message = ' . $api->getError();
}

Create / Update issue

$issue = (object) array(
	//if 'id' property was set, then UPDATE would be done instead of INSERT
	'subject'    => 'testing issues',
	'project_id' => 123,
);

if ($api->store($issue))
{
	echo 'Success, stored issue id  = ' . $issue->id;
}
else
{
	echo 'Error occurred, message = ' . $api->getError();
}

Delete issue

$id = 123;

if ($api->delete($id))
{
	echo 'Success, issue was deleted id  = ' . $id;
}
else
{
	echo 'Error occurred, message = ' . $api->getError();
}