Merged colosa/processmaker into master

This commit is contained in:
jonathan quispe
2015-05-08 18:05:42 -04:00
11 changed files with 199 additions and 24 deletions

View File

@@ -27,6 +27,11 @@ class Designer extends Controller
$appUid = isset($httpData->app_uid) ? $httpData->app_uid : '';
$proReadOnly = isset($httpData->prj_readonly) ? $httpData->prj_readonly : 'false';
$client = $this->getClientCredentials();
if (isset($httpData->tracker_designer) && $httpData->tracker_designer == 1) {
$client["tracker_designer"] = 1;
}
$authCode = $this->getAuthorizationCode($client);
$debug = false; //System::isDebugMode();
@@ -55,16 +60,19 @@ class Designer extends Controller
$clientToken["client_secret"] = $client['CLIENT_SECRET'];
$consolidated = 0;
$enterprise = 0;
/*----------------------------------********---------------------------------*/
$licensedFeatures = & PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7TTeDBQeWRoZTZKYjh4eFpYUlRDUUEyVERPU3FxellWank=')) {
$consolidated = 1;
}
$enterprise = 1;
/*----------------------------------********---------------------------------*/
$this->setVar('prj_uid', $proUid);
$this->setVar('app_uid', $appUid);
$this->setVar('consolidated', $consolidated);
$this->setVar('enterprise', $enterprise);
$this->setVar('prj_readonly', $proReadOnly);
$this->setVar('credentials', base64_encode(json_encode($clientToken)));
$this->setVar('isDebugMode', $debug);
@@ -128,6 +136,11 @@ class Designer extends Controller
\ProcessMaker\Services\OAuth2\Server::setPmClientId($client['CLIENT_ID']);
$oauthServer = new \ProcessMaker\Services\OAuth2\Server();
if (isset($client["tracker_designer"]) && $client["tracker_designer"] == 1) {
$_SESSION["USER_LOGGED"] = "00000000000000000000000000000001";
}
$userId = $_SESSION['USER_LOGGED'];
$authorize = true;
$_GET = array_merge($_GET, array(
@@ -139,6 +152,10 @@ class Designer extends Controller
$response = $oauthServer->postAuthorize($authorize, $userId, true);
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
if (isset($client["tracker_designer"]) && $client["tracker_designer"] == 1) {
unset($_SESSION["USER_LOGGED"]);
}
return $code;
}
@@ -151,4 +168,3 @@ class Designer extends Controller
return array('dsn' => $dsn, 'username' => DB_USER, 'password' => DB_PASS);
}
}

View File

