Merged colosa/processmaker into master
This commit is contained in:
@@ -118,11 +118,17 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isset($proUid) && $proUid != "") {
|
if(isset($proUid) && $proUid != "") {
|
||||||
$valuesProcess['PRO_UID'] = $proUid;
|
G::LoadClass("processes");
|
||||||
$valuesProcess['PRO_UPDATE_DATE'] = date("Y-m-d H:i:s");
|
|
||||||
G::LoadClass('processes');
|
|
||||||
$infoProcess = new Processes();
|
$infoProcess = new Processes();
|
||||||
$resultProcess = $infoProcess->updateProcessRow($valuesProcess);
|
|
||||||
|
if (!in_array($_REQUEST["action"], array("load"))) {
|
||||||
|
$infoProcess->updateProcessRow(array(
|
||||||
|
"PRO_UID" => $proUid,
|
||||||
|
"PRO_UPDATE_DATE" => date("Y-m-d H:i:s")
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
$resultProcess = $infoProcess->getProcessRow($proUid);
|
$resultProcess = $infoProcess->getProcessRow($proUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,65 @@ use \DepartmentPeer;
|
|||||||
*/
|
*/
|
||||||
class Department
|
class Department
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Verify if exists the title of a Department
|
||||||
|
*
|
||||||
|
* @param string $departmentTitle Title
|
||||||
|
* @param string $departmentUidExclude Unique id of Department to exclude
|
||||||
|
*
|
||||||
|
* return bool Return true if exists the title of a Department, false otherwise
|
||||||
|
*/
|
||||||
|
public function existsTitle($departmentTitle, $departmentUidExclude = "")
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$delimiter = \DBAdapter::getStringDelimiter();
|
||||||
|
|
||||||
|
$criteria = new \Criteria("workflow");
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(\DepartmentPeer::DEP_UID);
|
||||||
|
|
||||||
|
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
|
||||||
|
|
||||||
|
$arrayCondition = array();
|
||||||
|
$arrayCondition[] = array(\DepartmentPeer::DEP_UID, "CT.CON_ID", \Criteria::EQUAL);
|
||||||
|
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "DEPO_TITLE" . $delimiter, \Criteria::EQUAL);
|
||||||
|
$arrayCondition[] = array("CT.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
|
||||||
|
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
|
||||||
|
|
||||||
|
if ($departmentUidExclude != "") {
|
||||||
|
$criteria->add(\DepartmentPeer::DEP_UID, $departmentUidExclude, \Criteria::NOT_EQUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
$criteria->add("CT.CON_VALUE", $departmentTitle, \Criteria::EQUAL);
|
||||||
|
|
||||||
|
$rsCriteria = \DepartmentPeer::doSelectRS($criteria);
|
||||||
|
|
||||||
|
return ($rsCriteria->next())? true : false;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify if exists the title of a Department
|
||||||
|
*
|
||||||
|
* @param string $departmentTitle Title
|
||||||
|
* @param string $fieldNameForException Field name for the exception
|
||||||
|
* @param string $departmentUidExclude Unique id of Department to exclude
|
||||||
|
*
|
||||||
|
* return void Throw exception if exists the title of a Department
|
||||||
|
*/
|
||||||
|
public function throwExceptionIfExistsTitle($departmentTitle, $fieldNameForException, $departmentUidExclude = "")
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if ($this->existsTitle($departmentTitle, $departmentUidExclude)) {
|
||||||
|
throw new \Exception(\G::LoadTranslation("ID_DEPARTMENT_TITLE_ALREADY_EXISTS", array($fieldNameForException, $departmentTitle)));
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get list for Departments
|
* Get list for Departments
|
||||||
*
|
*
|
||||||
@@ -99,25 +158,63 @@ class Department
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Put Assign User
|
* Assign User to Department
|
||||||
*
|
*
|
||||||
* @access public
|
* @param string $departmentUid Unique id of Department
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
* @param array $arrayData Data
|
||||||
* @copyright Colosa - Bolivia
|
|
||||||
*
|
*
|
||||||
* @return void
|
* return array Return data of the User assigned to Department
|
||||||
*/
|
*/
|
||||||
public function assignUser($dep_uid, $usr_uid)
|
public function assignUser($departmentUid, array $arrayData)
|
||||||
{
|
{
|
||||||
$dep_uid = Validator::depUid($dep_uid);
|
try {
|
||||||
$usr_uid = Validator::usrUid($usr_uid);
|
//Verify data
|
||||||
|
$process = new \ProcessMaker\BusinessModel\Process();
|
||||||
|
$validator = new \ProcessMaker\BusinessModel\Validator();
|
||||||
|
|
||||||
$dep = new \Department();
|
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
|
||||||
$dep->load($dep_uid);
|
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
|
||||||
$dep_manager = $dep->getDepManager();
|
|
||||||
$manager = ($dep_manager == '') ? true : false;
|
//Set data
|
||||||
$dep->addUserToDepartment( $dep_uid, $usr_uid, $manager, false );
|
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
|
||||||
$dep->updateDepartmentManager( $dep_uid );
|
|
||||||
|
unset($arrayData["DEP_UID"]);
|
||||||
|
|
||||||
|
//Set variables
|
||||||
|
$arrayUserFieldDefinition = array(
|
||||||
|
"DEP_UID" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "departmentUid"),
|
||||||
|
"USR_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "userUid")
|
||||||
|
);
|
||||||
|
|
||||||
|
$arrayUserFieldNameForException = array(
|
||||||
|
"departmentUid" => strtolower("DEP_UID"),
|
||||||
|
"userUid" => strtolower("USR_UID")
|
||||||
|
);
|
||||||
|
|
||||||
|
//Verify data
|
||||||
|
$departmentUid = \ProcessMaker\BusinessModel\Validator::depUid($departmentUid);
|
||||||
|
|
||||||
|
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $arrayUserFieldDefinition, $arrayUserFieldNameForException, true);
|
||||||
|
|
||||||
|
$process->throwExceptionIfNotExistsUser($arrayData["USR_UID"], $arrayUserFieldNameForException["userUid"]);
|
||||||
|
|
||||||
|
//Assign User
|
||||||
|
$department = new \Department();
|
||||||
|
|
||||||
|
$department->load($departmentUid);
|
||||||
|
|
||||||
|
$department->addUserToDepartment($departmentUid, $arrayData["USR_UID"], ($department->getDepManager() == "")? true : false, false);
|
||||||
|
$department->updateDepartmentManager($departmentUid);
|
||||||
|
|
||||||
|
//Return
|
||||||
|
$arrayData = array_merge(array("DEP_UID" => $departmentUid), $arrayData);
|
||||||
|
|
||||||
|
$arrayData = array_change_key_case($arrayData, CASE_LOWER);
|
||||||
|
|
||||||
|
return $arrayData;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -239,6 +336,11 @@ class Department
|
|||||||
Validator::isBoolean($create, '$create');
|
Validator::isBoolean($create, '$create');
|
||||||
|
|
||||||
$dep_data = array_change_key_case($dep_data, CASE_UPPER);
|
$dep_data = array_change_key_case($dep_data, CASE_UPPER);
|
||||||
|
|
||||||
|
if ($create) {
|
||||||
|
unset($dep_data["DEP_UID"]);
|
||||||
|
}
|
||||||
|
|
||||||
$oDepartment = new \Department();
|
$oDepartment = new \Department();
|
||||||
if (isset($dep_data['DEP_UID']) && $dep_data['DEP_UID'] != '') {
|
if (isset($dep_data['DEP_UID']) && $dep_data['DEP_UID'] != '') {
|
||||||
Validator::depUid($dep_data['DEP_UID']);
|
Validator::depUid($dep_data['DEP_UID']);
|
||||||
@@ -254,18 +356,21 @@ class Department
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$create) {
|
if (!$create) {
|
||||||
$dep_data['DEPO_TITLE'] = $dep_data['DEP_TITLE'];
|
if (isset($dep_data["DEP_TITLE"])) {
|
||||||
if (isset($dep_data['DEP_TITLE'])) {
|
$this->throwExceptionIfExistsTitle($dep_data["DEP_TITLE"], strtolower("DEP_TITLE"), $dep_data["DEP_UID"]);
|
||||||
Validator::depTitle($dep_data['DEP_TITLE'], $dep_data['DEP_UID']);
|
|
||||||
|
$dep_data["DEPO_TITLE"] = $dep_data["DEP_TITLE"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$oDepartment->update($dep_data);
|
$oDepartment->update($dep_data);
|
||||||
$oDepartment->updateDepartmentManager($dep_data['DEP_UID']);
|
$oDepartment->updateDepartmentManager($dep_data['DEP_UID']);
|
||||||
} else {
|
} else {
|
||||||
if (isset($dep_data['DEP_TITLE'])) {
|
if (isset($dep_data['DEP_TITLE'])) {
|
||||||
Validator::depTitle($dep_data['DEP_TITLE']);
|
$this->throwExceptionIfExistsTitle($dep_data["DEP_TITLE"], strtolower("DEP_TITLE"));
|
||||||
} else {
|
} else {
|
||||||
throw (new \Exception(\G::LoadTranslation("ID_FIELD_REQUIRED", array('dep_title'))));
|
throw (new \Exception(\G::LoadTranslation("ID_FIELD_REQUIRED", array('dep_title'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
$dep_uid = $oDepartment->create($dep_data);
|
$dep_uid = $oDepartment->create($dep_data);
|
||||||
$response = $this->getDepartment($dep_uid);
|
$response = $this->getDepartment($dep_uid);
|
||||||
return $response;
|
return $response;
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ class User
|
|||||||
if ($form['USR_REPLACED_BY'] != '') {
|
if ($form['USR_REPLACED_BY'] != '') {
|
||||||
$oReplacedBy = \UsersPeer::retrieveByPK($form['USR_REPLACED_BY']);
|
$oReplacedBy = \UsersPeer::retrieveByPK($form['USR_REPLACED_BY']);
|
||||||
if (is_null($oReplacedBy)) {
|
if (is_null($oReplacedBy)) {
|
||||||
throw new \Exception('usr_replaced_by:'.$form['USR_REPLACED_BY'].' '.\G::LoadTranslation('ID_AUTHENTICATION_SOURCE_INVALID'));
|
throw new \Exception(\G::LoadTranslation("ID_USER_DOES_NOT_EXIST", array(strtolower("USR_REPLACED_BY"), $form["USR_REPLACED_BY"])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,47 +35,6 @@ class Validator
|
|||||||
return $dep_uid;
|
return $dep_uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate dep_title
|
|
||||||
* @var string $dep_title. Name or Title for Departament
|
|
||||||
* @var string $dep_uid. Uid for Departament
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
||||||
* @copyright Colosa - Bolivia
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*
|
|
||||||
* @url GET
|
|
||||||
*/
|
|
||||||
static public function depTitle($dep_title, $dep_uid = '')
|
|
||||||
{
|
|
||||||
$dep_title = trim($dep_title);
|
|
||||||
if ($dep_title == '') {
|
|
||||||
throw (new \Exception(\G::LoadTranslation("ID_DEPARTMENT_NOT_EXIST", array('dep_title',''))));
|
|
||||||
}
|
|
||||||
|
|
||||||
$oCriteria = new \Criteria( 'workflow' );
|
|
||||||
$oCriteria->clearSelectColumns();
|
|
||||||
$oCriteria->addSelectColumn( \ContentPeer::CON_CATEGORY );
|
|
||||||
$oCriteria->addSelectColumn( \ContentPeer::CON_VALUE );
|
|
||||||
$oCriteria->addSelectColumn( \DepartmentPeer::DEP_PARENT );
|
|
||||||
$oCriteria->add( \ContentPeer::CON_CATEGORY, 'DEPO_TITLE' );
|
|
||||||
$oCriteria->addJoin( \ContentPeer::CON_ID, \DepartmentPeer::DEP_UID, \Criteria::LEFT_JOIN );
|
|
||||||
$oCriteria->add( \ContentPeer::CON_VALUE, $dep_title );
|
|
||||||
$oCriteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
|
||||||
if ($dep_uid != '') {
|
|
||||||
$oCriteria->add( \ContentPeer::CON_ID, $dep_uid, \Criteria::NOT_EQUAL );
|
|
||||||
}
|
|
||||||
|
|
||||||
$oDataset = \DepartmentPeer::doSelectRS( $oCriteria );
|
|
||||||
$oDataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
|
|
||||||
if ($oDataset->next()) {
|
|
||||||
throw (new \Exception(\G::LoadTranslation("ID_DEPARTMENT_NOT_EXIST", array('dep_title',$dep_title))));
|
|
||||||
}
|
|
||||||
return $dep_title;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate dep_status
|
* Validate dep_status
|
||||||
* @var string $dep_uid. Uid for Departament
|
* @var string $dep_uid. Uid for Departament
|
||||||
|
|||||||
@@ -80,25 +80,21 @@ class Department extends Api
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $dep_uid {@min 1}{@max 32}
|
* @url POST /:dep_uid/assign-user
|
||||||
* @param string $usr_uid {@min 1}{@max 32}
|
|
||||||
*
|
*
|
||||||
* @access public
|
* @param string $dep_uid {@min 32}{@max 32}
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
* @param array $request_data
|
||||||
* @copyright Colosa - Bolivia
|
|
||||||
*
|
*
|
||||||
* @return array
|
* @status 201
|
||||||
*
|
|
||||||
* @url PUT /:dep_uid/assign-user/:usr_uid
|
|
||||||
*/
|
*/
|
||||||
public function doPutAssignUser($dep_uid, $usr_uid)
|
public function doPostAssignUser($dep_uid, array $request_data)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oDepartment = new \ProcessMaker\BusinessModel\Department();
|
$department = new \ProcessMaker\BusinessModel\Department();
|
||||||
$response = $oDepartment->assignUser($dep_uid, $usr_uid);
|
|
||||||
return $response;
|
$arrayData = $department->assignUser($dep_uid, $request_data);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -401,225 +401,225 @@ Ext.onReady(function () {
|
|||||||
mode : 'local'
|
mode : 'local'
|
||||||
});
|
});
|
||||||
|
|
||||||
var informationFields = new Ext.form.FieldSet({
|
var informationFields = new Ext.form.FieldSet({
|
||||||
title : _('ID_PERSONAL_INFORMATION'),
|
title : _('ID_PERSONAL_INFORMATION'),
|
||||||
items : [
|
items : [
|
||||||
{
|
{
|
||||||
id : 'USR_FIRSTNAME',
|
id : 'USR_FIRSTNAME',
|
||||||
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_FIRSTNAME')) +'"> * </span>' + _('ID_FIRSTNAME'),
|
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_FIRSTNAME')) +'"> * </span>' + _('ID_FIRSTNAME'),
|
||||||
xtype : 'textfield',
|
xtype : 'textfield',
|
||||||
width : 260,
|
width : 260,
|
||||||
allowBlank : false
|
allowBlank : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id : 'USR_LASTNAME',
|
id : 'USR_LASTNAME',
|
||||||
fieldLabel : _('ID_LASTNAME'),
|
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_LASTNAME')) +'"> * </span>' + _('ID_LASTNAME'),
|
||||||
xtype : 'textfield',
|
xtype : 'textfield',
|
||||||
width : 260,
|
width : 260,
|
||||||
allowBlank : false
|
allowBlank : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id : 'USR_USERNAME',
|
id : 'USR_USERNAME',
|
||||||
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_USER_ID')) +'"> * </span>' + _('ID_USER_ID'),
|
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_USER_ID')) +'"> * </span>' + _('ID_USER_ID'),
|
||||||
xtype : 'textfield',
|
xtype : 'textfield',
|
||||||
width : 260,
|
width : 260,
|
||||||
allowBlank : false,
|
allowBlank : false,
|
||||||
hidden : (typeof EDITPROFILE != "undefined" && EDITPROFILE == 1)? true : false,
|
hidden : (typeof EDITPROFILE != "undefined" && EDITPROFILE == 1)? true : false,
|
||||||
listeners: {
|
listeners: {
|
||||||
blur : function(ob)
|
blur : function(ob)
|
||||||
{
|
{
|
||||||
// trim
|
// trim
|
||||||
this.value = this.getValue().replace(/^\s+|\s+$/g,"");
|
this.value = this.getValue().replace(/^\s+|\s+$/g,"");
|
||||||
document.getElementById('USR_USERNAME').value = this.getValue().replace(/^\s+|\s+$/g,"");
|
document.getElementById('USR_USERNAME').value = this.getValue().replace(/^\s+|\s+$/g,"");
|
||||||
|
|
||||||
Ext.getCmp('saveB').disable();
|
Ext.getCmp('saveB').disable();
|
||||||
Ext.getCmp('cancelB').disable();
|
Ext.getCmp('cancelB').disable();
|
||||||
|
|
||||||
var spanAjax = '<span style="font: 9px tahoma,arial,helvetica,sans-serif;">';
|
var spanAjax = '<span style="font: 9px tahoma,arial,helvetica,sans-serif;">';
|
||||||
var imageAjax = '<img width="13" height="13" border="0" src="/images/ajax-loader.gif">';
|
var imageAjax = '<img width="13" height="13" border="0" src="/images/ajax-loader.gif">';
|
||||||
var labelAjax = _('ID_USERNAME_TESTING');
|
var labelAjax = _('ID_USERNAME_TESTING');
|
||||||
|
|
||||||
Ext.getCmp('usernameReview').setText(spanAjax + imageAjax + labelAjax + '</span>', false);
|
Ext.getCmp('usernameReview').setText(spanAjax + imageAjax + labelAjax + '</span>', false);
|
||||||
Ext.getCmp('usernameReview').setVisible(true);
|
Ext.getCmp('usernameReview').setVisible(true);
|
||||||
|
|
||||||
usernameText = this.getValue();
|
usernameText = this.getValue();
|
||||||
|
|
||||||
validateUserName();
|
validateUserName();
|
||||||
|
|
||||||
Ext.getCmp('usernameReview').setVisible(true);
|
Ext.getCmp('usernameReview').setVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
xtype: 'label',
|
||||||
xtype: 'label',
|
fieldLabel: ' ',
|
||||||
fieldLabel: ' ',
|
id:'usernameReview',
|
||||||
id:'usernameReview',
|
width: 300,
|
||||||
width: 300,
|
labelSeparator: ''
|
||||||
labelSeparator: ''
|
},
|
||||||
},
|
{
|
||||||
{
|
id : 'USR_EMAIL',
|
||||||
id : 'USR_EMAIL',
|
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_EMAIL')) +'"> * </span>' + _('ID_EMAIL'),
|
||||||
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_EMAIL')) +'"> * </span>' + _('ID_EMAIL'),
|
vtype : 'email',
|
||||||
vtype : 'email',
|
xtype : 'textfield',
|
||||||
xtype : 'textfield',
|
width : 260,
|
||||||
width : 260,
|
allowBlank : false
|
||||||
allowBlank : false
|
},
|
||||||
},
|
{
|
||||||
{
|
xtype : 'textarea',
|
||||||
xtype : 'textarea',
|
name : 'USR_ADDRESS',
|
||||||
name : 'USR_ADDRESS',
|
fieldLabel : _('ID_ADDRESS'),
|
||||||
fieldLabel : _('ID_ADDRESS'),
|
labelSeparator : '',
|
||||||
labelSeparator : '',
|
height : 50,
|
||||||
height : 50,
|
width : 260
|
||||||
width : 260
|
},
|
||||||
},
|
{
|
||||||
{
|
id : 'USR_ZIP_CODE',
|
||||||
id : 'USR_ZIP_CODE',
|
fieldLabel : _('ID_ZIP_CODE'),
|
||||||
fieldLabel : _('ID_ZIP_CODE'),
|
xtype : 'textfield',
|
||||||
xtype : 'textfield',
|
|
||||||
width : 260
|
|
||||||
},
|
|
||||||
comboCountry,
|
|
||||||
comboRegion,
|
|
||||||
comboLocation,
|
|
||||||
{
|
|
||||||
id : 'USR_PHONE',
|
|
||||||
fieldLabel : _('ID_PHONE'),
|
|
||||||
xtype : 'textfield',
|
|
||||||
width : 260
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id : 'USR_POSITION',
|
|
||||||
fieldLabel : _('ID_POSITION'),
|
|
||||||
xtype : 'textfield',
|
|
||||||
width : 260
|
|
||||||
},
|
|
||||||
comboReplacedBy,
|
|
||||||
dateField,
|
|
||||||
comboCalendar,
|
|
||||||
comboStatus,
|
|
||||||
comboRole
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
var passwordFields = new Ext.form.FieldSet({
|
|
||||||
title : _('ID_CHANGE_PASSWORD'),
|
|
||||||
items : [
|
|
||||||
{
|
|
||||||
xtype : "textfield",
|
|
||||||
id : "currentPassword",
|
|
||||||
name : "currentPassword",
|
|
||||||
fieldLabel : _("ID_PASSWORD_CURRENT"),
|
|
||||||
inputType : "password",
|
|
||||||
hidden : (typeof EDITPROFILE != "undefined" && EDITPROFILE == 1)? false : true,
|
|
||||||
width : 260
|
width : 260
|
||||||
},
|
},
|
||||||
{
|
comboCountry,
|
||||||
id : 'USR_NEW_PASS',
|
comboRegion,
|
||||||
fieldLabel : _('ID_NEW_PASSWORD'),
|
comboLocation,
|
||||||
xtype : 'textfield',
|
{
|
||||||
inputType : 'password',
|
id : 'USR_PHONE',
|
||||||
width : 260,
|
fieldLabel : _('ID_PHONE'),
|
||||||
allowBlank : allowBlackStatus,
|
xtype : 'textfield',
|
||||||
listeners: {
|
width : 260
|
||||||
blur : function(ob)
|
},
|
||||||
{
|
{
|
||||||
Ext.getCmp('saveB').disable();
|
id : 'USR_POSITION',
|
||||||
Ext.getCmp('cancelB').disable();
|
fieldLabel : _('ID_POSITION'),
|
||||||
var spanAjax = '<span style="font: 9px tahoma,arial,helvetica,sans-serif;">';
|
xtype : 'textfield',
|
||||||
var imageAjax = '<img width="13" height="13" border="0" src="/images/ajax-loader.gif">';
|
width : 260
|
||||||
var labelAjax = _('ID_PASSWORD_TESTING');
|
},
|
||||||
|
comboReplacedBy,
|
||||||
|
dateField,
|
||||||
|
comboCalendar,
|
||||||
|
comboStatus,
|
||||||
|
comboRole
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
Ext.getCmp('passwordReview').setText(spanAjax + imageAjax + labelAjax + '</span>', false);
|
var passwordFields = new Ext.form.FieldSet({
|
||||||
Ext.getCmp('passwordReview').setVisible(true);
|
title : _('ID_CHANGE_PASSWORD'),
|
||||||
|
items : [
|
||||||
|
{
|
||||||
|
xtype : "textfield",
|
||||||
|
id : "currentPassword",
|
||||||
|
name : "currentPassword",
|
||||||
|
fieldLabel : _("ID_PASSWORD_CURRENT"),
|
||||||
|
inputType : "password",
|
||||||
|
hidden : (typeof EDITPROFILE != "undefined" && EDITPROFILE == 1)? false : true,
|
||||||
|
width : 260
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id : 'USR_NEW_PASS',
|
||||||
|
fieldLabel : MODE == 'edit' ? _('ID_NEW_PASSWORD') : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_NEW_PASSWORD')) +'"> * </span>' + _('ID_NEW_PASSWORD'),
|
||||||
|
xtype : 'textfield',
|
||||||
|
inputType : 'password',
|
||||||
|
width : 260,
|
||||||
|
allowBlank : allowBlackStatus,
|
||||||
|
listeners: {
|
||||||
|
blur : function(ob)
|
||||||
|
{
|
||||||
|
Ext.getCmp('saveB').disable();
|
||||||
|
Ext.getCmp('cancelB').disable();
|
||||||
|
var spanAjax = '<span style="font: 9px tahoma,arial,helvetica,sans-serif;">';
|
||||||
|
var imageAjax = '<img width="13" height="13" border="0" src="/images/ajax-loader.gif">';
|
||||||
|
var labelAjax = _('ID_PASSWORD_TESTING');
|
||||||
|
|
||||||
var passwordText = this.getValue();
|
Ext.getCmp('passwordReview').setText(spanAjax + imageAjax + labelAjax + '</span>', false);
|
||||||
|
Ext.getCmp('passwordReview').setVisible(true);
|
||||||
|
|
||||||
Ext.Ajax.request({
|
var passwordText = this.getValue();
|
||||||
url : 'usersAjax',
|
|
||||||
method:'POST',
|
|
||||||
params : {
|
|
||||||
'action' : 'testPassword',
|
|
||||||
'PASSWORD_TEXT' : passwordText
|
|
||||||
},
|
|
||||||
success: function(r,o){
|
|
||||||
var resp = Ext.util.JSON.decode(r.responseText);
|
|
||||||
|
|
||||||
if (resp.STATUS) {
|
Ext.Ajax.request({
|
||||||
flagPoliciesPassword = true;
|
url : 'usersAjax',
|
||||||
} else {
|
method:'POST',
|
||||||
flagPoliciesPassword = false;
|
params : {
|
||||||
|
'action' : 'testPassword',
|
||||||
|
'PASSWORD_TEXT' : passwordText
|
||||||
|
},
|
||||||
|
success: function(r,o){
|
||||||
|
var resp = Ext.util.JSON.decode(r.responseText);
|
||||||
|
|
||||||
|
if (resp.STATUS) {
|
||||||
|
flagPoliciesPassword = true;
|
||||||
|
} else {
|
||||||
|
flagPoliciesPassword = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ext.getCmp('passwordReview').setText(resp.DESCRIPTION, false);
|
||||||
|
Ext.getCmp('saveB').enable();
|
||||||
|
Ext.getCmp('cancelB').enable();
|
||||||
|
},
|
||||||
|
failure: function () {
|
||||||
|
Ext.MessageBox.show({
|
||||||
|
title: _('ID_ERROR'),
|
||||||
|
msg: _('ID_FAILED_STORE_DATA'),
|
||||||
|
buttons: Ext.MessageBox.OK,
|
||||||
|
animEl: 'mb9',
|
||||||
|
icon: Ext.MessageBox.ERROR
|
||||||
|
});
|
||||||
|
Ext.getCmp('saveB').enable();
|
||||||
|
Ext.getCmp('cancelB').enable();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Ext.getCmp('passwordReview').setText(resp.DESCRIPTION, false);
|
Ext.getCmp('passwordReview').setVisible(true);
|
||||||
Ext.getCmp('saveB').enable();
|
|
||||||
Ext.getCmp('cancelB').enable();
|
if (Ext.getCmp('USR_CNF_PASS').getValue() != '') {
|
||||||
},
|
userExecuteEvent(document.getElementById('USR_CNF_PASS'), 'blur');
|
||||||
failure: function () {
|
|
||||||
Ext.MessageBox.show({
|
|
||||||
title: _('ID_ERROR'),
|
|
||||||
msg: _('ID_FAILED_STORE_DATA'),
|
|
||||||
buttons: Ext.MessageBox.OK,
|
|
||||||
animEl: 'mb9',
|
|
||||||
icon: Ext.MessageBox.ERROR
|
|
||||||
});
|
|
||||||
Ext.getCmp('saveB').enable();
|
|
||||||
Ext.getCmp('cancelB').enable();
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
Ext.getCmp('passwordReview').setVisible(true);
|
|
||||||
|
|
||||||
if (Ext.getCmp('USR_CNF_PASS').getValue() != '') {
|
|
||||||
userExecuteEvent(document.getElementById('USR_CNF_PASS'), 'blur');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
xtype: 'label',
|
|
||||||
fieldLabel: ' ',
|
|
||||||
id:'passwordReview',
|
|
||||||
width: 300,
|
|
||||||
labelSeparator: ''
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id : 'USR_CNF_PASS',
|
|
||||||
fieldLabel : _('ID_CONFIRM_PASSWORD'),
|
|
||||||
xtype : 'textfield',
|
|
||||||
inputType : 'password',
|
|
||||||
width : 260,
|
|
||||||
allowBlank : allowBlackStatus,
|
|
||||||
listeners: {
|
|
||||||
blur : function(ob)
|
|
||||||
{
|
|
||||||
var passwordText = Ext.getCmp('USR_NEW_PASS').getValue();
|
|
||||||
var passwordConfirm = this.getValue();
|
|
||||||
|
|
||||||
if (passwordText != passwordConfirm) {
|
|
||||||
var spanErrorConfirm = '<span style="color: red; font: 9px tahoma,arial,helvetica,sans-serif;">';
|
|
||||||
var imageErrorConfirm = '<img width="13" height="13" border="0" src="/images/delete.png">';
|
|
||||||
var labelErrorConfirm = _('ID_NEW_PASS_SAME_OLD_PASS');
|
|
||||||
|
|
||||||
Ext.getCmp('passwordConfirm').setText(spanErrorConfirm + imageErrorConfirm + labelErrorConfirm + '</span>', false);
|
|
||||||
Ext.getCmp('passwordConfirm').setVisible(true);
|
|
||||||
} else {
|
|
||||||
Ext.getCmp('passwordConfirm').setVisible(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
xtype: 'label',
|
||||||
xtype: 'label',
|
fieldLabel: ' ',
|
||||||
fieldLabel: ' ',
|
id:'passwordReview',
|
||||||
id:'passwordConfirm',
|
width: 300,
|
||||||
width: 300,
|
labelSeparator: ''
|
||||||
labelSeparator: ''
|
},
|
||||||
}
|
{
|
||||||
|
id : 'USR_CNF_PASS',
|
||||||
|
fieldLabel : MODE == 'edit' ? _('ID_CONFIRM_PASSWORD') : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_CONFIRM_PASSWORD')) +'"> * </span>' + _('ID_CONFIRM_PASSWORD'),
|
||||||
|
xtype : 'textfield',
|
||||||
|
inputType : 'password',
|
||||||
|
width : 260,
|
||||||
|
allowBlank : allowBlackStatus,
|
||||||
|
listeners: {
|
||||||
|
blur : function(ob)
|
||||||
|
{
|
||||||
|
var passwordText = Ext.getCmp('USR_NEW_PASS').getValue();
|
||||||
|
var passwordConfirm = this.getValue();
|
||||||
|
|
||||||
]
|
if (passwordText != passwordConfirm) {
|
||||||
});
|
var spanErrorConfirm = '<span style="color: red; font: 9px tahoma,arial,helvetica,sans-serif;">';
|
||||||
|
var imageErrorConfirm = '<img width="13" height="13" border="0" src="/images/delete.png">';
|
||||||
|
var labelErrorConfirm = _('ID_NEW_PASS_SAME_OLD_PASS');
|
||||||
|
|
||||||
|
Ext.getCmp('passwordConfirm').setText(spanErrorConfirm + imageErrorConfirm + labelErrorConfirm + '</span>', false);
|
||||||
|
Ext.getCmp('passwordConfirm').setVisible(true);
|
||||||
|
} else {
|
||||||
|
Ext.getCmp('passwordConfirm').setVisible(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'label',
|
||||||
|
fieldLabel: ' ',
|
||||||
|
id:'passwordConfirm',
|
||||||
|
width: 300,
|
||||||
|
labelSeparator: ''
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
var accountOptions = new Ext.form.FieldSet({
|
var accountOptions = new Ext.form.FieldSet({
|
||||||
title: _('ID_ACCOUNT_OPTIONS'),
|
title: _('ID_ACCOUNT_OPTIONS'),
|
||||||
|
|||||||
@@ -10,16 +10,15 @@
|
|||||||
<en><![CDATA[New]]></en>
|
<en><![CDATA[New]]></en>
|
||||||
</MNU_ADD>
|
</MNU_ADD>
|
||||||
<PAGED_TABLE_ID type="private"/>
|
<PAGED_TABLE_ID type="private"/>
|
||||||
<PAGED_TABLE_FAST_SEARCH type="FastSearch" label=""/>
|
<PAGED_TABLE_FAST_SEARCH type="FastSearch" label="@G::LoadTranslation(ID_SEARCH)"/>
|
||||||
<MNU_FAST_SEARCH type="button" label="@G::LoadTranslation(ID_SEARCH)" colAlign="right" colWidth="50" onclick="@#PAGED_TABLE_ID.doFastSearch(getField('PAGED_TABLE_FAST_SEARCH',this.form).value);"/>
|
|
||||||
<JS type="javascript"><![CDATA[
|
<JS type="javascript"><![CDATA[
|
||||||
function $_GET(q,s) {
|
function $_GET(q,s) {
|
||||||
s = (s) ? s : self.location.search;
|
s = (s) ? s : self.location.search;
|
||||||
var re = new RegExp('&'+q+'=([^&]*)','i');
|
var re = new RegExp('&'+q+'=([^&]*)','i');
|
||||||
return (s=s.replace(/^\?/,'&').match(re)) ? s=s[1] : s='';
|
return (s=s.replace(/^\?/,'&').match(re)) ? s=s[1] : s='';
|
||||||
}
|
}
|
||||||
function newScheduler() {
|
function newScheduler() {
|
||||||
window.location = 'cases_Scheduler_New?PRO_UID='+$_GET('PRO_UID'); return false;
|
window.location = 'cases_Scheduler_New?PRO_UID='+$_GET('PRO_UID'); return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function casesSchedulerDelete(schUID,proUid) {
|
function casesSchedulerDelete(schUID,proUid) {
|
||||||
@@ -31,8 +30,8 @@ function casesSchedulerDelete(schUID,proUid) {
|
|||||||
|
|
||||||
function editCaseScheduler(SCH_UID,PRO_UID)
|
function editCaseScheduler(SCH_UID,PRO_UID)
|
||||||
{
|
{
|
||||||
window.location = 'cases_Scheduler_Edit?SCH_UID='+SCH_UID+'&PRO_UID='+PRO_UID;
|
window.location = 'cases_Scheduler_Edit?SCH_UID='+SCH_UID+'&PRO_UID='+PRO_UID;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
]]></JS>
|
]]></JS>
|
||||||
|
|||||||
Reference in New Issue
Block a user