BUG 7516 Login name is not enough for sender identification in case notes

This functionality was added
This commit is contained in:
Carlos Pacha
2011-08-31 10:04:07 -04:00
parent 4cdf06dc19
commit 87f0718671
3 changed files with 35 additions and 4 deletions

View File

@@ -18,6 +18,8 @@ class AppNotes extends BaseAppNotes {
function getNotesList($appUid, $usrUid, $start, $limit) { function getNotesList($appUid, $usrUid, $start, $limit) {
require_once ( "classes/model/Users.php" ); require_once ( "classes/model/Users.php" );
G::LoadClass('ArrayPeer');
$Criteria = new Criteria('workflow'); $Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns(); $Criteria->clearSelectColumns();
@@ -32,6 +34,9 @@ class AppNotes extends BaseAppNotes {
$Criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ2); $Criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ2);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_RECIPIENTS); $Criteria->addSelectColumn(AppNotesPeer::NOTE_RECIPIENTS);
$Criteria->addSelectColumn(UsersPeer::USR_USERNAME); $Criteria->addSelectColumn(UsersPeer::USR_USERNAME);
$Criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$Criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$Criteria->addSelectColumn(UsersPeer::USR_EMAIL); $Criteria->addSelectColumn(UsersPeer::USR_EMAIL);
$Criteria->addJoin(AppNotesPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN); $Criteria->addJoin(AppNotesPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
@@ -248,4 +253,4 @@ class AppNotes extends BaseAppNotes {
throw $oException; throw $oException;
} }
} }
} }

View File

@@ -112,11 +112,14 @@
$oHeadPublisher->assign( '___p34315105', $menuPerms); // user menu permissions $oHeadPublisher->assign( '___p34315105', $menuPerms); // user menu permissions
G::LoadClass('configuration');
$c = new Configurations();
$oHeadPublisher->usingExtJs('ux/GridRowActions'); $oHeadPublisher->usingExtJs('ux/GridRowActions');
$oHeadPublisher->addExtJsScript('cases/caseUtils', true); $oHeadPublisher->addExtJsScript('cases/caseUtils', true);
$oHeadPublisher->addExtJsScript('cases/casesList', false ); //adding a javascript file .js $oHeadPublisher->addExtJsScript('cases/casesList', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesListExtJs'); //adding a html file .html. $oHeadPublisher->addContent( 'cases/casesListExtJs'); //adding a html file .html.
$oHeadPublisher->assign('FORMATS',$c->getFormats());
G::RenderPage('publish', 'extJs'); G::RenderPage('publish', 'extJs');
//functions to fill the comboboxes in the case list page //functions to fill the comboboxes in the case list page

View File

@@ -16,7 +16,7 @@ function openCaseNotesWindow(appUid,modalSw){
url : '../caseProxy/getNotesList?appUid='+appUid, url : '../caseProxy/getNotesList?appUid='+appUid,
root: 'notes', root: 'notes',
totalProperty: 'totalCount', totalProperty: 'totalCount',
fields: ['USR_USERNAME','NOTE_DATE','NOTE_CONTENT'], fields: ['USR_USERNAME','USR_FIRSTNAME','USR_LASTNAME','USR_FULL_NAME','NOTE_DATE','NOTE_CONTENT'],
baseParams:{ baseParams:{
start:startRecord, start:startRecord,
limit:startRecord+loadSize limit:startRecord+loadSize
@@ -33,11 +33,34 @@ function openCaseNotesWindow(appUid,modalSw){
}); });
storeNotes.load(); storeNotes.load();
// note added by krlos pacha carlos-at-colosa.com
// code added to get info about the users' name configuration
// to can see the correct user name set into enviroment
var userName = '';
switch(FORMATS.FullNameFormat){
case '@lastName, @firstName (@userName)':
userName = '{USR_LASTNAME}, {USR_FIRSTNAME} ({USR_USERNAME})';break;
case '@firstName @lastName':
userName = '{USR_FIRSTNAME} {USR_LASTNAME}';break;
case '@firstName @lastName (@userName)':
userName = '{USR_FIRSTNAME} {USR_LASTNAME} ({USR_USERNAME})';break;
case '@userName':
userName = '{USR_USERNAME}';break;
case '@userName (@firstName @lastName)':
userName = '{USR_USERNAME} ({USR_FIRSTNAME} {USR_LASTNAME})';break;
case '@lastName @firstName':
userName = '{USR_LASTNAME} {USR_FIRSTNAME}';break;
case '@lastName, @firstName':
userName = '{USR_LASTNAME}, {USR_FIRSTNAME}';break;
case '@lastName, @firstName (@userName)':
userName = '{USR_LASTNAME}, {USR_FIRSTNAME} ({USR_USERNAME})';break;
}
var tplNotes = new Ext.XTemplate( var tplNotes = new Ext.XTemplate(
'<tpl for=".">', '<tpl for=".">',
'<div class="thumb-wrap">', '<div class="thumb-wrap">',
'<div class="thumb" >', '<div class="thumb" >',
'<span class="x-editable"><b>{USR_USERNAME}</b></span><br>', '<span class="x-editable"><b>'+userName+'</b></span><br>',
'<span class="x-editable">{NOTE_CONTENT}</span><br>', '<span class="x-editable">{NOTE_CONTENT}</span><br>',
'<span class="x-editable"><small><i>{NOTE_DATE}</i></small><hr /></span>', '<span class="x-editable"><small><i>{NOTE_DATE}</i></small><hr /></span>',
'</div>', '</div>',