Merged in jonathanquispe/processmaker/pm2153 (pull request #2145)

pm2153
This commit is contained in:
Julio Cesar Laura Avendaño
2015-05-08 16:10:08 -04:00
4 changed files with 110 additions and 8 deletions

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

@@ -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>