2005-08-11 20:35:00 +02:00
< ? php
2017-04-14 12:52:32 +02:00
/* Copyright ( C ) 2005 - 2017 Laurent Destailleur < eldy @ users . sourceforge . net >
2015-06-26 15:26:08 +02:00
* Copyright ( C ) 2010 - 2015 Regis Houssin < regis . houssin @ capnetworks . com >
2013-02-22 09:42:02 +01:00
* Copyright ( C ) 2013 Florian Henry < florian . henry @ open - concept . pro . com >
2005-08-11 20:35:00 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2005-08-11 20:35:00 +02:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2011-08-01 01:19:04 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2005-08-11 20:35:00 +02:00
*/
/**
2009-08-17 19:32:38 +02:00
* \file htdocs / user / param_ihm . php
2010-02-27 11:11:00 +01:00
* \brief Page to show user setup for display
2009-08-17 19:32:38 +02:00
*/
2005-08-11 20:35:00 +02:00
2012-08-22 23:24:21 +02:00
require '../main.inc.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/usergroups.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php' ;
2005-08-11 20:35:00 +02:00
2018-05-26 16:24:54 +02:00
// Load translation files required by page
$langs -> loadLangs ( array ( 'companies' , 'products' , 'admin' , 'users' , 'languages' , 'projects' , 'members' ));
2005-08-11 20:35:00 +02:00
2007-10-11 17:41:42 +02:00
// Defini si peux lire/modifier permisssions
2009-08-17 19:32:38 +02:00
$canreaduser = ( $user -> admin || $user -> rights -> user -> user -> lire );
2007-10-11 17:41:42 +02:00
2011-11-02 20:29:27 +01:00
$id = GETPOST ( 'id' , 'int' );
2012-07-10 13:20:53 +02:00
$action = GETPOST ( 'action' , 'alpha' );
2018-03-31 18:48:27 +02:00
$contextpage = GETPOST ( 'contextpage' , 'aZ' ) ? GETPOST ( 'contextpage' , 'aZ' ) : 'userihm' ; // To manage different context of search
2011-11-02 20:24:51 +01:00
if ( $id )
2007-10-11 17:41:42 +02:00
{
2011-11-02 20:24:51 +01:00
// $user est le user qui edite, $id est l'id de l'utilisateur edite
2012-07-28 11:28:37 +02:00
$caneditfield = ((( $user -> id == $id ) && $user -> rights -> user -> self -> creer )
2011-11-02 20:24:51 +01:00
|| (( $user -> id != $id ) && $user -> rights -> user -> user -> creer ));
2007-10-11 17:41:42 +02:00
}
2009-08-06 15:07:25 +02:00
// Security check
$socid = 0 ;
if ( $user -> societe_id > 0 ) $socid = $user -> societe_id ;
$feature2 = (( $socid && $user -> rights -> user -> self -> creer ) ? '' : 'user' );
2011-11-02 20:24:51 +01:00
if ( $user -> id == $id ) // A user can always read its own card
2009-08-17 19:32:38 +02:00
{
2011-07-08 20:49:16 +02:00
$feature2 = '' ;
$canreaduser = 1 ;
2009-08-17 19:32:38 +02:00
}
2015-05-13 09:32:54 +02:00
$result = restrictedArea ( $user , 'user' , $id , 'user&user' , $feature2 );
2011-11-02 20:24:51 +01:00
if ( $user -> id <> $id && ! $canreaduser ) accessforbidden ();
2007-10-11 17:41:42 +02:00
2011-10-24 14:11:49 +02:00
$dirtop = " ../core/menus/standard " ;
$dirleft = " ../core/menus/standard " ;
2005-08-11 20:35:00 +02:00
2010-02-18 15:39:51 +01:00
// Charge utilisateur edite
2015-06-26 15:26:08 +02:00
$object = new User ( $db );
2017-04-14 12:52:32 +02:00
$object -> fetch ( $id , '' , '' , 1 );
2015-06-26 15:26:08 +02:00
$object -> getrights ();
2005-08-14 19:42:31 +02:00
2010-02-18 15:39:51 +01:00
// Liste des zone de recherche permanentes supportees
2016-01-03 19:34:19 +01:00
/* deprecated
2005-08-11 20:35:00 +02:00
$searchform = array ( " main_searchform_societe " , " main_searchform_contact " , " main_searchform_produitservice " );
$searchformconst = array ( $conf -> global -> MAIN_SEARCHFORM_SOCIETE , $conf -> global -> MAIN_SEARCHFORM_CONTACT , $conf -> global -> MAIN_SEARCHFORM_PRODUITSERVICE );
$searchformtitle = array ( $langs -> trans ( " Companies " ), $langs -> trans ( " Contacts " ), $langs -> trans ( " ProductsAndServices " ));
2016-01-03 19:34:19 +01:00
*/
2005-08-11 20:35:00 +02:00
2011-11-08 10:18:45 +01:00
$form = new Form ( $db );
2008-10-25 19:27:15 +02:00
$formadmin = new FormAdmin ( $db );
2005-08-11 20:35:00 +02:00
2017-06-10 12:56:28 +02:00
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
2018-03-31 18:48:27 +02:00
$hookmanager -> initHooks ( array ( 'usercard' , 'userihm' , 'globalcard' ));
2005-08-14 19:42:31 +02:00
2017-04-14 12:52:32 +02:00
2005-08-11 20:35:00 +02:00
/*
* Actions
*/
2017-04-14 12:52:32 +02:00
2015-09-16 09:37:49 +02:00
$parameters = array ( 'id' => $socid );
$reshook = $hookmanager -> executeHooks ( 'doActions' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
if ( $reshook < 0 ) setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
if ( empty ( $reshook )) {
2015-11-23 14:21:25 +01:00
if ( $action == 'update' && ( $caneditfield || ! empty ( $user -> admin ))) {
if ( ! $_POST [ " cancel " ]) {
$tabparam = array ();
2016-07-26 21:12:52 +02:00
if ( GETPOST ( " check_MAIN_LANDING_PAGE " ) == " on " ) {
$tabparam [ " MAIN_LANDING_PAGE " ] = $_POST [ " MAIN_LANDING_PAGE " ];
} else {
$tabparam [ " MAIN_LANDING_PAGE " ] = '' ;
}
2015-11-23 14:21:25 +01:00
if ( GETPOST ( " check_MAIN_LANG_DEFAULT " ) == " on " ) {
$tabparam [ " MAIN_LANG_DEFAULT " ] = $_POST [ " main_lang_default " ];
} else {
$tabparam [ " MAIN_LANG_DEFAULT " ] = '' ;
}
if ( GETPOST ( " check_SIZE_LISTE_LIMIT " ) == " on " ) {
$tabparam [ " MAIN_SIZE_LISTE_LIMIT " ] = $_POST [ " main_size_liste_limit " ];
} else {
$tabparam [ " MAIN_SIZE_LISTE_LIMIT " ] = '' ;
}
if ( GETPOST ( " check_MAIN_THEME " ) == " on " ) {
$tabparam [ " MAIN_THEME " ] = $_POST [ " main_theme " ];
} else {
$tabparam [ " MAIN_THEME " ] = '' ;
}
$val = ( implode ( ',' , ( colorStringToArray ( GETPOST ( 'THEME_ELDY_TOPMENU_BACK1' ), array ()))));
if ( $val == '' ) {
$tabparam [ 'THEME_ELDY_TOPMENU_BACK1' ] = '' ;
} else {
$tabparam [ 'THEME_ELDY_TOPMENU_BACK1' ] = join ( ',' ,
colorStringToArray ( GETPOST ( 'THEME_ELDY_TOPMENU_BACK1' ), array ()));
}
$val = ( implode ( ',' , ( colorStringToArray ( GETPOST ( 'THEME_ELDY_BACKTITLE1' ), array ()))));
if ( $val == '' ) {
$tabparam [ 'THEME_ELDY_BACKTITLE1' ] = '' ;
} else {
$tabparam [ 'THEME_ELDY_BACKTITLE1' ] = join ( ',' ,
colorStringToArray ( GETPOST ( 'THEME_ELDY_BACKTITLE1' ), array ()));
}
if ( GETPOST ( 'check_THEME_ELDY_USE_HOVER' ) == 'on' ) {
$tabparam [ " THEME_ELDY_USE_HOVER " ] = 1 ;
} else {
$tabparam [ " THEME_ELDY_USE_HOVER " ] = 0 ;
}
$result = dol_set_user_param ( $db , $conf , $object , $tabparam );
header ( 'Location: ' . $_SERVER [ " PHP_SELF " ] . '?id=' . $id );
exit ;
}
}
2005-08-11 20:35:00 +02:00
}
/*
2009-08-05 19:19:55 +02:00
* View
2005-08-11 20:35:00 +02:00
*/
2009-08-05 19:19:55 +02:00
llxHeader ();
2016-07-26 21:12:52 +02:00
// List of possible landing pages
$tmparray = array ( 'index.php' => 'Dashboard' );
if ( ! empty ( $conf -> societe -> enabled )) $tmparray [ 'societe/index.php?mainmenu=companies&leftmenu=' ] = 'ThirdPartiesArea' ;
if ( ! empty ( $conf -> projet -> enabled )) $tmparray [ 'projet/index.php?mainmenu=project&leftmenu=' ] = 'ProjectsArea' ;
if ( ! empty ( $conf -> holiday -> enabled ) || ! empty ( $conf -> expensereport -> enabled )) $tmparray [ 'hrm/index.php?mainmenu=hrm&leftmenu=' ] = 'HRMArea' ; // TODO Complete list with first level of menus
if ( ! empty ( $conf -> product -> enabled ) || ! empty ( $conf -> service -> enabled )) $tmparray [ 'product/index.php?mainmenu=products&leftmenu=' ] = 'ProductsAndServicesArea' ;
2018-03-22 16:39:47 +01:00
if ( ! empty ( $conf -> propal -> enabled ) || ! empty ( $conf -> commande -> enabled ) || ! empty ( $conf -> ficheinter -> enabled ) || ! empty ( $conf -> contrat -> enabled )) $tmparray [ 'comm/index.php?mainmenu=commercial&leftmenu=' ] = 'CommercialArea' ;
2016-07-26 21:12:52 +02:00
if ( ! empty ( $conf -> compta -> enabled ) || ! empty ( $conf -> accounting -> enabled )) $tmparray [ 'compta/index.php?mainmenu=compta&leftmenu=' ] = 'AccountancyTreasuryArea' ;
if ( ! empty ( $conf -> adherent -> enabled )) $tmparray [ 'adherents/index.php?mainmenu=members&leftmenu=' ] = 'MembersArea' ;
if ( ! empty ( $conf -> agenda -> enabled )) $tmparray [ 'comm/action/index.php?mainmenu=agenda&leftmenu=' ] = 'Agenda' ;
2015-06-26 15:26:08 +02:00
$head = user_prepare_head ( $object );
2005-08-11 20:35:00 +02:00
2009-05-05 02:20:17 +02:00
$title = $langs -> trans ( " User " );
2013-04-24 03:56:13 +02:00
if ( $action == 'edit' )
{
2013-06-05 16:12:07 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . $_SESSION [ 'newtoken' ] . '">' ;
print '<input type="hidden" name="action" value="update">' ;
print '<input type="hidden" name="id" value="' . $id . '">' ;
2013-04-24 03:56:13 +02:00
}
2012-07-10 13:20:53 +02:00
if ( $action == 'edit' )
2005-08-11 20:35:00 +02:00
{
2017-04-29 14:55:23 +02:00
dol_fiche_head ( $head , 'guisetup' , $title , - 1 , 'user' );
2017-04-09 14:09:33 +02:00
$linkback = '' ;
if ( $user -> rights -> user -> user -> lire || $user -> admin ) {
2018-10-09 14:20:53 +02:00
$linkback = '<a href="' . DOL_URL_ROOT . '/user/list.php?restore_lastsearch_values=1">' . $langs -> trans ( " BackToList " ) . '</a>' ;
2017-04-09 14:09:33 +02:00
}
2017-11-04 15:40:35 +01:00
2015-11-04 15:45:35 +01:00
dol_banner_tab ( $object , 'id' , $linkback , $user -> rights -> user -> user -> lire || $user -> admin );
2017-11-04 15:40:35 +01:00
2015-09-09 12:11:57 +02:00
if ( ! empty ( $conf -> use_javascript_ajax ))
{ /*
print ' < script type = " text/javascript " language = " javascript " >
jQuery ( document ) . ready ( function () {
$ ( " #main_lang_default " ) . change ( function () {
$ ( " #check_MAIN_LANG_DEFAULT " ) . prop ( " checked " , true );
});
$ ( " #main_size_liste_limit " ) . keyup ( function () {
if ( $ ( this ) . val () . length ) $ ( " #check_SIZE_LISTE_LIMIT " ) . prop ( " checked " , true );
else $ ( " #check_SIZE_LISTE_LIMIT " ) . prop ( " checked " , false );
});
});
</ script > ' ; */
2017-11-04 15:40:35 +01:00
}
2015-09-09 12:11:57 +02:00
if ( ! empty ( $conf -> use_javascript_ajax ))
{
print ' < script type = " text/javascript " language = " javascript " >
jQuery ( document ) . ready ( function () {
function init_myfunc ()
{
2016-07-26 21:12:52 +02:00
if ( jQuery ( " #check_MAIN_LANDING_PAGE " ) . prop ( " checked " )) { jQuery ( " #MAIN_LANDING_PAGE " ) . removeAttr ( \ ' disabled\ ' ); }
else { jQuery ( " #MAIN_LANDING_PAGE " ) . attr ( \ ' disabled\ ' , \ ' disabled\ ' ); }
2017-11-04 15:40:35 +01:00
2016-07-26 21:12:52 +02:00
if ( jQuery ( " #check_MAIN_LANG_DEFAULT " ) . prop ( " checked " )) { jQuery ( " #main_lang_default " ) . removeAttr ( \ ' disabled\ ' ); }
2015-09-09 12:11:57 +02:00
else { jQuery ( " #main_lang_default " ) . attr ( \ ' disabled\ ' , \ ' disabled\ ' ); }
2017-11-04 15:40:35 +01:00
2015-09-09 12:11:57 +02:00
if ( jQuery ( " #check_SIZE_LISTE_LIMIT " ) . prop ( " checked " )) { jQuery ( " #main_size_liste_limit " ) . removeAttr ( \ ' disabled\ ' ); }
else { jQuery ( " #main_size_liste_limit " ) . attr ( \ ' disabled\ ' , \ ' disabled\ ' ); }
2017-11-04 15:40:35 +01:00
2015-09-09 12:11:57 +02:00
if ( jQuery ( " #check_MAIN_THEME " ) . prop ( " checked " )) { jQuery ( " .themethumbs " ) . removeAttr ( \ ' disabled\ ' ); }
else { jQuery ( " .themethumbs " ) . attr ( \ ' disabled\ ' , \ ' disabled\ ' ); }
2017-11-04 15:40:35 +01:00
2015-09-09 12:11:57 +02:00
if ( jQuery ( " #check_THEME_ELDY_TOPMENU_BACK1 " ) . prop ( " checked " )) { jQuery ( " #colorpickerTHEME_ELDY_TOPMENU_BACK1 " ) . removeAttr ( \ ' disabled\ ' ); }
else { jQuery ( " #colorpickerTHEME_ELDY_TOPMENU_BACK1 " ) . attr ( \ ' disabled\ ' , \ ' disabled\ ' ); }
}
init_myfunc ();
2016-07-26 21:12:52 +02:00
jQuery ( " #check_MAIN_LANDING_PAGE " ) . click ( function () { init_myfunc (); });
jQuery ( " #check_SIZE_LISTE_LIMIT " ) . click ( function () { init_myfunc (); });
2015-09-09 12:11:57 +02:00
jQuery ( " #check_MAIN_LANG_DEFAULT " ) . click ( function () { init_myfunc (); });
jQuery ( " #check_MAIN_THEME " ) . click ( function () { init_myfunc (); });
jQuery ( " #check_THEME_ELDY_TOPMENU_BACK1 " ) . click ( function () { init_myfunc (); });
jQuery ( " #check_THEME_ELDY_BACKTITLE1 " ) . click ( function () { init_myfunc (); });
});
</ script > ' ;
}
2017-11-04 15:40:35 +01:00
2012-07-27 20:47:17 +02:00
2005-08-11 20:35:00 +02:00
clearstatcache ();
2009-02-11 03:18:27 +01:00
2005-08-11 20:35:00 +02:00
print '<table class="noborder" width="100%">' ;
2005-10-30 01:42:54 +02:00
print '<tr class="liste_titre"><td width="25%">' . $langs -> trans ( " Parameter " ) . '</td><td width="25%">' . $langs -> trans ( " DefaultValue " ) . '</td><td> </td><td>' . $langs -> trans ( " PersonalValue " ) . '</td></tr>' ;
2005-08-11 20:35:00 +02:00
2016-07-26 21:12:52 +02:00
// Landing page
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " LandingPage " ) . '</td>' ;
2016-07-26 21:12:52 +02:00
print '<td>' ;
print ( empty ( $conf -> global -> MAIN_LANDING_PAGE ) ? '' : $conf -> global -> MAIN_LANDING_PAGE );
print '</td>' ;
print '<td align="left" class="nowrap" width="20%"><input ' . $bc [ $var ] . ' name="check_MAIN_LANDING_PAGE" id="check_MAIN_LANDING_PAGE" type="checkbox" ' . ( ! empty ( $object -> conf -> MAIN_LANDING_PAGE ) ? " checked " : " " );
print empty ( $dolibarr_main_demo ) ? '' : ' disabled="disabled"' ; // Disabled for demo
print '> ' . $langs -> trans ( " UsePersonalValue " ) . '</td>' ;
print '<td>' ;
print $form -> selectarray ( 'MAIN_LANDING_PAGE' , $tmparray , ( ! empty ( $object -> conf -> MAIN_LANDING_PAGE ) ? $object -> conf -> MAIN_LANDING_PAGE : '' ), 0 , 0 , 0 , '' , 1 );
//print info_admin($langs->trans("WarningYouMayLooseAccess"), 0, 0, 0);
print '</td></tr>' ;
2017-11-04 15:40:35 +01:00
2005-08-11 20:35:00 +02:00
// Langue par defaut
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Language " ) . '</td>' ;
2010-02-27 11:11:00 +01:00
print '<td>' ;
2010-02-27 17:49:34 +01:00
$s = picto_from_langcode ( $conf -> global -> MAIN_LANG_DEFAULT );
print $s ? $s . ' ' : '' ;
2010-02-27 11:11:00 +01:00
print ( $conf -> global -> MAIN_LANG_DEFAULT == 'auto' ? $langs -> trans ( " AutoDetectLang " ) : $langs -> trans ( " Language_ " . $conf -> global -> MAIN_LANG_DEFAULT ));
print '</td>' ;
2015-06-26 15:26:08 +02:00
print '<td align="left" class="nowrap" width="20%"><input ' . $bc [ $var ] . ' name="check_MAIN_LANG_DEFAULT" id="check_MAIN_LANG_DEFAULT" type="checkbox" ' . ( ! empty ( $object -> conf -> MAIN_LANG_DEFAULT ) ? " checked " : " " );
2014-11-29 12:11:12 +01:00
print empty ( $dolibarr_main_demo ) ? '' : ' disabled="disabled"' ; // Disabled for demo
2008-05-13 22:38:21 +02:00
print '> ' . $langs -> trans ( " UsePersonalValue " ) . '</td>' ;
2005-08-11 20:35:00 +02:00
print '<td>' ;
2015-06-26 15:26:08 +02:00
print $formadmin -> select_language (( ! empty ( $object -> conf -> MAIN_LANG_DEFAULT ) ? $object -> conf -> MAIN_LANG_DEFAULT : '' ), 'main_lang_default' , 1 , null , 0 , 0 ,( ! empty ( $dolibarr_main_demo )));
2005-08-11 20:35:00 +02:00
print '</td></tr>' ;
// Taille max des listes
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " MaxSizeList " ) . '</td>' ;
2006-03-22 00:47:01 +01:00
print '<td>' . $conf -> global -> MAIN_SIZE_LISTE_LIMIT . '</td>' ;
2015-06-26 15:26:08 +02:00
print '<td align="left" class="nowrap" width="20%"><input ' . $bc [ $var ] . ' name="check_SIZE_LISTE_LIMIT" id="check_SIZE_LISTE_LIMIT" type="checkbox" ' . ( ! empty ( $object -> conf -> MAIN_SIZE_LISTE_LIMIT ) ? " checked " : " " );
2014-11-29 12:11:12 +01:00
print empty ( $dolibarr_main_demo ) ? '' : ' disabled="disabled"' ; // Disabled for demo
2008-05-13 22:49:38 +02:00
print '> ' . $langs -> trans ( " UsePersonalValue " ) . '</td>' ;
2015-06-26 15:26:08 +02:00
print '<td><input class="flat" name="main_size_liste_limit" id="main_size_liste_limit" size="4" value="' . ( ! empty ( $object -> conf -> MAIN_SIZE_LISTE_LIMIT ) ? $object -> conf -> MAIN_SIZE_LISTE_LIMIT : '' ) . '"></td></tr>' ;
2005-08-11 20:35:00 +02:00
print '</table><br>' ;
// Theme
2015-09-09 12:11:57 +02:00
show_theme ( $object , (( $user -> admin || empty ( $dolibarr_main_demo )) ? 1 : 0 ), true );
2005-08-11 20:35:00 +02:00
2013-04-24 03:56:13 +02:00
dol_fiche_end ();
2005-08-11 20:35:00 +02:00
2014-11-24 06:43:15 +01:00
print '<div class="center">' ;
2005-08-24 00:41:12 +02:00
print '<input type="submit" class="button" name="save" value="' . $langs -> trans ( " Save " ) . '">' ;
2014-11-24 06:43:15 +01:00
print ' ' ;
2005-08-24 00:41:12 +02:00
print '<input type="submit" class="button" name="cancel" value="' . $langs -> trans ( " Cancel " ) . '">' ;
2014-11-24 06:43:15 +01:00
print '</div>' ;
2013-04-24 03:56:13 +02:00
2005-08-11 20:35:00 +02:00
}
else
{
2017-04-14 13:00:39 +02:00
dol_fiche_head ( $head , 'guisetup' , $title , - 1 , 'user' );
2017-11-04 15:40:35 +01:00
2018-04-06 00:36:52 +02:00
$linkback = '<a href="' . DOL_URL_ROOT . '/user/list.php">' . $langs -> trans ( " BackToList " ) . '</a>' ;
2017-11-04 15:40:35 +01:00
2015-11-04 15:45:35 +01:00
dol_banner_tab ( $object , 'id' , $linkback , $user -> rights -> user -> user -> lire || $user -> admin );
2017-11-04 15:40:35 +01:00
2005-08-11 20:35:00 +02:00
print '<table class="noborder" width="100%">' ;
2005-10-30 01:42:54 +02:00
print '<tr class="liste_titre"><td width="25%">' . $langs -> trans ( " Parameter " ) . '</td><td width="25%">' . $langs -> trans ( " DefaultValue " ) . '</td><td> </td><td>' . $langs -> trans ( " PersonalValue " ) . '</td></tr>' ;
2005-08-11 20:35:00 +02:00
2016-07-26 21:12:52 +02:00
// Landing page
2017-11-04 15:40:35 +01:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " LandingPage " ) . '</td>' ;
2016-07-26 21:12:52 +02:00
print '<td>' ;
print ( empty ( $conf -> global -> MAIN_LANDING_PAGE ) ? '' : $conf -> global -> MAIN_LANDING_PAGE );
print '</td>' ;
print '<td align="left" class="nowrap"><input ' . $bc [ $var ] . ' name="check_MAIN_LANDING_PAGE" disabled id="check_MAIN_LANDING_PAGE" type="checkbox" ' . ( ! empty ( $object -> conf -> MAIN_LANDING_PAGE ) ? " checked " : " " );
print empty ( $dolibarr_main_demo ) ? '' : ' disabled="disabled"' ; // Disabled for demo
print '> ' . $langs -> trans ( " UsePersonalValue " ) . '</td>' ;
print '<td>' ;
if ( ! empty ( $tmparray [ $object -> conf -> MAIN_LANDING_PAGE ]))
{
print $langs -> trans ( $tmparray [ $object -> conf -> MAIN_LANDING_PAGE ]);
}
else print $object -> conf -> MAIN_LANDING_PAGE ;
//print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (! empty($object->conf->MAIN_LANDING_PAGE)?$object->conf->MAIN_LANDING_PAGE:''), 0, 0, 0, '', 1);
print '</td></tr>' ;
2017-11-04 15:40:35 +01:00
2016-07-26 21:12:52 +02:00
// Language
2017-11-04 15:40:35 +01:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " Language " ) . '</td>' ;
2010-02-27 11:11:00 +01:00
print '<td>' ;
$s = picto_from_langcode ( $conf -> global -> MAIN_LANG_DEFAULT );
print ( $s ? $s . ' ' : '' );
2012-07-10 13:20:53 +02:00
print ( isset ( $conf -> global -> MAIN_LANG_DEFAULT ) && $conf -> global -> MAIN_LANG_DEFAULT == 'auto' ? $langs -> trans ( " AutoDetectLang " ) : $langs -> trans ( " Language_ " . $conf -> global -> MAIN_LANG_DEFAULT ));
2010-02-27 11:11:00 +01:00
print '</td>' ;
2016-07-26 21:12:52 +02:00
print '<td align="left" class="nowrap"><input ' . $bc [ $var ] . ' type="checkbox" disabled ' . ( ! empty ( $object -> conf -> MAIN_LANG_DEFAULT ) ? " checked " : " " ) . '> ' . $langs -> trans ( " UsePersonalValue " ) . '</td>' ;
2010-02-27 11:11:00 +01:00
print '<td>' ;
2015-06-26 15:26:08 +02:00
$s = ( isset ( $object -> conf -> MAIN_LANG_DEFAULT ) ? picto_from_langcode ( $object -> conf -> MAIN_LANG_DEFAULT ) : '' );
2010-02-27 11:11:00 +01:00
print ( $s ? $s . ' ' : '' );
2015-06-26 15:26:08 +02:00
print ( isset ( $object -> conf -> MAIN_LANG_DEFAULT ) && $object -> conf -> MAIN_LANG_DEFAULT == 'auto' ? $langs -> trans ( " AutoDetectLang " ) : ( ! empty ( $object -> conf -> MAIN_LANG_DEFAULT ) ? $langs -> trans ( " Language_ " . $object -> conf -> MAIN_LANG_DEFAULT ) : '' ));
2010-02-27 11:11:00 +01:00
print '</td></tr>' ;
2005-08-11 20:35:00 +02:00
2017-11-04 15:40:35 +01:00
2017-04-14 13:02:29 +02:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " MaxSizeList " ) . '</td>' ;
2012-07-10 13:20:53 +02:00
print '<td>' . ( ! empty ( $conf -> global -> MAIN_SIZE_LISTE_LIMIT ) ? $conf -> global -> MAIN_SIZE_LISTE_LIMIT : ' ' ) . '</td>' ;
2015-06-26 15:26:08 +02:00
print '<td align="left" class="nowrap" width="20%"><input ' . $bc [ $var ] . ' type="checkbox" disabled ' . ( ! empty ( $object -> conf -> MAIN_SIZE_LISTE_LIMIT ) ? " checked " : " " ) . '> ' . $langs -> trans ( " UsePersonalValue " ) . '</td>' ;
print '<td>' . ( ! empty ( $object -> conf -> MAIN_SIZE_LISTE_LIMIT ) ? $object -> conf -> MAIN_SIZE_LISTE_LIMIT : ' ' ) . '</td></tr>' ;
2005-08-11 20:35:00 +02:00
print '</table><br>' ;
// Skin
2015-06-26 15:26:08 +02:00
show_theme ( $object , 0 , true );
2005-08-11 20:35:00 +02:00
2013-04-24 03:56:13 +02:00
dol_fiche_end ();
2005-08-11 20:35:00 +02:00
print '<div class="tabsAction">' ;
2011-09-01 00:33:36 +02:00
if ( empty ( $user -> admin ) && ! empty ( $dolibarr_main_demo ))
2011-07-08 20:49:16 +02:00
{
print " <a class= \" butActionRefused \" title= \" " . $langs -> trans ( " FeatureDisabledInDemo " ) . " \" href= \" # \" > " . $langs -> trans ( " Modify " ) . " </a> " ;
}
else
{
2013-11-24 13:40:33 +01:00
if ( $caneditfield || ! empty ( $user -> admin )) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin
2011-07-08 20:49:16 +02:00
{
2015-06-26 15:26:08 +02:00
print '<a class="butAction" href="' . $_SERVER [ " PHP_SELF " ] . '?action=edit&id=' . $object -> id . '">' . $langs -> trans ( " Modify " ) . '</a>' ;
2011-07-08 20:49:16 +02:00
}
else
{
print " <a class= \" butActionRefused \" title= \" " . $langs -> trans ( " NotEnoughPermissions " ) . " \" href= \" # \" > " . $langs -> trans ( " Modify " ) . " </a> " ;
}
}
2009-02-11 03:18:27 +01:00
2005-08-11 20:35:00 +02:00
print '</div>' ;
}
2015-10-11 16:12:12 +02:00
if ( $action == 'edit' )
{
print '</form>' ;
}
2005-08-11 20:35:00 +02:00
2011-08-27 16:24:16 +02:00
llxFooter ();
2012-07-10 13:20:53 +02:00
$db -> close ();