BUG 0000 BUG 0000 User Inbox Simplified (third commit)

This commit is contained in:
Erik Amaru Ortiz
2012-01-31 18:45:30 -04:00
parent 6bc409131d
commit 8c91f1c057
16 changed files with 205 additions and 60 deletions

View File

@@ -1676,6 +1676,11 @@ $output = $outputHeader.$output;
$format = str_replace('dd', '{DAY}', $format);
$format = str_replace('d', '{day}', $format);
$format = str_replace('h', '{h}', $format);
$format = str_replace('i', '{i}', $format);
$format = str_replace('s', '{s}', $format);
if ($lang==='') $lang=defined(SYS_LANG)?SYS_LANG:'en';
$aux = explode (' ', $date); //para dividir la fecha del dia
@@ -1686,9 +1691,9 @@ $output = $outputHeader.$output;
$month = (int)((isset($date[1]))?$date[1]:'0'); //month
$day = (int)((isset($date[2]))?$date[2]:'0'); //day
$time[0] = (int)((isset($time[0]))?$time[0]:'0'); //hour
$time[1] = (int)((isset($time[1]))?$time[1]:'0'); //minute
$time[2] = (int)((isset($time[2]))?$time[2]:'0'); //second
$h = isset($time[0])? $time[0]: '00'; //hour
$i = isset($time[1])? $time[1]: '00'; //minute
$s = isset($time[2])? $time[2]: '00'; //second
$MONTHS = Array();
for($i=1; $i<=12; $i++){
@@ -1707,8 +1712,8 @@ $output = $outputHeader.$output;
$yy = substr($year,strlen($year)-2,2);
$yyyy = $year;
$names = array('{day}', '{DAY}', '{month}', '{YONTH}', '{XONTH}', '{year}', '{YEAR}');
$values = array($d, $dd, $m, $mm, $M, $yy, $yyyy);
$names = array('{day}', '{DAY}', '{month}', '{YONTH}', '{XONTH}', '{year}', '{YEAR}', '{h}', '{i}', '{s}');
$values = array($d, $dd, $m, $mm, $M, $yy, $yyyy, $h, $i, $s);
$ret = str_replace( $names, $values, $format );

View File

@@ -16,8 +16,10 @@ require_once 'classes/model/om/BaseUsersProperties.php';
/**
* @package workflow.engine.classes.model
*/
class UsersProperties extends BaseUsersProperties {
function UserPropertyExists($sUserUID) {
class UsersProperties extends BaseUsersProperties
{
function UserPropertyExists($sUserUID)
{
try {
$oUserProperty = UsersPropertiesPeer::retrieveByPk($sUserUID);
if (is_object($oUserProperty) && get_class($oUserProperty) == 'UsersProperties') {
@@ -32,7 +34,8 @@ class UsersProperties extends BaseUsersProperties {
}
}
public function load($sUserUID) {
public function load($sUserUID)
{
try {
$oUserProperty = UsersPropertiesPeer::retrieveByPK($sUserUID);
if (!is_null($oUserProperty)) {
@@ -49,7 +52,8 @@ class UsersProperties extends BaseUsersProperties {
}
}
public function create($aData) {
public function create($aData)
{
$oConnection = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
try {
$oUserProperty = new UsersProperties();
@@ -75,7 +79,8 @@ class UsersProperties extends BaseUsersProperties {
}
}
public function update($aData) {
public function update($aData)
{
$oConnection = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
try {
$oUserProperty = UsersPropertiesPeer::retrieveByPK($aData['USR_UID']);
@@ -106,7 +111,8 @@ class UsersProperties extends BaseUsersProperties {
}
}
public function loadOrCreateIfNotExists($sUserUID, $aUserProperty = array()) {
public function loadOrCreateIfNotExists($sUserUID, $aUserProperty = array())
{
if (!$this->UserPropertyExists($sUserUID)) {
$aUserProperty['USR_UID'] = $sUserUID;
if (!isset($aUserProperty['USR_LAST_UPDATE_DATE'])) {
@@ -123,7 +129,8 @@ class UsersProperties extends BaseUsersProperties {
return $aUserProperty;
}
public function validatePassword($sPassword, $sLastUpdate, $iChangePasswordNextTime) {
public function validatePassword($sPassword, $sLastUpdate, $iChangePasswordNextTime)
{
if (!defined('PPP_MINIMUM_LENGTH')) {
define('PPP_MINIMUM_LENGTH', 5);
}
@@ -219,6 +226,7 @@ class UsersProperties extends BaseUsersProperties {
require_once 'classes/model/Users.php';
$u = UsersPeer::retrieveByPK($sUserUID);
$uxType = $u->getUsrUx();
$_SESSION['user_experience'] = 'NORMAL';
// find a group setting
if ($uxType == '' || $uxType == 'NORMAL') {
@@ -236,21 +244,21 @@ class UsersProperties extends BaseUsersProperties {
switch ($uxType) {
case 'SIMPLIFIED':
case 'SWITCHABLE':
$_SESSION['user_experience'] = $uxType;
return '/sys' . SYS_SYS . '/' . $sLanguage . '/' . SYS_SKIN . '/' . 'home';
break;
}
// end user experience redirection
#New feature by Erik erik@colosa.com>
#get user preferences for default redirect
#verifying if it has any preferences on the configurations table
// get user preferences for default redirect
// verifying if it has any preferences on configurations table
G::loadClass('configuration');
$oConf = new Configurations;
$oConf->loadConfig($x, 'USER_PREFERENCES','','',$_SESSION['USER_LOGGED'],'');
if( sizeof($oConf->aConfig) > 0) { #this user has a configuration record
//these is for backward compatibility, because now, we dont have user and dashboard menu.
if( sizeof($oConf->aConfig) > 0) { // this user has a configuration record
// backward compatibility, because now, we don't have user and dashboard menu.
if ( $oConf->aConfig['DEFAULT_MENU'] == 'PM_USERS') $oConf->aConfig['DEFAULT_MENU'] = 'PM_SETUP';
if ( $oConf->aConfig['DEFAULT_MENU'] == 'PM_DASHBOARD') $oConf->aConfig['DEFAULT_MENU'] = 'PM_SETUP';

View File

@@ -11,18 +11,17 @@ class Admin extends Controller
public function uxList()
{
require_once PATH_CONTROLLERS . 'adminProxy.php';
$this->includeExtJS('admin/uxUsersList');
//$this->setView('admin/calendarEdit');
//$this->setJSVar('fields',$fields);ç
G::LoadClass('configuration');
$c = new Configurations();
$configPage = $c->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$this->setJSVar('CONFIG', $Config);
$this->setJSVar('FORMATS',$c->getFormats());
$this->setJSVar('FORMATS', $c->getFormats());
$this->setJSVar('uxTypes', AdminProxy::getUxTypesList('list'));
G::RenderPage('publish', 'extJs');
}

View File

@@ -61,13 +61,27 @@ class adminProxy extends HttpProxyController
return array('success' => true, 'message'=>'done', 'groups'=>$row);
}
function getUxTypesList()
function getUxTypesList($type = 'assoc')
{
return Array(
$list = array();
if ($type == 'assoc') {
$list = array(
'NORMAL' => 'Normal',
'SIMPLIFIED' => 'Simplified'
'SIMPLIFIED' => 'Simplified',
'SWITCHABLE' => 'Switchable'
);
}
else {
$list = array(
array('NORMAL', 'Normal'),
array('SIMPLIFIED', 'Simplified'),
array('SWITCHABLE', 'Switchable')
);
}
return $list;
}
function calendarSave()
{

View File

@@ -13,10 +13,15 @@ class Home extends Controller
private $userName;
private $userFullName;
private $userRolName;
private $userUxType;
public function __construct()
{
$_SESSION['user_experience'] = 'simplified';
// setting as using simplified.
$_SESSION['current_ux'] = 'SIMPLIFIED';
// getting the ux type from user o group conf.
$this->userUxType = isset($_SESSION['user_experience'])? $_SESSION['user_experience']: $_SESSION['current_ux'];
if (isset($_SESSION['USER_LOGGED']) && !empty($_SESSION['USER_LOGGED'])) {
$this->userID = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : null;
@@ -24,6 +29,7 @@ class Home extends Controller
$this->userFullName = isset($_SESSION['USR_FULLNAME']) ? $_SESSION['USR_FULLNAME'] : '';
$this->userRolName = isset($_SESSION['USR_ROLENAME']) ? $_SESSION['USR_ROLENAME'] : '';
}
//g::pr($_SESSION); die;
}
/**
@@ -52,6 +58,7 @@ class Home extends Controller
$this->setVar('userName', $this->userName);
$this->setVar('processList', $processList);
$this->setVar('canStartCase', $case->canStartCase($_SESSION ['USER_LOGGED']));
$this->setVar('userUxType', $this->userUxType);
G::RenderPage('publish', 'mvc');
}

View File

@@ -77,7 +77,7 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') ==
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1) {
$G_TMP_MENU->AddIdRawOption('AUTHSOURCES', '../authSources/authSources_List', G::LoadTranslation('ID_AUTH_SOURCES'), '', '', 'users');
$G_TMP_MENU->AddIdRawOption('UX', '../admin/uxList', 'User experience (UX)', '', '', 'users');
$G_TMP_MENU->AddIdRawOption('UX', '../admin/uxList', G::LoadTranslation('ID_USER_EXPERIENCE'), '', '', 'users');
}

View File

@@ -146,7 +146,7 @@ try {
//Events - End
$debuggerAvailable = true;
if (isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'simplified') {
if (isset($_SESSION['current_ux']) && $_SESSION['current_ux'] == 'SIMPLIFIED') {
$aNextStep['PAGE'] = '../home/appList';
$debuggerAvailable = false;
}

View File

@@ -239,7 +239,7 @@ try {
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep ['PAGE'];
$debuggerAvailable = true;
if (isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'simplified') {
if (isset($_SESSION['current_ux']) && $_SESSION['current_ux'] == 'SIMPLIFIED') {
$debuggerAvailable = false;
}

View File

@@ -53,7 +53,7 @@
$oHeadPublisher->assign( 'defaultOption', $defaultOption); // user menu permissions
$oHeadPublisher->assign( '_nodeId', isset($confDefaultOption)?$confDefaultOption:'PM_USERS'); // user menu permissions
$_SESSION['user_experience'] = 'normal';
$_SESSION['current_ux'] = 'NORMAL';
G::RenderPage('publish', 'extJs');

View File

@@ -16,12 +16,15 @@
<td width="50%" height="16" align="right" valign="top">
<div align="right" class="logout">
<small>
{php}if ((int)$_SESSION['USER_LOGGED'] != 0) {{/php}
{if $user_logged neq ''}
{$msgVer}<label class="textBlue">{$userfullname} <a href="../users/myInfo">{$user}</a> | </label>
{if $switch_interface}
<label class="textBlue"><a href="../home">{$switch_interface_label}</a> | </label>
{/if}
<a href="{$linklogout}" class="tableOption">{$logout}</a>&nbsp;&nbsp;<br/>
<label class="textBlack"><b>{$rolename}</b> {$workspace_label} <b><u>{$workspace}</u></b> &nbsp; &nbsp; <br/>
{$udate}</label>&nbsp; &nbsp;
{php}}{/php}
{/if}
</small>
</div>
</td>

View File

@@ -6,7 +6,7 @@
body {
margin : 0px;
color : #808080;
font : normal 8em sans-serif,Tahoma,MiscFixed;
font : normal 11px sans-serif,Tahoma,MiscFixed;
background-color: #ECECEC;
}
@@ -21,7 +21,6 @@
}
a:hover {
color: #1F98C7;
font-weight: bold;
text-decoration: underline;
}
@@ -53,6 +52,9 @@
z-index: 0;
}
.ui-widget .ui-widget {
font-size: 12px !important;
}
.bar-nav {
width: 100%;
@@ -129,6 +131,14 @@
#commentlist .notes-link {
position: absolute;
right: 0;
top: 64px;
font: normal 200%/100% Georgia, "Times New Roman", Times, serif;
color: #ccc;
}
#commentlist .notes-plus-link {
position: absolute;
right: 0px;
top: 38px;
font: normal 200%/100% Georgia, "Times New Roman", Times, serif;
color: #ccc;

View File

@@ -481,6 +481,13 @@ if (isset($G_ENABLE_BLANK_SKIN) && $G_ENABLE_BLANK_SKIN) {
define('NO_DISPLAY_USERNAME', 0);
}
if (NO_DISPLAY_USERNAME == 0) {
$switch_interface = isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'SWITCHABLE';
$smarty->assign('user_logged', (isset($_SESSION['USER_LOGGED'])? $_SESSION['USER_LOGGED'] : ''));
$smarty->assign('switch_interface', $switch_interface);
$smarty->assign('switch_interface_label', G::LoadTranslation('ID_SWITCH_INTERFACE'));
$smarty->assign('userfullname', isset($_SESSION['USR_FULLNAME']) ? $_SESSION['USR_FULLNAME'] : '');
$smarty->assign('user', isset($_SESSION['USR_USERNAME']) ? '(' . $_SESSION['USR_USERNAME'] . ')' : '');
$smarty->assign('rolename', isset($_SESSION['USR_ROLENAME']) ? $_SESSION['USR_ROLENAME'] . '' : '');

View File

@@ -169,7 +169,7 @@ Ext.onReady(function(){
editable: false,
store: new Ext.data.ArrayStore({
fields: ['id', 'name'],
data : [['NORMAL', 'Normal'], ['SIMPLIFIED', 'Simplified']]
data : uxTypes
}),
listeners: {
select: function(a, b) {
@@ -177,11 +177,10 @@ Ext.onReady(function(){
role = row.get('USR_ROLE');
//console.log(role)
if (role == 'PROCESSMAKER_ADMIN') {
PMExt.warning(_('ID_ERROR'), 'You can\'t assign this User Experience UI for users that have PROCESSMAKER_ADMIN role.');
this.setValue('NORMAL');
}
// if (role == 'PROCESSMAKER_ADMIN') {
// PMExt.warning(_('ID_ERROR'), 'You can\'t assign this User Experience UI for users that have PROCESSMAKER_ADMIN role.');
// this.setValue('NORMAL');
// }
}
}
})
@@ -286,7 +285,7 @@ Ext.onReady(function(){
editable: false,
store: new Ext.data.ArrayStore({
fields: ['id', 'name'],
data : [['NORMAL', 'Normal'], ['SIMPLIFIED', 'Simplified']]
data : uxTypes
})
})
}

View File

@@ -3,8 +3,12 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes" />
<link rel="stylesheet" href="/css/simplified.css" media="screen" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/js/jquery/css/smoothness/jquery-ui-1.8.17.custom.css" type="text/css">
<script type="text/javascript" src="/js/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="/js/jquery/jquery-ui-1.8.17.min.js"></script>
{literal}
<style>
@@ -33,9 +37,9 @@
$('.content-header').width(w-50);
}
function showNt(appNum)
function showNt(appUid)
{
var d = $('#m_'+appNum);
var d = $('#m_'+appUid);
if (d.css('display') == 'block') {
d.hide('slow');
@@ -44,6 +48,63 @@
d.show('slow');
}
}
function addNt(appUid)
{
$( "#dialog-add-note" ).dialog({
resizable: false,
height:178,
modal: true,
buttons: {
"Add Note": function() {
$(this).dialog("close");
$.post(
'../appProxy/postNote',
{appUid: appUid, noteText: $('textarea#note_text').val()},
function(responseText) {
updateNt(appUid);
}
);
//redirect('home/startCase?id='+id);
},
Cancel: function() {
$(this).dialog( "close" );
}
}
});
}
function updateNt(appUid)
{
$.post(
'../appProxy/getNotesList?appUid='+appUid,
{start:0, limit:100},
function(resp) {
data = jQuery.parseJSON(resp);
content = $('div#m_'+appUid);
content.html('');
for (i=0; i<data.notes.length; i++) {
r = data.notes[i];
console.log(r);
s = '<div class="appMessage"><table border="0"><tr>' +
'<td width="50" valign="top">'+
'<img border="0" src="../users/users_ViewPhotoGrid?pUID='+r.USR_UID+'" width="40" height="40"/>' +
'</td><td>' +
'<h3>'+r.USR_FIRSTNAME+' '+r.USR_LASTNAME+' ('+r.USR_USERNAME+')</h3>' +
'<p><pre>'+r.NOTE_CONTENT+'</pre>' +
'<div class="appMessageDate">Posted at '+r.NOTE_DATE+'</div>' +
'</td></tr></table></div>';
console.log(s);
content.append(s);
$('#n_'+appUid).show('slow');
}
d = $('#m_'+appUid);
d.show('slow');
}
);
return true;
}
</script>
{/literal}
</head>
@@ -60,11 +121,13 @@
#{$APP.APP_NUMBER}
</span>
{if $APP.NOTES_COUNT neq 0}
<span class="notes-link">
<a href="#" onclick="showNt('{$APP.APP_NUMBER}'); return false;"><img src="/images/simplified/messages-grey.png" height="20" width="20"></a>
<span id="n_{$APP.APP_UID}" class="notes-link" style="display:{if $APP.NOTES_COUNT neq 0}block{else}none{/if}">
<a href="#" onclick="showNt('{$APP.APP_UID}'); return false;"><img src="/images/simplified/messages-grey.png" height="20" width="20"></a>
</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"></a>
</span>
{/if}
<p>
<cite>
@@ -75,7 +138,7 @@
<p>{$APP.APP_PRO_TITLE}
<br/>{$APP.APP_TAS_TITLE}</p>
<div id="m_{$APP.APP_NUMBER}" class="appMessages">
<div id="m_{$APP.APP_UID}" class="appMessages">
{if $APP.NOTES_COUNT neq 0}
{foreach from=$APP.NOTES_LIST key=k item=NOTE}
<div class="appMessage">
@@ -102,5 +165,13 @@
</ul>
</div>
</center>
<div id="dialog-add-note" title="Case Note" style="display:none">
<p><!-- <span class="ui-icon ui-icon-document" style="float:left; margin:0 7px 20px 0;"></span> -->
<span id="startAppTitle"/>
<textarea id="note_text" rows="2" cols="22"></textarea>
</p>
</div>
</body>
</html>

View File

@@ -35,7 +35,7 @@
function appStart(id, title)
{
$.confirm({
/*$.confirm({
'title' : 'Start Case Confirmation',
'message' : 'Do you wanna start a new case for:<br /> * <b>"'+title+'"</b>?',
'buttons' : {
@@ -51,6 +51,22 @@
'action': function(){} // Nothing to do in this case. You can as well omit the action property.
}
}
});*/
$('#startAppTitle').html(title)
$( "#dialog-confirm" ).dialog({
resizable: false,
height:160,
modal: true,
buttons: {
"Start Case": function() {
$( this ).dialog( "close" );
redirect('home/startCase?id='+id);
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
}
</script>
@@ -83,7 +99,7 @@
{if $canStartCase neq false}
<li class="account">
<a class="menu user-actions" href="#">
<img alt="A99679add21e8b0704ea5f0fb569572c_mini" src="/images/simplified/plus-set-grey.png" title="Start a new Application"/>
<img alt="A99679add21e8b0704ea5f0fb569572c_mini" src="/images/simplified/plus-set-grey.png" title="New Case"/>
<!-- <span class="menu-label screen-name">new cases</span> -->
</a>
@@ -108,7 +124,9 @@
<ul class="menu-dropdown">
<!--<li><a href="#" accesskey="s" id="settings_link">Settings</a></li>
<li><a href="#" accesskey="?" id="help_link">Help</a></li>-->
{if $userUxType eq 'SWITCHABLE'}
<li><a href="cases/main" accesskey="?" id="help_link">Switch Interface</a></li>
{/if}
<li><a href="login/login" accesskey="l" id="sign_out_link">Sign out</a></li>
</ul>
</li>
@@ -122,6 +140,10 @@
<iframe id="iframex" name="iframex" src="home/appList" width="100%" height="200" scrolling="yes" frameborder="0"></iframe>
<div id="dialog-confirm" title="Confirm" style="display:none">
<p><span class="ui-icon ui-icon-document" style="float:left; margin:0 7px 20px 0;"></span>
<span id="startAppTitle"/></p>
</div>
{literal}
<script type="text/javascript">

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB