diff --git a/workflow/engine/classes/model/AppCacheView.php b/workflow/engine/classes/model/AppCacheView.php index fa5f9d3af..d8b232d81 100755 --- a/workflow/engine/classes/model/AppCacheView.php +++ b/workflow/engine/classes/model/AppCacheView.php @@ -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, ''); diff --git a/workflow/engine/controllers/home.php b/workflow/engine/controllers/home.php index 9a2cf107f..2b3f7b6e4 100755 --- a/workflow/engine/controllers/home.php +++ b/workflow/engine/controllers/home.php @@ -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 ); diff --git a/workflow/engine/templates/home/appList.html b/workflow/engine/templates/home/appList.html index a99cf19d7..31b5655f1 100644 --- a/workflow/engine/templates/home/appList.html +++ b/workflow/engine/templates/home/appList.html @@ -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}'; diff --git a/workflow/engine/templates/home/appListSearch.html b/workflow/engine/templates/home/appListSearch.html index 38cfaff7e..844893e89 100644 --- a/workflow/engine/templates/home/appListSearch.html +++ b/workflow/engine/templates/home/appListSearch.html @@ -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]}'; diff --git a/workflow/engine/templates/home/applications.html b/workflow/engine/templates/home/applications.html index 2be3e212f..91cd8e0c3 100644 --- a/workflow/engine/templates/home/applications.html +++ b/workflow/engine/templates/home/applications.html @@ -9,7 +9,7 @@ - +