diff --git a/CHANGELOG b/CHANGELOG index 6878922f..f3cf6cdb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,12 @@ +=== ** v1.0rc3 ** === + +* [BUG] Corregidos fallos en la comprobación de actualizaciones. +* [BUG] Corregido error al borrar grupos. +* [MOD] Cambio de fancybox por alertify para los mensajes que no requieren de bloqueo. +* [MOD] Ecribir versión en BD y archivo de configuración. +* [MOD] Añadir scroll en resultados de cuentas, usuarios, grupos y perfiles. +* [MOD] Actualizadas las traducciones. + === ** v1.0rc2 ** === * [MOD] Mejor manejo de peticiones GET/POST. @@ -109,6 +118,15 @@ --- +=== ** v1.0rc3 ** === + +* [BUG] Fix updates checking. +* [BUG] Fix error on removing groups. +* [MOD] Change fancybox to alertify for non-locking messages. +* [MOD] Set version string in DB and config file +* [MOD] Update translations +* [MOD] Add scroll to search, users, groups and profiles results. + === ** v1.0rc2 ** === * [MOD] Better GET/POST variable handling. diff --git a/ajax/ajax_checkupds.php b/ajax/ajax_checkupds.php index 1d7bbddb..a0637745 100644 --- a/ajax/ajax_checkupds.php +++ b/ajax/ajax_checkupds.php @@ -28,7 +28,7 @@ include_once (APP_ROOT."/inc/init.php"); SP_Util::checkReferer('GET'); -$checkVersion = SP_Common::parseParams('s', 'UPDATED', FALSE); +$checkVersion = SP_Common::parseParams('s', 'UPDATED', FALSE, TRUE); // Una vez por sesión if ( ! $checkVersion ){ diff --git a/css/alertify.core.css b/css/alertify.core.css new file mode 100644 index 00000000..12d82dd2 --- /dev/null +++ b/css/alertify.core.css @@ -0,0 +1,137 @@ +.alertify, +.alertify-show, +.alertify-log { + -webkit-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); + -moz-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); + -ms-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); + -o-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); + transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); /* easeOutBack */ +} +.alertify-hide { + -webkit-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); + -moz-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); + -ms-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); + -o-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); + transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); /* easeInBack */ +} +.alertify-log-hide { + -webkit-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); + -moz-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); + -ms-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); + -o-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); + transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); /* easeInBack */ +} +.alertify-cover { + position: fixed; z-index: 99999; + top: 0; right: 0; bottom: 0; left: 0; + background-color:white; + filter:alpha(opacity=0); + opacity:0; +} + .alertify-cover-hidden { + display: none; + } +.alertify { + position: fixed; z-index: 99999; + top: 50px; left: 50%; + width: 550px; + margin-left: -275px; + opacity: 1; +} + .alertify-hidden { + -webkit-transform: translate(0,-150px); + -moz-transform: translate(0,-150px); + -ms-transform: translate(0,-150px); + -o-transform: translate(0,-150px); + transform: translate(0,-150px); + opacity: 0; + display: none; + } + /* overwrite display: none; for everything except IE6-8 */ + :root *> .alertify-hidden { + display: block; + visibility: hidden; + } +.alertify-logs { + position: fixed; + z-index: 5000; + bottom: 10px; + right: 10px; + width: 300px; +} +.alertify-logs-hidden { + display: none; +} + .alertify-log { + display: block; + margin-top: 10px; + position: relative; + right: -300px; + opacity: 0; + } + .alertify-log-show { + right: 0; + opacity: 1; + } + .alertify-log-hide { + -webkit-transform: translate(300px, 0); + -moz-transform: translate(300px, 0); + -ms-transform: translate(300px, 0); + -o-transform: translate(300px, 0); + transform: translate(300px, 0); + opacity: 0; + } + .alertify-dialog { + padding: 25px; + } + .alertify-resetFocus { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; + } + .alertify-inner { + text-align: center; + } + .alertify-text { + margin-bottom: 15px; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + font-size: 100%; + } + .alertify-buttons { + } + .alertify-button, + .alertify-button:hover, + .alertify-button:active, + .alertify-button:visited { + background: none; + text-decoration: none; + border: none; + /* line-height and font-size for input button */ + line-height: 1.5; + font-size: 100%; + display: inline-block; + cursor: pointer; + margin-left: 5px; + } + +@media only screen and (max-width: 680px) { + .alertify, + .alertify-logs { + width: 90%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .alertify { + left: 5%; + margin: 0; + } +} diff --git a/css/alertify.default.css b/css/alertify.default.css new file mode 100644 index 00000000..e6e3d89f --- /dev/null +++ b/css/alertify.default.css @@ -0,0 +1,82 @@ +/** + * Default Look and Feel + */ +.alertify, +.alertify-log { + font-family: sans-serif; +} +.alertify { + background: #FFF; + border: 10px solid #333; /* browsers that don't support rgba */ + border: 10px solid rgba(0,0,0,.7); + border-radius: 8px; + box-shadow: 0 3px 3px rgba(0,0,0,.3); + -webkit-background-clip: padding; /* Safari 4? Chrome 6? */ + -moz-background-clip: padding; /* Firefox 3.6 */ + background-clip: padding-box; /* Firefox 4, Safari 5, Opera 10, IE 9 */ +} +.alertify-text { + border: 1px solid #CCC; + padding: 10px; + border-radius: 4px; +} +.alertify-button { + border-radius: 4px; + color: #FFF; + font-weight: bold; + padding: 6px 15px; + text-decoration: none; + text-shadow: 1px 1px 0 rgba(0,0,0,.5); + box-shadow: inset 0 1px 0 0 rgba(255,255,255,.5); + background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); + background-image: -moz-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); + background-image: -ms-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); + background-image: -o-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); + background-image: linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); +} +.alertify-button:hover, +.alertify-button:focus { + outline: none; + background-image: -webkit-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0)); + background-image: -moz-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0)); + background-image: -ms-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0)); + background-image: -o-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0)); + background-image: linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0)); +} +.alertify-button:focus { + box-shadow: 0 0 15px #2B72D5; +} +.alertify-button:active { + position: relative; + box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); +} +.alertify-button-cancel, +.alertify-button-cancel:hover, +.alertify-button-cancel:focus { + background-color: #FE1A00; + border: 1px solid #D83526; +} +.alertify-button-ok, +.alertify-button-ok:hover, +.alertify-button-ok:focus { + background-color: #5CB811; + border: 1px solid #3B7808; +} + +.alertify-log { + background: #1F1F1F; + background: rgba(0,0,0,.9); + padding: 15px; + border-radius: 4px; + color: #FFF; + font-weight: bold; + text-shadow: -1px -1px 0 rgba(0,0,0,.5); +} +.alertify-log-error { + background: #FE1A00; + background: rgba(254,26,0,.9); +} +.alertify-log-success { + background: #5CB811; + background: rgba(92,184,17,.9); +} \ No newline at end of file diff --git a/css/styles.css b/css/styles.css index b638bb3a..c30cd24d 100644 --- a/css/styles.css +++ b/css/styles.css @@ -244,8 +244,12 @@ A:focus {text-decoration: none; color: #FF0000;} #content #tblTools{width: 100%; height: 5em; padding-left: 15px;padding: 5px;} -#content #resBuscar{ width: 100%; margin-top: 20px; min-height: 500px;} +#content #resBuscar{ width: 100%; margin-top: 20px;} #content #resBuscar IMG {vertical-align:middle;} +#content #resBuscar #data-search, +#content .data-rows, +#content #resEventLog #resSearch +{overflow-y: auto; max-height: 400px} #content #pageNav { float: left; @@ -714,6 +718,16 @@ A:focus {text-decoration: none; color: #FF0000;} #passLevel.good, #passLevel.good:hover { background-color: #FFF2D9 !important; color: orange; font-weight: bold; border: #ffe5b3 1px solid;} #passLevel.weak, #passLevel.weak:hover { background-color: #fee8e6 !important; color: #CC0000; font-weight: bold; border: #fed2ce 1px solid;} +#alert #alert-text{margin: 15px auto; font-size: 14px; font-weight: bold;} +#alert #alert-pass{ + width: 50%; + padding: 10px; + margin: 15px auto; + border: 1px solid #c9c9c9; + color: #555; + font-weight: bold; +} + /*Login Page*/ #boxLogin{ width:450px; diff --git a/inc/config.class.php b/inc/config.class.php index 66f6b2f3..e429b379 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -49,14 +49,14 @@ class SP_Config{ static $arrConfigValue; /** - * @brief Obtener en valor de un parámetro - * @param string $strConfigParam parámetro - * @return string valor + * @brief Obtiene un valor desde la configuración en la BBDD + * @param string $param con el parámetro de configuración + * @return string con el valor * * Obtener el valor de un parámetro almacenado en la BBDD */ - public static function getConfigValue($strConfigParam){ - $query = "SELECT config_value FROM config WHERE config_parameter = '$strConfigParam'"; + public static function getConfigValue($param){ + $query = "SELECT config_value FROM config WHERE config_parameter = '$param'"; $queryRes = DB::getResults($query, __FUNCTION__); if ( $queryRes === FALSE || ! is_array($queryRes) ){ @@ -65,7 +65,7 @@ class SP_Config{ return $queryRes[0]->config_value; } - + /** * @brief Obtener array con la configuración * @@ -122,7 +122,34 @@ class SP_Config{ return TRUE; } - + + /** + * @brief Guardar un parámetro de configuración + * @param string $param con el parámetro a guardar + * @param string $value con el calor a guardar + * @return bool + */ + public static function setConfigValue($param, $value) { + $query = "INSERT INTO config " + . "SET config_parameter = '" . DB::escape($param) . "'," + . "config_value = '" . DB::escape($value) . "'" + . "ON DUPLICATE KEY UPDATE config_value = '" . DB::escape($value) . "' "; + + if (DB::doQuery($query, __FUNCTION__) === FALSE) { + return FALSE; + } + + $message['action'] = _('Configuración'); + $message['text'][] = _('Modificar configuración'); + $message['text'][] = _('Parámetro') . ': ' . $param; + $message['text'][] = _('Valor') . ': ' . $value; + + SP_Common::wrLogInfo($message); + SP_Common::sendEmail($message); + + return TRUE; + } + /** * @brief Cargar la configuración desde la BBDD * @param bool $force reescribir la variable global $CFG? @@ -353,22 +380,6 @@ class SP_Config{ return TRUE; } - /** - * @brief Obtiene un valor desde la configuración en la BBDD - * @param $param string con el parámetro de configuración - * @return array or false - */ - public static function getConfigParameter($param){ - $query = "SELECT config_value FROM config WHERE config_parameter = '$param' "; - $queryRes = DB::getResults($query, __FUNCTION__); - - if ( $queryRes === FALSE || ! is_array($queryRes) ){ - return FALSE; - } - - return $queryRes; - } - /** * @brief Establece los valores de configuración por defecto en config.php * @return none diff --git a/inc/html.class.php b/inc/html.class.php index 064f15b7..1aa09f84 100644 --- a/inc/html.class.php +++ b/inc/html.class.php @@ -303,6 +303,8 @@ class SP_Html { array("href" => "css/jquery.powertip.css", "media" => "screen"), array("href" => "css/jquery.powertip-yellow.min.css", "media" => "screen"), array("href" => "css/chosen.css", "media" => "screen"), + array("href" => "css/alertify.core.css", "media" => "screen"), + array("href" => "css/alertify.default.css", "media" => "screen"), array("href" => "js/fancybox/jquery.fancybox.css", "media" => "screen"), array("href" => "css/styles.css", "media" => "")); @@ -326,6 +328,7 @@ class SP_Html { array("src" => "js/fancybox/jquery.fancybox.pack.js", "params" => ""), array("src" => "js/jquery.powertip.min.js", "params" => ""), array("src" => "js/chosen.jquery.min.js", "params" => ""), + array("src" => "js/alertify.min.js", "params" => ""), array("src" => "js/functions.php", "params" => "&l=" . SP_Init::$LANG . "&r=" . base64_encode(SP_Init::$WEBROOT))); foreach ($jsProp as $js) { diff --git a/inc/init.php b/inc/init.php index 1b38347e..b3ef7fe2 100644 --- a/inc/init.php +++ b/inc/init.php @@ -118,6 +118,8 @@ class SP_Init { // Comprobar si el modo mantenimiento está activado self::checkMaintenanceMode(); + // Comprobar la versión y actualizarla + self::checkVersion(); // Inicializar la sesión self::initSession(); @@ -403,6 +405,36 @@ class SP_Init { textdomain("messages"); bind_textdomain_codeset("messages", 'UTF-8'); } + + /** + * @brief Comrpueba y actualiza la versión de la aplicación + * @returns none + */ + private static function checkVersion(){ + $update = FALSE; + $configVersion = SP_Config::getValue('version'); + $databaseVersion = SP_Config::getConfigValue('version'); + $appVersion = SP_Util::getVersionString(); + + if ( $configVersion != $appVersion ){ + SP_Config::setValue('version', $appVersion); + $update = TRUE; + } + + if ( $databaseVersion != $appVersion ){ + SP_Config::setConfigValue('version', $appVersion); + $update = TRUE; + } + + if ( $update === TRUE ){ + $message['action'] = _('Actualización'); + $message['text'][] = _('Actualización de versión realizada.'); + $message['text'][] = _('Versión') . ': ' . $appVersion; + + SP_Common::wrLogInfo($message); + SP_Common::sendEmail($message); + } + } } // Empezar a calcular el tiempo y memoria utilizados diff --git a/inc/locales/en_US/LC_MESSAGES/messages.mo b/inc/locales/en_US/LC_MESSAGES/messages.mo index 7a143eb4..fbab3ce1 100644 Binary files a/inc/locales/en_US/LC_MESSAGES/messages.mo and b/inc/locales/en_US/LC_MESSAGES/messages.mo differ diff --git a/inc/tpl/search.php b/inc/tpl/search.php index 7f852268..02f258d7 100644 --- a/inc/tpl/search.php +++ b/inc/tpl/search.php @@ -52,7 +52,6 @@ $categoriesSelProp = array("name" => "category", - @@ -65,16 +64,12 @@ $categoriesSelProp = array("name" => "category", - -