Пример #1
0
     }
 }
 $Account->setAccountId($accountId);
 $Account->setAccountName($accountName);
 $Account->setAccountCategoryId($categoryId);
 $Account->setAccountCustomerId($customerId);
 $Account->setAccountLogin($accountLogin);
 $Account->setAccountUrl($accountUrl);
 $Account->setAccountNotes($accountNotes);
 $Account->setAccountUserEditId($currentUserId);
 $Account->setAccountUsersId($accountOtherUsers);
 $Account->setAccountUserGroupsId($accountOtherGroups);
 $Account->setAccountOtherUserEdit($accountUserEditEnabled);
 $Account->setAccountOtherGroupEdit($accountGroupEditEnabled);
 // Cambiar el grupo principal si el usuario es Admin
 if (SP\Session::getUserIsAdminApp() || SP\Session::getUserIsAdminAcc()) {
     $Account->setAccountUserGroupId($accountMainGroupId);
 }
 // Comprobar si han habido cambios
 if ($accountChangesHash == $Account->calcChangesHash()) {
     SP\Response::printJSON(_('Sin cambios'), 0);
 }
 // Actualizar cuenta
 if ($Account->updateAccount()) {
     if (is_array($customFields)) {
         foreach ($customFields as $id => $value) {
             $CustomFields = new \SP\CustomFields($id, $accountId, $value);
             $CustomFields->updateCustomField();
         }
     }
     SP\Response::printJSON(_('Cuenta actualizada'), 0);
Пример #2
0
if (!SP\Request::analyze('actionId', 0, true)) {
    die('<div class="error">' . _('Parámetros incorrectos') . '</DIV>');
}
$actionId = SP\Request::analyze('actionId');
$itemId = SP\Request::analyze('itemId', 0);
$lastAction = SP\Request::analyze('lastAction', \SP\Controller\ActionsInterface::ACTION_ACC_SEARCH);
$tpl = new SP\Template();
$tpl->assign('actionId', $actionId);
$tpl->assign('id', $itemId);
$tpl->assign('activeTabId', $itemId);
$tpl->assign('lastAccountId', \SP\Session::getLastAcountId());
$tpl->assign('queryTimeStart', microtime());
$tpl->assign('userId', SP\Session::getUserId());
$tpl->assign('userGroupId', SP\Session::getUserGroupId());
$tpl->assign('userIsAdminApp', SP\Session::getUserIsAdminApp());
$tpl->assign('userIsAdminAcc', SP\Session::getUserIsAdminAcc());
$tpl->assign('themeUri', Themes::$themeUri);
// Control de ruta de acciones
if ($actionId != \SP\Controller\ActionsInterface::ACTION_ACC_SEARCH) {
    $actionsPath =& $_SESSION['actionsPath'];
    $actionsPath[] = $actionId;
    $actions = count($actionsPath);
    // Se eliminan las acciones ya realizadas
    if ($actions > 2 && $actionsPath[$actions - 3] == $actionId) {
        unset($actionsPath[$actions - 3]);
        unset($actionsPath[$actions - 2]);
        $actionsPath = array_values($actionsPath);
        $actions = count($actionsPath);
    }
    $tpl->assign('lastAction', $actionsPath[$actions - 2]);
}