BUG 8863 Migrate the User Profile interface from master branch version SOLVED.
- Migrate the User Profile interface from master branch version - User Profile ExtJS migrated from the master branch.
This commit is contained in:
@@ -22,157 +22,16 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
try {
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_LOGIN')){
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
// deprecated the class XmlForm_Field_Image is currently part of the class.xmlform.php package
|
||||
// the use of the external xmlfield_Image is highly discouraged
|
||||
if (!class_exists('XmlForm_Field_Image')){
|
||||
G::LoadClass('xmlfield_Image');
|
||||
}
|
||||
// G::LoadClass('xmlfield_Department');
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/Department.php';
|
||||
unset($_SESSION['CURRENT_USER']);
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->load($_SESSION['USER_LOGGED']);
|
||||
$aFields['USR_PASSWORD'] = '********';
|
||||
$aFields['MESSAGE0'] = G::LoadTranslation('ID_USER_REGISTERED') . '!';
|
||||
$aFields['MESSAGE1'] = G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME');
|
||||
$aFields['MESSAGE2'] = G::LoadTranslation('ID_MSG_ERROR_DUE_DATE');
|
||||
$aFields['MESSAGE3'] = G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS');
|
||||
$aFields['MESSAGE4'] = G::LoadTranslation('ID_MSG_ERROR_USR_FIRSTNAME');
|
||||
$aFields['MESSAGE5'] = G::LoadTranslation('ID_MSG_ERROR_USR_LASTNAME');
|
||||
$aFields['NO_RESUME'] = G::LoadTranslation('ID_NO_RESUME');
|
||||
$aFields['START_DATE'] = date('Y-m-d');
|
||||
$aFields['END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
|
||||
$aFields['RANDOM'] = rand();
|
||||
|
||||
//getting the user and department
|
||||
$oDepInfo = new Department();
|
||||
$oUser = UsersPeer::retrieveByPk( $aFields['USR_REPORTS_TO'] );
|
||||
if ( is_object($oUser) && get_class ($oUser) == 'Users' ) {
|
||||
$userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
|
||||
try {
|
||||
$depFields = $oDepInfo->load($userFields['DEP_UID'] );
|
||||
$aFields['USR_REPORTS_TO'] .= " (" . $depFields['DEPO_TITLE'] . ")";
|
||||
}
|
||||
catch( Exception $e ) {
|
||||
}
|
||||
}
|
||||
else{
|
||||
$aFields['USR_REPORTS_TO'] = ' ';
|
||||
}
|
||||
|
||||
try {
|
||||
$depFields = $oDepInfo->load($aFields['DEP_UID']);
|
||||
$aFields['USR_DEPARTMENT'] = $depFields['DEPO_TITLE'];
|
||||
}
|
||||
catch( Exception $e ) {
|
||||
$oUser = UsersPeer::retrieveByPk( $_SESSION['USER_LOGGED'] );
|
||||
$oUser->setDepUid( '' );
|
||||
$aFields['USR_DEPARTMENT'] = ' ';
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
|
||||
$G_ID_MENU_SELECTED = 'MY_ACCOUNT';
|
||||
$G_PUBLISH = new Publisher;
|
||||
|
||||
|
||||
#verifying if it has any preferences on the configurations table
|
||||
G::loadClass('configuration');
|
||||
$oConf = new Configurations;
|
||||
$oConf->loadConfig($x, 'USER_PREFERENCES','','',$_SESSION['USER_LOGGED'],'');
|
||||
|
||||
if( sizeof($oConf->Fields) > 0){ #this user has a configuration record
|
||||
$aFields['PREF_DEFAULT_LANG'] = $oConf->aConfig['DEFAULT_LANG'];
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED'] = isset($oConf->aConfig['DEFAULT_MENU']) ? $oConf->aConfig['DEFAULT_MENU']: '';
|
||||
$aFields['PREF_DEFAULT_CASES_MENUSELECTED'] = isset($oConf->aConfig['DEFAULT_CASES_MENU']) ? $oConf->aConfig['DEFAULT_CASES_MENU']: '';
|
||||
} else {
|
||||
switch($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']){
|
||||
case 'PROCESSMAKER_ADMIN':
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_USERS';
|
||||
break;
|
||||
|
||||
case 'PROCESSMAKER_OPERATOR':
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_CASES';
|
||||
break;
|
||||
$G_PUBLISH = new Publisher ();
|
||||
|
||||
if ( isset($_GET['type']) ){
|
||||
$G_PUBLISH->AddContent('view', 'users/usersReload');
|
||||
G::RenderPage( "publishBlank", "blank");
|
||||
}
|
||||
$aFields['PREF_DEFAULT_LANG'] = SYS_LANG;
|
||||
else {
|
||||
$G_PUBLISH->AddContent('view', 'users/usersLoad');
|
||||
G::RenderPage( "publish" );
|
||||
}
|
||||
$rows[] = Array('id'=>'char', 'name'=>'char');
|
||||
|
||||
|
||||
foreach($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission){
|
||||
|
||||
switch($permission['PER_CODE']){
|
||||
case 'PM_USERS':
|
||||
$rows[] = Array('id'=>'PM_USERS', 'name'=>strtoupper(G::LoadTranslation('ID_USERS')));
|
||||
break;
|
||||
case 'PM_CASES':
|
||||
$rows[] = Array('id'=>'PM_CASES', 'name'=>strtoupper(G::LoadTranslation('ID_CASES')));
|
||||
break;
|
||||
case 'PM_FACTORY':
|
||||
$rows[] = Array('id'=>'PM_FACTORY', 'name'=>strtoupper(G::LoadTranslation('ID_APPLICATIONS')));
|
||||
break;
|
||||
case 'PM_DASHBOARD':
|
||||
$rows[] = Array('id'=>'PM_DASHBOARD', 'name'=>strtoupper(G::LoadTranslation('ID_DASHBOARD')));
|
||||
break;
|
||||
case 'PM_SETUP':
|
||||
$rows[] = Array('id'=>'PM_SETUP', 'name'=>strtoupper(G::LoadTranslation('ID_SETUP')));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
global $G_TMP_MENU;
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('cases');
|
||||
|
||||
$rowsCasesMenu[] = Array('id'=>'char', 'name'=>'char');
|
||||
|
||||
foreach($oMenu->Id as $i=>$item){
|
||||
if( $oMenu->Types[$i] != 'blockHeader' ){
|
||||
$rowsCasesMenu[] = Array('id'=>$item, 'name'=>$oMenu->Labels[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
//G::pr($rows); die;
|
||||
global $_DBArray;
|
||||
$_DBArray['menutab'] = $rows;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$_DBArray['CASES_MENU'] = $rowsCasesMenu;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
G::LoadClass('ArrayPeer');
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('menutab');
|
||||
$oCriteria2 = new Criteria('dbarray');
|
||||
$oCriteria2->setDBArrayTable('CASES_MENU');
|
||||
|
||||
if ($RBAC->userCanAccess('PM_EDITPERSONALINFO') == 1) { //he has permitions for edit his profile
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/myInfoView.xml', '', $aFields);
|
||||
} else { //he has not permitions for edit his profile, so just view mode will be displayed
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/myInfoView2.xml', '', $aFields);
|
||||
}
|
||||
|
||||
G::RenderPage('publish');
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
515
workflow/engine/methods/users/usersAjax.php
Normal file
515
workflow/engine/methods/users/usersAjax.php
Normal file
@@ -0,0 +1,515 @@
|
||||
<?php
|
||||
|
||||
global $RBAC;
|
||||
|
||||
switch($_POST['action'])
|
||||
{
|
||||
case 'countryList' :
|
||||
require_once ("classes/model/IsoCountry.php");
|
||||
$c = new Criteria();
|
||||
$c->add(IsoCountryPeer::IC_UID, NULL, Criteria::ISNOTNULL);
|
||||
|
||||
$countries = IsoCountryPeer::doSelect($c);
|
||||
foreach ( $countries as $rowid => $row ) {
|
||||
$oData[] = Array('IC_UID'=>$row->getICUid(),'IC_NAME'=>$row->getICName());
|
||||
}
|
||||
print(G::json_encode($oData));
|
||||
break;
|
||||
|
||||
case 'stateList' :
|
||||
require_once ("classes/model/IsoSubdivision.php");
|
||||
$c = new Criteria();
|
||||
$country = $_POST['IC_UID'];
|
||||
$c->add(IsoSubdivisionPeer::IC_UID, $country, Criteria::EQUAL);
|
||||
$locations = IsoSubdivisionPeer::doSelect($c);
|
||||
|
||||
foreach( $locations as $rowid => $row ) {
|
||||
if (($row->getISUid() != '') && ($row->getISName() != ''))
|
||||
$oData[] = Array('IS_UID' => $row->getISUid(), 'IS_NAME' => $row->getISName());
|
||||
}
|
||||
print(G::json_encode($oData));
|
||||
break;
|
||||
|
||||
case 'locationList' :
|
||||
require_once ("classes/model/IsoLocation.php");
|
||||
$c = new Criteria();
|
||||
$country = $_POST['IC_UID'];
|
||||
$state = $_POST['IS_UID'];
|
||||
$c->add(IsoLocationPeer::IC_UID, $country, Criteria::EQUAL);
|
||||
$c->add(IsoLocationPeer::IS_UID, $state, Criteria::EQUAL);
|
||||
$locations = IsoLocationPeer::doSelect($c);
|
||||
|
||||
foreach ( $locations as $rowid => $row ) {
|
||||
if (($row->getILUid() != '') && ($row->getILName() != ''))
|
||||
$oData[] = Array('IL_UID' => $row->getILUid(), 'IL_NAME' => $row->getILName());
|
||||
}
|
||||
print(G::json_encode($oData));
|
||||
break;
|
||||
case 'usersList' :
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
|
||||
$oCriteria->add(UsersPeer::USR_STATUS,'ACTIVE');
|
||||
$oDataset = UsersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
G::loadClass('configuration');
|
||||
$oConf = new Configurations;
|
||||
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
|
||||
|
||||
$defaultOption = isset($oConf->aConfig['format']) ? $oConf->aConfig['format'] : '';
|
||||
|
||||
$aUserInfo = array();
|
||||
while ( $oDataset->next()) {
|
||||
$aRow1 = $oDataset->getRow();
|
||||
|
||||
$infoUser = G::getFormatUserList($defaultOption,$aRow1);
|
||||
$aUserInfo[] = array(
|
||||
'USR_UID' => $aRow1['USR_UID'],
|
||||
'USER_FULLNAME' => $infoUser
|
||||
);
|
||||
}
|
||||
print(G::json_encode($aUserInfo));
|
||||
|
||||
break;
|
||||
|
||||
case 'availableCalendars' :
|
||||
G::LoadClass ( 'calendar' );
|
||||
$calendar = new Calendar ( );
|
||||
$calendarObj = $calendar->getCalendarList ( true, true );
|
||||
$oData[] = array('CALENDAR_UID' => '', 'CALENDAR_NAME' => '- None -');
|
||||
foreach ( $calendarObj ['array'] as $rowid => $row ) {
|
||||
if ($rowid > 0)
|
||||
$oData[] = array('CALENDAR_UID' => $row['CALENDAR_UID'], 'CALENDAR_NAME' => $row['CALENDAR_NAME']);
|
||||
}
|
||||
print(G::json_encode($oData));
|
||||
break;
|
||||
case 'rolesList':
|
||||
require_once PATH_RBAC."model/Roles.php";
|
||||
$roles = new Roles();
|
||||
$rolesData = $roles->getAllRoles();
|
||||
foreach( $rolesData as $rowid => $row ) {
|
||||
$oData[] = array('ROL_UID' => $row['ROL_CODE'],'ROL_CODE' => $row['ROL_CODE']);
|
||||
}
|
||||
print(G::json_encode($oData));
|
||||
break;
|
||||
case 'saveUser' :
|
||||
try {
|
||||
$form = $_POST;
|
||||
|
||||
if ( isset($_POST['USR_UID'])) {
|
||||
$form['USR_UID'] = $_POST['USR_UID'];
|
||||
}
|
||||
else {
|
||||
$form['USR_UID'] = '';
|
||||
}
|
||||
/*
|
||||
if ( isset($_FILES['USR_RESUME']['name']) ) {
|
||||
if ($_FILES['USR_RESUME']['tmp_name'] != '') {
|
||||
$form['USR_RESUME'] = $_FILES['USR_RESUME']['name'];
|
||||
}
|
||||
else {
|
||||
$form['USR_RESUME'] = '';
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (!isset($form['USR_NEW_PASS'])) {
|
||||
$form['USR_NEW_PASS'] = '';
|
||||
}
|
||||
if ($form['USR_NEW_PASS'] != '') {
|
||||
$form['USR_PASSWORD'] = md5($form['USR_NEW_PASS']);
|
||||
}
|
||||
if (!isset($form['USR_CITY'])) {
|
||||
$form['USR_CITY'] = '';
|
||||
}
|
||||
if (!isset($form['USR_LOCATION'])) {
|
||||
$form['USR_LOCATION'] = '';
|
||||
}
|
||||
if (!isset($form['USR_AUTH_USER_DN'])) {
|
||||
$form['USR_AUTH_USER_DN'] = '';
|
||||
}
|
||||
|
||||
if ($form['USR_UID'] == '') {
|
||||
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
|
||||
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
|
||||
$aData['USR_FIRSTNAME'] = $form['USR_FIRSTNAME'];
|
||||
$aData['USR_LASTNAME'] = $form['USR_LASTNAME'];
|
||||
$aData['USR_EMAIL'] = $form['USR_EMAIL'];
|
||||
$aData['USR_DUE_DATE'] = $form['USR_DUE_DATE'];
|
||||
$aData['USR_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aData['USR_BIRTHDAY'] = date('Y-m-d');
|
||||
$aData['USR_AUTH_USER_DN'] = $form['USR_AUTH_USER_DN'];
|
||||
//fixing bug in inactive user when the admin create a new user.
|
||||
$statusWF = $form['USR_STATUS'];
|
||||
$aData['USR_STATUS'] = $form['USR_STATUS'] == 'ACTIVE' ? 1 : 0;
|
||||
$sUserUID = $RBAC->createUser($aData, $form['USR_ROLE'] );
|
||||
$aData['USR_STATUS'] = $statusWF;
|
||||
$aData['USR_UID'] = $sUserUID;
|
||||
$aData['USR_PASSWORD'] = md5($sUserUID);//fake :p
|
||||
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
|
||||
$aData['USR_CITY'] = $form['USR_CITY'];
|
||||
$aData['USR_LOCATION'] = $form['USR_LOCATION'];
|
||||
$aData['USR_ADDRESS'] = $form['USR_ADDRESS'];
|
||||
$aData['USR_PHONE'] = $form['USR_PHONE'];
|
||||
$aData['USR_ZIP_CODE'] = $form['USR_ZIP_CODE'];
|
||||
$aData['USR_POSITION'] = $form['USR_POSITION'];
|
||||
// $aData['USR_RESUME'] = $form['USR_RESUME'];
|
||||
$aData['USR_ROLE'] = $form['USR_ROLE'];
|
||||
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$oUser->create($aData);
|
||||
|
||||
if ($_FILES['USR_PHOTO']['error'] != 1) {
|
||||
//print (PATH_IMAGES_ENVIRONMENT_USERS);
|
||||
if ($_FILES['USR_PHOTO']['tmp_name'] != '') {
|
||||
G::uploadFile($_FILES['USR_PHOTO']['tmp_name'], PATH_IMAGES_ENVIRONMENT_USERS, $sUserUID . '.gif');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$result->success = false;
|
||||
$result->fileError = true;
|
||||
print(G::json_encode($result));
|
||||
die;
|
||||
}
|
||||
/*
|
||||
if ($_FILES['USR_RESUME']['error'] != 1) {
|
||||
if ($_FILES['USR_RESUME']['tmp_name'] != '') {
|
||||
G::uploadFile($_FILES['USR_RESUME']['tmp_name'], PATH_IMAGES_ENVIRONMENT_FILES . $sUserUID . '/', $_FILES['USR_RESUME']['name']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$result->success = false;
|
||||
$result->fileError = true;
|
||||
print(G::json_encode($result));
|
||||
die;
|
||||
}
|
||||
*/
|
||||
}
|
||||
else {
|
||||
|
||||
$aData['USR_UID'] = $form['USR_UID'];
|
||||
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
|
||||
|
||||
if (isset($form['USR_PASSWORD'])) {
|
||||
|
||||
if ($form['USR_PASSWORD'] != '') {
|
||||
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
|
||||
require_once 'classes/model/UsersProperties.php';
|
||||
$oUserProperty = new UsersProperties();
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($form['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($form['USR_PASSWORD'])))));
|
||||
|
||||
$memKey = 'rbacSession' . session_id();
|
||||
$memcache = & PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : '');
|
||||
if ( ($RBAC->aUserInfo = $memcache->get($memKey)) === false ) {
|
||||
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED'] );
|
||||
$memcache->set( $memKey, $RBAC->aUserInfo, PMmemcached::EIGHT_HOURS );
|
||||
}
|
||||
if( $RBAC->aUserInfo[ 'PROCESSMAKER' ]['ROLE']['ROL_CODE']=='PROCESSMAKER_ADMIN'){
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 1;
|
||||
$oUserProperty->update($aUserProperty);
|
||||
}
|
||||
|
||||
$aErrors = $oUserProperty->validatePassword($form['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], 0);
|
||||
|
||||
|
||||
if (count($aErrors) > 0) {
|
||||
$sDescription = G::LoadTranslation('ID_POLICY_ALERT').':,';
|
||||
foreach ($aErrors as $sError) {
|
||||
switch ($sError) {
|
||||
case 'ID_PPP_MINIMUN_LENGTH':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).': ' . PPP_MINIMUN_LENGTH . ',';
|
||||
break;
|
||||
case 'ID_PPP_MAXIMUN_LENGTH':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).': ' . PPP_MAXIMUN_LENGTH . ',';
|
||||
break;
|
||||
case 'ID_PPP_EXPIRATION_IN':
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).' ' . PPP_EXPIRATION_IN . ' ' . G::LoadTranslation('ID_DAYS') . ',';
|
||||
break;
|
||||
default:
|
||||
$sDescription .= ' - ' . G::LoadTranslation($sError).',';
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sDescription .= ''.G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY');
|
||||
$result->success = false;
|
||||
$result->msg = $sDescription;
|
||||
print(G::json_encode($result));
|
||||
die;
|
||||
|
||||
|
||||
}
|
||||
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
|
||||
if (!is_array($aHistory)) {
|
||||
$aHistory = array();
|
||||
}
|
||||
if (!defined('PPP_PASSWORD_HISTORY')) {
|
||||
define('PPP_PASSWORD_HISTORY', 0);
|
||||
}
|
||||
if (PPP_PASSWORD_HISTORY > 0) {
|
||||
//it's looking a password igual into aHistory array that was send for post in md5 way
|
||||
$c = 0;
|
||||
$sw = 1;
|
||||
while (count($aHistory) >= 1 && count($aHistory) > $c && $sw ){
|
||||
if (strcmp(trim($aHistory[$c]), trim($form['USR_PASSWORD'])) == 0){
|
||||
$sw = 0;
|
||||
}
|
||||
$c++;
|
||||
}
|
||||
if ($sw == 0) {
|
||||
$sDescription = G::LoadTranslation('ID_POLICY_ALERT').':<br /><br />';
|
||||
$sDescription .= ' - ' . G::LoadTranslation('PASSWORD_HISTORY').': ' . PPP_PASSWORD_HISTORY . '<br />';
|
||||
$sDescription .= '<br />' . G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY').'';
|
||||
G::SendMessageText($sDescription, 'warning');
|
||||
G::header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
die;
|
||||
}
|
||||
|
||||
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
|
||||
$sLastPassw = array_shift($aHistory);
|
||||
}
|
||||
$aHistory[] = $form['USR_PASSWORD'];
|
||||
}
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 1;
|
||||
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize($aHistory);
|
||||
$oUserProperty->update($aUserProperty);
|
||||
}
|
||||
}
|
||||
$aData['USR_FIRSTNAME'] = $form['USR_FIRSTNAME'];
|
||||
$aData['USR_LASTNAME'] = $form['USR_LASTNAME'];
|
||||
$aData['USR_EMAIL'] = $form['USR_EMAIL'];
|
||||
$aData['USR_DUE_DATE'] = $form['USR_DUE_DATE'];
|
||||
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
if (isset($form['USR_STATUS'])) {
|
||||
$aData['USR_STATUS'] = $form['USR_STATUS'];
|
||||
}
|
||||
if (isset($form['USR_ROLE'])) {
|
||||
$RBAC->updateUser($aData, $form['USR_ROLE']);
|
||||
}
|
||||
else {
|
||||
$RBAC->updateUser($aData);
|
||||
}
|
||||
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
|
||||
$aData['USR_CITY'] = $form['USR_CITY'];
|
||||
$aData['USR_LOCATION'] = $form['USR_LOCATION'];
|
||||
$aData['USR_ADDRESS'] = $form['USR_ADDRESS'];
|
||||
$aData['USR_PHONE'] = $form['USR_PHONE'];
|
||||
$aData['USR_ZIP_CODE'] = $form['USR_ZIP_CODE'];
|
||||
$aData['USR_POSITION'] = $form['USR_POSITION'];
|
||||
/*
|
||||
if ($form['USR_RESUME'] != '') {
|
||||
$aData['USR_RESUME'] = $form['USR_RESUME'];
|
||||
}
|
||||
*/
|
||||
if (isset($form['USR_ROLE'])) {
|
||||
$aData['USR_ROLE'] = $form['USR_ROLE'];
|
||||
}
|
||||
|
||||
if(isset($form['USR_REPLACED_BY'])){
|
||||
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
||||
}
|
||||
if(isset($form['USR_AUTH_USER_DN'])){
|
||||
$aData['USR_AUTH_USER_DN'] = $form['USR_AUTH_USER_DN'];
|
||||
}
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$oUser->update($aData);
|
||||
if ($_FILES['USR_PHOTO']['error'] != 1) {
|
||||
if ($_FILES['USR_PHOTO']['tmp_name'] != '') {
|
||||
$aAux = explode('.', $_FILES['USR_PHOTO']['name']);
|
||||
G::uploadFile($_FILES['USR_PHOTO']['tmp_name'], PATH_IMAGES_ENVIRONMENT_USERS, $aData['USR_UID'] . '.' . $aAux[1]);
|
||||
G::resizeImage(PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.' . $aAux[1], 96, 96, PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.gif');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$result->success = false;
|
||||
$result->fileError = true;
|
||||
print(G::json_encode($result));
|
||||
die;
|
||||
}
|
||||
/*
|
||||
if ($_FILES['USR_RESUME']['error'] != 1) {
|
||||
if ($_FILES['USR_RESUME']['tmp_name'] != '') {
|
||||
G::uploadFile($_FILES['USR_RESUME']['tmp_name'], PATH_IMAGES_ENVIRONMENT_FILES . $aData['USR_UID'] . '/', $_FILES['USR_RESUME']['name']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$result->success = false;
|
||||
$result->fileError = true;
|
||||
print(G::json_encode($result));
|
||||
die;
|
||||
}
|
||||
*/
|
||||
/* Saving preferences */
|
||||
$def_lang = $form['PREF_DEFAULT_LANG'];
|
||||
$def_menu = $form['PREF_DEFAULT_MENUSELECTED'];
|
||||
$def_cases_menu = $form['PREF_DEFAULT_CASES_MENUSELECTED'];
|
||||
|
||||
G::loadClass('configuration');
|
||||
|
||||
$oConf = new Configurations;
|
||||
$aConf = Array(
|
||||
'DEFAULT_LANG' => $def_lang,
|
||||
'DEFAULT_MENU' => $def_menu,
|
||||
'DEFAULT_CASES_MENU' => $def_cases_menu
|
||||
);
|
||||
|
||||
/*UPDATING SESSION VARIABLES*/
|
||||
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
||||
//$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
|
||||
$oConf->aConfig = $aConf;
|
||||
$oConf->saveConfig('USER_PREFERENCES', '', '',$_SESSION['USER_LOGGED']);
|
||||
|
||||
}
|
||||
|
||||
if ( $_SESSION['USER_LOGGED'] == $form['USR_UID'] ) {
|
||||
/* UPDATING SESSION VARIABLES */
|
||||
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
||||
$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
}
|
||||
|
||||
|
||||
//Save Calendar assigment
|
||||
if ((isset($form['USR_CALENDAR']))) {
|
||||
//Save Calendar ID for this user
|
||||
G::LoadClass("calendar");
|
||||
$calendarObj = new Calendar();
|
||||
$calendarObj->assignCalendarTo($aData['USR_UID'], $form['USR_CALENDAR'], 'USER');
|
||||
}
|
||||
$result->success = true;
|
||||
print(G::json_encode($result));
|
||||
}catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->error = $e->getMessage();
|
||||
print(G::json_encode($result));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'userData':
|
||||
require_once 'classes/model/Users.php';
|
||||
$_SESSION['CURRENT_USER'] = $_POST['USR_UID'];
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->loadDetailed($_POST['USR_UID']);
|
||||
|
||||
//Load Calendar options and falue for this user
|
||||
G::LoadClass ( 'calendar' );
|
||||
$calendar = new Calendar ( );
|
||||
$calendarInfo = $calendar->getCalendarFor ( $_POST['USR_UID'], $_POST['USR_UID'], $_POST['USR_UID'] );
|
||||
//If the function returns a DEFAULT calendar it means that this object doesn't have assigned any calendar
|
||||
$aFields ['USR_CALENDAR'] = $calendarInfo ['CALENDAR_APPLIED'] != 'DEFAULT' ? $calendarInfo ['CALENDAR_UID'] : "";
|
||||
|
||||
#verifying if it has any preferences on the configurations table
|
||||
G::loadClass('configuration');
|
||||
$oConf = new Configurations;
|
||||
$oConf->loadConfig($x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '');
|
||||
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED']='';
|
||||
$aFields['PREF_DEFAULT_CASES_MENUSELECTED']='';
|
||||
if( sizeof($oConf->Fields) > 0){ #this user has a configuration record
|
||||
$aFields['PREF_DEFAULT_LANG'] = $oConf->aConfig['DEFAULT_LANG'];
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED'] = isset($oConf->aConfig['DEFAULT_MENU']) ? $oConf->aConfig['DEFAULT_MENU']: '';
|
||||
$aFields['PREF_DEFAULT_CASES_MENUSELECTED'] = isset($oConf->aConfig['DEFAULT_CASES_MENU']) ? $oConf->aConfig['DEFAULT_CASES_MENU']: '';
|
||||
} else {
|
||||
switch($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']){
|
||||
case 'PROCESSMAKER_ADMIN':
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_SETUP';
|
||||
break;
|
||||
|
||||
case 'PROCESSMAKER_OPERATOR':
|
||||
$aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_CASES';
|
||||
break;
|
||||
|
||||
}
|
||||
$aFields['PREF_DEFAULT_LANG'] = SYS_LANG;
|
||||
}
|
||||
if ($aFields['USR_REPLACED_BY'] != ''){
|
||||
$user = new Users();
|
||||
$u = $user->load($aFields['USR_REPLACED_BY']);
|
||||
$c = new Configurations();
|
||||
$replaced_by = $c->usersNameFormat($u['USR_USERNAME'], $u['USR_FIRSTNAME'], $u['USR_LASTNAME']);
|
||||
}else{
|
||||
$replaced_by = '';
|
||||
}
|
||||
$aFields['REPLACED_NAME'] = $replaced_by;
|
||||
if ($aFields['PREF_DEFAULT_MENUSELECTED'] != ''){
|
||||
$menuSelected = '';
|
||||
foreach ( $RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission ) {
|
||||
if($aFields['PREF_DEFAULT_MENUSELECTED']==$permission['PER_CODE']){
|
||||
switch($permission['PER_CODE']){
|
||||
case 'PM_USERS' :
|
||||
case 'PM_SETUP' :
|
||||
|
||||
$menuSelected = strtoupper(G::LoadTranslation('ID_SETUP'));
|
||||
break;
|
||||
case 'PM_CASES' :
|
||||
$menuSelected = strtoupper(G::LoadTranslation('ID_CASES'));
|
||||
break;
|
||||
case 'PM_FACTORY' :
|
||||
$menuSelected = strtoupper(G::LoadTranslation('ID_APPLICATIONS'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$aFields['MENUSELECTED_NAME'] = $menuSelected;
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('cases');
|
||||
if ($aFields['PREF_DEFAULT_CASES_MENUSELECTED'] != ''){
|
||||
foreach($oMenu->Id as $i => $item){
|
||||
|
||||
if ($aFields['PREF_DEFAULT_CASES_MENUSELECTED'] == $item)
|
||||
$casesMenuSelected =$oMenu->Labels[$i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$casesMenuSelected = '';
|
||||
}
|
||||
$aFields['CASES_MENUSELECTED_NAME'] = $casesMenuSelected;
|
||||
|
||||
$result->success = true;
|
||||
$result->user = $aFields;
|
||||
|
||||
print(G::json_encode($result));
|
||||
break;
|
||||
|
||||
case 'defaultMainMenuOptionList';
|
||||
foreach($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission){
|
||||
switch($permission['PER_CODE']){
|
||||
case 'PM_USERS':
|
||||
case 'PM_SETUP':
|
||||
$rows[] = Array('id'=>'PM_SETUP', 'name'=>strtoupper(G::LoadTranslation('ID_SETUP')));
|
||||
break;
|
||||
case 'PM_CASES':
|
||||
$rows[] = Array('id'=>'PM_CASES', 'name'=>strtoupper(G::LoadTranslation('ID_CASES')));
|
||||
break;
|
||||
case 'PM_FACTORY':
|
||||
$rows[] = Array('id'=>'PM_FACTORY', 'name'=>strtoupper(G::LoadTranslation('ID_APPLICATIONS')));
|
||||
break;
|
||||
}
|
||||
}
|
||||
print(G::json_encode($rows));
|
||||
break;
|
||||
case 'defaultCasesMenuOptionList';
|
||||
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('cases');
|
||||
|
||||
foreach($oMenu->Id as $i=>$item){
|
||||
if( $oMenu->Types[$i] != 'blockHeader' ){
|
||||
$rowsCasesMenu[] = Array('id'=>$item, 'name' => $oMenu->Labels[$i]);
|
||||
}
|
||||
}
|
||||
print(G::json_encode($rowsCasesMenu));
|
||||
break;
|
||||
|
||||
}
|
||||
19
workflow/engine/methods/users/usersEdit.php
Normal file
19
workflow/engine/methods/users/usersEdit.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
//calculating the max upload file size;
|
||||
$POST_MAX_SIZE = ini_get('post_max_size');
|
||||
$mul = substr($POST_MAX_SIZE, -1);
|
||||
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
|
||||
$postMaxSize = (int)$POST_MAX_SIZE * $mul;
|
||||
|
||||
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
|
||||
$mul = substr($UPLOAD_MAX_SIZE, -1);
|
||||
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
|
||||
$uploadMaxSize = (int)$UPLOAD_MAX_SIZE * $mul;
|
||||
|
||||
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('users/users', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->assign('USR_UID', $_GET['USR_UID']);
|
||||
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
|
||||
G::RenderPage('publish', 'extJs');
|
||||
@@ -85,9 +85,11 @@ $users['CURRENT_TAB'] = $ctab;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('users/usersGroups', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('users/usersGroups'); //adding a html file .html.
|
||||
// $oHeadPublisher->addContent('users/usersGroups'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('USERS', $users);
|
||||
|
||||
$oHeadPublisher->assign('hasAuthPerm', ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1));
|
||||
if ($ctab == 2) {
|
||||
$oHeadPublisher->assign('hasAuthPerm', ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1));
|
||||
}
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
35
workflow/engine/methods/users/usersInit.php
Normal file
35
workflow/engine/methods/users/usersInit.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
global $RBAC;
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
unset($_SESSION['CURRENT_USER']);
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->load($_SESSION['USER_LOGGED']);
|
||||
|
||||
if ($RBAC->userCanAccess('PM_EDITPERSONALINFO') == 1) { //he has permitions for edit his profile
|
||||
$canEdit = false;
|
||||
} else { //he has not permitions for edit his profile, so just view mode will be displayed
|
||||
$canEdit = true;
|
||||
}
|
||||
|
||||
//calculating the max upload file size;
|
||||
$POST_MAX_SIZE = ini_get('post_max_size');
|
||||
$mul = substr($POST_MAX_SIZE, -1);
|
||||
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
|
||||
$postMaxSize = (int)$POST_MAX_SIZE * $mul;
|
||||
|
||||
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
|
||||
$mul = substr($UPLOAD_MAX_SIZE, -1);
|
||||
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
|
||||
$uploadMaxSize = (int)$UPLOAD_MAX_SIZE * $mul;
|
||||
|
||||
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('users/users', true ); //adding a javascript file .js
|
||||
// $oHeadPublisher->addContent('users/users'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('USR_UID', $aFields['USR_UID']);
|
||||
$oHeadPublisher->assign('infoMode', true);
|
||||
$oHeadPublisher->assign('canEdit', $canEdit);
|
||||
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
|
||||
G::RenderPage('publish', 'extJs');
|
||||
20
workflow/engine/methods/users/usersNew.php
Normal file
20
workflow/engine/methods/users/usersNew.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
//calculating the max upload file size;
|
||||
$POST_MAX_SIZE = ini_get('post_max_size');
|
||||
$mul = substr($POST_MAX_SIZE, -1);
|
||||
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
|
||||
$postMaxSize = (int)$POST_MAX_SIZE * $mul;
|
||||
|
||||
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
|
||||
$mul = substr($UPLOAD_MAX_SIZE, -1);
|
||||
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
|
||||
$uploadMaxSize = (int)$UPLOAD_MAX_SIZE * $mul;
|
||||
|
||||
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('users/users', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->assign('USR_UID', '');
|
||||
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
|
||||
G::RenderPage('publish', 'extJs');
|
||||
1052
workflow/engine/templates/users/users.js
Normal file
1052
workflow/engine/templates/users/users.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -117,9 +117,14 @@ Ext.onReady(function(){
|
||||
handler: DoSearch
|
||||
});
|
||||
|
||||
contextMenu = new Ext.menu.Menu({
|
||||
items: [editButton, deleteButton,'-',groupsButton,'-',authenticationButton,'-',summaryButton]
|
||||
});
|
||||
contextMenuConfig = new Array();
|
||||
contextMenuConfig.push(editButton);
|
||||
contextMenuConfig.push(deleteButton);
|
||||
contextMenuConfig.push('-');
|
||||
contextMenuConfig.push(groupsButton);
|
||||
contextMenuConfig.push('-');
|
||||
contextMenuConfig.push(summaryButton);
|
||||
contextMenu = new Ext.menu.Menu(contextMenuConfig);
|
||||
|
||||
searchText = new Ext.form.TextField ({
|
||||
id: 'searchTxt',
|
||||
@@ -154,7 +159,7 @@ Ext.onReady(function(){
|
||||
deleteButton.enable();
|
||||
groupsButton.enable();
|
||||
//reassignButton.enable();
|
||||
authenticationButton.enable();
|
||||
// authenticationButton.enable();
|
||||
summaryButton.enable();
|
||||
},
|
||||
rowdeselect: function(sm){
|
||||
@@ -162,7 +167,7 @@ Ext.onReady(function(){
|
||||
deleteButton.disable();
|
||||
groupsButton.disable();
|
||||
//reassignButton.disable();
|
||||
authenticationButton.disable();
|
||||
//authenticationButton.disable();
|
||||
summaryButton.disable();
|
||||
}
|
||||
}
|
||||
@@ -300,10 +305,10 @@ Ext.onReady(function(){
|
||||
store: store,
|
||||
cm: cmodel,
|
||||
sm: smodel,
|
||||
tbar: [newButton, '-',summaryButton,'-', editButton, deleteButton,/*'-',groupsButton,'-',authenticationButton,*/ {xtype: 'tbfill'},_('ID_AUTH_SOURCES')+': ',comboAuthSources,'-', searchText,clearTextButton,searchButton],
|
||||
tbar: [newButton, '-',summaryButton,'-', editButton, deleteButton, '-', groupsButton, /* '-',authenticationButton, */ {xtype: 'tbfill'}, /* _('ID_AUTH_SOURCES')+': ',comboAuthSources,'-', */ searchText,clearTextButton,searchButton],
|
||||
bbar: bbarpaging,
|
||||
listeners: {
|
||||
rowdblclick: SummaryTabOpen
|
||||
rowdblclick : EditUserAction
|
||||
},
|
||||
view: new Ext.grid.GroupingView({
|
||||
forceFit:true,
|
||||
@@ -349,7 +354,7 @@ DoNothing = function(){};
|
||||
|
||||
//Open New User Form
|
||||
NewUserAction = function(){
|
||||
location.href = 'users_New';
|
||||
location.href = 'usersNew';
|
||||
};
|
||||
|
||||
//Delete User Action
|
||||
@@ -415,7 +420,7 @@ SummaryTabOpen = function(){
|
||||
EditUserAction = function(){
|
||||
var uid = infoGrid.getSelectionModel().getSelected();
|
||||
if (uid) {
|
||||
location.href = 'users_Edit?USR_UID=' + uid.data.USR_UID+'&USR_AUTH_SOURCE=' + uid.data.USR_AUTH_SOURCE;
|
||||
location.href = 'usersEdit?USR_UID=' + uid.data.USR_UID+'&USR_AUTH_SOURCE=' + uid.data.USR_AUTH_SOURCE;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
42
workflow/engine/templates/users/usersLoad.php
Normal file
42
workflow/engine/templates/users/usersLoad.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<html>
|
||||
<style>
|
||||
.Footer{
|
||||
font : normal 8pt sans-serif,Tahoma,MiscFixed !important;
|
||||
color : #000 !important;
|
||||
height : 0px !important;
|
||||
text-align : center !important;
|
||||
}
|
||||
.Footer .content{
|
||||
color : black !important;
|
||||
padding : 0px !important;
|
||||
}
|
||||
</style>
|
||||
<body onresize="autoResizeScreen()" onload="autoResizeScreen()">
|
||||
<iframe name="frameMain" id="frameMain" src ="../users/usersInit" width="100%" height="200" frameborder="0">
|
||||
<p>Your browser does not support iframes.</p>
|
||||
</iframe>
|
||||
</body>
|
||||
<script>
|
||||
oClientWinSize = getClientWindowSize();
|
||||
h = getStyle(document.getElementById('pm_menu'),'top');
|
||||
h = h.replace("px", "");
|
||||
h = parseInt(h) + 18;
|
||||
if ( document.getElementById('pm_submenu') )
|
||||
document.getElementById('pm_submenu').style.display = 'none';
|
||||
document.documentElement.style.overflowY = 'hidden';
|
||||
function autoResizeScreen()
|
||||
{
|
||||
oCasesFrame = document.getElementById('frameMain');
|
||||
oClientWinSize = getClientWindowSize();
|
||||
height = oClientWinSize.height - 105;
|
||||
oCasesFrame.style.height = height;
|
||||
}
|
||||
function getStyle(targetElement,styleProp)
|
||||
{
|
||||
if (targetElement) {
|
||||
if (targetElement.currentStyle) return targetElement.currentStyle[styleProp];
|
||||
else if (window.getComputedStyle) return document.defaultView.getComputedStyle(targetElement,null).getPropertyValue(styleProp);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
20
workflow/engine/templates/users/usersReload.php
Normal file
20
workflow/engine/templates/users/usersReload.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<html>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<body onresize="autoResizeScreen()" onload="autoResizeScreen()">
|
||||
<iframe name="frameMain" id="frameMain" src ="../users/usersInit" width="100%" height="200" frameborder="0" style >
|
||||
<p>Your browser does not support iframes.</p>
|
||||
</iframe>
|
||||
</body>
|
||||
<script>
|
||||
function autoResizeScreen() {
|
||||
oCasesFrame = document.getElementById('frameMain');
|
||||
oClientWinSize = getClientWindowSize();
|
||||
height = oClientWinSize.height-5;
|
||||
oCasesFrame.style.height = height;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user