Skip to content
Snippets Groups Projects
Commit c7b88d39 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Change to prepare module skincoloreditor

parent 7cb398c6
No related branches found
No related tags found
No related merge requests found
...@@ -372,7 +372,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='') ...@@ -372,7 +372,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='')
* @param int $entity Multi company id, -1 for all entities * @param int $entity Multi company id, -1 for all entities
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* *
* @see dolibarr_get_const, dolibarr_sel_const * @see dolibarr_get_const, dolibarr_set_const, dol_set_user_param
*/ */
function dolibarr_del_const($db, $name, $entity=1) function dolibarr_del_const($db, $name, $entity=1)
{ {
...@@ -406,7 +406,7 @@ function dolibarr_del_const($db, $name, $entity=1) ...@@ -406,7 +406,7 @@ function dolibarr_del_const($db, $name, $entity=1)
* @param int $entity Multi company id * @param int $entity Multi company id
* @return string Valeur de la constante * @return string Valeur de la constante
* *
* @see dolibarr_del_const, dolibarr_set_const * @see dolibarr_del_const, dolibarr_set_const, dol_set_user_param
*/ */
function dolibarr_get_const($db, $name, $entity=1) function dolibarr_get_const($db, $name, $entity=1)
{ {
...@@ -441,7 +441,7 @@ function dolibarr_get_const($db, $name, $entity=1) ...@@ -441,7 +441,7 @@ function dolibarr_get_const($db, $name, $entity=1)
* @param int $entity Multi company id (0 means all entities) * @param int $entity Multi company id (0 means all entities)
* @return int -1 if KO, 1 if OK * @return int -1 if KO, 1 if OK
* *
* @see dolibarr_del_const, dolibarr_get_const * @see dolibarr_del_const, dolibarr_get_const, dol_set_user_param
*/ */
function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1) function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
{ {
......
...@@ -901,6 +901,8 @@ function weight_convert($weight,&$from_unit,$to_unit) ...@@ -901,6 +901,8 @@ function weight_convert($weight,&$from_unit,$to_unit)
* @param user Object user * @param user Object user
* @param tab Tableau (cle=>valeur) des parametres a sauvegarder * @param tab Tableau (cle=>valeur) des parametres a sauvegarder
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*
* @see dolibarr_get_const, dolibarr_set_const, dolibarr_del_const
*/ */
function dol_set_user_param($db, $conf, &$user, $tab) function dol_set_user_param($db, $conf, &$user, $tab)
{ {
...@@ -949,8 +951,8 @@ function dol_set_user_param($db, $conf, &$user, $tab) ...@@ -949,8 +951,8 @@ function dol_set_user_param($db, $conf, &$user, $tab)
$db->rollback(); $db->rollback();
return -1; return -1;
} }
$user->conf->$key = $value;
$user->page_param[$key] = $value; //print "key=".$key." user->conf->key=".$user->conf->$key;
} }
} }
......
<?php <?php
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2007-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
* \brief File for CSS style sheet Eldy * \brief File for CSS style sheet Eldy
*/ */
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url. //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url.
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
if (! defined('NOLOGIN')) define('NOLOGIN',1); //if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled because need to load user to know its personal theme choices
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
...@@ -70,9 +70,10 @@ $img_button=dol_buildpath($path.'/theme/eldy/img/button_bg.png',1); ...@@ -70,9 +70,10 @@ $img_button=dol_buildpath($path.'/theme/eldy/img/button_bg.png',1);
// Example: Ocean: $colred=220;$colgreen=220;$colblue=240; // Example: Ocean: $colred=220;$colgreen=220;$colblue=240;
//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; //$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0;
//$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0; //$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0;
$colred =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,0,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,0,2))); //var_dump($user->conf->THEME_ELDY_RGB);
$colgreen=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,2,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,2,2))); $colred =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,0,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,0,2)));
$colblue =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,4,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,4,2))); $colgreen=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,2,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,2,2)));
$colblue =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,4,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,4,2)));
// Colors // Colors
$isred=max(0,(2*$colred-$colgreen-$colblue)/2); // 0 - 255 $isred=max(0,(2*$colred-$colgreen-$colblue)/2); // 0 - 255
......
...@@ -238,19 +238,19 @@ class User extends CommonObject ...@@ -238,19 +238,19 @@ class User extends CommonObject
$sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param"; $sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param";
$sql.= " WHERE fk_user = ".$this->id; $sql.= " WHERE fk_user = ".$this->id;
$sql.= " AND entity = ".$conf->entity; $sql.= " AND entity = ".$conf->entity;
$result=$this->db->query($sql); $resql=$this->db->query($sql);
if ($result) if ($resql)
{ {
$num = $this->db->num_rows($result); $num = $this->db->num_rows($resql);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($resql);
$p=$obj->param; $p=$obj->param;
if ($p) $this->conf->$p = $obj->value; if ($p) $this->conf->$p = $obj->value;
$i++; $i++;
} }
$this->db->free($result); $this->db->free($resql);
} }
else else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment