BUG 10548 Case Notes. After adding case notes, ProcessMaker... SOLVED

- The cases notes no obey restrictions of permits en uxs.
- Was add validation.
This commit is contained in:
Marco Antonio Nina
2013-01-29 17:13:38 -04:00
parent e43d7a8259
commit b286a4e1cf
5 changed files with 100 additions and 48 deletions

View File

@@ -151,6 +151,8 @@ class AppCacheView extends BaseAppCacheView
$criteria = $this->addPMFieldsToCriteria('draft');
}
$criteria->addSelectColumn(AppCacheViewPeer::TAS_UID);
$criteria->addSelectColumn(AppCacheViewPeer::PRO_UID);
$criteria->add(AppCacheViewPeer::APP_STATUS, "DRAFT", CRITERIA::EQUAL);
if (!empty($userUid)) {
@@ -403,6 +405,8 @@ class AppCacheView extends BaseAppCacheView
$criteria = $this->addPMFieldsToCriteria('unassigned');
}
$criteria->addSelectColumn(AppCacheViewPeer::TAS_UID);
$criteria->addSelectColumn(AppCacheViewPeer::PRO_UID);
$criteria->add(AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
$criteria->add(AppCacheViewPeer::USR_UID, '');

View File

@@ -213,6 +213,7 @@ class Home extends Controller
$this->setVar( 'cases', $cases['data'] );
$this->setVar( 'cases_count', $cases['totalCount'] );
$this->setVar( 'title', $title );
$this->setVar( 'noPerms', G::LoadTranslation( 'ID_CASES_NOTES_NO_PERMISSIONS' ));
$this->setVar( 'appListStart', $this->appListLimit );
$this->setVar( 'appListLimit', 10 );
$this->setVar( 'listType', $httpData->t );
@@ -260,6 +261,7 @@ class Home extends Controller
$this->setVar( 'cases', $cases['data'] );
$this->setVar( 'cases_count', $cases['totalCount'] );
$this->setVar( 'title', $title );
$this->setVar( 'noPerms', G::LoadTranslation( 'ID_CASES_NOTES_NO_PERMISSIONS' ));
$this->setVar( 'appListStart', $this->appListLimit );
$this->setVar( 'appListLimit', 10 );
$this->setVar( 'listType', $httpData->t );

View File

@@ -58,34 +58,57 @@
}
}
function addNt(appUid)
function addNt(appUid, proUid, tasUid)
{
$('textarea#note_text').val('');
$( "#dialog-add-note" ).dialog({
resizable: false,
height:192,
modal: true,
buttons: {
"Add Note": function() {
var sendMail = document.getElementById('chkSendMail').checked;
sendMail = (sendMail == true) ? '1' : '0';
$(this).dialog("close");
$.post(
'../appProxy/postNote',
{appUid : appUid,
noteText: $('textarea#note_text').val(),
swSendMail : sendMail},
function(responseText) {
updateNt(appUid);
}
);
//redirect('home/startCase?id='+id);
$.post(
'../appProxy/getNotesList',
{
appUid : appUid,
pro:proUid,
tas:tasUid,
start:0,
limit:25
},
Cancel: function() {
$(this).dialog( "close" );
function(responseText) {
data = jQuery.parseJSON(responseText);
if (typeof (data.noPerms) != 'undefined') {
alert(noPerms);
return false;
} else {
$( "#dialog-add-note" ).dialog({
resizable: false,
height:192,
modal: true,
buttons: {
"Add Note": function() {
var sendMail = document.getElementById('chkSendMail').checked;
sendMail = (sendMail == true) ? '1' : '0';
$(this).dialog("close");
$.post(
'../appProxy/postNote',
{appUid : appUid,
noteText: $('textarea#note_text').val(),
swSendMail : sendMail},
function(responseText) {
updateNt(appUid);
}
);
//redirect('home/startCase?id='+id);
},
Cancel: function() {
$(this).dialog( "close" );
}
}
});
}
//updateNt(appUid);
}
}
});
);
}
function updateNt(appUid)
@@ -146,6 +169,7 @@
var appListLimit = {$appListLimit};
var appListStart = {$appListStart};
var listType = '{$listType}';
var noPerms = '{$noPerms}';
</script>
</head>

View File

@@ -125,34 +125,55 @@
}
}
function addNt(appUid)
function addNt(appUid, proUid, tasUid)
{
$('textarea#note_text').val('');
$( "#dialog-add-note" ).dialog({
resizable: false,
height:192,
modal: true,
buttons: {
"Add Note": function() {
var sendMail = document.getElementById('chkSendMail').checked;
sendMail = (sendMail == true) ? '1' : '0';
$(this).dialog("close");
$.post(
'../appProxy/postNote',
{appUid : appUid,
noteText: $('textarea#note_text').val(),
swSendMail : sendMail},
function(responseText) {
updateNt(appUid);
$.post(
'../appProxy/getNotesList',
{
appUid : appUid,
pro:proUid,
tas:tasUid,
start:0,
limit:25
},
function(responseText) {
console.log(responseText);
data = jQuery.parseJSON(responseText);
console.log(data.noPerms);
if (typeof (data.noPerms) != 'undefined') {
alert(noPerms);
return false;
} else {
$( "#dialog-add-note" ).dialog({
resizable: false,
height:192,
modal: true,
buttons: {
"Add Note": function() {
var sendMail = document.getElementById('chkSendMail').checked;
sendMail = (sendMail == true) ? '1' : '0';
$(this).dialog("close");
$.post(
'../appProxy/postNote',
{appUid : appUid,
noteText: $('textarea#note_text').val(),
swSendMail : sendMail},
function(responseText) {
updateNt(appUid);
}
);
//redirect('home/startCase?id='+id);
},
Cancel: function() {
$(this).dialog( "close" );
}
}
);
//redirect('home/startCase?id='+id);
},
Cancel: function() {
$(this).dialog( "close" );
});
}
//updateNt(appUid);
}
});
);
}
function addPanelSearch()
{
@@ -246,6 +267,7 @@
var appListLimit = {$appListLimit};
var appListStart = {$appListStart};
var noPerms = '{$noPerms}';
var listType = '{$listType}';
var process = '{$arraySearch[0]}';
var status = '{$arraySearch[1]}';

View File

@@ -9,7 +9,7 @@
</span>
<span class="notes-plus-link">
<a href="#" onclick="addNt('{$APP.APP_UID}', '{$APP.APP_UID}'); return false;"><img src="/images/simplified/messages-grey-plus.png" height="21" width="21" border="0"></a>
<a href="#" onclick="addNt('{$APP.APP_UID}', '{$APP.PRO_UID}', '{$APP.TAS_UID}'); return false;"><img src="/images/simplified/messages-grey-plus.png" height="21" width="21" border="0"></a>
</span>
<p>