Skip to content

Commit

Permalink
* [FIX] Fixed bug on publick link availability detection
Browse files Browse the repository at this point in the history
* [FIX] Fixed bug on viewing files for account from history
* [FIX] Fixed bug shen showing account request modification data
* [MOD] UI Tweaks
  • Loading branch information
nuxsmin committed Jan 13, 2017
1 parent 75e6be4 commit 47181be
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 31 deletions.
2 changes: 1 addition & 1 deletion inc/SP/Account/AccountAcl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ protected function makeAcl()
&& Acl::checkUserAccess(Acl::ACTION_ACC_EDIT);

// Mostrar acción de enlace público
$this->showLink = Checks::publicLinksIsEnabled() && Acl::checkUserAccess(Acl::ACTION_MGM_PUBLICLINKS);
$this->showLink = Checks::publicLinksIsEnabled() && Acl::checkUserAccess(Acl::ACTION_MGM_PUBLICLINKS_NEW);

// Mostrar acción de ver cuenta
$this->showView = $Acl->checkAccountAccess(Acl::ACTION_ACC_VIEW) && Acl::checkUserAccess(Acl::ACTION_ACC_VIEW);
Expand Down
5 changes: 2 additions & 3 deletions inc/SP/Account/AccountUtil.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,10 @@ public static function getLinkedAccounts($accountId)
'SELECT account_id, account_name, customer_name ' .
'FROM accounts ' .
'LEFT JOIN customers ON customer_id = account_customerId ' .
'WHERE ' . implode(' AND ', $queryWhere);
'WHERE ' . implode(' AND ', $queryWhere) . ' ORDER BY customer_name';

$Data->setQuery($query);


return DB::getResultsArray($Data);
}

Expand All @@ -240,7 +239,7 @@ public static function getAccountsForUser($accountId = 0)
'SELECT account_id, account_name, customer_name ' .
'FROM accounts ' .
'LEFT JOIN customers ON customer_id = account_customerId ' .
'WHERE ' . implode(' AND ', $queryWhere);
'WHERE ' . implode(' AND ', $queryWhere) . ' ORDER BY customer_name';

$Data->setQuery($query);

Expand Down
1 change: 1 addition & 0 deletions inc/SP/Controller/ItemsController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

namespace SP\Controller;

use SP\Account\AccountUtil;
use SP\Core\ItemsTypeInterface;
use SP\DataModel\DataModelInterface;
use SP\Mgmt\Categories\Category;
Expand Down
16 changes: 12 additions & 4 deletions inc/SP/Controller/MainController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,15 @@ private function getSessionBar()
{
$this->view->addTemplate('sessionbar');

$this->view->assign('adminApp', $this->UserData->isUserIsAdminApp() ? '<span title="' . _('Admin Aplicación') . '">(A+)</span>' : '');
$userType = null;

if ($this->UserData->isUserIsAdminApp()) {
$userType = $this->icons->getIconAppAdmin();
} elseif ($this->UserData->isUserIsAdminAcc()) {
$userType = $this->icons->getIconAccAdmin();
}

$this->view->assign('userType', $userType);
$this->view->assign('userId', $this->UserData->getUserId());
$this->view->assign('userLogin', strtoupper($this->UserData->getUserLogin()));
$this->view->assign('userName', $this->UserData->getUserName() ?: strtoupper($this->view->userLogin));
Expand Down Expand Up @@ -498,7 +506,7 @@ public function getPublicLink()
{
$this->setPage('publiclink');

$this->view->addTemplate('body-header');
$this->view->addTemplate('body-header', 'main');

$hash = Request::analyze('h');

Expand Down Expand Up @@ -540,8 +548,8 @@ public function getPublicLink()
$this->showError(self::ERR_PAGE_NO_PERMISSION, false);
}

$this->view->addTemplate('body-footer');
$this->view->addTemplate('body-end');
$this->view->addTemplate('body-footer', 'main');
$this->view->addTemplate('body-end', 'main');

$this->view();
exit();
Expand Down
1 change: 1 addition & 0 deletions inc/SP/Core/ItemsTypeInterface.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ interface ItemsTypeInterface
const ITEM_USERS = 5;
const ITEM_GROUPS = 6;
const ITEM_PROFILES = 7;
const ITEM_ACCOUNTS = 8;
}
5 changes: 4 additions & 1 deletion inc/SP/Mgmt/Users/UserPreferences.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ public function getById($id)
/** @var UserData $queryRes */
$queryRes = DB::getResults($Data);

