PM-1396 No es posible actualizar los calendarios
Se agrego validacion para verificar Id del calendario a modificar
This commit is contained in:
@@ -177,7 +177,7 @@ class adminProxy extends HttpProxyController
|
|||||||
$httpData=array_unique((array)$httpData);
|
$httpData=array_unique((array)$httpData);
|
||||||
$message = '';
|
$message = '';
|
||||||
$oldName = isset($_POST['oldName'])? $_POST['oldName']:'';
|
$oldName = isset($_POST['oldName'])? $_POST['oldName']:'';
|
||||||
|
$uid = isset($_POST['uid'])? $_POST['uid']:'';
|
||||||
|
|
||||||
switch ($_POST['action']){
|
switch ($_POST['action']){
|
||||||
case 'calendarName':
|
case 'calendarName':
|
||||||
@@ -185,7 +185,7 @@ class adminProxy extends HttpProxyController
|
|||||||
$oCalendar = new CalendarDefinition();
|
$oCalendar = new CalendarDefinition();
|
||||||
$aCalendars = $oCalendar->getCalendarList(false,true);
|
$aCalendars = $oCalendar->getCalendarList(false,true);
|
||||||
$aCalendarDefinitions = end($aCalendars);
|
$aCalendarDefinitions = end($aCalendars);
|
||||||
|
|
||||||
foreach ($aCalendarDefinitions as $aDefinitions) {
|
foreach ($aCalendarDefinitions as $aDefinitions) {
|
||||||
if (trim($_POST['name'])=='') {
|
if (trim($_POST['name'])=='') {
|
||||||
$validated = false;
|
$validated = false;
|
||||||
@@ -194,7 +194,8 @@ class adminProxy extends HttpProxyController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aDefinitions['CALENDAR_NAME'])) {
|
if (isset($aDefinitions['CALENDAR_NAME'])) {
|
||||||
if ($oldName != $_POST['name']) {
|
|
||||||
|
if ($aDefinitions['CALENDAR_UID'] != $uid) {
|
||||||
if ($aDefinitions['CALENDAR_NAME'] == $_POST['name']) {
|
if ($aDefinitions['CALENDAR_NAME'] == $_POST['name']) {
|
||||||
$validated = false;
|
$validated = false;
|
||||||
$message = G::loadTranslation('ID_CALENDAR_INVALID_NAME');
|
$message = G::loadTranslation('ID_CALENDAR_INVALID_NAME');
|
||||||
|
|||||||
@@ -757,13 +757,13 @@ Ext.onReady( function() {
|
|||||||
Ext.getCmp('idInvalidCalendarName').hide();
|
Ext.getCmp('idInvalidCalendarName').hide();
|
||||||
var validateMessage = '';
|
var validateMessage = '';
|
||||||
var canlendarName = Ext.getCmp('dynaformCalendarName').getValue();
|
var canlendarName = Ext.getCmp('dynaformCalendarName').getValue();
|
||||||
|
|
||||||
Ext.Ajax.request( {
|
Ext.Ajax.request( {
|
||||||
url: '../adminProxy/calendarValidate',
|
url: '../adminProxy/calendarValidate',
|
||||||
params: {
|
params: {
|
||||||
action : 'calendarName',
|
action : 'calendarName',
|
||||||
oldName : fields.OLD_NAME,
|
oldName : fields.OLD_NAME,
|
||||||
name : canlendarName
|
name : canlendarName,
|
||||||
|
uid : fields.CALENDAR_UID
|
||||||
},
|
},
|
||||||
success: function(resp){
|
success: function(resp){
|
||||||
if (resp.responseText != '[]')
|
if (resp.responseText != '[]')
|
||||||
|
|||||||
Reference in New Issue
Block a user