BUG 0000 BUG 0000 User Inbox Simplified (th commit)

This commit is contained in:
Erik Amaru Ortiz
2012-02-01 17:59:27 -04:00
parent 40749dfb74
commit 862215fd62
4 changed files with 41 additions and 7 deletions

View File

@@ -68,14 +68,29 @@ class Home extends Controller
public function appList($httpData) public function appList($httpData)
{ {
require_once ( "classes/model/AppNotes.php" );
$appNotes = new AppNotes();
$httpData->t = isset($httpData->t)? $httpData->t : 'in'; $httpData->t = isset($httpData->t)? $httpData->t : 'in';
$title = $httpData->t != 'draft' ? 'My Inbox' : 'My Drafts'; $title = $httpData->t != 'draft' ? 'My Inbox' : 'My Drafts';
$action = $httpData->t != 'draft' ? 'todo' : 'draft'; $action = $httpData->t != 'draft' ? 'todo' : 'draft';
$notesStart = 0;
$notesLimit = 4;
//$cases = self::getAppList($httpData->t, $this->appListStart, $this->appListLimit); //$cases = self::getAppList($httpData->t, $this->appListStart, $this->appListLimit);
G::LoadClass('applications'); G::LoadClass('applications');
$apps = new Applications(); $apps = new Applications();
$cases = $apps->getAll($this->appListStart, $this->appListLimit, $action); $cases = $apps->getAll($this->appListStart, $this->appListLimit, $action);
foreach ($cases['data'] as $i => $row) {
$notes = $appNotes->getNotesList($row['APP_UID'], $this->userID, $notesStart, $notesLimit);
$notes = $notes['array'];
$cases['data'][$i]['NOTES_COUNT'] = $notes['totalCount'];
$cases['data'][$i]['NOTES_LIST'] = $notes['notes'];
}
// settings html template // settings html template
$this->setView('home/appList'); $this->setView('home/appList');
@@ -85,7 +100,8 @@ class Home extends Controller
$this->setVar('cases_count', $cases['totalCount']); $this->setVar('cases_count', $cases['totalCount']);
$this->setVar('title', $title); $this->setVar('title', $title);
$this->setVar('appListStart', $this->appListLimit); $this->setVar('appListStart', $this->appListLimit);
$this->setVar('appListLimit', 5); $this->setVar('appListLimit', 10);
$this->setVar('listType', $httpData->t);
G::RenderPage('publish', 'mvc'); G::RenderPage('publish', 'mvc');
} }
@@ -94,7 +110,24 @@ class Home extends Controller
{ {
G::LoadClass('applications'); G::LoadClass('applications');
$apps = new Applications(); $apps = new Applications();
$cases = $apps->getAll($httpData->start, $httpData->limit);
require_once ( "classes/model/AppNotes.php" );
$appNotes = new AppNotes();
$notesStart = 0;
$notesLimit = 4;
$action = $httpData->t != 'draft' ? 'todo' : 'draft';
$cases = $apps->getAll($httpData->start, $httpData->limit, $action);
foreach ($cases['data'] as $i => $row) {
$notes = $appNotes->getNotesList($row['APP_UID'], $this->userID, $notesStart, $notesLimit);
$notes = $notes['array'];
$cases['data'][$i]['NOTES_COUNT'] = $notes['totalCount'];
$cases['data'][$i]['NOTES_LIST'] = $notes['notes'];
}
$this->setView('home/applications'); $this->setView('home/applications');

View File

@@ -158,8 +158,8 @@
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 5px;
-moz-border-radius: 5px 5px 5px 5px; -moz-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.6); /*-webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.6);*/
-moz-box-shadow: 0 1px 2px rgba(0,0,0,0.6); /*-moz-box-shadow: 0 1px 2px rgba(0,0,0,0.6);*/
min-height: 20px; min-height: 20px;
padding: 12px; padding: 12px;
} }

View File

@@ -120,7 +120,7 @@
$("#loadmorebutton").click(function (){ $("#loadmorebutton").click(function (){
$('#loadmorebutton').html('<img src="/images/ajax-loader.gif" />'); $('#loadmorebutton').html('<img src="/images/ajax-loader.gif" />');
$.ajax({ $.ajax({
url: "getApps?start="+appListStart+"&limit="+appListLimit, url: "getApps?t="+listType+"&start="+appListStart+"&limit="+appListLimit,
success: function(html){ success: function(html){
appListStart += appListLimit; appListStart += appListLimit;
@@ -141,6 +141,7 @@
var appListLimit = {$appListLimit}; var appListLimit = {$appListLimit};
var appListStart = {$appListStart}; var appListStart = {$appListStart};
var listType = '{$listType}';
</script> </script>
</head> </head>

View File

@@ -6,11 +6,11 @@
</span> </span>
<span id="n_{$APP.APP_UID}" class="notes-link" style="display:{if $APP.NOTES_COUNT neq 0}block{else}none{/if}"> <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> <a href="#" onclick="showNt('{$APP.APP_UID}'); return false;"><img src="/images/simplified/messages-grey.png" height="20" width="20" border="0"></a>
</span> </span>
<span class="notes-plus-link"> <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> <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>
</span> </span>
<p> <p>