if ($queryRes === false || $queryRes->getUserPreferences() === null) {
if ($queryRes === false
|| $queryRes->getUserPreferences() === null
|| $queryRes->getUserPreferences() === ''
) {
return $this->getItemData();
}

Expand Down
2 changes: 1 addition & 1 deletion inc/SP/Util/Util.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public static function getAppInfo($index = null)
*/
public static function getVersion($retBuild = false)
{
$build = '17011204';
$build = '17011301';
$version = [2, 0, 0];

if ($retBuild) {
Expand Down
2 changes: 1 addition & 1 deletion inc/themes/material-blue/css/styles.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions inc/themes/material-blue/views/account/account.inc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<?php foreach ($otherAccounts as $otherAccount): ?>
<?php $selected = ($gotData && (int)$otherAccount->account_id === $accountData->getAccountParentId()) ? 'selected' : ''; ?>

<option value="<?php echo $otherAccount->account_id; ?>" <?php echo $selected; ?>><?php printf('%s (%s)', $otherAccount->account_name, $otherAccount->customer_name); ?></option>
<option value="<?php echo $otherAccount->account_id; ?>" <?php echo $selected; ?>><?php printf('%s - %s', $otherAccount->customer_name, $otherAccount->account_name); ?></option>
<?php endforeach; ?>
</select>
</td>
Expand All @@ -214,10 +214,10 @@
</tr>
<?php endif; ?>

<?php if ($actionId === \SP\Core\ActionsInterface::ACTION_ACC_EDIT && $accountData->getUserEditName()): ?>
<?php if ($actionId === \SP\Core\ActionsInterface::ACTION_ACC_EDIT && $isModified && $accountData->getUserEditName()): ?>
<tr>
<td class="descField"><?php echo _('Última Modificación'); ?></td>
<td class="valField"><?php echo $accountData->getAccountDateEdit(), ' ', _('por'), ' ', $accountData->getUserEditName(); ?></td>
<td class="valField"><?php printf('%s (%s)', $accountData->getAccountDateEdit(), $accountData->getUserEditName()); ?></td>
</tr>
<?php endif; ?>

Expand Down
2 changes: 1 addition & 1 deletion inc/themes/material-blue/views/account/files.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<td class="descField"><?php echo _('Archivos'); ?></td>
<td class="valField">
<div id="list-account-files"
data-item-id="<?php echo $accountIsHistory ? $accountParentId : $accountId; ?>"
data-item-id="<?php echo $accountId; ?>"
data-history="<?php $accountIsHistory; ?>"
data-delete="<?php echo (int)$AccountAcl->isShowDelete(); ?>"
data-sk="<?php echo $sk; ?>">
Expand Down
9 changes: 0 additions & 9 deletions inc/themes/material-blue/views/account/request.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@
<td class="descField"><?php echo _('Cliente'); ?></td>
<td class="valField"><?php echo $accountData->customer_name; ?></td>
</tr>
<tr>
<td class="descField"><?php echo _('URL / IP'); ?></td>
<td class="valField"><A href="<?php echo $accountData->getAccountUrl(); ?>"
target="_blank"><?php echo $accountData->getAccountUrl(); ?></td>
</tr>
<tr>
<td class="descField"><?php echo _('Usuario'); ?></td>
<td class="valField"><?php echo $accountData->getAccountLogin(); ?></td>
</tr>
<tr>
<td class="descField"><?php echo _('Petición'); ?></td>
<td class="valField">
Expand Down
21 changes: 17 additions & 4 deletions inc/themes/material-blue/views/main/body-footer.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php if ($useLayout === true): ?>
</div> <!-- Close mdl-layout -->
</div> <!-- Close mdl-layout -->
<?php endif; ?>
</div> <!-- Close container -->
<footer>
Expand All @@ -9,6 +9,7 @@
<i id="btnLogout" class="material-icons">exit_to_app</i>
<span for="btnLogout"
class="mdl-tooltip mdl-tooltip--top"><?php echo _('Salir'); ?></span>

<?php if ($showPassIcon): ?>
<i id="btnUserPass" class="btn-action material-icons"
data-onclick="appMgmt/show"
Expand All @@ -33,12 +34,24 @@
class="mdl-tooltip mdl-tooltip--top"><?php printf(_('Hay %d notificaciones pendientes'), $userNotices); ?></span>
<?php else: ?>
<div id="notices-user" class="material-icons mdl-badge mdl-badge--overlap"
data-badge="0">notifications</div>
data-badge="0">notifications
</div>
<span for="notices-user"
class="mdl-tooltip mdl-tooltip--top"><?php echo _('No hay notificaciones pendientes'); ?></span>
class="mdl-tooltip mdl-tooltip--top"><?php echo _('No hay noInes pendientes'); ?></span>
<?php endif; ?>

<span id="user-info"><?php printf('%s (%s) %s', $userName, $userGroup, $adminApp); ?></span>
<span id="user-info">
<span id="user-name"><?php echo $userName; ?></span>
<span for="user-name"
class="mdl-tooltip mdl-tooltip--top"><?php printf('%s : %s', _('Grupo'), $userGroup); ?></span>

<?php /** @var \SP\Html\Assets\IconInterface $userType */
if ($userType !== null): ?>
<i id="user-type" class="material-icons"><?php echo $userType->getIcon(); ?></i>
<span for="user-type"
class="mdl-tooltip mdl-tooltip--top"><?php echo $userType->getTitle(); ?></span>
<?php endif; ?>
</span>
</div>
<?php endif; ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion js/app-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ sysPass.Actions = function (Common) {
* @param response
*/
var showImageBox = function ($obj, response) {
var $content = $("<div id=\"fancyContainer\" class=\"image\">" + response + "</div>");
var $content = $("<div id=\"box-popup\" class=\"image\">" + response + "</div>");
var $image = $content.find("img");

$image.hide();
Expand Down
4 changes: 2 additions & 2 deletions js/app-actions.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 47181be

Please sign in to comment.