@@ -60,6 +60,9 @@ function run_flush_cache($args, $opts)
|
||||
G::mk_dir($workspace->path . "/cache", 0777);
|
||||
G::rm_dir($workspace->path . "/cachefiles");
|
||||
G::mk_dir($workspace->path . "/cachefiles", 0777);
|
||||
if (file_exists($workspace->path.'/routes.php')) {
|
||||
unlink($workspace->path.'/routes.php');
|
||||
}
|
||||
echo "DONE" . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,6 +432,23 @@ class PMPlugin
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* callBack File on reassign
|
||||
*
|
||||
* @param string $callBackFile
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerOpenReassignCallback($callBackFile = '')
|
||||
{
|
||||
try {
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->registerOpenReassignCallback($callBackFile);
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class menuDetail
|
||||
@@ -788,4 +805,20 @@ class importCallBack
|
||||
$this->namespace = $namespace;
|
||||
$this->callBackFile = $callBackFile;
|
||||
}
|
||||
}
|
||||
|
||||
class OpenReassignCallback
|
||||
{
|
||||
public $callBackFile;
|
||||
|
||||
/**
|
||||
* This function is the constructor of the cronFile class
|
||||
* param string $namespace
|
||||
* param string $callBackFile
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($callBackFile)
|
||||
{
|
||||
$this->callBackFile = $callBackFile;
|
||||
}
|
||||
}
|
||||
@@ -104,6 +104,7 @@ class PMPluginRegistry
|
||||
private $_arrayDesignerMenu = array();
|
||||
private $_aMenuOptionsToReplace = array ();
|
||||
private $_aImportProcessCallbackFile = array ();
|
||||
private $_aOpenReassignCallback = array ();
|
||||
|
||||
/**
|
||||
* Registry a plugin javascript to include with js core at same runtime
|
||||
@@ -413,7 +414,10 @@ class PMPluginRegistry
|
||||
if(sizeof( $this->_aImportProcessCallbackFile )){
|
||||
unset( $this->_aImportProcessCallbackFile );
|
||||
}
|
||||
|
||||
|
||||
if(sizeof( $this->_aOpenReassignCallback )){
|
||||
unset( $this->_aOpenReassignCallback );
|
||||
}
|
||||
//unregistering javascripts from this plugin
|
||||
$this->unregisterJavascripts( $sNamespace );
|
||||
//unregistering rest services from this plugin
|
||||
@@ -1748,5 +1752,42 @@ class PMPluginRegistry
|
||||
{
|
||||
return $this->_aImportProcessCallbackFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a callBackFile in the singleton
|
||||
*
|
||||
* @param string $callBackFile
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerOpenReassignCallback ($callBackFile)
|
||||
{
|
||||
try {
|
||||
$found = false;
|
||||
foreach ($this->_aOpenReassignCallback as $row => $detail) {
|
||||
if ($callBackFile == $detail->callBackFile) {
|
||||
$detail->callBackFile = $callBackFile;
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$callBackFile = new OpenReassignCallback( $callBackFile );
|
||||
$this->_aOpenReassignCallback[] = $callBackFile;
|
||||
}
|
||||
} catch(Excepton $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all callBackFiles registered
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOpenReassignCallback()
|
||||
{
|
||||
return $this->_aOpenReassignCallback;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ class System
|
||||
'error_reporting' => "",
|
||||
'display_errors' => 'On',
|
||||
'system_utc_time_zone' => 0,
|
||||
'server_protocol' => '',
|
||||
'server_hostname_requests_frontend' => ''
|
||||
);
|
||||
|
||||
@@ -1265,11 +1266,14 @@ class System
|
||||
try {
|
||||
$arraySystemConfiguration = self::getSystemConfiguration();
|
||||
|
||||
$serverProtocol = $arraySystemConfiguration['server_protocol'];
|
||||
$serverProtocol = ($serverProtocol != '')? $serverProtocol : ((G::is_https())? 'https' : 'http');
|
||||
|
||||
$serverHostname = $arraySystemConfiguration['server_hostname_requests_frontend'];
|
||||
$serverHostname = ($serverHostname != '')? $serverHostname : $_SERVER['HTTP_HOST'];
|
||||
|
||||
//Return
|
||||
return ((G::is_https())? 'https://' : 'http://') . $serverHostname;
|
||||
return $serverProtocol . '://' . $serverHostname;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -590,6 +590,14 @@ class Ajax
|
||||
$data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
|
||||
$result->status = 0;
|
||||
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
||||
|
||||
// Save the note reassign reason
|
||||
if (isset($_POST['NOTE_REASON']) && $_POST['NOTE_REASON'] !== '') {
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
$appNotes = new AppNotes();
|
||||
$noteContent = addslashes($_POST['NOTE_REASON']);
|
||||
$appNotes->postNewNote($_SESSION['APPLICATION'], $_SESSION['USER_LOGGED'], $noteContent, $_POST['NOTIFY_REASSIGN']);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$result->status = 1;
|
||||
$result->msg = $e->getMessage();
|
||||
|
||||
@@ -222,6 +222,22 @@ $oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
|
||||
$oHeadPublisher->assign('isIE', Bootstrap::isIE());
|
||||
$oHeadPublisher->assign('__OPEN_APPLICATION_UID__', $openApplicationUid);
|
||||
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$fromPlugin = $oPluginRegistry->getOpenReassignCallback();
|
||||
$jsFunction = false;
|
||||
if(sizeof($fromPlugin)) {
|
||||
foreach($fromPlugin as $key => $jsFile) {
|
||||
$jsFile = $jsFile->callBackFile;
|
||||
if(is_file($jsFile)) {
|
||||
$jsFile = file_get_contents($jsFile);
|
||||
if(!empty($jsFile)) {
|
||||
$jsFunction[] = $jsFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$oHeadPublisher->assign( 'openReassignCallback', $jsFunction );
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
function getUserArray ($action, $userUid)
|
||||
@@ -349,7 +365,13 @@ function getReassignList ()
|
||||
);
|
||||
$caseColumns[] = array ('header' => 'Reassigned Uid','dataIndex' => 'TAS_UID','width' => 120,'hidden' => true,'hideable' => false
|
||||
);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_REASSIGN_TO' ),'dataIndex' => 'APP_REASSIGN_USER','width' => 170
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_ASSIGNED_TO' ),'dataIndex' => 'APP_CURRENT_USER','width' => 170
|
||||
);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_REASSIGNED_TO' ),'dataIndex' => 'APP_REASSIGN_USER','width' => 170
|
||||
);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_REASON' ),'dataIndex' => 'NOTE_REASON','width' => 170
|
||||
);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_NOTIFY'), 'dataIndex' => 'NOTIFY_REASSIGN', 'width' => 100
|
||||
);
|
||||
|
||||
$caseReaderFields = array ();
|
||||
@@ -364,6 +386,7 @@ function getReassignList ()
|
||||
$caseReaderFields[] = array ('name' => 'APP_REASSIGN_USER');
|
||||
$caseReaderFields[] = array ('name' => 'CASE_SUMMARY');
|
||||
$caseReaderFields[] = array ('name' => 'CASE_NOTES_COUNT');
|
||||
$caseReaderFields[] = array ('name' => 'APP_CURRENT_USER');
|
||||
|
||||
return array ('caseColumns' => $caseColumns,'caseReaderFields' => $caseReaderFields,'rowsperpage' => 20,'dateformat' => 'M d, Y'
|
||||
);
|
||||
|
||||
@@ -208,6 +208,14 @@ if ($actionAjax == 'reassignCase') {
|
||||
$result = new stdClass();
|
||||
$result->status = 0;
|
||||
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
||||
|
||||
// Save the note reassign reason
|
||||
if (isset($_POST['NOTE_REASON']) && $_POST['NOTE_REASON'] !== '') {
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
$appNotes = new AppNotes();
|
||||
$noteContent = addslashes($_POST['NOTE_REASON']);
|
||||
$res = $appNotes->postNewNote($_SESSION['APPLICATION'], $_SESSION['USER_LOGGED'], $noteContent, $_POST['NOTIFY_REASSIGN']);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$result->status = 1;
|
||||
$result->msg = $e->getMessage();
|
||||
|
||||
@@ -52,6 +52,7 @@ if (empty( $aData )) {
|
||||
// var_dump($sql);
|
||||
if (is_array( $aData )) {
|
||||
$currentCasesReassigned = 0;
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
foreach ($aData as $data) {
|
||||
$oTmpReassignCriteria = $oCasesReassignList;
|
||||
$oTmpReassignCriteria->add( AppCacheViewPeer::APP_UID, $data->APP_UID );
|
||||
@@ -66,6 +67,13 @@ if (is_array( $aData )) {
|
||||
$casesReassignedCount ++;
|
||||
$serverResponse[] = array ('APP_REASSIGN_USER' => $data->APP_REASSIGN_USER,'APP_TITLE' => $data->APP_TITLE,'TAS_TITLE' => $data->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned
|
||||
);
|
||||
|
||||
// Save the note reassign reason
|
||||
if (isset($data->NOTE_REASON) && $data->NOTE_REASON !== '') {
|
||||
$appNotes = new AppNotes();
|
||||
$noteContent = addslashes($data->NOTE_REASON);
|
||||
$appNotes->postNewNote($row['APP_UID'], $_SESSION['USER_LOGGED'], $noteContent, isset($data->NOTIFY_REASSIGN) ? $data->NOTIFY_REASSIGN : false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$oTmpReassignCriteria = $oCasesReassignList;
|
||||
|
||||
@@ -2892,5 +2892,53 @@ class Cases
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch reassign
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* return json Return an json with the result of the reassigned cases.
|
||||
*/
|
||||
public function doPostReassign($data)
|
||||
{
|
||||
if(!is_array($data)) {
|
||||
$isJson = is_string($data) && is_array(G::json_decode($data, true)) ? true : false;
|
||||
if($isJson) {
|
||||
$data = G::json_decode($data, true);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$dataResponse = $data;
|
||||
|
||||
G::LoadClass( 'case' );
|
||||
$oCases = new \Cases();
|
||||
$appDelegation = new \AppDelegation();
|
||||
$casesToReassign = $data['cases'];
|
||||
if(sizeof($casesToReassign)) {
|
||||
foreach($casesToReassign as $key => $val) {
|
||||
$usrUid = '';
|
||||
if(array_key_exists('USR_UID', $val)) {
|
||||
if($val['USR_UID'] != '') {
|
||||
$usrUid = $val['USR_UID'];
|
||||
}
|
||||
}
|
||||
|
||||
if($usrUid == '') {
|
||||
$fields = $appDelegation->load($val['APP_UID'], $val['DEL_INDEX']);
|
||||
$usrUid = $fields['USR_UID'];
|
||||
}
|
||||
|
||||
$reassigned = $oCases->reassignCase($val['APP_UID'], $val['DEL_INDEX'], $usrUid, $data['usr_uid_target']);
|
||||
$result = $reassigned ? 1 : 0 ;
|
||||
$dataResponse['cases'][$key]['result'] = $result;
|
||||
}
|
||||
}
|
||||
unset($dataResponse['usr_uid_target']);
|
||||
|
||||
return G::json_encode($dataResponse);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1150,4 +1150,20 @@ class Cases extends Api
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch reassign
|
||||
* @url POST /reassign
|
||||
*
|
||||
*/
|
||||
public function doPostReassign($request_data)
|
||||
{
|
||||
try {
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
$response = $case->doPostReassign($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -658,6 +658,26 @@ Ext.onReady ( function() {
|
||||
columns: columns
|
||||
});
|
||||
|
||||
for (var i in reassignColumns) {
|
||||
if (reassignColumns[i].dataIndex === 'APP_REASSIGN_USER') {
|
||||
reassignColumns[i].editor = comboUsersToReassign;
|
||||
}
|
||||
if (reassignColumns[i].dataIndex === 'NOTE_REASON') {
|
||||
reassignColumns[i].editor = new Ext.form.TextArea({allowBlank: false});
|
||||
}
|
||||
if (reassignColumns[i].dataIndex === 'NOTIFY_REASSIGN') {
|
||||
reassignColumns[i].editor = new Ext.form.Checkbox({});
|
||||
reassignColumns[i].renderer = function (v, x, s) {
|
||||
if (s.data.NOTIFY_REASSIGN === true) {
|
||||
return _('ID_YES');
|
||||
}
|
||||
if (s.data.NOTIFY_REASSIGN === true) {
|
||||
return _('ID_NO');
|
||||
}
|
||||
return s.data.NOTIFY_REASSIGN;
|
||||
};
|
||||
}
|
||||
}
|
||||
var reassignCm = new Ext.grid.ColumnModel({
|
||||
defaults: {
|
||||
sortable: true // columns are sortable by default
|
||||
@@ -1155,6 +1175,13 @@ Ext.onReady ( function() {
|
||||
// text: 'Reassign',
|
||||
// text: TRANSLATIONS.LABEL_UNSELECT_ALL,
|
||||
handler: function(){
|
||||
if(openReassignCallback) {
|
||||
for(var key in openReassignCallback){
|
||||
var callbackFunction = new Function(openReassignCallback[key]);
|
||||
callbackFunction.call();
|
||||
}
|
||||
return;
|
||||
}
|
||||
reassign();
|
||||
}
|
||||
});
|
||||
@@ -1493,12 +1520,16 @@ Ext.onReady ( function() {
|
||||
var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected();
|
||||
|
||||
if( rowSelected ) {
|
||||
if (Ext.getCmp('idTextareaReasonCasesList').getValue() === '') {
|
||||
Ext.Msg.alert(_('ID_ALERT'), _('ID_THE_REASON_REASSIGN_EMPTY'));
|
||||
return;
|
||||
}
|
||||
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
|
||||
var loadMask = new Ext.LoadMask(winReassignInCasesList.getEl(), {msg: _('ID_PROCESSING')});
|
||||
loadMask.show();
|
||||
Ext.Ajax.request({
|
||||
url : 'casesList_Ajax' ,
|
||||
params : {actionAjax : 'reassignCase', USR_UID: rowSelected.data.USR_UID, APP_UID: APP_UID, DEL_INDEX:DEL_INDEX},
|
||||
params : {actionAjax : 'reassignCase', USR_UID: rowSelected.data.USR_UID, APP_UID: APP_UID, DEL_INDEX:DEL_INDEX, NOTE_REASON: Ext.getCmp('idTextareaReasonCasesList').getValue(), NOTIFY_REASSIGN: Ext.getCmp('idCheckboxReasonCasesList').getValue()},
|
||||
success: function ( result, request ) {
|
||||
var data = Ext.util.JSON.decode(result.responseText);
|
||||
if( data.status == 0 ) {
|
||||
@@ -1653,6 +1684,23 @@ Ext.onReady ( function() {
|
||||
var smodelUsersToReassign = new Ext.grid.RowSelectionModel({
|
||||
singleSelect: true
|
||||
});
|
||||
|
||||
var textareaReason = new Ext.form.TextArea({
|
||||
id: 'idTextareaReasonCasesList',
|
||||
disabled: true,
|
||||
fieldLabel : _('ID_REASON_REASSIGN'),
|
||||
emptyText: _('ID_REASON_REASSIGN') + '...',
|
||||
enableKeyEvents: true,
|
||||
width: 200
|
||||
});
|
||||
|
||||
var checkboxReason = new Ext.form.Checkbox({
|
||||
id: 'idCheckboxReasonCasesList',
|
||||
disabled: true,
|
||||
fieldLabel : _('ID_NOTIFY_USERS_CASE'),
|
||||
labelSeparator: '',
|
||||
labelStyle: 'margin-left:150px;position:absolute;'
|
||||
});
|
||||
|
||||
var grdpnlUsersToReassign = new Ext.grid.GridPanel({
|
||||
id: "grdpnlUsersToReassign",
|
||||
@@ -1660,7 +1708,7 @@ Ext.onReady ( function() {
|
||||
store: storeUsersToReassign,
|
||||
colModel: cmodelUsersToReassign,
|
||||
selModel: smodelUsersToReassign,
|
||||
|
||||
height: 200,
|
||||
columnLines: true,
|
||||
viewConfig: {forceFit: true},
|
||||
enableColumnResize: true,
|
||||
@@ -1714,18 +1762,35 @@ Ext.onReady ( function() {
|
||||
],
|
||||
bbar: pagingUsersToReassign,
|
||||
|
||||
title: ""
|
||||
title: "",
|
||||
listeners: {
|
||||
click: function () {
|
||||
textareaReason.enable();
|
||||
checkboxReason.enable();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
winReassignInCasesList = new Ext.Window({
|
||||
title: '',
|
||||
width: 450,
|
||||
height: 350,
|
||||
layout:'fit',
|
||||
layout:'auto',
|
||||
autoScroll:true,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
maximizable: false,
|
||||
items: [grdpnlUsersToReassign]
|
||||
items: [{
|
||||
xtype: 'fieldset',
|
||||
labelWidth: 130,
|
||||
border: false,
|
||||
items: [
|
||||
textareaReason,
|
||||
checkboxReason
|
||||
]
|
||||
},
|
||||
grdpnlUsersToReassign
|
||||
]
|
||||
});
|
||||
|
||||
winReassignInCasesList.show();
|
||||
@@ -2157,113 +2222,93 @@ Ext.onReady ( function() {
|
||||
}
|
||||
});
|
||||
|
||||
var btnExecReassignSelected = new Ext.Button ({
|
||||
var btnExecReassignSelected = new Ext.Button({
|
||||
text: _('ID_REASSIGN'),
|
||||
handler: function(){
|
||||
handler: function () {
|
||||
var rs = storeReassignCases.getModifiedRecords();
|
||||
if (rs.length < storeReassignCases.totalLength) {
|
||||
Ext.Msg.confirm( _('ID_CONFIRM'), _('ID_CONFIRM_TO_REASSIGN'), function (btn, text) {
|
||||
if ( btn == 'yes' ) {
|
||||
Ext.Msg.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_TO_REASSIGN'), function (btn, text) {
|
||||
if (btn == 'yes') {
|
||||
if (!isValidNoteReason(rs)) {
|
||||
return;
|
||||
}
|
||||
ExecReassign();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (!isValidNoteReason(rs)) {
|
||||
return;
|
||||
}
|
||||
ExecReassign();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function isValidNoteReason(data) {
|
||||
var row, sw = true;
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
row = data[i].data;
|
||||
if (!(row.APP_REASSIGN_USER_UID !== '' && row.NOTE_REASON !== undefined && row.NOTE_REASON !== '')) {
|
||||
sw = false;
|
||||
}
|
||||
}
|
||||
if (!sw) {
|
||||
Ext.Msg.alert(_('ID_ALERT'), _('ID_THE_REASON_REASSIGN_USER_EMPTY'));
|
||||
}
|
||||
return sw;
|
||||
}
|
||||
|
||||
var gridForm = new Ext.FormPanel({
|
||||
id: 'reassign-form',
|
||||
frame: true,
|
||||
border: true,
|
||||
labelAlign: 'left',
|
||||
//title: 'Company data',
|
||||
bodyStyle:'padding:5px',
|
||||
width: 750,
|
||||
|
||||
|
||||
layout: 'column', // Specifies that the items will now be arranged in columns
|
||||
width: 736,
|
||||
items: [{
|
||||
id : 'tasksGrid',
|
||||
columnWidth: 0.60,
|
||||
layout: 'fit',
|
||||
items: {
|
||||
id: 'TasksToReassign',
|
||||
xtype: 'grid',
|
||||
ds: storeReassignCases,
|
||||
cm: reassignCm,
|
||||
sm: new Ext.grid.RowSelectionModel({
|
||||
singleSelect: true
|
||||
/*listeners: {
|
||||
rowselect: function(sm, row, rec) {
|
||||
Ext.getCmp("reassign-form").getForm().loadRecord(rec);
|
||||
}
|
||||
}*/
|
||||
}),
|
||||
//autoExpandColumn: 'company',
|
||||
height: 265,
|
||||
title : _('ID_CASES_TO_REASSIGN_TASK_LIST'),
|
||||
border : true,
|
||||
|
||||
listeners: {
|
||||
|
||||
click: function() {
|
||||
rows = this.getSelectionModel().getSelections();
|
||||
var application = '';
|
||||
var task = '';
|
||||
var currentUser = '';
|
||||
comboUsersToReassign.disable();
|
||||
if( rows.length > 0 ) {
|
||||
comboUsersToReassign.enable();
|
||||
var ids = '';
|
||||
for(i=0; i<rows.length; i++) {
|
||||
// filtering duplicate tasks
|
||||
application = rows[i].get('APP_UID');
|
||||
task = rows[i].get('TAS_UID');
|
||||
currentUser = rows[i].get('USR_UID');
|
||||
id: 'tasksGrid',
|
||||
columnWidth: 0.60,
|
||||
layout: 'fit',
|
||||
items: {
|
||||
id: 'TasksToReassign',
|
||||
xtype: 'editorgrid',
|
||||
ds: storeReassignCases,
|
||||
cm: reassignCm,
|
||||
sm: new Ext.grid.RowSelectionModel({
|
||||
singleSelect: true
|
||||
}),
|
||||
//autoExpandColumn: 'company',
|
||||
height: 278,
|
||||
title: _('ID_CASES_TO_REASSIGN_TASK_LIST'),
|
||||
border: true,
|
||||
listeners: {
|
||||
click: function () {
|
||||
rows = this.getSelectionModel().getSelections();
|
||||
var application = '';
|
||||
var task = '';
|
||||
var currentUser = '';
|
||||
comboUsersToReassign.disable();
|
||||
if (rows.length > 0) {
|
||||
comboUsersToReassign.enable();
|
||||
var ids = '';
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
// filtering duplicate tasks
|
||||
application = rows[i].get('APP_UID');
|
||||
task = rows[i].get('TAS_UID');
|
||||
currentUser = rows[i].get('USR_UID');
|
||||
}
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
comboUsersToReassign.clearValue();
|
||||
storeUsersToReassign.removeAll();
|
||||
storeUsersToReassign.setBaseParam('application', application);
|
||||
storeUsersToReassign.setBaseParam('task', task);
|
||||
storeUsersToReassign.setBaseParam('currentUser', currentUser);
|
||||
|
||||
storeUsersToReassign.load();
|
||||
//alert(record.USERS);
|
||||
} // Allow rows to be rendered.
|
||||
|
||||
comboUsersToReassign.clearValue();
|
||||
storeUsersToReassign.removeAll();
|
||||
storeUsersToReassign.setBaseParam('application', application);
|
||||
storeUsersToReassign.setBaseParam('task', task);
|
||||
storeUsersToReassign.setBaseParam('currentUser', currentUser);
|
||||
storeUsersToReassign.load();
|
||||
//alert(record.USERS);
|
||||
} // Allow rows to be rendered.
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
columnWidth: 0.4,
|
||||
xtype: 'fieldset',
|
||||
labelWidth: 50,
|
||||
title: _('ID_USER_LIST'),
|
||||
defaults: {width: 200, border:false}, // Default config options for child items
|
||||
defaultType: 'textfield',
|
||||
autoHeight: true,
|
||||
bodyStyle: Ext.isIE ? 'text-align: left;padding:0 0 5px 15px;' : 'text-align: left; padding:10px 5px;',
|
||||
border: false,
|
||||
//style: {
|
||||
// "margin-left": "10px", // when you add custom margin in IE 6...
|
||||
// "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0" // you have to adjust for it somewhere else
|
||||
//},
|
||||
items:
|
||||
[
|
||||
comboUsersToReassign,
|
||||
{
|
||||
xtype: 'fieldset',
|
||||
border : true,
|
||||
defaultType: 'textfield',
|
||||
title: _('ID_INSTRUCTIONS'),
|
||||
autoHeight:true,
|
||||
html: _('ID_INSTRUCTIONS_TEXT')
|
||||
}
|
||||
]
|
||||
}]
|
||||
]
|
||||
//renderTo: bd
|
||||
});
|
||||
|
||||
|
||||
@@ -1047,16 +1047,14 @@ Ext.onReady(function(){
|
||||
|
||||
var grdpnlUsersToReassign = new Ext.grid.GridPanel({
|
||||
id: "grdpnlUsersToReassign",
|
||||
|
||||
store: storeUsersToReassign,
|
||||
colModel: cmodelUsersToReassign,
|
||||
selModel: smodelUsersToReassign,
|
||||
|
||||
height: 200,
|
||||
columnLines: true,
|
||||
viewConfig: {forceFit: true},
|
||||
enableColumnResize: true,
|
||||
enableHdMenu: true,
|
||||
|
||||
tbar: [
|
||||
{
|
||||
text: _("ID_REASSIGN"),
|
||||
@@ -1102,19 +1100,52 @@ Ext.onReady(function(){
|
||||
],
|
||||
bbar: pagingUsersToReassign,
|
||||
|
||||
title: ""
|
||||
title: "",
|
||||
listeners: {
|
||||
click: function () {
|
||||
textareaReason.enable();
|
||||
checkboxReason.enable();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var textareaReason = new Ext.form.TextArea({
|
||||
id: 'idTextareaReason',
|
||||
disabled: true,
|
||||
fieldLabel : _('ID_REASON_REASSIGN'),
|
||||
emptyText: _('ID_REASON_REASSIGN') + '...',
|
||||
enableKeyEvents: true,
|
||||
width: 200
|
||||
});
|
||||
|
||||
var checkboxReason = new Ext.form.Checkbox({
|
||||
id: 'idCheckboxReason',
|
||||
disabled: true,
|
||||
fieldLabel : _('ID_NOTIFY_USERS_CASE'),
|
||||
labelSeparator: '',
|
||||
labelStyle: 'margin-left:150px;position:absolute;'
|
||||
});
|
||||
|
||||
var winReassignInCasesList = new Ext.Window({
|
||||
title: '',
|
||||
width: 450,
|
||||
height: 350,
|
||||
layout:'fit',
|
||||
autoScroll:true,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
maximizable: false,
|
||||
items: [grdpnlUsersToReassign]
|
||||
title: '',
|
||||
width: 450,
|
||||
height: 350,
|
||||
layout: 'auto',
|
||||
autoScroll: true,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
maximizable: false,
|
||||
items: [{
|
||||
xtype: 'fieldset',
|
||||
labelWidth: 130,
|
||||
border: false,
|
||||
items: [
|
||||
textareaReason,
|
||||
checkboxReason
|
||||
]
|
||||
},
|
||||
grdpnlUsersToReassign
|
||||
]
|
||||
});
|
||||
|
||||
Ext.Ajax.request({
|
||||
@@ -1160,10 +1191,14 @@ Ext.onReady(function(){
|
||||
var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected();
|
||||
|
||||
if( rowSelected ) {
|
||||
if (Ext.getCmp('idTextareaReason').getValue() === '') {
|
||||
Ext.Msg.alert(_('ID_ALERT'), _('ID_THE_REASON_REASSIGN_EMPTY'));
|
||||
return;
|
||||
}
|
||||
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
|
||||
Ext.Ajax.request({
|
||||
url : 'ajaxListener' ,
|
||||
params : {action : 'reassignCase', USR_UID: rowSelected.data.USR_UID},
|
||||
params : {action : 'reassignCase', USR_UID: rowSelected.data.USR_UID, NOTE_REASON: Ext.getCmp('idTextareaReason').getValue(), NOTIFY_REASSIGN: Ext.getCmp('idCheckboxReason').getValue()},
|
||||
success: function ( result, request ) {
|
||||
var data = Ext.util.JSON.decode(result.responseText);
|
||||
if( data.status == 0 ) {
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
disabled : true,
|
||||
width : 280,
|
||||
boxMaxWidth : 180,
|
||||
|
||||
allowBlank: false,
|
||||
//lazyRender : true,
|
||||
// store : new Ext.data.Store(),
|
||||
store : storeUsersToReassign,
|
||||
|
||||
@@ -902,7 +902,7 @@ if (! defined( 'EXECUTE_BY_CRON' )) {
|
||||
if (PHP_VERSION < 5.2) {
|
||||
setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly');
|
||||
} else {
|
||||
setcookie(session_name(), session_id(), time() + $timelife, '/', null, false, true);
|
||||
setcookie(session_name(), session_id(), time() + $timelife, '/', null, G::is_https(), true);
|
||||
}
|
||||
}
|
||||
$RBAC->initRBAC();
|
||||
@@ -979,7 +979,7 @@ if (! defined( 'EXECUTE_BY_CRON' )) {
|
||||
if (PHP_VERSION < 5.2) {
|
||||
setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly');
|
||||
} else {
|
||||
setcookie(session_name(), session_id(), time() + $timelife, '/', null, false, true);
|
||||
setcookie(session_name(), session_id(), time() + $timelife, '/', null, G::is_https(), true);
|
||||
}
|
||||
}
|
||||
$RBAC->initRBAC();
|
||||
|
||||
Reference in New Issue
Block a user