Merge branch 'master' into michelangelo

This commit is contained in:
Erik Amaru Ortiz
2013-09-04 16:12:17 -04:00
16 changed files with 489 additions and 201 deletions

View File

@@ -6432,7 +6432,7 @@ class Cases
}
}
public function getUsersToReassign($TAS_UID, $USR_UID)
public function getUsersToReassign($TAS_UID, $USR_UID, $PRO_UID=null)
{
G::LoadClass('groups');
G::LoadClass('tasks');
@@ -6495,6 +6495,60 @@ class Cases
$rows[] = $rs->getRow();
}
if ($PRO_UID != null) {
//Add supervisor
// Users
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessUserPeer::PU_UID);
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);
$oCriteria->addSelectColumn(ProcessUserPeer::PRO_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
$oCriteria->addJoin(ProcessUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'SUPERVISOR');
$oCriteria->add(ProcessUserPeer::PRO_UID, $PRO_UID);
$oCriteria->add(ProcessUserPeer::USR_UID, $USR_UID);
$oCriteria->addAscendingOrderByColumn(UsersPeer::USR_FIRSTNAME);
$oDataset = ProcessUserPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$flagSupervisors = false;
if ($oDataset->next()) {
$rows[] = $oDataset->getRow();
$flagSupervisors = true;
}
if (!$flagSupervisors) {
// Groups
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessUserPeer::PU_UID);
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);
$oCriteria->addSelectColumn(ProcessUserPeer::PRO_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
$oCriteria->addJoin(ProcessUserPeer::USR_UID, GroupUserPeer::GRP_UID, Criteria::LEFT_JOIN);
$oCriteria->addJoin(GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR');
$oCriteria->add(ProcessUserPeer::PRO_UID, $PRO_UID);
$oCriteria->add(GroupUserPeer::USR_UID, $USR_UID);
$oDataset = ProcessUserPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($oDataset->next()) {
$rows[] = $oDataset->getRow();
}
}
}
return $rows;
}

View File

@@ -506,8 +506,11 @@ class Ajax
print G::json_encode( $response );
die();
}
G::LoadClass( 'tasks' );
$task = new Task();
$tasks = $task->load($_SESSION['TASK']);
$case = new Cases();
$result->data = $case->getUsersToReassign($_SESSION['TASK'], $_SESSION['USER_LOGGED']);
$result->data = $case->getUsersToReassign($_SESSION['TASK'], $_SESSION['USER_LOGGED'], $tasks['PRO_UID']);
print G::json_encode($result);
}

View File

