Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#795085
I want to develop a user interface for the all-new task list here for the company. Usage version 3.2 community. My question is how best to do this?
Create a new application and use REST API to integrate or create a SKIN?
Last edited by marcosfpa on Wed Sep 06, 2017 2:12 pm, edited 1 time in total.
User avatar
By amosbatto
#795087
I recommend creating a plugin which adds an option to the Cases sidebar and uses REST to populate your custom cases list.
See: http://wiki.processmaker.com/3.0/Plugin ... es_Sidebar

You can use this code in your plugin to get the access token for REST calls:
Code: Select all
if (!isset($_SESSION['USER_LOGGED'])) {
	header("Location: ../login/login");
}
$userId = $_SESSION['USER_LOGGED'];
$sql = "SELECT * FROM OAUTH_REFRESH_TOKENS WHERE USER_ID='$userId' ORDER BY EXPIRES DESC";
$result = executeQuery($sql);
if (empty($result)) {
	header("Location: ../login/login");
}
	
$refreshToken = $result[1]['REFRESH_TOKEN'];

//Universal Client ID and Client Secret from workflow/engine/methods/oauth2/grant.php
$clientId = 'x-pm-local-client';
$clientSecret = '179ad45c6ce2cb97cf1029e212046e81';
$pmServer = (G::is_https() ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']; 

$aVars = array(
      'grant_type'    => 'refresh_token',
      'client_id'     => $clientId,
      'client_secret' => $clientSecret,
      'refresh_token' => $refreshToken
);
 
$ch = curl_init($pmServer.'/'.SYS_SYS.'/oauth2/token');
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $aVars);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 
$oToken = json_decode(curl_exec($ch));
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
 
if ($httpStatus != 200) {
    print "Error in HTTP status code: $httpStatus\n";
}
elseif (isset($oToken->error)) {
    print "Error logging into $pmServer:\n" .
         "Error:       {$oToken->error}\n" .
         "Description: {$oToken->description}\n";
}
else {
      $accessToken = $oToken->access_token;
      $refreshToken = $oToken->refresh_token;
		   
      //Now the access token can be used for REST calls or saved as a cookie. 
      //Save access token as a cookie that expires in 86400 seconds:
      //setcookie("access_token",  $oToken->access_token, time() + 86400);
}
#795094
Hi,

I think home page of processmaker must be changed and update to new interfaces (admin templates) in their new releases and they must use new versions of extjs libraries.

I also had this problem, I create a new skin and change header and sidebar menu and use new css, colors and images in my design.
With this way you can change limited things in your skin. But if you want to change all of them grid and etc I think you must leave more time and create your customize admin template and then use REST API to integrate.

Thanks
User avatar
By amosbatto
#795128
programerboy wrote: I think home page of processmaker must be changed and update to new interfaces (admin templates) in their new releases and they must use new versions of extjs libraries.

I also had this problem, I create a new skin and change header and sidebar menu and use new css, colors and images in my design.
With this way you can change limited things in your skin. But if you want to change all of them grid and etc I think you must leave more time and create your customize admin template and then use REST API to integrate.
We have many complaints about the case lists under the HOME menu because it isn't customizable, except for adding additional columns with an Enterprise Plugin. Eventually, they want to stop using ExtJS because of the licensing fees. If you want a change in PM, you should register a bug report at http://bugs.processmaker.com which the PM developers read. They don't read this forum.

In the rapidly evolving world of online sports be[…]

STEPN integrates social networking and games that […]

Cenforce 150 is a medication used to cope with a c[…]

What's SAP FICO?

Trustworthy and skill-building, each of these actu[…]