* * 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 * the Free Software Foundation; either version 3 of the License, or * (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 * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file /multicompany/admin/options.php * \ingroup multicompany * \brief Configuration of Multicompany module */ $res=@include("../../main.inc.php"); // For root directory if (empty($res) && file_exists($_SERVER['DOCUMENT_ROOT']."/main.inc.php")) { $res=@include($_SERVER['DOCUMENT_ROOT']."/main.inc.php"); // Use on dev env only } if (empty($res)) { $res=@include("../../../main.inc.php"); // For "custom" directory } require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; dol_include_once('/multicompany/class/actions_multicompany.class.php', 'ActionsMulticompany'); $langs->loadLangs(array('admin', 'multicompany@multicompany')); // Security check if (empty($user->admin) || !empty($user->entity)) { accessforbidden(); } $action = GETPOST('action','alpha'); $object = new ActionsMulticompany($db); /* * Action */ /* * View */ $extrajs = array( '/multicompany/core/js/lib_head.js' ); $help_url='EN:Module_MultiCompany|FR:Module_MultiSociété'; llxHeader('', $langs->trans("MultiCompanySetup"), $help_url,'','','',$extrajs); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("MultiCompanySetup"),$linkback,'multicompany@multicompany',0,'multicompany_title'); $head = multicompany_prepare_head(); dol_fiche_head($head, 'options', $langs->trans("ModuleSetup"), -1); $level = checkMultiCompanyVersion(); if ($level === -1) { // shouldn't happen print '
| '.$langs->trans("Parameters").' | '."\n"; print ''; print ' | '.$langs->trans("Value").' | '."\n"; print '
| '.$langs->trans("HideLoginCombobox").' | '; print ''; print ' | '; if ($checkconfig !== true) { $input = array( 'showhide' => array( '#mc_hide_login_combobox_error' ) ); } else { $input = array( 'hideshow' => array( '#dol_hide_login_combobox_error' ) ); } $input['hideshow'][] = '#changeloginlogo'; $input['hideshow'][] = '#changeloginbackground'; $input['del'] = array('MULTICOMPANY_LOGIN_LOGO_BY_ENTITY', 'MULTICOMPANY_LOGIN_BACKGROUND_BY_ENTITY'); print ajax_mcconstantonoff('MULTICOMPANY_HIDE_LOGIN_COMBOBOX', $input, 0); print ' |
| '.$langs->trans("EntityLogoInLoginPage").' | '; print ''; print ' | '; $input = array( 'showhide' => array( '#changeloginbackground' ), 'del' => array( 'MULTICOMPANY_LOGIN_BACKGROUND_BY_ENTITY' ) ); print ajax_mcconstantonoff('MULTICOMPANY_LOGIN_LOGO_BY_ENTITY', $input, 0); print ' |
| '.$langs->trans("EntityBackgroundInLoginPage").' | '; print ''; print ' | '; print ajax_mcconstantonoff('MULTICOMPANY_LOGIN_BACKGROUND_BY_ENTITY', '', 0); print ' |
| '.$langs->trans("DisableSwitchEntityDropdownMenu").' | '; print ''; print ' | '; $input = array( 'reload' => true ); print ajax_mcconstantonoff('MULTICOMPANY_DROPDOWN_MENU_DISABLED', $input, 0); print ' |
| '.$langs->trans("ShowTopMenuEntityLabel").' | '; print ''; print ' | '; $input = array( 'reload' => true ); print ajax_mcconstantonoff('MULTICOMPANY_NO_TOP_MENU_ENTITY_LABEL', $input, 0, 1); print ' |
| '.$langs->trans("EntityActiveByDefault").' | '; print ''; print ' | '; $input = array( 'showhide' => array( '#visiblebydefault' ), 'del' => array( 'MULTICOMPANY_VISIBLE_BY_DEFAULT' ) ); print ajax_mcconstantonoff('MULTICOMPANY_ACTIVE_BY_DEFAULT', $input, 0); print ' |
| '.$langs->trans("EntityVisibleByDefault").' | '; print ''; print ' | '; print ajax_mcconstantonoff('MULTICOMPANY_VISIBLE_BY_DEFAULT', '', 0); print ' |
| '.$langs->trans("TemplateOfEntityManagement").' '.$form->textwithtooltip('',$htmltext,2,1,$text).' | '; print ''; print ' | '; print ajax_mcconstantonoff('MULTICOMPANY_TEMPLATE_MANAGEMENT', '', 0); print ' |
| '.$langs->trans("Parameters").' | '."\n"; print ''; print ' | '.$langs->trans("Value").' | '."\n"; print '
| '.$langs->trans("GroupModeTransversal").' '.$form->textwithtooltip('', $htmltext, 2, 1, $text).' | '; print ''; print ' | '; $input = array( 'alert' => array( 'set' => array( 'info' => true, 'height' => 200, 'yesButton' => $langs->trans('Ok'), 'title' => $langs->transnoentities('GroupModeTransversalTitle'), 'content' => img_warning().' '.$langs->trans('GroupModeTransversalInfo') ) ) ); print ajax_mcconstantonoff('MULTICOMPANY_TRANSVERSE_MODE', $input, 0); print ' |
| '.$langs->trans("EnableGlobalSharings").' | '; print ''; print ' | '; $input = array( 'alert' => array( 'set' => array( 'info' => true, 'yesButton' => $langs->trans('Ok'), 'title' => $langs->transnoentities('GlobalSharings'), 'content' => img_warning().' '.$langs->trans('GlobalSharingsInfo') ) ), 'showhide' => array( '#shareelementtitle', '#sharethirdparty', '#sharingbyelement' ), 'hide' => array( '#shareelementtitle', '#shareobjecttitle', '#sharethirdparty', '#sharingbyelement' ), 'del' => array( 'MULTICOMPANY_THIRDPARTY_SHARING_ENABLED', 'MULTICOMPANY_SHARING_BYELEMENT_ENABLED', 'MULTICOMPANY_THIRDPARTY_SHARING_BYELEMENT_ENABLED', 'MULTICOMPANY_CONTACT_SHARING_BYELEMENT_ENABLED', 'MULTICOMPANY_PRODUCT_SHARING_BYELEMENT_ENABLED' ) ); foreach ($object->sharingelements as $key => $values) { if (!isset($values['disable'])) { if (isset($values['input']) && isset($values['input']['global'])) { if (isset($values['input']['global']['showhide']) && $values['input']['global']['showhide'] === true) { if (!isset($input['showhide'])) { $input['showhide'] = array(); } array_push($input['showhide'], '#share'.$key); } if (isset($values['input']['global']['hide']) && $values['input']['global']['hide'] === true) { if (!isset($input['hide'])) { $input['hide'] = array(); } array_push($input['hide'], '#share'.$key); } if (isset($values['input']['global']['del']) && $values['input']['global']['del'] === true) { if (!isset($input['del'])) { $input['del'] = array(); } array_push($input['del'], 'MULTICOMPANY_'.strtoupper($key).'_SHARING_ENABLED'); } } } } print ajax_mcconstantonoff('MULTICOMPANY_SHARINGS_ENABLED', $input, 0); print ' |
| '.$langs->trans("EnableSharingsByElement").' '.$form->textwithtooltip('', $htmltext, 2, 1, $text).' | '; print ''; print ' | '; print ajax_mcconstantonoff('MULTICOMPANY_SHARING_BYELEMENT_ENABLED', $input, 0); print ' |
| '.$langs->trans("ActivatingShares").' '.$form->textwithtooltip('', $htmltext, 2, 1, $text).' | '."\n"; print ''; print ' | '.$langs->trans("Value").' | '."\n"; print '
| '.$langs->trans("ShareThirdpartiesAndContacts").' | '; print ''; print ' | '; $input = array( 'showhide' => array( '#shareobjecttitle' ), 'del' => array( 'MULTICOMPANY_THIRDPARTY_SHARING_BYELEMENT_ENABLED', 'MULTICOMPANY_CONTACT_SHARING_BYELEMENT_ENABLED' ) ); foreach ($object->sharingelements as $key => $values) { if (!isset($values['disable']) && ($values['type'] === 'object' || $values['type'] === 'objectnumber')) { if (isset($values['input']) && isset($values['input']['thirdparty'])) { if (isset($values['input']['thirdparty']['showhide']) && $values['input']['thirdparty']['showhide'] === true) { if (!isset($input['showhide'])) { $input['showhide'] = array(); } array_push($input['showhide'], '#share'.$key); } if (isset($values['input']['thirdparty']['hide']) && $values['input']['thirdparty']['hide'] === true) { if (!isset($input['hide'])) { $input['hide'] = array(); } array_push($input['hide'], '#share'.$key); } if (isset($values['input']['thirdparty']['del']) && $values['input']['thirdparty']['del'] === true) { if (!isset($input['del'])) { $input['del'] = array(); } array_push($input['del'], 'MULTICOMPANY_'.strtoupper($key).'_SHARING_ENABLED'); } } } } print ajax_mcconstantonoff('MULTICOMPANY_THIRDPARTY_SHARING_ENABLED', $input, 0); print ' |
| '; print ''.$langs->trans("Share".ucfirst($element)).(!empty($tooltip) ? ' '.$tooltip : '').' | '; print ''; print ' | '; $input = array(); if ($element == 'product') { $input = array( 'del' => array( 'MULTICOMPANY_PRODUCT_SHARING_BYELEMENT_ENABLED' ) ); } foreach ($object->sharingelements as $key => $values) { if (!isset($values['disable']) && isset($values['input']) && isset($values['input'][$element])) { if (isset($values['input'][$element]['showhide']) && $values['input'][$element]['showhide'] === true) { if (!isset($input['showhide'])) $input['showhide'] = array(); array_push($input['showhide'], '#share'.$key); } if (isset($values['input'][$element]['hide']) && $values['input'][$element]['hide'] === true) { if (!isset($input['hide'])) $input['hide'] = array(); array_push($input['hide'], '#share'.$key); } if (isset($values['input'][$element]['del']) && $values['input'][$element]['del'] === true) { if (!isset($input['del'])) $input['del'] = array(); array_push($input['del'], 'MULTICOMPANY_'.strtoupper($key).'_SHARING_ENABLED'); } if (isset($values['input'][$element]['granularity']) && $values['input'][$element]['del'] === true) { if (!isset($input['del'])) { $input['del'] = array(); } array_push($input['del'], 'MULTICOMPANY_'.strtoupper($key).'_SHARING_BYELEMENT_ENABLED'); } } } print ajax_mcconstantonoff('MULTICOMPANY_'.strtoupper($element).'_SHARING_ENABLED', $input, 0); print ' |
| '.$langs->trans("ActivatingObjectShares").' '.$form->textwithtooltip('', $htmltext, 2, 1, $text).' | '."\n"; print ''; print ' | '.$langs->trans("Value").' | '."\n"; print '
| '; print ''.$langs->trans("Share".ucfirst($element)).(!empty($tooltip) ? ' '.$tooltip : '').' | '; print ''; print ' | '; $input = array(); print ajax_mcconstantonoff('MULTICOMPANY_'.strtoupper($element).'_SHARING_ENABLED', $input, 0); print ' |
| '.$langs->trans("ActivatingObjectNumberShares").' '.$form->textwithtooltip('', $htmltext, 2, 1, $text).' | '."\n"; print ''; print ' | '.$langs->trans("Value").' | '."\n"; print '
| '; print ''.$langs->trans("Share".ucfirst($element)).(!empty($tooltip) ? ' '.$tooltip : '').' | '; print ''; print ' | '; $input = array(); print ajax_mcconstantonoff('MULTICOMPANY_'.strtoupper($element).'_SHARING_ENABLED', $input, 0); print ' |
| '.$langs->trans("ActivatingDictsShares").' '.$form->textwithtooltip('', $htmltext, 2, 1, $text).' | '."\n"; print ''; print ' | '.$langs->trans("Value").' | '."\n"; print '
| '; print ''.$langs->trans($transkey).' | '; print ''; print ' | '; print ajax_mcconstantonoff('MULTICOMPANY_'.strtoupper($dict).'_CUSTOM_ENABLED', '', 0); print ' |