@@ -193,7 +193,10 @@ if ($actionAjax == "processListExtJs") {
if ($actionAjax == "getUsersToReassign") {
$_SESSION['TASK'] = $_REQUEST['TAS_UID'];
$case = new Cases();
$result->data = $case->getUsersToReassign( $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
G::LoadClass( 'tasks' );
$task = new Task();
$tasks = $task->load($_SESSION['TASK']);
$result->data = $case->getUsersToReassign( $_SESSION['TASK'], $_SESSION['USER_LOGGED'], $tasks['PRO_UID'] );
print G::json_encode( $result );
}
if ($actionAjax == 'reassignCase') {

View File

@@ -22,9 +22,17 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
if (!isset($_SESSION['USER_LOGGED'])) {
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
die( '<script type="text/javascript">
parent.location = "../cases/casesListExtJs?action=selfservice";
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
</script>');
}
/* Permissions */

View File

@@ -22,11 +22,19 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
//validate the data post
if (!isset($_SESSION['USER_LOGGED'])) {
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
die( '<script type="text/javascript">
parent.location = "../cases/casesStartPage?action=startCase";
</script>');
if (!isset($_SESSION['USER_LOGGED'])) {
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
die( '<script type="text/javascript">
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
</script>');
}
try {
if ($_GET['APP_UID'] !== $_SESSION['APPLICATION']) {

View File

@@ -2,7 +2,15 @@
if (!isset($_SESSION['USER_LOGGED'])) {
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
die( '<script type="text/javascript">
parent.location = "../cases/casesStartPage?action=startCase";
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
</script>');
}
/**

View File

@@ -70,83 +70,15 @@ $oConf = new Configurations();
$aUsersInvolved = Array();
$ConfEnv = $oConf->getFormats();
$rows = $oCases->getUsersToReassign($TaskUid, $sReassignFromUser);
$flagSupervisors = false;
G::LoadClass( 'tasks' );
$task = new Task();
$tasks = $task->load($TaskUid);
$rows = $oCases->getUsersToReassign($TaskUid, $_SESSION['USER_LOGGED'], $tasks['PRO_UID']);
foreach ($rows as $row) {
$sCaseUser = G::getFormatUserList( $ConfEnv['format'], $row );
$aUsersInvolved[] = array ('userUid' => $row['USR_UID'], 'userFullname' => $sCaseUser);
if ($row['USR_UID'] == $_SESSION['USER_LOGGED']) {
$flagSupervisors = true;
}
}
if (!$flagSupervisors) {
G::LoadClass('application');
$application = new Application();
$appData = $application->Load($appUid);
$aResp =array();
$sProcessUID =$appData ['PRO_UID'];
// Users
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessUserPeer::PU_UID);
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);
$oCriteria->addSelectColumn(ProcessUserPeer::PRO_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
$oCriteria->addJoin(ProcessUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'SUPERVISOR');
$oCriteria->add(ProcessUserPeer::PRO_UID, $sProcessUID);
$oCriteria->add(ProcessUserPeer::USR_UID, $_SESSION['USER_LOGGED']);
$oCriteria->addAscendingOrderByColumn(UsersPeer::USR_FIRSTNAME);
$oDataset = ProcessUserPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$flagSupervisors = false;
if ($oDataset->next()) {
$aRow = $oDataset->getRow();
$supervisors = G::getFormatUserList( $ConfEnv['format'], $aRow );
$aUsersInvolved[] = array ('userUid' => $aRow['USR_UID'], 'userFullname' => $supervisors);
$flagSupervisors = true;
}
if (!$flagSupervisors) {
// Groups
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessUserPeer::PU_UID);
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);
$oCriteria->addSelectColumn(ProcessUserPeer::PRO_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
$oCriteria->addJoin(ProcessUserPeer::USR_UID, GroupUserPeer::GRP_UID, Criteria::LEFT_JOIN);
$oCriteria->addJoin(GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR');
$oCriteria->add(ProcessUserPeer::PRO_UID, $sProcessUID);
$oCriteria->add(GroupUserPeer::USR_UID, $_SESSION['USER_LOGGED']);
$oDataset = ProcessUserPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($oDataset->next()) {
$aRow = $oDataset->getRow();
$supervisors = G::getFormatUserList( $ConfEnv['format'], $aRow );
$aUsersInvolved[] = array ('userUid' => $aRow['USR_UID'], 'userFullname' => $supervisors);
}
}
}
// $oTmp = new stdClass();
// $oTmp->items = $aUsersInvolved;
$result = array ();

View File

@@ -64,6 +64,12 @@ try {
$bClassFile = true;
}
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
if (($sClassName == 'enterprise') && ($partnerFlag)) {
$pathFileFlag = PATH_DATA . 'flagNewLicence';
file_put_contents($pathFileFlag, 'New Enterprise');
}
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$pluginFile = $sClassName . '.php';

View File

@@ -79,7 +79,15 @@ function openCaseNotesWindow(appUid1, modalSw, appTitle, proUid, taskUid)
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
}
@@ -385,7 +393,15 @@ function sendNote()
icon : Ext.MessageBox.ERROR,
buttons : Ext.Msg.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -520,7 +536,15 @@ var openSummaryWindow = function(appUid, delIndex, action)
icon : Ext.MessageBox.ERROR,
buttons : Ext.Msg.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {

View File

@@ -466,7 +466,15 @@ function openActionDialog(caller, action, dataAux)
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {

View File

@@ -360,7 +360,15 @@
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -426,7 +434,15 @@
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {

View File

@@ -158,8 +158,16 @@ function deleteCase() {
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
if( rows.length > 0 ) {
@@ -1321,7 +1329,15 @@ Ext.onReady ( function() {
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -1416,7 +1432,15 @@ Ext.onReady ( function() {
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -2218,7 +2242,15 @@ function reassign(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {

View File

@@ -81,7 +81,15 @@ Ext.onReady(function() {
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -113,7 +121,15 @@ Ext.onReady(function() {
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -145,7 +161,15 @@ Ext.onReady(function() {
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -179,7 +203,15 @@ Ext.onReady(function() {
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -214,7 +246,15 @@ Ext.onReady(function() {
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -426,7 +466,15 @@ function openCaseA(n){
icon : Ext.MessageBox.ERROR,
buttons : Ext.Msg.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {

View File

@@ -437,7 +437,15 @@
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
top.location = '../login/login';
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {

View File

@@ -451,7 +451,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -481,7 +489,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -550,7 +566,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -621,7 +645,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -651,7 +683,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -681,7 +721,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -711,7 +759,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -741,7 +797,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -922,7 +986,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -1070,7 +1142,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -1100,7 +1180,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -1201,7 +1289,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {
@@ -1279,7 +1375,15 @@ Ext.onReady(function(){
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
try
{
prnt = parent.parent;
top.location = top.location;
}
catch (err)
{
parent.location = parent.location;
}
}
});
} else {

View File

@@ -200,6 +200,7 @@ Ext.onReady(function(){
dataIndex: 'field_type',
width: 75,
editor: new fm.ComboBox({
id: "fieldType",
typeAhead: true,
editable: false,
lazyRender: true,
@@ -232,93 +233,15 @@ Ext.onReady(function(){
if(selCombo != combo.getValue()) {
Ext.getCmp('sizeEdit').setValue('');
}
selCombo = combo.getValue();
var swSize = 1; //Enable
var swNull = 1;
var swPK = 1;
var swAI = 1;
var fieldNull = Ext.getCmp("field_null");
var fieldPrimaryKey = Ext.getCmp("field_primary_key");
var fieldInc = Ext.getCmp("field_incre");
var sizeEdit = Ext.getCmp("sizeEdit");
//Date
if (selCombo == "DATE" || selCombo == "DATETIME" || selCombo == "TIME") {
swSize = 0; //Disable
swPK = 0;
swAI = 0;
}
//Numbers
if (selCombo == "INTEGER" || selCombo == "BIGINT") {
//Enable All
}
if (selCombo == "TINYINT" || selCombo == "SMALLINT") {
swSize = 0;
}
if (selCombo == "DECIMAL" || selCombo == "FLOAT") {
swPK = 0;
swAI = 0;
}
if (selCombo == "DOUBLE" || selCombo == "REAL") {
swSize = 0;
swPK = 0;
swAI = 0;
}
//String
if (selCombo == "CHAR" || selCombo == "VARCHAR") {
swAI = 0;
}
if (selCombo == "LONGVARCHAR") {
swPK = 0;
swAI = 0;
}
//Boolean
if (selCombo == "BOOLEAN") {
swSize = 0;
swNull = 0;
swPK = 0;
swAI = 0;
}
if (swNull == 1) {
Ext.getCmp("field_null").enable();
} else {
Ext.getCmp("field_null").disable();
Ext.getCmp("field_null").setValue(false);
}
if (swPK == 1) {
Ext.getCmp("field_primary_key").enable();
} else {
Ext.getCmp("field_primary_key").disable();
Ext.getCmp("field_primary_key").setValue(false);
}
if (swAI == 1) {
Ext.getCmp("field_incre").enable();
} else {
Ext.getCmp("field_incre").disable();
Ext.getCmp("field_incre").setValue(false);
}
if (swSize == 1) {
Ext.getCmp("sizeEdit").enable();
if (selCombo == "CHAR" || selCombo == "VARCHAR" || selCombo == "LONGVARCHAR") {
Ext.getCmp("sizeEdit").setMaxValue(((selCombo == "CHAR") ? 255 : 999));
sizeField.getEl().dom.maxLength = 3;
} else {
Ext.getCmp("sizeEdit").setMaxValue(99);
sizeField.getEl().dom.maxLength = 2;
}
} else {
Ext.getCmp("sizeEdit").disable();
Ext.getCmp("sizeEdit").setValue("");
}
editorFieldsEnableDisable(selCombo, fieldNull, fieldPrimaryKey, fieldInc, sizeEdit);
}
}//select
}
@@ -428,10 +351,24 @@ Ext.onReady(function(){
});
editor.on({
afteredit: function(roweditor, changes, record, rowIndex) {
//
beforeedit: function(roweditor, rowIndex)
{
setTimeout(
function ()
{
var fieldTypeValue = Ext.getCmp("fieldType").getValue();
var fieldNull = Ext.getCmp("field_null");
var fieldPrimaryKey = Ext.getCmp("field_primary_key");
var fieldInc = Ext.getCmp("field_incre");
var sizeEdit = Ext.getCmp("sizeEdit");
editorFieldsEnableDisable(fieldTypeValue, fieldNull, fieldPrimaryKey, fieldInc, sizeEdit);
},
250
);
},
afteredit: function(roweditor, rowIndex) {
afteredit: function(roweditor, changes, r, rowIndex)
{
row = assignedGrid.getSelectionModel().getSelected();
//if a column was set as PK so can't be null
if (row.get('field_key') == true) {
@@ -996,6 +933,95 @@ function removeColumn()
});
}
function editorFieldsEnableDisable(fieldTypeValue, fieldNull, fieldPrimaryKey, fieldInc, sizeEdit)
{
var swSize = 1; //Enable
var swNull = 1;
var swPK = 1;
var swAI = 1;
//Date
if (fieldTypeValue == "DATE" || fieldTypeValue == "DATETIME" || fieldTypeValue == "TIME") {
swSize = 0; //Disable
swPK = 0;
swAI = 0;
}
//Numbers
if (fieldTypeValue == "INTEGER" || fieldTypeValue == "BIGINT") {
//Enable All
}
if (fieldTypeValue == "TINYINT" || fieldTypeValue == "SMALLINT") {
swSize = 0;
}
if (fieldTypeValue == "DECIMAL" || fieldTypeValue == "FLOAT") {
swPK = 0;
swAI = 0;
}
if (fieldTypeValue == "DOUBLE" || fieldTypeValue == "REAL") {
swSize = 0;
swPK = 0;
swAI = 0;
}
//String
if (fieldTypeValue == "CHAR" || fieldTypeValue == "VARCHAR") {
swAI = 0;
}
if (fieldTypeValue == "LONGVARCHAR") {
swPK = 0;
swAI = 0;
}
//Boolean
if (fieldTypeValue == "BOOLEAN") {
swSize = 0;
swNull = 0;
swPK = 0;
swAI = 0;
}
//Set enable/disable
if (swNull == 1) {
fieldNull.enable();
} else {
fieldNull.disable();
fieldNull.setValue(false);
}
if (swPK == 1) {
fieldPrimaryKey.enable();
} else {
fieldPrimaryKey.disable();
fieldPrimaryKey.setValue(false);
}
if (swAI == 1) {
fieldInc.enable();
} else {
fieldInc.disable();
fieldInc.setValue(false);
}
if (swSize == 1) {
sizeEdit.enable();
if (fieldTypeValue == "CHAR" || fieldTypeValue == "VARCHAR" || fieldTypeValue == "LONGVARCHAR") {
sizeEdit.setMaxValue(((fieldTypeValue == "CHAR") ? 255 : 999));
sizeEdit.getEl().dom.maxLength = 3;
} else {
sizeEdit.setMaxValue(99);
sizeEdit.getEl().dom.maxLength = 2;
}
} else {
sizeEdit.disable();
sizeEdit.setValue("");
}
}
////ASSIGNBUTON FUNCTIONALITY
AssignFieldsAction = function(){