@@ -57,13 +57,27 @@ try {
die();
}
/*----------------------------------********---------------------------------*/
if (file_exists( PATH_DYNAFORM . $applicationFields['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'] . '.xml' )) {
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP'] = '#';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = '#';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['DYNUIDPRINT'] = $_REQUEST['DYN_UID'];
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP'] = '#';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = '#';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['DYNUIDPRINT'] = $_REQUEST['DYN_UID'];
$criteria = new Criteria();
$criteria->addSelectColumn(DynaformPeer::DYN_CONTENT);
$criteria->add(DynaformPeer::DYN_UID, $_REQUEST['DYN_UID']);
$criteria->add(DynaformPeer::DYN_VERSION, 2);
$result = DynaformPeer::doSelectRS($criteria);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($result->next()) {
G::LoadClass('pmDynaform');
G::LoadClass('pmDynaform');
$FieldsPmDynaform = $applicationFields;
$FieldsPmDynaform["CURRENT_DYNAFORM"] = $_REQUEST['DYN_UID'];
$a = new pmDynaform($FieldsPmDynaform);
$a->printView();
}
if (file_exists( PATH_DYNAFORM . $applicationFields['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'] . '.xml' )) {
G::LoadClass( 'dbConnections' );
$_SESSION['PROCESS'] = $applicationFields['PRO_UID'];
$dbConnections = new dbConnections( $_SESSION['PROCESS'] );

View File

@@ -41,8 +41,9 @@ SELECT
FROM
APP_CACHE_VIEW AS ACV
WHERE
ACV.DEL_INIT_DATE BETWEEN CAST(@INIT_DATE AS DATETIME) AND CAST(@FINISH_DATE AS DATETIME)
GROUP BY ACV.USR_UID , ACV.TAS_UID , ACV.PRO_UID;
(ACV.DEL_INIT_DATE BETWEEN CAST(@INIT_DATE AS DATETIME) AND CAST(@FINISH_DATE AS DATETIME))
AND ACV.DEL_INIT_DATE IS NOT NULL
GROUP BY ACV.USR_UID , ACV.TAS_UID, DATE_FORMAT( ACV.DEL_INIT_DATE, '%m' ) , DATE_FORMAT( ACV.DEL_INIT_DATE, '%Y' ) ;
DELETE USR_REPORTING
FROM USR_REPORTING

View File

@@ -22,16 +22,20 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/*
* Login for authentication of Case Tracker
*
* @author Everth S. Berrios Morales <everth@colosa.com>
*
/*
* Login for authentication of Case Tracker
*
* @author Everth S. Berrios Morales <everth@colosa.com>
*
*/
$G_PUBLISH = new Publisher();
//echo G::generateUniqueNumber();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/login', '', '', SYS_URI . 'tracker/authentication.php' );
//echo G::generateUniqueNumber();
if(SYS_SKIN == 'neoclassic'){
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/loginpm3', '', '', SYS_URI . 'tracker/authentication.php' );
}else{
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/login', '', '', SYS_URI . 'tracker/authentication.php' );
}
G::RenderPage( "publish" );
session_destroy();

View File

@@ -734,7 +734,11 @@ class SkinEngine
$switch_interface = isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'SWITCHABLE';
$smarty->assign('user_logged', (isset($_SESSION['USER_LOGGED'])? $_SESSION['USER_LOGGED'] : ''));
$smarty->assign('tracker', (SYS_COLLECTION == 'tracker') ? ( ($G_PUBLISH->Parts[0]['File'] != 'tracker/login' ) ? true : '') : '');
if(SYS_SKIN == 'neoclassic'){
$smarty->assign('tracker', (SYS_COLLECTION == 'tracker') ? ( ($G_PUBLISH->Parts[0]['File'] != 'tracker/loginpm3' ) ? true : '') : '');
}else{
$smarty->assign('tracker', (SYS_COLLECTION == 'tracker') ? ( ($G_PUBLISH->Parts[0]['File'] != 'tracker/login' ) ? true : '') : '');
}
$smarty->assign('switch_interface', $switch_interface);
$smarty->assign('switch_interface_label', G::LoadTranslation('ID_SWITCH_INTERFACE'));
$smarty->assign('rolename', isset($_SESSION['USR_ROLENAME']) ? $_SESSION['USR_ROLENAME'] . '' : '');

View File

@@ -67,7 +67,7 @@ class ProcessPermissions extends Api
* @param string $op_user_relation {@from body} {@choice 1,2}
* @param string $op_case_status {@from body} {@choice ALL,DRAFT,TO_DO,PAUSED,COMPLETED}
* @param string $op_participate {@from body} {@choice 0,1}
* @param string $op_obj_type {@from body} {@choice ANY,DYNAFORM,INPUT,OUTPUT,CASES_NOTES,MSGS_HISTORY}
* @param string $op_obj_type {@from body} {@choice ANY,DYNAFORM,INPUT,OUTPUT,CASES_NOTES,MSGS_HISTORY,SUMMARY_FORM}
* @param string $op_action {@from body} {@choice VIEW,BLOCK,DELETE,RESEND}
* @param string $tas_uid {@from body}
* @param string $op_task_source {@from body}

View File

@@ -21,6 +21,7 @@
var prj_uid = "{$prj_uid}";
var app_uid = "{$app_uid}";
var consolidated = "{$consolidated}";
var enterprise = "{$enterprise}";
var prj_readonly = "{$prj_readonly}";
var credentials = "{$credentials}";
var distribution = "{$distribution}";
@@ -69,6 +70,7 @@
var prj_uid = "{$prj_uid}";
var app_uid = "{$app_uid}";
var consolidated = "{$consolidated}";
var enterprise = "{$enterprise}";
var prj_readonly = "{$prj_readonly}";
var credentials = "{$credentials}";
var distribution = "{$distribution}";

View File

@@ -1,5 +1,45 @@
<!--<iframe name="casesFrame" id="casesFrame" src ="../designer?prj_uid=<?php echo $_SESSION['PROCESS']; ?>&prj_readonly=true&app_uid=<?php echo $_SESSION['APP_UID']; ?>" width="99%" height="768" frameborder="0">
<p>Your browser does not support iframes.</p>
</iframe>
-->
Not supported yet.
<?php
$url = "../designer?prj_uid=" . $_SESSION["PROCESS"] . "&prj_readonly=true&app_uid=" . $_SESSION["APP_UID"] . "&tracker_designer=1";
?>
<script type="text/javascript">
var winTracker;
if ((navigator.userAgent.indexOf("MSIE") != -1) || (navigator.userAgent.indexOf("Trident") != -1)) {
var li1 = document.getElementById("MAP");
var a1 = li1.getElementsByTagName("a");
a1[0].href = "javascript:;";
a1[0].onclick = function () { winTracker = window.open("<?php echo $url; ?>", "winTracker"); return false; };
var li2 = document.getElementById("DYNADOC");
var a2= li2.getElementsByTagName("a");
a2[0].onclick = function ()
{
if (winTracker) {
winTracker.close();
}
};
var li3 = document.getElementById("HISTORY");
var a3 = li3.getElementsByTagName("a");
a3[0].onclick = function ()
{
if (winTracker) {
winTracker.close();
}
};
var li4 = document.getElementById("MESSAGES");
var a4 = li4.getElementsByTagName("a");
a4[0].onclick = function ()
{
if (winTracker) {
winTracker.close();
}
};
} else {
document.write("<iframe name=\"casesFrame\" id=\"casesFrame\" src=\"<?php echo $url; ?>\" width=\"99%\" height=\"768\" frameborder=\"0\">");
document.write("<p>Your browser does not support iframes.</p>");
document.write("</iframe>");
}
</script>

View File

@@ -0,0 +1,25 @@
<form accept-charset="UTF-8" role="form" class="form-signin" id="{$form_id}" name="{$form_name}" action="{$form_action}" method="post" encType="multipart/form-data" style="margin:0px;" onsubmit="return validateForm('{$form_objectRequiredFields}');">
<input type="hidden" class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="{$form_objectRequiredFields}" />
<input type="hidden" name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" />
<input type="hidden" name="__DynaformName__" id="__DynaformName__" value="{$form_name}" />
<fieldset>
<label class="panel-login">
<div class="login_result"><h4>{$form.TITLE}</h4></div>
</label>
{$form.USR_USERNAME}
{$form.CASE}
{$form.PIN}
</fieldset>
<fieldset>
<label class="panel-login">
<div class="login_result"></div>
</label>
{$form.BSUBMIT}
</fieldset>
<script type="text/javascript">
{$form.JS}
</script>
</form>
<script src="/lib/pmdynaform/libs/respondjs/respond.min.js"></script>
<script src="/lib/pmdynaform/libs/html5shiv/html5shiv.js"></script>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="login" version="1.0" basedir="" xmlform_type="NORMAL" width="400px" enabletemplate ="1">
<TITLE type="title">
<en><![CDATA[CASE TRACKER]]></en>
</TITLE>
<CASE type="Text" size="30" maxlength="50" validate="Any">
<en><![CDATA[Case Code]]></en>
</CASE>
<PIN type="password" size="30" maxlength="32">
<en><![CDATA[Pin]]></en>
</PIN>
<BSUBMIT type="submit">
<en><![CDATA[Enter]]></en>
</BSUBMIT>
<JS type="javascript"><![CDATA[
function getElementsByClassNameIE8(node, classname) {
var a = [];
var re = new RegExp('(^| )'+classname+'( |$)');
var els = node.getElementsByTagName("*");
for(var i=0,j=els.length; i<j; i++)
if(re.test(els[i].className))a.push(els[i]);
return a;
};
window.onload= function(){
var inputCode,
inputPin;
if(document.getElementById('form[BSUBMIT]').classList == undefined && document.getElementById('form[CASE]').placeholder === undefined){
document.getElementById('form[BSUBMIT]').className = "button-login-success";
document.getElementById('form[CASE]').value = _('ID_CASE_CODE');
document.getElementById('form[PIN]').value = _('ID_PIN');
document.getElementById('form[PIN]').title = _('ID_PIN');
inputCode = document.getElementById('form[CASE]');
inputPin = document.getElementById('form[PIN]');
inputCode.attachEvent("onclick", function (){
if(_('ID_CASE_CODE') == inputCode.value){
inputCode.value="";
}
});
inputCode.attachEvent("onblur", function (){
if(inputCode.value == ""){
inputCode.value=_('ID_CASE_CODE');
}
});
inputPin.attachEvent("onclick", function (){
if(_('ID_PIN') == inputPin.value){
inputPin.value="";
}
});
inputPin.attachEvent("onblur", function (){
if(inputPin.value == ""){
inputPin.value=_('ID_PIN');
}
});
}else{
document.getElementById('form[BSUBMIT]').classList.remove('module_app_button___gray');
document.getElementById('form[BSUBMIT]').classList.add('button-login-success');
document.getElementById('form[CASE]').placeholder = _('ID_CASE_CODE');
document.getElementById('form[PIN]').placeholder = _('ID_PIN');
}
};
]]></JS>
</dynaForm>

View File

@@ -961,7 +961,7 @@ if (! defined( 'EXECUTE_BY_CRON' )) {
}
}
if ($bRedirect) {
if ($bRedirect && !isset($_GET["tracker_designer"])) {
if (substr( SYS_SKIN, 0, 2 ) == 'ux' && SYS_SKIN != 'uxs') { // verify if the current skin is a 'ux' variant
$loginUrl = 'main/login';
} else if (strpos( $_SERVER['REQUEST_URI'], '/home' ) !== false) { //verify is it is using the uxs skin for simplified interface