BUG 0000 BUG 0000 User Inbox Simplified (second commit)
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
require_once 'classes/model/om/BaseGroupUser.php';
|
||||
require_once 'classes/model/Content.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/Groupwf.php';
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'GROUP_USER' table.
|
||||
@@ -45,7 +46,7 @@ class GroupUser extends BaseGroupUser {
|
||||
* Create the application document registry
|
||||
* @param array $aData
|
||||
* @return string
|
||||
**/
|
||||
*/
|
||||
public function create($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection(GroupUserPeer::DATABASE_NAME);
|
||||
@@ -78,7 +79,7 @@ class GroupUser extends BaseGroupUser {
|
||||
* @param string $sGrpUid
|
||||
* @param string $sUserUid
|
||||
* @return string
|
||||
**/
|
||||
*/
|
||||
public function remove($sGrpUid, $sUserUid)
|
||||
{
|
||||
$oConnection = Propel::getConnection(GroupUserPeer::DATABASE_NAME);
|
||||
@@ -101,7 +102,8 @@ class GroupUser extends BaseGroupUser {
|
||||
}
|
||||
}
|
||||
|
||||
function getCountAllUsersByGroup(){
|
||||
function getCountAllUsersByGroup()
|
||||
{
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(GroupUserPeer::GRP_UID);
|
||||
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
|
||||
@@ -118,4 +120,28 @@ class GroupUser extends BaseGroupUser {
|
||||
return $aRows;
|
||||
}
|
||||
|
||||
function getAllUserGroups($usrUid)
|
||||
{
|
||||
$oCriteria = new Criteria('workflow');
|
||||
// $oCriteria->addSelectColumn(GroupUserPeer::GRP_UID);
|
||||
// $oCriteria->addSelectColumn('COUNT(*) AS CNT');
|
||||
// $oCriteria->addJoin(GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::INNER_JOIN);
|
||||
$oCriteria->add(GroupUserPeer::USR_UID, $usrUid);
|
||||
//$oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
|
||||
//$oCriteria->addGroupByColumn(GroupUserPeer::GRP_UID);
|
||||
$oDataset = GroupUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode (ResultSet::FETCHMODE_ASSOC);
|
||||
$g = new Groupwf();
|
||||
$rows = Array();
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
$grpRow = $g->load($row['GRP_UID']);
|
||||
$row = array_merge($row, $grpRow);
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
} // GroupUser
|
||||
|
||||
@@ -188,8 +188,11 @@ class UsersProperties extends BaseUsersProperties {
|
||||
}
|
||||
return $aErrors;
|
||||
}
|
||||
public function redirectTo($sUserUID, $sLanguage = 'en') {
|
||||
|
||||
public function redirectTo($sUserUID, $sLanguage = 'en')
|
||||
{
|
||||
global $RBAC;
|
||||
|
||||
//get the plugins, and check if there is redirectLogins
|
||||
//if yes, then redirect goes according his Role
|
||||
if ( class_exists('redirectDetail')) {
|
||||
@@ -209,6 +212,36 @@ class UsersProperties extends BaseUsersProperties {
|
||||
}
|
||||
//end plugin
|
||||
|
||||
/**
|
||||
* New feature - User Experience Redirector
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
*/
|
||||
require_once 'classes/model/Users.php';
|
||||
$u = UsersPeer::retrieveByPK($sUserUID);
|
||||
$uxType = $u->getUsrUx();
|
||||
|
||||
// find a group setting
|
||||
if ($uxType == '' || $uxType == 'NORMAL') {
|
||||
require_once 'classes/model/GroupUser.php';
|
||||
$gu = new GroupUser();
|
||||
$ugList = $gu->getAllUserGroups($sUserUID);
|
||||
|
||||
foreach ($ugList as $row) {
|
||||
if ($row['GRP_UX'] != 'NORMAL' && $row['GRP_UX'] != '') {
|
||||
$uxType = $row['GRP_UX'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch ($uxType) {
|
||||
case 'SIMPLIFIED':
|
||||
return '/sys' . SYS_SYS . '/' . $sLanguage . '/' . SYS_SKIN . '/' . 'home';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#New feature by Erik erik@colosa.com>
|
||||
#get user preferences for default redirect
|
||||
#verifying if it has any preferences on the configurations table
|
||||
|
||||
@@ -70,6 +70,8 @@ class GroupwfMapBuilder {
|
||||
|
||||
$tMap->addColumn('GRP_LDAP_DN', 'GrpLdapDn', 'string', CreoleTypes::VARCHAR, true, 255);
|
||||
|
||||
$tMap->addColumn('GRP_UX', 'GrpUx', 'string', CreoleTypes::VARCHAR, false, 128);
|
||||
|
||||
$tMap->addValidator('GRP_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE', 'Please select a valid status.');
|
||||
|
||||
$tMap->addValidator('GRP_STATUS', 'required', 'propel.validator.RequiredValidator', '', 'Application Document UID is required.');
|
||||
|
||||
@@ -114,6 +114,8 @@ class UsersMapBuilder {
|
||||
|
||||
$tMap->addColumn('USR_REPLACED_BY', 'UsrReplacedBy', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||
|
||||
$tMap->addColumn('USR_UX', 'UsrUx', 'string', CreoleTypes::VARCHAR, false, 128);
|
||||
|
||||
$tMap->addValidator('USR_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE|VACATION|CLOSED', 'Please select a valid type.');
|
||||
|
||||
$tMap->addValidator('USR_STATUS', 'required', 'propel.validator.RequiredValidator', '', 'Type is required.');
|
||||
|
||||
@@ -48,6 +48,13 @@ abstract class BaseGroupwf extends BaseObject implements Persistent {
|
||||
*/
|
||||
protected $grp_ldap_dn = '';
|
||||
|
||||
|
||||
/**
|
||||
* The value for the grp_ux field.
|
||||
* @var string
|
||||
*/
|
||||
protected $grp_ux = 'NORMAL';
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
@@ -95,6 +102,17 @@ abstract class BaseGroupwf extends BaseObject implements Persistent {
|
||||
return $this->grp_ldap_dn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [grp_ux] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGrpUx()
|
||||
{
|
||||
|
||||
return $this->grp_ux;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [grp_uid] column.
|
||||
*
|
||||
@@ -161,6 +179,28 @@ abstract class BaseGroupwf extends BaseObject implements Persistent {
|
||||
|
||||
} // setGrpLdapDn()
|
||||
|
||||
/**
|
||||
* Set the value of [grp_ux] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setGrpUx($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->grp_ux !== $v || $v === 'NORMAL') {
|
||||
$this->grp_ux = $v;
|
||||
$this->modifiedColumns[] = GroupwfPeer::GRP_UX;
|
||||
}
|
||||
|
||||
} // setGrpUx()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
@@ -184,12 +224,14 @@ abstract class BaseGroupwf extends BaseObject implements Persistent {
|
||||
|
||||
$this->grp_ldap_dn = $rs->getString($startcol + 2);
|
||||
|
||||
$this->grp_ux = $rs->getString($startcol + 3);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 3; // 3 = GroupwfPeer::NUM_COLUMNS - GroupwfPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 4; // 4 = GroupwfPeer::NUM_COLUMNS - GroupwfPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating Groupwf object", $e);
|
||||
@@ -401,6 +443,9 @@ abstract class BaseGroupwf extends BaseObject implements Persistent {
|
||||
case 2:
|
||||
return $this->getGrpLdapDn();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getGrpUx();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -424,6 +469,7 @@ abstract class BaseGroupwf extends BaseObject implements Persistent {
|
||||
$keys[0] => $this->getGrpUid(),
|
||||
$keys[1] => $this->getGrpStatus(),
|
||||
$keys[2] => $this->getGrpLdapDn(),
|
||||
$keys[3] => $this->getGrpUx(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
@@ -464,6 +510,9 @@ abstract class BaseGroupwf extends BaseObject implements Persistent {
|
||||
case 2:
|
||||
$this->setGrpLdapDn($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setGrpUx($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -490,6 +539,7 @@ abstract class BaseGroupwf extends BaseObject implements Persistent {
|
||||
if (array_key_exists($keys[0], $arr)) $this->setGrpUid($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setGrpStatus($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setGrpLdapDn($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setGrpUx($arr[$keys[3]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -504,6 +554,7 @@ abstract class BaseGroupwf extends BaseObject implements Persistent {
|
||||
if ($this->isColumnModified(GroupwfPeer::GRP_UID)) $criteria->add(GroupwfPeer::GRP_UID, $this->grp_uid);
|
||||
if ($this->isColumnModified(GroupwfPeer::GRP_STATUS)) $criteria->add(GroupwfPeer::GRP_STATUS, $this->grp_status);
|
||||
if ($this->isColumnModified(GroupwfPeer::GRP_LDAP_DN)) $criteria->add(GroupwfPeer::GRP_LDAP_DN, $this->grp_ldap_dn);
|
||||
if ($this->isColumnModified(GroupwfPeer::GRP_UX)) $criteria->add(GroupwfPeer::GRP_UX, $this->grp_ux);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -562,6 +613,8 @@ abstract class BaseGroupwf extends BaseObject implements Persistent {
|
||||
|
||||
$copyObj->setGrpLdapDn($this->grp_ldap_dn);
|
||||
|
||||
$copyObj->setGrpUx($this->grp_ux);
|
||||
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ abstract class BaseGroupwfPeer {
|
||||
const CLASS_DEFAULT = 'classes.model.Groupwf';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 3;
|
||||
const NUM_COLUMNS = 4;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
@@ -39,6 +39,9 @@ abstract class BaseGroupwfPeer {
|
||||
/** the column name for the GRP_LDAP_DN field */
|
||||
const GRP_LDAP_DN = 'GROUPWF.GRP_LDAP_DN';
|
||||
|
||||
/** the column name for the GRP_UX field */
|
||||
const GRP_UX = 'GROUPWF.GRP_UX';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
@@ -50,10 +53,10 @@ abstract class BaseGroupwfPeer {
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('GrpUid', 'GrpStatus', 'GrpLdapDn', ),
|
||||
BasePeer::TYPE_COLNAME => array (GroupwfPeer::GRP_UID, GroupwfPeer::GRP_STATUS, GroupwfPeer::GRP_LDAP_DN, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('GRP_UID', 'GRP_STATUS', 'GRP_LDAP_DN', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, )
|
||||
BasePeer::TYPE_PHPNAME => array ('GrpUid', 'GrpStatus', 'GrpLdapDn', 'GrpUx', ),
|
||||
BasePeer::TYPE_COLNAME => array (GroupwfPeer::GRP_UID, GroupwfPeer::GRP_STATUS, GroupwfPeer::GRP_LDAP_DN, GroupwfPeer::GRP_UX, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('GRP_UID', 'GRP_STATUS', 'GRP_LDAP_DN', 'GRP_UX', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -63,10 +66,10 @@ abstract class BaseGroupwfPeer {
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('GrpUid' => 0, 'GrpStatus' => 1, 'GrpLdapDn' => 2, ),
|
||||
BasePeer::TYPE_COLNAME => array (GroupwfPeer::GRP_UID => 0, GroupwfPeer::GRP_STATUS => 1, GroupwfPeer::GRP_LDAP_DN => 2, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('GRP_UID' => 0, 'GRP_STATUS' => 1, 'GRP_LDAP_DN' => 2, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, )
|
||||
BasePeer::TYPE_PHPNAME => array ('GrpUid' => 0, 'GrpStatus' => 1, 'GrpLdapDn' => 2, 'GrpUx' => 3, ),
|
||||
BasePeer::TYPE_COLNAME => array (GroupwfPeer::GRP_UID => 0, GroupwfPeer::GRP_STATUS => 1, GroupwfPeer::GRP_LDAP_DN => 2, GroupwfPeer::GRP_UX => 3, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('GRP_UID' => 0, 'GRP_STATUS' => 1, 'GRP_LDAP_DN' => 2, 'GRP_UX' => 3, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -173,6 +176,8 @@ abstract class BaseGroupwfPeer {
|
||||
|
||||
$criteria->addSelectColumn(GroupwfPeer::GRP_LDAP_DN);
|
||||
|
||||
$criteria->addSelectColumn(GroupwfPeer::GRP_UX);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(GROUPWF.GRP_UID)';
|
||||
|
||||
@@ -202,6 +202,13 @@ abstract class BaseUsers extends BaseObject implements Persistent {
|
||||
*/
|
||||
protected $usr_replaced_by = '';
|
||||
|
||||
|
||||
/**
|
||||
* The value for the usr_ux field.
|
||||
* @var string
|
||||
*/
|
||||
protected $usr_ux = 'NORMAL';
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
@@ -571,6 +578,17 @@ abstract class BaseUsers extends BaseObject implements Persistent {
|
||||
return $this->usr_replaced_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [usr_ux] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUsrUx()
|
||||
{
|
||||
|
||||
return $this->usr_ux;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [usr_uid] column.
|
||||
*
|
||||
@@ -1129,6 +1147,28 @@ abstract class BaseUsers extends BaseObject implements Persistent {
|
||||
|
||||
} // setUsrReplacedBy()
|
||||
|
||||
/**
|
||||
* Set the value of [usr_ux] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setUsrUx($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->usr_ux !== $v || $v === 'NORMAL') {
|
||||
$this->usr_ux = $v;
|
||||
$this->modifiedColumns[] = UsersPeer::USR_UX;
|
||||
}
|
||||
|
||||
} // setUsrUx()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
@@ -1196,12 +1236,14 @@ abstract class BaseUsers extends BaseObject implements Persistent {
|
||||
|
||||
$this->usr_replaced_by = $rs->getString($startcol + 24);
|
||||
|
||||
$this->usr_ux = $rs->getString($startcol + 25);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 25; // 25 = UsersPeer::NUM_COLUMNS - UsersPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 26; // 26 = UsersPeer::NUM_COLUMNS - UsersPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating Users object", $e);
|
||||
@@ -1479,6 +1521,9 @@ abstract class BaseUsers extends BaseObject implements Persistent {
|
||||
case 24:
|
||||
return $this->getUsrReplacedBy();
|
||||
break;
|
||||
case 25:
|
||||
return $this->getUsrUx();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -1524,6 +1569,7 @@ abstract class BaseUsers extends BaseObject implements Persistent {
|
||||
$keys[22] => $this->getUsrRole(),
|
||||
$keys[23] => $this->getUsrReportsTo(),
|
||||
$keys[24] => $this->getUsrReplacedBy(),
|
||||
$keys[25] => $this->getUsrUx(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
@@ -1630,6 +1676,9 @@ abstract class BaseUsers extends BaseObject implements Persistent {
|
||||
case 24:
|
||||
$this->setUsrReplacedBy($value);
|
||||
break;
|
||||
case 25:
|
||||
$this->setUsrUx($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -1678,6 +1727,7 @@ abstract class BaseUsers extends BaseObject implements Persistent {
|
||||
if (array_key_exists($keys[22], $arr)) $this->setUsrRole($arr[$keys[22]]);
|
||||
if (array_key_exists($keys[23], $arr)) $this->setUsrReportsTo($arr[$keys[23]]);
|
||||
if (array_key_exists($keys[24], $arr)) $this->setUsrReplacedBy($arr[$keys[24]]);
|
||||
if (array_key_exists($keys[25], $arr)) $this->setUsrUx($arr[$keys[25]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1714,6 +1764,7 @@ abstract class BaseUsers extends BaseObject implements Persistent {
|
||||
if ($this->isColumnModified(UsersPeer::USR_ROLE)) $criteria->add(UsersPeer::USR_ROLE, $this->usr_role);
|
||||
if ($this->isColumnModified(UsersPeer::USR_REPORTS_TO)) $criteria->add(UsersPeer::USR_REPORTS_TO, $this->usr_reports_to);
|
||||
if ($this->isColumnModified(UsersPeer::USR_REPLACED_BY)) $criteria->add(UsersPeer::USR_REPLACED_BY, $this->usr_replaced_by);
|
||||
if ($this->isColumnModified(UsersPeer::USR_UX)) $criteria->add(UsersPeer::USR_UX, $this->usr_ux);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1816,6 +1867,8 @@ abstract class BaseUsers extends BaseObject implements Persistent {
|
||||
|
||||
$copyObj->setUsrReplacedBy($this->usr_replaced_by);
|
||||
|
||||
$copyObj->setUsrUx($this->usr_ux);
|
||||
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ abstract class BaseUsersPeer {
|
||||
const CLASS_DEFAULT = 'classes.model.Users';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 25;
|
||||
const NUM_COLUMNS = 26;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
@@ -105,6 +105,9 @@ abstract class BaseUsersPeer {
|
||||
/** the column name for the USR_REPLACED_BY field */
|
||||
const USR_REPLACED_BY = 'USERS.USR_REPLACED_BY';
|
||||
|
||||
/** the column name for the USR_UX field */
|
||||
const USR_UX = 'USERS.USR_UX';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
@@ -116,10 +119,10 @@ abstract class BaseUsersPeer {
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('UsrUid', 'UsrUsername', 'UsrPassword', 'UsrFirstname', 'UsrLastname', 'UsrEmail', 'UsrDueDate', 'UsrCreateDate', 'UsrUpdateDate', 'UsrStatus', 'UsrCountry', 'UsrCity', 'UsrLocation', 'UsrAddress', 'UsrPhone', 'UsrFax', 'UsrCellular', 'UsrZipCode', 'DepUid', 'UsrPosition', 'UsrResume', 'UsrBirthday', 'UsrRole', 'UsrReportsTo', 'UsrReplacedBy', ),
|
||||
BasePeer::TYPE_COLNAME => array (UsersPeer::USR_UID, UsersPeer::USR_USERNAME, UsersPeer::USR_PASSWORD, UsersPeer::USR_FIRSTNAME, UsersPeer::USR_LASTNAME, UsersPeer::USR_EMAIL, UsersPeer::USR_DUE_DATE, UsersPeer::USR_CREATE_DATE, UsersPeer::USR_UPDATE_DATE, UsersPeer::USR_STATUS, UsersPeer::USR_COUNTRY, UsersPeer::USR_CITY, UsersPeer::USR_LOCATION, UsersPeer::USR_ADDRESS, UsersPeer::USR_PHONE, UsersPeer::USR_FAX, UsersPeer::USR_CELLULAR, UsersPeer::USR_ZIP_CODE, UsersPeer::DEP_UID, UsersPeer::USR_POSITION, UsersPeer::USR_RESUME, UsersPeer::USR_BIRTHDAY, UsersPeer::USR_ROLE, UsersPeer::USR_REPORTS_TO, UsersPeer::USR_REPLACED_BY, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('USR_UID', 'USR_USERNAME', 'USR_PASSWORD', 'USR_FIRSTNAME', 'USR_LASTNAME', 'USR_EMAIL', 'USR_DUE_DATE', 'USR_CREATE_DATE', 'USR_UPDATE_DATE', 'USR_STATUS', 'USR_COUNTRY', 'USR_CITY', 'USR_LOCATION', 'USR_ADDRESS', 'USR_PHONE', 'USR_FAX', 'USR_CELLULAR', 'USR_ZIP_CODE', 'DEP_UID', 'USR_POSITION', 'USR_RESUME', 'USR_BIRTHDAY', 'USR_ROLE', 'USR_REPORTS_TO', 'USR_REPLACED_BY', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, )
|
||||
BasePeer::TYPE_PHPNAME => array ('UsrUid', 'UsrUsername', 'UsrPassword', 'UsrFirstname', 'UsrLastname', 'UsrEmail', 'UsrDueDate', 'UsrCreateDate', 'UsrUpdateDate', 'UsrStatus', 'UsrCountry', 'UsrCity', 'UsrLocation', 'UsrAddress', 'UsrPhone', 'UsrFax', 'UsrCellular', 'UsrZipCode', 'DepUid', 'UsrPosition', 'UsrResume', 'UsrBirthday', 'UsrRole', 'UsrReportsTo', 'UsrReplacedBy', 'UsrUx', ),
|
||||
BasePeer::TYPE_COLNAME => array (UsersPeer::USR_UID, UsersPeer::USR_USERNAME, UsersPeer::USR_PASSWORD, UsersPeer::USR_FIRSTNAME, UsersPeer::USR_LASTNAME, UsersPeer::USR_EMAIL, UsersPeer::USR_DUE_DATE, UsersPeer::USR_CREATE_DATE, UsersPeer::USR_UPDATE_DATE, UsersPeer::USR_STATUS, UsersPeer::USR_COUNTRY, UsersPeer::USR_CITY, UsersPeer::USR_LOCATION, UsersPeer::USR_ADDRESS, UsersPeer::USR_PHONE, UsersPeer::USR_FAX, UsersPeer::USR_CELLULAR, UsersPeer::USR_ZIP_CODE, UsersPeer::DEP_UID, UsersPeer::USR_POSITION, UsersPeer::USR_RESUME, UsersPeer::USR_BIRTHDAY, UsersPeer::USR_ROLE, UsersPeer::USR_REPORTS_TO, UsersPeer::USR_REPLACED_BY, UsersPeer::USR_UX, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('USR_UID', 'USR_USERNAME', 'USR_PASSWORD', 'USR_FIRSTNAME', 'USR_LASTNAME', 'USR_EMAIL', 'USR_DUE_DATE', 'USR_CREATE_DATE', 'USR_UPDATE_DATE', 'USR_STATUS', 'USR_COUNTRY', 'USR_CITY', 'USR_LOCATION', 'USR_ADDRESS', 'USR_PHONE', 'USR_FAX', 'USR_CELLULAR', 'USR_ZIP_CODE', 'DEP_UID', 'USR_POSITION', 'USR_RESUME', 'USR_BIRTHDAY', 'USR_ROLE', 'USR_REPORTS_TO', 'USR_REPLACED_BY', 'USR_UX', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -129,10 +132,10 @@ abstract class BaseUsersPeer {
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('UsrUid' => 0, 'UsrUsername' => 1, 'UsrPassword' => 2, 'UsrFirstname' => 3, 'UsrLastname' => 4, 'UsrEmail' => 5, 'UsrDueDate' => 6, 'UsrCreateDate' => 7, 'UsrUpdateDate' => 8, 'UsrStatus' => 9, 'UsrCountry' => 10, 'UsrCity' => 11, 'UsrLocation' => 12, 'UsrAddress' => 13, 'UsrPhone' => 14, 'UsrFax' => 15, 'UsrCellular' => 16, 'UsrZipCode' => 17, 'DepUid' => 18, 'UsrPosition' => 19, 'UsrResume' => 20, 'UsrBirthday' => 21, 'UsrRole' => 22, 'UsrReportsTo' => 23, 'UsrReplacedBy' => 24, ),
|
||||
BasePeer::TYPE_COLNAME => array (UsersPeer::USR_UID => 0, UsersPeer::USR_USERNAME => 1, UsersPeer::USR_PASSWORD => 2, UsersPeer::USR_FIRSTNAME => 3, UsersPeer::USR_LASTNAME => 4, UsersPeer::USR_EMAIL => 5, UsersPeer::USR_DUE_DATE => 6, UsersPeer::USR_CREATE_DATE => 7, UsersPeer::USR_UPDATE_DATE => 8, UsersPeer::USR_STATUS => 9, UsersPeer::USR_COUNTRY => 10, UsersPeer::USR_CITY => 11, UsersPeer::USR_LOCATION => 12, UsersPeer::USR_ADDRESS => 13, UsersPeer::USR_PHONE => 14, UsersPeer::USR_FAX => 15, UsersPeer::USR_CELLULAR => 16, UsersPeer::USR_ZIP_CODE => 17, UsersPeer::DEP_UID => 18, UsersPeer::USR_POSITION => 19, UsersPeer::USR_RESUME => 20, UsersPeer::USR_BIRTHDAY => 21, UsersPeer::USR_ROLE => 22, UsersPeer::USR_REPORTS_TO => 23, UsersPeer::USR_REPLACED_BY => 24, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('USR_UID' => 0, 'USR_USERNAME' => 1, 'USR_PASSWORD' => 2, 'USR_FIRSTNAME' => 3, 'USR_LASTNAME' => 4, 'USR_EMAIL' => 5, 'USR_DUE_DATE' => 6, 'USR_CREATE_DATE' => 7, 'USR_UPDATE_DATE' => 8, 'USR_STATUS' => 9, 'USR_COUNTRY' => 10, 'USR_CITY' => 11, 'USR_LOCATION' => 12, 'USR_ADDRESS' => 13, 'USR_PHONE' => 14, 'USR_FAX' => 15, 'USR_CELLULAR' => 16, 'USR_ZIP_CODE' => 17, 'DEP_UID' => 18, 'USR_POSITION' => 19, 'USR_RESUME' => 20, 'USR_BIRTHDAY' => 21, 'USR_ROLE' => 22, 'USR_REPORTS_TO' => 23, 'USR_REPLACED_BY' => 24, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, )
|
||||
BasePeer::TYPE_PHPNAME => array ('UsrUid' => 0, 'UsrUsername' => 1, 'UsrPassword' => 2, 'UsrFirstname' => 3, 'UsrLastname' => 4, 'UsrEmail' => 5, 'UsrDueDate' => 6, 'UsrCreateDate' => 7, 'UsrUpdateDate' => 8, 'UsrStatus' => 9, 'UsrCountry' => 10, 'UsrCity' => 11, 'UsrLocation' => 12, 'UsrAddress' => 13, 'UsrPhone' => 14, 'UsrFax' => 15, 'UsrCellular' => 16, 'UsrZipCode' => 17, 'DepUid' => 18, 'UsrPosition' => 19, 'UsrResume' => 20, 'UsrBirthday' => 21, 'UsrRole' => 22, 'UsrReportsTo' => 23, 'UsrReplacedBy' => 24, 'UsrUx' => 25, ),
|
||||
BasePeer::TYPE_COLNAME => array (UsersPeer::USR_UID => 0, UsersPeer::USR_USERNAME => 1, UsersPeer::USR_PASSWORD => 2, UsersPeer::USR_FIRSTNAME => 3, UsersPeer::USR_LASTNAME => 4, UsersPeer::USR_EMAIL => 5, UsersPeer::USR_DUE_DATE => 6, UsersPeer::USR_CREATE_DATE => 7, UsersPeer::USR_UPDATE_DATE => 8, UsersPeer::USR_STATUS => 9, UsersPeer::USR_COUNTRY => 10, UsersPeer::USR_CITY => 11, UsersPeer::USR_LOCATION => 12, UsersPeer::USR_ADDRESS => 13, UsersPeer::USR_PHONE => 14, UsersPeer::USR_FAX => 15, UsersPeer::USR_CELLULAR => 16, UsersPeer::USR_ZIP_CODE => 17, UsersPeer::DEP_UID => 18, UsersPeer::USR_POSITION => 19, UsersPeer::USR_RESUME => 20, UsersPeer::USR_BIRTHDAY => 21, UsersPeer::USR_ROLE => 22, UsersPeer::USR_REPORTS_TO => 23, UsersPeer::USR_REPLACED_BY => 24, UsersPeer::USR_UX => 25, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('USR_UID' => 0, 'USR_USERNAME' => 1, 'USR_PASSWORD' => 2, 'USR_FIRSTNAME' => 3, 'USR_LASTNAME' => 4, 'USR_EMAIL' => 5, 'USR_DUE_DATE' => 6, 'USR_CREATE_DATE' => 7, 'USR_UPDATE_DATE' => 8, 'USR_STATUS' => 9, 'USR_COUNTRY' => 10, 'USR_CITY' => 11, 'USR_LOCATION' => 12, 'USR_ADDRESS' => 13, 'USR_PHONE' => 14, 'USR_FAX' => 15, 'USR_CELLULAR' => 16, 'USR_ZIP_CODE' => 17, 'DEP_UID' => 18, 'USR_POSITION' => 19, 'USR_RESUME' => 20, 'USR_BIRTHDAY' => 21, 'USR_ROLE' => 22, 'USR_REPORTS_TO' => 23, 'USR_REPLACED_BY' => 24, 'USR_UX' => 25, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -283,6 +286,8 @@ abstract class BaseUsersPeer {
|
||||
|
||||
$criteria->addSelectColumn(UsersPeer::USR_REPLACED_BY);
|
||||
|
||||
$criteria->addSelectColumn(UsersPeer::USR_UX);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(USERS.USR_UID)';
|
||||
|
||||
@@ -437,6 +437,7 @@
|
||||
<column name="GRP_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
||||
<column name="GRP_STATUS" type="CHAR" size="8" required="true" default="ACTIVE"/>
|
||||
<column name="GRP_LDAP_DN" type="VARCHAR" size="255" required="true" default=""/>
|
||||
<column name="GRP_UX" type="VARCHAR" size="128" default="NORMAL"/>
|
||||
<validator column="GRP_STATUS">
|
||||
<rule name="validValues" value="ACTIVE|INACTIVE" message="Please select a valid status."/>
|
||||
<rule name="required" message="Application Document UID is required."/>
|
||||
@@ -1389,6 +1390,7 @@
|
||||
<column name="USR_ROLE" type="VARCHAR" size="32" default="PROCESSMAKER_ADMIN"/>
|
||||
<column name="USR_REPORTS_TO" type="VARCHAR" size="32" default=""/>
|
||||
<column name="USR_REPLACED_BY" type="VARCHAR" size="32" default=""/>
|
||||
<column name="USR_UX" type="VARCHAR" size="128" default="NORMAL"/>
|
||||
<validator column="USR_STATUS">
|
||||
<rule name="validValues" value="ACTIVE|INACTIVE|VACATION|CLOSED" message="Please select a valid type."/>
|
||||
<rule name="required" message="Type is required."/>
|
||||
|
||||
@@ -1,29 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* pmTables controller
|
||||
* @author Douglas Medrano <douglas@colosa.com, douglas.medrano@live.com>
|
||||
* @New Calendar
|
||||
* Admin controller
|
||||
* @access public
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* UX - User experience
|
||||
*/
|
||||
|
||||
public function uxList()
|
||||
{
|
||||
$this->includeExtJS('admin/uxUsersList');
|
||||
//$this->setView('admin/calendarEdit');
|
||||
|
||||
//$this->setJSVar('fields',$fields);ç
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$this->setJSVar('CONFIG', $Config);
|
||||
$this->setJSVar('FORMATS',$c->getFormats());
|
||||
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* CALENDAR
|
||||
* getting default list
|
||||
* @param string $httpData->PRO_UID (opional)
|
||||
*/
|
||||
public function calendarEdit($httpData)
|
||||
{
|
||||
global $RBAC;
|
||||
//$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
||||
G::LoadClass('configuration');
|
||||
G::LoadClass('calendar');
|
||||
|
||||
$CalendarUid = str_replace ( '"', '', isset ( $_GET ['id'] ) ? $_GET ['id'] : G::GenerateUniqueID () );
|
||||
G::LoadClass ( 'calendar' );
|
||||
$calendarObj = new calendar ( );
|
||||
|
||||
if ((isset ( $_GET ['id'] )) && ($_GET ['id'] != "")) {
|
||||
$fields = $calendarObj->getCalendarInfoE ( $CalendarUid );
|
||||
$fields ['OLD_NAME'] = $fields['CALENDAR_NAME'];
|
||||
}
|
||||
if (! (isset ( $fields ['CALENDAR_UID'] ))) { //For a new Calendar
|
||||
if (!isset($fields['CALENDAR_UID'])) { //For a new Calendar
|
||||
$fields ['CALENDAR_UID'] = $CalendarUid;
|
||||
$fields ['OLD_NAME'] = '';
|
||||
|
||||
@@ -37,25 +61,18 @@ class Admin extends Controller
|
||||
$fields ['CALENDAR_NAME'] = G::LoadTranslation ( "ID_COPY_OF" ) . " " . $fields ['CALENDAR_NAME'];
|
||||
}
|
||||
|
||||
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('additionalTablesList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$this->includeExtJS('admin/calendarEdit');
|
||||
$this->setView('admin/calendarEdit');
|
||||
|
||||
$variableArray = array();
|
||||
$variableArray[0] = 'uno';
|
||||
$variableArray[1] = 'dos';
|
||||
|
||||
|
||||
$businessDayArray = array();
|
||||
for($i=0;$i<sizeof($fields['BUSINESS_DAY']);$i++) {
|
||||
$businessDayArray[$i] = $fields['BUSINESS_DAY'][$i+1];
|
||||
|
||||
}
|
||||
for($i=0;$i<sizeof($fields['BUSINESS_DAY']);$i++) {
|
||||
$businessDayArray[$i] = $fields['BUSINESS_DAY'][$i+1];
|
||||
}
|
||||
|
||||
$fields['BUSINESS_DAY'] = $businessDayArray;
|
||||
//validating if the calendar is new, it means that we don't have the $_GET array
|
||||
$fields['HOLIDAY']=(isset ( $_GET['id'] )&&$_GET['id']!='')?$fields['HOLIDAY']:array();
|
||||
|
||||
@@ -22,9 +22,55 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
class adminProxy extends HttpProxyController
|
||||
{
|
||||
function calendarSave() {
|
||||
function uxUserUpdate($httpData)
|
||||
{
|
||||
require_once 'classes/model/Users.php';
|
||||
$data = (array) json_decode($httpData->users);
|
||||
|
||||
$user = UsersPeer::retrieveByPK($data['USR_UID']);
|
||||
$user->setUsrUx($data['USR_UX']);
|
||||
$user->save();
|
||||
$row = $user->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
$uxList = self::getUxTypesList();
|
||||
$row['USR_UX'] = $uxList[$user->getUsrUx()];
|
||||
|
||||
return array('success' => true, 'message'=>'done', 'users'=>$row);
|
||||
}
|
||||
|
||||
function uxGroupUpdate($httpData)
|
||||
{
|
||||
require_once 'classes/model/Groupwf.php';
|
||||
$data = (array) json_decode($httpData->groups);
|
||||
|
||||
$group = GroupwfPeer::retrieveByPK($data['GRP_UID']);
|
||||
$group->setGrpUx($data['GRP_UX']);
|
||||
$group->save();
|
||||
|
||||
$g = new Groupwf();
|
||||
//$row = $group->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$row = $g->Load($group->getGrpUid());
|
||||
$row['CON_VALUE'] = $row['GRP_TITLE'];
|
||||
|
||||
$uxList = self::getUxTypesList();
|
||||
$row['GRP_UX'] = $uxList[$group->getGrpUx()];
|
||||
|
||||
return array('success' => true, 'message'=>'done', 'groups'=>$row);
|
||||
}
|
||||
|
||||
function getUxTypesList()
|
||||
{
|
||||
return Array(
|
||||
'NORMAL' => 'Normal',
|
||||
'SIMPLIFIED' => 'Simplified'
|
||||
);
|
||||
}
|
||||
|
||||
function calendarSave()
|
||||
{
|
||||
//{ $_POST['BUSINESS_DAY']
|
||||
$businessDayArray = G::json_decode($_POST['BUSINESS_DAY']);
|
||||
$businessDayFixArray = array();
|
||||
@@ -86,7 +132,7 @@ class adminProxy extends HttpProxyController
|
||||
|
||||
}// end testingOption function
|
||||
|
||||
/**
|
||||
/**
|
||||
* saving the authentication source data
|
||||
* @param object $params
|
||||
* @return array $data
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Application controller
|
||||
* Home controller
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
|
||||
* @inherits Controller
|
||||
* @access public
|
||||
@@ -15,13 +16,14 @@ class Home extends Controller
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$_SESSION['user_experience'] = 'simplified';
|
||||
|
||||
if (isset($_SESSION['USER_LOGGED']) && !empty($_SESSION['USER_LOGGED'])) {
|
||||
$this->userID = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : null;
|
||||
$this->userName = isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '';
|
||||
$this->userFullName = isset($_SESSION['USR_FULLNAME']) ? $_SESSION['USR_FULLNAME'] : '';
|
||||
$this->userRolName = isset($_SESSION['USR_ROLENAME']) ? $_SESSION['USR_ROLENAME'] : '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,14 +39,6 @@ class Home extends Controller
|
||||
$process = new Process();
|
||||
$case = new Cases();
|
||||
|
||||
/**
|
||||
* Getting the user's processes that can start
|
||||
*/
|
||||
|
||||
if (!$case->canStartCase($_SESSION ['USER_LOGGED'])) {
|
||||
//throw new Exception("User can not start a cases");
|
||||
}
|
||||
|
||||
//Get ProcessStatistics Info
|
||||
$start = 0;
|
||||
$limit = '';
|
||||
@@ -53,32 +47,16 @@ class Home extends Controller
|
||||
$processList = $case->getStartCasesPerType ( $_SESSION ['USER_LOGGED'], 'category' );
|
||||
unset($processList[0]);
|
||||
|
||||
//$processList = array();
|
||||
|
||||
// foreach ( $processListInitial as $key => $procInfo ) {
|
||||
// if (isset ( $procInfo ['pro_uid'] )) {
|
||||
// if (trim ( $procInfo ['cat'] ) == "")
|
||||
// $procInfo ['cat'] = "_OTHER_";
|
||||
// $processList [$procInfo ['catname']] [$procInfo ['value']] = $procInfo;
|
||||
// }
|
||||
// }
|
||||
//ksort($processList);
|
||||
|
||||
|
||||
|
||||
|
||||
//g::pr($processList); die;
|
||||
|
||||
|
||||
$this->setView('home/index');
|
||||
$this->setVar('usrUid', $this->userID);
|
||||
$this->setVar('userName', $this->userName);
|
||||
$this->setVar('processList', $processList);
|
||||
$this->setVar('canStartCase', $case->canStartCase($_SESSION ['USER_LOGGED']));
|
||||
|
||||
G::RenderPage('publish', 'mvc');
|
||||
}
|
||||
|
||||
public function init($httpData)
|
||||
public function appList($httpData)
|
||||
{
|
||||
require_once ( "classes/model/AppCacheView.php" );
|
||||
require_once ( "classes/model/Application.php" );
|
||||
@@ -98,11 +76,10 @@ class Home extends Controller
|
||||
/**
|
||||
* Getting the user's applications list
|
||||
*/
|
||||
|
||||
//TODO validate user id
|
||||
|
||||
|
||||
// getting user's cases on inbox
|
||||
|
||||
switch ($httpData->t) {
|
||||
case 'in':
|
||||
$criteria = $appCache->getToDoListCriteria($this->userID);
|
||||
@@ -115,16 +92,10 @@ class Home extends Controller
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//$criteriac = $oAppCache->getToDoCountCriteria($this->userID);
|
||||
|
||||
//$criteria->setLimit($limit);
|
||||
//$criteria->setOffset($start);
|
||||
|
||||
//$this->setView('home/index4');
|
||||
$this->setView('home/index2');
|
||||
|
||||
$criteria->addDescendingOrderByColumn(AppCacheViewPeer::APP_NUMBER);
|
||||
$dataset = AppCacheViewPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
@@ -161,7 +132,10 @@ class Home extends Controller
|
||||
$cases[] = $row;
|
||||
|
||||
}
|
||||
//g::pr($cases); die;
|
||||
|
||||
// settings html template
|
||||
$this->setView('home/appList');
|
||||
|
||||
// settings vars and rendering
|
||||
$this->setVar('cases', $cases);
|
||||
$this->setVar('title', $title);
|
||||
@@ -169,48 +143,6 @@ class Home extends Controller
|
||||
G::RenderPage('publish', 'mvc');
|
||||
}
|
||||
|
||||
/**
|
||||
* getting default list
|
||||
* @param string $httpData (opional)
|
||||
*/
|
||||
public function start($httpData)
|
||||
{
|
||||
$this->setView('home/index5');
|
||||
|
||||
//$this->setVar('id', $httpData->a);
|
||||
//$this->setVar('index', $httpData->i);
|
||||
$this->setVar('action', 'todo');
|
||||
|
||||
G::RenderPage('publish', 'mvc');
|
||||
}
|
||||
|
||||
public function iframe_3($httpData)
|
||||
{
|
||||
$this->setView('home/iframe_3');
|
||||
|
||||
//$this->setVar('id', $httpData->a);
|
||||
//$this->setVar('index', $httpData->i);
|
||||
$this->setVar('action', 'todo');
|
||||
|
||||
G::RenderPage('publish', 'mvc');
|
||||
}
|
||||
|
||||
public function iframe_4($httpData)
|
||||
{
|
||||
$this->setView('home/iframe_4');
|
||||
|
||||
//$this->setVar('id', $httpData->a);
|
||||
//$this->setVar('index', $httpData->i);
|
||||
$this->setVar('action', 'todo');
|
||||
|
||||
G::RenderPage('publish', 'mvc');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Private functions
|
||||
*/
|
||||
|
||||
public function startCase($httpData)
|
||||
{
|
||||
G::LoadClass('case');
|
||||
|
||||
@@ -211,6 +211,7 @@ CREATE TABLE `GROUPWF`
|
||||
`GRP_UID` VARCHAR(32) default '' NOT NULL,
|
||||
`GRP_STATUS` CHAR(8) default 'ACTIVE' NOT NULL,
|
||||
`GRP_LDAP_DN` VARCHAR(255) default '' NOT NULL,
|
||||
`GRP_UX` VARCHAR(128) default 'NORMAL',
|
||||
PRIMARY KEY (`GRP_UID`)
|
||||
)ENGINE=MyISAM DEFAULT CHARSET='utf8';
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -664,6 +665,7 @@ CREATE TABLE `USERS`
|
||||
`USR_ROLE` VARCHAR(32) default 'PROCESSMAKER_ADMIN',
|
||||
`USR_REPORTS_TO` VARCHAR(32) default '',
|
||||
`USR_REPLACED_BY` VARCHAR(32) default '',
|
||||
`USR_UX` VARCHAR(128) default 'NORMAL',
|
||||
PRIMARY KEY (`USR_UID`)
|
||||
)ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Users';
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -1391,14 +1393,8 @@ CREATE TABLE `DASHLET_INSTANCE`
|
||||
(
|
||||
`DAS_INS_UID` VARCHAR(32) default '' NOT NULL,
|
||||
`DAS_UID` VARCHAR(32) default '' NOT NULL,
|
||||
`DAS_INS_TYPE` VARCHAR(20) default '' NOT NULL,
|
||||
`DAS_INS_CONTEXT_TIME` VARCHAR(20) default '' NOT NULL,
|
||||
`DAS_INS_START_DATE` DATETIME,
|
||||
`DAS_INS_END_DATE` DATETIME,
|
||||
`DAS_INS_OWNER_TYPE` VARCHAR(20) default '' NOT NULL,
|
||||
`DAS_INS_OWNER_UID` VARCHAR(32) default '',
|
||||
`DAS_INS_PROCESSES` MEDIUMTEXT,
|
||||
`DAS_INS_TASKS` MEDIUMTEXT,
|
||||
`DAS_INS_ADDITIONAL_PROPERTIES` MEDIUMTEXT,
|
||||
`DAS_INS_CREATE_DATE` DATETIME NOT NULL,
|
||||
`DAS_INS_UPDATE_DATE` DATETIME,
|
||||
|
||||
@@ -79,3 +79,4 @@ if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('AUTHSOURCES', '../authSources/authSources_List', G::LoadTranslation('ID_AUTH_SOURCES'), '', '', 'users');
|
||||
}
|
||||
|
||||
$G_TMP_MENU->AddIdRawOption('UX', '../admin/uxList', 'User experience (UX)', '', '', 'users');
|
||||
@@ -27,16 +27,16 @@
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess('PM_CASES'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
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;
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
@@ -53,75 +53,75 @@ foreach ($_POST['form']['TASKS'] as $aValues){
|
||||
}
|
||||
|
||||
try {
|
||||
//load data
|
||||
$oCase = new Cases ();
|
||||
//warning: we are not using the result value of function thisIsTheCurrentUser, so I'm commenting to optimize speed.
|
||||
//$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
|
||||
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$appFields['APP_DATA'] = array_merge($appFields['APP_DATA'], G::getSystemConstants());
|
||||
//cleaning debug variables
|
||||
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array();
|
||||
//load data
|
||||
$oCase = new Cases ();
|
||||
//warning: we are not using the result value of function thisIsTheCurrentUser, so I'm commenting to optimize speed.
|
||||
//$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
|
||||
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$appFields['APP_DATA'] = array_merge($appFields['APP_DATA'], G::getSystemConstants());
|
||||
//cleaning debug variables
|
||||
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array();
|
||||
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'BEFORE');
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'BEFORE');
|
||||
|
||||
//if there are some triggers to execute
|
||||
if( sizeof($triggers) > 0) {
|
||||
//Execute triggers before derivation
|
||||
$appFields['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'BEFORE', $appFields['APP_DATA'] );
|
||||
//if there are some triggers to execute
|
||||
if( sizeof($triggers) > 0) {
|
||||
//Execute triggers before derivation
|
||||
$appFields['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'BEFORE', $appFields['APP_DATA'] );
|
||||
|
||||
//save trigger variables for debugger
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['NUM_TRIGGERS'] = sizeof($triggers);
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TIME'] = 'BEFORE';
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers);
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
//save trigger variables for debugger
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['NUM_TRIGGERS'] = sizeof($triggers);
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TIME'] = 'BEFORE';
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers);
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
|
||||
$appFields['DEL_INDEX'] = $_SESSION['INDEX'];
|
||||
$appFields['TAS_UID'] = $_SESSION['TASK'];
|
||||
$appFields['DEL_INDEX'] = $_SESSION['INDEX'];
|
||||
$appFields['TAS_UID'] = $_SESSION['TASK'];
|
||||
|
||||
$oCase->updateCase ( $_SESSION['APPLICATION'], $appFields); //Save data
|
||||
$oCase->updateCase ( $_SESSION['APPLICATION'], $appFields); //Save data
|
||||
|
||||
//derivate case
|
||||
$oDerivation = new Derivation();
|
||||
$aCurrentDerivation = array(
|
||||
'APP_UID' => $_SESSION['APPLICATION'],
|
||||
'DEL_INDEX' => $_SESSION['INDEX'],
|
||||
'APP_STATUS' => $sStatus,
|
||||
'TAS_UID' => $_SESSION['TASK'],
|
||||
'ROU_TYPE' => $_POST['form']['ROU_TYPE']
|
||||
);
|
||||
//derivate case
|
||||
$oDerivation = new Derivation();
|
||||
$aCurrentDerivation = array(
|
||||
'APP_UID' => $_SESSION['APPLICATION'],
|
||||
'DEL_INDEX' => $_SESSION['INDEX'],
|
||||
'APP_STATUS' => $sStatus,
|
||||
'TAS_UID' => $_SESSION['TASK'],
|
||||
'ROU_TYPE' => $_POST['form']['ROU_TYPE']
|
||||
);
|
||||
|
||||
$oDerivation->derivate( $aCurrentDerivation, $_POST['form']['TASKS'] );
|
||||
$oDerivation->derivate( $aCurrentDerivation, $_POST['form']['TASKS'] );
|
||||
|
||||
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] ); //refresh appFields, because in derivations should change some values
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'AFTER'); //load the triggers after derivation
|
||||
if( sizeof($triggers) > 0 ) {
|
||||
$appFields['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'AFTER', $appFields['APP_DATA'] ); //Execute triggers after derivation
|
||||
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] ); //refresh appFields, because in derivations should change some values
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'AFTER'); //load the triggers after derivation
|
||||
if( sizeof($triggers) > 0 ) {
|
||||
$appFields['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'AFTER', $appFields['APP_DATA'] ); //Execute triggers after derivation
|
||||
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['NUM_TRIGGERS'] = sizeof($triggers);
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = 'AFTER';
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers);
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
$oCase->updateCase ( $_SESSION['APPLICATION'], $appFields);
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['NUM_TRIGGERS'] = sizeof($triggers);
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = 'AFTER';
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers);
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
$oCase->updateCase ( $_SESSION['APPLICATION'], $appFields);
|
||||
|
||||
// Send notifications - Start
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load($_SESSION['USER_LOGGED']);
|
||||
$sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '"';
|
||||
try {
|
||||
$oCase->sendNotifications($_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromName);
|
||||
} catch(Exception $e){
|
||||
G::SendTemporalMessage(G::loadTranslation('ID_NOTIFICATION_ERROR').' - '. $e->getMessage(), 'warning', 'string', null, '100%');
|
||||
}
|
||||
// Send notifications - End
|
||||
// Send notifications - Start
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load($_SESSION['USER_LOGGED']);
|
||||
$sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '"';
|
||||
try {
|
||||
$oCase->sendNotifications($_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromName);
|
||||
} catch(Exception $e){
|
||||
G::SendTemporalMessage(G::loadTranslation('ID_NOTIFICATION_ERROR').' - '. $e->getMessage(), 'warning', 'string', null, '100%');
|
||||
}
|
||||
// Send notifications - End
|
||||
|
||||
// Events - Start
|
||||
$oEvent = new Event();
|
||||
// Events - Start
|
||||
$oEvent = new Event();
|
||||
|
||||
$oEvent->closeAppEvents($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']);
|
||||
$oEvent->closeAppEvents($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']);
|
||||
$oCurrentAppDel = AppDelegationPeer::retrieveByPk($_SESSION['APPLICATION'], $_SESSION['INDEX']+1 );
|
||||
$multipleDelegation = false;
|
||||
// check if there are multiple derivations
|
||||
@@ -143,20 +143,31 @@ try {
|
||||
}
|
||||
}
|
||||
}
|
||||
//Events - End
|
||||
//Events - End
|
||||
$debuggerAvailable = true;
|
||||
|
||||
$aNextStep['PAGE'] = 'casesListExtJsRedirector';
|
||||
if( isset($_SESSION['PMDEBUGGER']) && $_SESSION['PMDEBUGGER'] ){
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
G::header('location: ' . 'cases_Step?' .'breakpoint=triggerdebug');
|
||||
} else {
|
||||
G::header('location: casesListExtJsRedirector');
|
||||
}
|
||||
if (isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'simplified') {
|
||||
$aNextStep['PAGE'] = '../home/appList';
|
||||
$debuggerAvailable = false;
|
||||
}
|
||||
else {
|
||||
$aNextStep['PAGE'] = 'casesListExtJsRedirector';
|
||||
}
|
||||
|
||||
if (isset($_SESSION['PMDEBUGGER']) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
$loc = 'cases_Step?' .'breakpoint=triggerdebug';
|
||||
}
|
||||
else {
|
||||
$loc = $aNextStep['PAGE'];
|
||||
}
|
||||
|
||||
G::header("location: $loc");
|
||||
}
|
||||
catch ( Exception $e ){
|
||||
$aMessage = array();
|
||||
$aMessage['MESSAGE'] = $e->getMessage() . '<br>'.$e->getTraceAsString();
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
catch ( Exception $e ) {
|
||||
$aMessage = array();
|
||||
$aMessage['MESSAGE'] = $e->getMessage() . '<br>'.$e->getTraceAsString();
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank');
|
||||
}
|
||||
|
||||
@@ -234,11 +234,16 @@ try {
|
||||
G::header ( 'location: ' . $_SERVER ['HTTP_REFERER'] );
|
||||
die ();
|
||||
}
|
||||
|
||||
$_SESSION ['STEP_POSITION'] = $aNextStep ['POSITION'];
|
||||
|
||||
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep ['PAGE'];
|
||||
$debuggerAvailable = true;
|
||||
|
||||
if ($trigger_debug_session) {
|
||||
if (isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'simplified') {
|
||||
$debuggerAvailable = false;
|
||||
}
|
||||
|
||||
if ($trigger_debug_session && $debuggerAvailable) {
|
||||
$_SESSION ['TRIGGER_DEBUG'] ['BREAKPAGE'] = $aNextStep ['PAGE'];
|
||||
$aNextStep ['PAGE'] = $aNextStep ['PAGE'] . '&breakpoint=triggerdebug';
|
||||
}
|
||||
|
||||
@@ -53,5 +53,7 @@
|
||||
$oHeadPublisher->assign( 'defaultOption', $defaultOption); // user menu permissions
|
||||
$oHeadPublisher->assign( '_nodeId', isset($confDefaultOption)?$confDefaultOption:'PM_USERS'); // user menu permissions
|
||||
|
||||
$_SESSION['user_experience'] = 'normal';
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -122,6 +122,7 @@ switch ($_POST['action'])
|
||||
|
||||
$oCriteria->addSelectColumn(GroupwfPeer::GRP_UID);
|
||||
$oCriteria->addSelectColumn(GroupwfPeer::GRP_STATUS);
|
||||
$oCriteria->addSelectColumn(GroupwfPeer::GRP_UX);
|
||||
$oCriteria->addSelectColumn(ContentPeer::CON_VALUE);
|
||||
$oCriteria->addAsColumn('GRP_TASKS', 0);
|
||||
$oCriteria->addAsColumn('GRP_USERS', 0);
|
||||
@@ -143,13 +144,18 @@ switch ($_POST['action'])
|
||||
$members = new GroupUser();
|
||||
$aMembers = $members->getCountAllUsersByGroup();
|
||||
|
||||
require_once PATH_CONTROLLERS . 'adminProxy.php';
|
||||
$uxList = adminProxy::getUxTypesList();
|
||||
|
||||
$arrData = Array();
|
||||
while ($oDataset->next()){
|
||||
$row = $oDataset->getRow();
|
||||
$row['GRP_TASKS'] = isset($aTask[$row['GRP_UID']]) ? $aTask[$row['GRP_UID']] : 0;
|
||||
$row['GRP_USERS'] = isset($aMembers[$row['GRP_UID']]) ? $aMembers[$row['GRP_UID']] : 0;
|
||||
$group = GroupwfPeer::retrieveByPK($row['GRP_UID']);
|
||||
$row['CON_VALUE']= $group->getGrpTitle();
|
||||
$row['CON_VALUE'] = $group->getGrpTitle();
|
||||
$row['GRP_UX'] = isset($uxList[$row['GRP_UX']]) ? $uxList[$row['GRP_UX']] : $uxList['NORMAL'];
|
||||
|
||||
$arrData[] = $row;
|
||||
}
|
||||
|
||||
|
||||
@@ -354,6 +354,7 @@ try {
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_ROLE);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_DUE_DATE);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_STATUS);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UX);
|
||||
$oCriteria->addSelectColumn(UsersPeer::DEP_UID);
|
||||
$oCriteria->addAsColumn('LAST_LOGIN', 0);
|
||||
$oCriteria->addAsColumn('DEP_TITLE', 0);
|
||||
@@ -396,15 +397,20 @@ try {
|
||||
$aDepart = $Department->getAllDepartmentsByUser();
|
||||
$aAuthSources = $RBAC->getAllAuthSourcesByUser();
|
||||
|
||||
require_once PATH_CONTROLLERS . 'adminProxy.php';
|
||||
$uxList = adminProxy::getUxTypesList();
|
||||
|
||||
$rows = Array();
|
||||
while($oDataset->next()){
|
||||
$rows[] = $oDataset->getRow();
|
||||
$index = sizeof($rows) - 1;
|
||||
$rows[$index]['DUE_DATE_OK'] = (date('Y-m-d')>date('Y-m-d',strtotime($rows[$index]['USR_DUE_DATE'])))? 0 : 1;
|
||||
$rows[$index]['LAST_LOGIN'] = isset($aLogin[$rows[$index]['USR_UID']]) ? $aLogin[$rows[$index]['USR_UID']] : '';
|
||||
$rows[$index]['TOTAL_CASES'] = isset($aCases[$rows[$index]['USR_UID']]) ? $aCases[$rows[$index]['USR_UID']] : 0;
|
||||
$rows[$index]['DEP_TITLE'] = isset($aDepart[$rows[$index]['USR_UID']]) ? $aDepart[$rows[$index]['USR_UID']] : '';
|
||||
$rows[$index]['USR_AUTH_SOURCE'] = isset($aAuthSources[$rows[$index]['USR_UID']]) ? $aAuthSources[$rows[$index]['USR_UID']] : 'ProcessMaker (MYSQL)';
|
||||
$row = $oDataset->getRow();
|
||||
$row['DUE_DATE_OK'] = (date('Y-m-d')>date('Y-m-d',strtotime($row['USR_DUE_DATE'])))? 0 : 1;
|
||||
$row['LAST_LOGIN'] = isset($aLogin[$row['USR_UID']]) ? $aLogin[$row['USR_UID']] : '';
|
||||
$row['TOTAL_CASES'] = isset($aCases[$row['USR_UID']]) ? $aCases[$row['USR_UID']] : 0;
|
||||
$row['DEP_TITLE'] = isset($aDepart[$row['USR_UID']]) ? $aDepart[$row['USR_UID']] : '';
|
||||
$row['USR_UX'] = isset($uxList[$row['USR_UX']]) ? $uxList[$row['USR_UX']] : $uxList['NORMAL'];
|
||||
$row['USR_AUTH_SOURCE'] = isset($aAuthSources[$row['USR_UID']]) ? $aAuthSources[$row['USR_UID']] : 'ProcessMaker (MYSQL)';
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
echo '{users: '.G::json_encode($rows).', total_users: '.$totalRows.'}';
|
||||
break;
|
||||
|
||||
468
workflow/engine/templates/admin/uxUsersList.js
Executable file
468
workflow/engine/templates/admin/uxUsersList.js
Executable file
@@ -0,0 +1,468 @@
|
||||
/**
|
||||
* @author: Erik Amaru O. <erik@colosa.com>
|
||||
*/
|
||||
|
||||
var store;
|
||||
var cmodel;
|
||||
var usersGrid;
|
||||
var groupsGrid;
|
||||
var smodel;
|
||||
|
||||
var searchButton;
|
||||
var searchText;
|
||||
|
||||
|
||||
var user_admin = '00000000000000000000000000000001';
|
||||
var pageSize;
|
||||
var fullNameFormat;
|
||||
var dateFormat;
|
||||
|
||||
Ext.onReady(function(){
|
||||
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
||||
Ext.QuickTips.init();
|
||||
|
||||
fullNameFormat = CONFIG.fullNameFormat;
|
||||
dateFormat = CONFIG.dateFormat;
|
||||
pageSize = parseInt(CONFIG.pageSize);
|
||||
|
||||
searchButton = new Ext.Action({
|
||||
text: _('ID_SEARCH'),
|
||||
handler: DoSearch
|
||||
});
|
||||
|
||||
searchText = new Ext.form.TextField ({
|
||||
id: 'searchTxt',
|
||||
ctCls:'pm_search_text_field',
|
||||
allowBlank: true,
|
||||
width: 150,
|
||||
emptyText: _('ID_ENTER_SEARCH_TERM'),//'enter search term',
|
||||
listeners: {
|
||||
specialkey: function(f,e){
|
||||
if (e.getKey() == e.ENTER) {
|
||||
DoSearch();
|
||||
}
|
||||
},
|
||||
focus: function(f,e) {
|
||||
var row = usersGrid.getSelectionModel().getSelected();
|
||||
usersGrid.getSelectionModel().deselectRow(usersGrid.getStore().indexOf(row));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
clearTextButton = new Ext.Action({
|
||||
text: 'X',
|
||||
ctCls:'pm_search_x_button',
|
||||
handler: GridByDefault
|
||||
});
|
||||
|
||||
smodel = new Ext.grid.RowSelectionModel({
|
||||
singleSelect: true,
|
||||
listeners:{
|
||||
rowselect: function(sm){
|
||||
//editButton.enable();
|
||||
},
|
||||
rowdeselect: function(sm){
|
||||
//editButton.disable();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var reader = new Ext.data.JsonReader( {
|
||||
root: 'users',
|
||||
totalProperty: 'total_users',
|
||||
idProperty: 'USR_UID',
|
||||
fields : [
|
||||
{name : 'USR_UID'},
|
||||
{name : 'USR_USERNAME'},
|
||||
{name : 'USR_FIRSTNAME'},
|
||||
{name : 'USR_LASTNAME'},
|
||||
{name : 'USR_EMAIL'},
|
||||
{name : 'USR_ROLE'},
|
||||
{name : 'USR_DUE_DATE'},
|
||||
{name : 'DEP_TITLE'},
|
||||
{name : 'LAST_LOGIN'},
|
||||
{name : 'USR_STATUS'},
|
||||
{name : 'USR_UX'},
|
||||
{name : 'TOTAL_CASES',type:'int'},
|
||||
{name : 'DUE_DATE_OK'},
|
||||
{name : 'USR_AUTH_SOURCE'}
|
||||
]
|
||||
});
|
||||
|
||||
var proxy = new Ext.data.HttpProxy({
|
||||
api: {
|
||||
read : '../users/users_Ajax?function=usersList',
|
||||
//create : 'app.php/users/create',
|
||||
update: '../adminProxy/uxUserUpdate'//,
|
||||
//destroy: 'app.php/users/destroy'
|
||||
}
|
||||
});
|
||||
|
||||
// The new DataWriter component.
|
||||
var writer = new Ext.data.JsonWriter({
|
||||
encode: true,
|
||||
writeAllFields: false
|
||||
});
|
||||
|
||||
store = new Ext.data.GroupingStore( {
|
||||
// proxy: new Ext.data.HttpProxy({
|
||||
// url: '../users/users_Ajax?function=usersList'
|
||||
// }),
|
||||
proxy: proxy,
|
||||
reader: reader,
|
||||
writer: writer, // <-- plug a DataWriter into the store just as you would a Reader
|
||||
autoSave: true // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
|
||||
});
|
||||
|
||||
comboPageSize = new Ext.form.ComboBox({
|
||||
typeAhead : false,
|
||||
mode : 'local',
|
||||
triggerAction : 'all',
|
||||
store: new Ext.data.SimpleStore({
|
||||
fields: ['size'],
|
||||
data: [['20'],['30'],['40'],['50'],['100']],
|
||||
autoLoad: true
|
||||
}),
|
||||
valueField: 'size',
|
||||
displayField: 'size',
|
||||
width: 50,
|
||||
editable: false,
|
||||
listeners:{
|
||||
select: function(c,d,i){
|
||||
//UpdatePageConfig(d.data['size']);
|
||||
bbarpaging.pageSize = parseInt(d.data['size']);
|
||||
bbarpaging.moveFirst();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
comboPageSize.setValue(pageSize);
|
||||
|
||||
bbarpaging = new Ext.PagingToolbar({
|
||||
pageSize: pageSize,
|
||||
store: store,
|
||||
displayInfo: true,
|
||||
displayMsg: _('ID_GRID_PAGE_DISPLAYING_USERS_MESSAGE') + ' ',
|
||||
emptyMsg: _('ID_GRID_PAGE_NO_USERS_MESSAGE'),
|
||||
items: ['-',_('ID_PAGE_SIZE')+':',comboPageSize]
|
||||
});
|
||||
|
||||
cmodel = new Ext.grid.ColumnModel({
|
||||
columns: [
|
||||
{id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
|
||||
//{header: '', dataIndex: 'USR_UID', width: 30, align:'center', sortable: false, renderer: photo_user},
|
||||
{header: _('ID_USER_NAME'), dataIndex: 'USR_USERNAME', width: 90, hidden:false, align:'left'},
|
||||
{header: _('ID_FULL_NAME'), dataIndex: 'USR_USERNAME', width: 50, align:'left', renderer: full_name},
|
||||
{header: _('ID_ROLE'), dataIndex: 'USR_ROLE', width: 50, hidden:false, align:'left'},
|
||||
{header: _('ID_STATUS'), dataIndex: 'USR_STATUS', width: 50, hidden: true, align: 'center', renderer: render_status},
|
||||
{
|
||||
header: 'User experience',
|
||||
dataIndex: 'USR_UX',
|
||||
width: 50,
|
||||
editor: new Ext.form.ComboBox({
|
||||
listClass: 'x-combo-list-small',
|
||||
mode: 'local',
|
||||
displayField:'name',
|
||||
lazyRender: true,
|
||||
triggerAction: 'all',
|
||||
valueField:'id',
|
||||
editable: false,
|
||||
store: new Ext.data.ArrayStore({
|
||||
fields: ['id', 'name'],
|
||||
data : [['NORMAL', 'Normal'], ['SIMPLIFIED', 'Simplified']]
|
||||
}),
|
||||
listeners: {
|
||||
select: function(a, b) {
|
||||
var row = usersGrid.getSelectionModel().getSelected();
|
||||
role = row.get('USR_ROLE');
|
||||
//console.log(role)
|
||||
|
||||
if (role == 'PROCESSMAKER_ADMIN') {
|
||||
PMExt.warning(_('ID_ERROR'), 'You can\'t assign this User Experience UI for users that have PROCESSMAKER_ADMIN role.');
|
||||
this.setValue('NORMAL');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
usersGrid = new Ext.grid.EditorGridPanel({
|
||||
title: 'Users',
|
||||
//region: 'center',
|
||||
layout: 'fit',
|
||||
id: 'usersGrid',
|
||||
height:100,
|
||||
autoWidth : true,
|
||||
stateful : true,
|
||||
stateId : 'grid',
|
||||
enableColumnResize: true,
|
||||
enableHdMenu: true,
|
||||
frame:false,
|
||||
columnLines: false,
|
||||
viewConfig: {
|
||||
forceFit:true
|
||||
},
|
||||
clicksToEdit: 1,
|
||||
store: store,
|
||||
cm: cmodel,
|
||||
sm: smodel,
|
||||
tbar: [{xtype: 'tbfill'}, searchText,clearTextButton,searchButton],
|
||||
bbar: bbarpaging,
|
||||
listeners: {
|
||||
rowdblclick: function(){
|
||||
|
||||
}
|
||||
},
|
||||
view: new Ext.grid.GroupingView({
|
||||
forceFit:true,
|
||||
groupTextTpl: '{text}'
|
||||
})
|
||||
});
|
||||
|
||||
// GROUPS
|
||||
var proxyGroups = new Ext.data.HttpProxy({
|
||||
api: {
|
||||
read : '../groups/groups_Ajax?action=groupsList',
|
||||
//create : 'app.php/users/create',
|
||||
update: '../adminProxy/uxGroupUpdate'//,
|
||||
//destroy: 'app.php/users/destroy'
|
||||
}
|
||||
});
|
||||
|
||||
var readerGroups = new Ext.data.JsonReader( {
|
||||
root: 'groups',
|
||||
totalProperty: 'total_groups',
|
||||
idProperty: 'GRP_UID',
|
||||
fields : [
|
||||
{name : 'GRP_UID'},
|
||||
{name : 'GRP_STATUS'},
|
||||
{name : 'CON_VALUE'},
|
||||
{name : 'GRP_TASKS', type: 'int'},
|
||||
{name : 'GRP_USERS', type: 'int'},
|
||||
{name : 'GRP_UX'}
|
||||
]
|
||||
});
|
||||
|
||||
// The new DataWriter component.
|
||||
var writerGroups = new Ext.data.JsonWriter({
|
||||
encode: true,
|
||||
writeAllFields: false
|
||||
});
|
||||
|
||||
storeGroups = new Ext.data.GroupingStore( {
|
||||
// proxy: new Ext.data.HttpProxy({
|
||||
// url: '../groups/groups_Ajax?action=groupsList'
|
||||
// }),
|
||||
proxy: proxyGroups,
|
||||
reader: readerGroups,
|
||||
writer: writerGroups, // <-- plug a DataWriter into the store just as you would a Reader
|
||||
autoSave: true // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
|
||||
});
|
||||
|
||||
cmodelGroups = new Ext.grid.ColumnModel({
|
||||
viewConfig: {
|
||||
cls:"x-grid-empty",
|
||||
emptyText: (TRANSLATIONS.ID_NO_RECORDS_FOUND)
|
||||
}
|
||||
,
|
||||
columns: [
|
||||
{id:'GRP_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
|
||||
{header: _('ID_GROUP_NAME'), dataIndex: 'CON_VALUE', width: 100, align:'left'},
|
||||
{header: _('ID_STATUS'), dataIndex: 'GRP_STATUS', width: 100, align:'center', renderer: render_status},
|
||||
{
|
||||
header: 'User experience',
|
||||
dataIndex: 'GRP_UX',
|
||||
width: 50,
|
||||
editor: new Ext.form.ComboBox({
|
||||
listClass: 'x-combo-list-small',
|
||||
mode: 'local',
|
||||
displayField:'name',
|
||||
lazyRender: true,
|
||||
triggerAction: 'all',
|
||||
valueField:'id',
|
||||
editable: false,
|
||||
store: new Ext.data.ArrayStore({
|
||||
fields: ['id', 'name'],
|
||||
data : [['NORMAL', 'Normal'], ['SIMPLIFIED', 'Simplified']]
|
||||
})
|
||||
})
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
comboPageSizeGroups = new Ext.form.ComboBox({
|
||||
typeAhead : false,
|
||||
mode : 'local',
|
||||
triggerAction : 'all',
|
||||
store: new Ext.data.SimpleStore({
|
||||
fields: ['size'],
|
||||
data: [['20'],['30'],['40'],['50'],['100']],
|
||||
autoLoad: true
|
||||
}),
|
||||
valueField: 'size',
|
||||
displayField: 'size',
|
||||
width: 50,
|
||||
editable: false,
|
||||
listeners:{
|
||||
select: function(c,d,i){
|
||||
//UpdatePageConfig(d.data['size']);
|
||||
bbarpaging.pageSize = parseInt(d.data['size']);
|
||||
bbarpaging.moveFirst();
|
||||
}
|
||||
}
|
||||
});
|
||||
comboPageSizeGroups.setValue(pageSize);
|
||||
|
||||
bbarpagingGroups = new Ext.PagingToolbar({
|
||||
pageSize: pageSize,
|
||||
store: storeGroups,
|
||||
displayInfo: true,
|
||||
displayMsg: _('ID_GRID_PAGE_DISPLAYING_GROUPS_MESSAGE') + ' ',
|
||||
emptyMsg: _('ID_GRID_PAGE_NO_GROUPS_MESSAGE'),
|
||||
items: ['-',_('ID_PAGE_SIZE')+':',comboPageSizeGroups]
|
||||
});
|
||||
|
||||
var searchButtonGroups = new Ext.Action({
|
||||
text: _('ID_SEARCH'),
|
||||
handler: DoSearchGroups
|
||||
});
|
||||
|
||||
var searchTextGroups = new Ext.form.TextField ({
|
||||
id: 'searchTxtGroups',
|
||||
ctCls:'pm_search_text_field',
|
||||
allowBlank: true,
|
||||
width: 150,
|
||||
emptyText: _('ID_ENTER_SEARCH_TERM'),//'enter search term',
|
||||
listeners: {
|
||||
specialkey: function(f,e){
|
||||
if (e.getKey() == e.ENTER) {
|
||||
DoSearchGroups();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var clearTextButtonGroups = new Ext.Action({
|
||||
text: 'X',
|
||||
ctCls:'pm_search_x_button',
|
||||
handler: GridByDefaultGroups
|
||||
});
|
||||
|
||||
groupsGrid = new Ext.grid.EditorGridPanel({
|
||||
title : _('ID_GROUPS'),
|
||||
//region: 'center',
|
||||
layout: 'fit',
|
||||
id: 'groupsGrid',
|
||||
height:100,
|
||||
autoWidth : true,
|
||||
stateful : true,
|
||||
stateId : 'grid',
|
||||
enableColumnResize: true,
|
||||
enableHdMenu: true,
|
||||
frame:false,
|
||||
columnLines: false,
|
||||
viewConfig: {
|
||||
forceFit:true
|
||||
},
|
||||
clicksToEdit: 1,
|
||||
store: storeGroups,
|
||||
cm: cmodelGroups,
|
||||
//sm: smodel,
|
||||
tbar: [{xtype: 'tbfill'}, searchTextGroups,clearTextButtonGroups,searchButtonGroups],
|
||||
bbar: bbarpagingGroups,
|
||||
// listeners: {
|
||||
// rowdblclick: EditGroupWindow
|
||||
// },
|
||||
view: new Ext.grid.GroupingView({
|
||||
forceFit:true,
|
||||
groupTextTpl: '{text}',
|
||||
cls:"x-grid-empty",
|
||||
emptyText: _('ID_NO_RECORDS_FOUND')
|
||||
})
|
||||
});
|
||||
|
||||
store.load();
|
||||
storeGroups.load();
|
||||
|
||||
viewport = new Ext.Viewport({
|
||||
layout: 'fit',
|
||||
autoScroll: false,
|
||||
items: [{
|
||||
xtype: 'tabpanel',
|
||||
region: 'center',
|
||||
activeTab: 0,
|
||||
items : [
|
||||
usersGrid,
|
||||
groupsGrid
|
||||
]
|
||||
}]
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//Render Full Name
|
||||
full_name = function(v,x,s){
|
||||
return _FNF(v, s.data.USR_FIRSTNAME, s.data.USR_LASTNAME);
|
||||
};
|
||||
|
||||
//Render Status
|
||||
render_status = function(v){
|
||||
switch(v){
|
||||
case 'ACTIVE': return '<font color="green">' + _('ID_ACTIVE') + '</font>'; break;
|
||||
case 'INACTIVE': return '<font color="red">' + _('ID_INACTIVE') + '</font>';; break;
|
||||
case 'VACATION': return '<font color="blue">' + _('ID_VACATION') + '</font>';; break;
|
||||
}
|
||||
};
|
||||
|
||||
//Render Due Date
|
||||
render_duedate = function(v,x,s){
|
||||
if (s.data.DUE_DATE_OK)
|
||||
return _DF(v);
|
||||
else
|
||||
return '<font color="red">' + _DF(v) + '</font>';
|
||||
};
|
||||
|
||||
render_lastlogin = function(v){
|
||||
return _DF(v);
|
||||
};
|
||||
|
||||
//Load Grid By Default
|
||||
GridByDefault = function(){
|
||||
searchText.reset();
|
||||
usersGrid.store.load();
|
||||
};
|
||||
|
||||
//Do Search Function
|
||||
DoSearch = function(){
|
||||
usersGrid.store.load({params: {textFilter: searchText.getValue()}});
|
||||
};
|
||||
|
||||
GridByDefaultGroups = function(){
|
||||
searchText.reset();
|
||||
groupsGrid.store.load();
|
||||
};
|
||||
|
||||
//Do Search Function
|
||||
DoSearchGroups = function(){
|
||||
groupsGrid.store.load({params: {textFilter: Ext.getCmp('searchTxtGroups').getValue()}});
|
||||
};
|
||||
|
||||
|
||||
|
||||
//Update Page Size Configuration
|
||||
UpdatePageConfig = function(pageSize){
|
||||
Ext.Ajax.request({
|
||||
url: 'users_Ajax',
|
||||
params: {'function':'updatePageSize', size: pageSize}
|
||||
});
|
||||
};
|
||||
|
||||
//Update Authentication Source Filter
|
||||
UpdateAuthSource = function(index){
|
||||
searchText.reset();
|
||||
usersGrid.store.load({params: {auths: index}});
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes" />
|
||||
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" href="/js/jquery/css/esmothness/jquery-ui-1.8.17.custom.css" type="text/css">
|
||||
<link rel="stylesheet" href="/js/jquery/css/smoothness/jquery-ui-1.8.17.custom.css" type="text/css">
|
||||
<link rel="stylesheet" href="/css/simplified.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
|
||||
<script type="text/javascript" src="/js/jquery/jquery-1.7.1.min.js"></script>
|
||||
@@ -68,19 +68,19 @@
|
||||
|
||||
<ul class="nav primary-nav">
|
||||
<li class="account">
|
||||
<a class="menu user-actions" href="#" onclick="redirect('home/init?t=in')" title="My Inbox">
|
||||
<a class="menu user-actions" href="#" onclick="redirect('home/appList?t=in')" title="My Inbox">
|
||||
<img alt="A99679add21e8b0704ea5f0fb569572c_mini" src="/images/simplified/in-set-grey.png" />
|
||||
<!-- <span class="menu-label screen-name">new cases</span> -->
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="account">
|
||||
<a class="menu user-actions" href="#" onclick="redirect('home/init?t=draft')" title="My Drafts">
|
||||
<a class="menu user-actions" href="#" onclick="redirect('home/appList?t=draft')" title="My Drafts">
|
||||
<img alt="A99679add21e8b0704ea5f0fb569572c_mini" src="/images/simplified/folder-grey.png" />
|
||||
<!-- <span class="menu-label screen-name">new cases</span> -->
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{if $canStartCase neq false}
|
||||
<li class="account">
|
||||
<a class="menu user-actions" href="#">
|
||||
<img alt="A99679add21e8b0704ea5f0fb569572c_mini" src="/images/simplified/plus-set-grey.png" title="Start a new Application"/>
|
||||
@@ -95,7 +95,7 @@
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
{/if}
|
||||
</ul>
|
||||
|
||||
<ul class="nav secondary-nav">
|
||||
@@ -120,7 +120,7 @@
|
||||
<!-- end topbar -->
|
||||
</div>
|
||||
|
||||
<iframe id="iframex" name="iframex" src="home/init" width="100%" height="200" scrolling="yes" frameborder="0"></iframe>
|
||||
<iframe id="iframex" name="iframex" src="home/appList" width="100%" height="200" scrolling="yes" frameborder="0"></iframe>
|
||||
|
||||
|
||||
{literal}
|
||||
|
||||
Reference in New Issue
Block a user