2004-12-01 17:50:33 +01:00
|
|
|
<?php
|
2006-03-12 16:28:54 +01:00
|
|
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2008-02-19 00:43:40 +01:00
|
|
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
2011-06-22 18:24:20 +02:00
|
|
|
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
2012-12-30 15:11:07 +01:00
|
|
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
2012-03-28 10:57:02 +02:00
|
|
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
2004-12-01 17:50:33 +01: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
|
2004-12-01 17:50:33 +01: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 00:21:57 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2004-12-01 17:50:33 +01:00
|
|
|
*/
|
|
|
|
|
|
2005-01-02 18:23:44 +01:00
|
|
|
/**
|
2011-11-26 12:36:36 +01:00
|
|
|
* \file htdocs/societe/admin/societe.php
|
2009-03-09 11:10:02 +01:00
|
|
|
* \ingroup company
|
|
|
|
|
* \brief Third party module setup page
|
2009-02-02 03:04:26 +01:00
|
|
|
*/
|
2004-12-01 17:50:33 +01: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/admin.lib.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
2004-12-01 17:50:33 +01:00
|
|
|
|
|
|
|
|
$langs->load("admin");
|
2013-05-06 23:31:19 +02:00
|
|
|
$langs->load('other');
|
2004-12-01 17:50:33 +01:00
|
|
|
|
2012-03-28 10:57:02 +02:00
|
|
|
$action=GETPOST('action','alpha');
|
|
|
|
|
$value=GETPOST('value','alpha');
|
2011-08-17 09:50:29 +02:00
|
|
|
|
2011-09-28 14:13:48 +02:00
|
|
|
if (!$user->admin) accessforbidden();
|
|
|
|
|
|
|
|
|
|
|
2011-08-27 18:03:47 +02:00
|
|
|
|
2006-03-12 16:28:54 +01:00
|
|
|
/*
|
|
|
|
|
* Actions
|
|
|
|
|
*/
|
2011-08-17 09:50:29 +02:00
|
|
|
if ($action == 'setcodeclient')
|
2004-12-01 17:50:33 +01:00
|
|
|
{
|
2011-08-31 10:10:39 +02:00
|
|
|
if (dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON",$value,'chaine',0,'',$conf->entity) > 0)
|
2006-03-12 16:28:54 +01:00
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
2006-04-09 00:47:51 +02:00
|
|
|
exit;
|
2006-03-12 16:28:54 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-02-20 23:53:15 +01:00
|
|
|
dol_print_error($db);
|
2006-03-12 16:28:54 +01:00
|
|
|
}
|
2004-12-01 17:50:33 +01:00
|
|
|
}
|
|
|
|
|
|
2011-08-17 09:50:29 +02:00
|
|
|
if ($action == 'setcodecompta')
|
2004-12-07 16:27:05 +01:00
|
|
|
{
|
2011-08-31 10:10:39 +02:00
|
|
|
if (dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON",$value,'chaine',0,'',$conf->entity) > 0)
|
2006-03-12 16:28:54 +01:00
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
2006-04-09 00:47:51 +02:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-02-20 23:53:15 +01:00
|
|
|
dol_print_error($db);
|
2006-04-09 00:47:51 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-31 13:02:48 +01:00
|
|
|
if ($action == 'updateoptions')
|
2007-06-23 09:03:20 +02:00
|
|
|
{
|
2014-01-31 13:02:48 +01:00
|
|
|
if (GETPOST('COMPANY_USE_SEARCH_TO_SELECT'))
|
2013-02-12 09:49:27 +01:00
|
|
|
{
|
2014-01-31 13:02:48 +01:00
|
|
|
$companysearch = GETPOST('activate_COMPANY_USE_SEARCH_TO_SELECT','alpha');
|
|
|
|
|
$res = dolibarr_set_const($db, "COMPANY_USE_SEARCH_TO_SELECT", $companysearch,'chaine',0,'',$conf->entity);
|
|
|
|
|
if (! $res > 0) $error++;
|
|
|
|
|
if (! $error)
|
|
|
|
|
{
|
|
|
|
|
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
|
|
|
|
}
|
2013-02-12 09:49:27 +01:00
|
|
|
}
|
2014-01-31 13:02:48 +01:00
|
|
|
|
|
|
|
|
if (GETPOST('CONTACT_USE_SEARCH_TO_SELECT'))
|
2013-02-12 09:49:27 +01:00
|
|
|
{
|
2014-01-31 13:02:48 +01:00
|
|
|
$contactsearch = GETPOST('activate_CONTACT_USE_SEARCH_TO_SELECT','alpha');
|
|
|
|
|
$res = dolibarr_set_const($db, "CONTACT_USE_SEARCH_TO_SELECT", $contactsearch,'chaine',0,'',$conf->entity);
|
|
|
|
|
if (! $res > 0) $error++;
|
|
|
|
|
if (! $error)
|
|
|
|
|
{
|
|
|
|
|
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
|
|
|
|
}
|
2013-02-12 09:49:27 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-27 18:03:47 +02:00
|
|
|
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
|
2011-08-17 09:50:29 +02:00
|
|
|
if ($action == 'setModuleOptions')
|
2007-09-18 16:41:47 +02:00
|
|
|
{
|
2010-09-01 09:50:28 +02:00
|
|
|
$post_size=count($_POST);
|
2011-09-03 02:19:56 +02:00
|
|
|
|
2011-08-28 11:52:46 +02:00
|
|
|
$db->begin();
|
2011-09-03 02:19:56 +02:00
|
|
|
|
2010-09-01 09:50:28 +02:00
|
|
|
for($i=0;$i < $post_size;$i++)
|
2010-04-07 17:05:21 +02:00
|
|
|
{
|
|
|
|
|
if (array_key_exists('param'.$i,$_POST))
|
|
|
|
|
{
|
2012-03-28 10:57:02 +02:00
|
|
|
$param=GETPOST("param".$i,'alpha');
|
|
|
|
|
$value=GETPOST("value".$i,'alpha');
|
2011-08-28 11:52:46 +02:00
|
|
|
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
|
|
|
|
|
if (! $res > 0) $error++;
|
2010-04-07 17:05:21 +02:00
|
|
|
}
|
|
|
|
|
}
|
2011-08-28 11:52:46 +02:00
|
|
|
if (! $error)
|
|
|
|
|
{
|
|
|
|
|
$db->commit();
|
|
|
|
|
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$db->rollback();
|
|
|
|
|
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
|
|
|
|
}
|
2007-09-18 16:41:47 +02:00
|
|
|
}
|
|
|
|
|
|
2010-03-10 21:36:30 +01:00
|
|
|
// Activate a document generator module
|
2011-08-17 09:50:29 +02:00
|
|
|
if ($action == 'set')
|
2010-02-24 17:41:19 +01:00
|
|
|
{
|
2012-03-28 10:57:02 +02:00
|
|
|
$label = GETPOST('label','alpha');
|
|
|
|
|
$scandir = GETPOST('scandir','alpha');
|
2011-09-03 02:19:56 +02:00
|
|
|
|
2010-02-24 17:41:19 +01:00
|
|
|
$type='company';
|
2010-02-28 23:49:06 +01:00
|
|
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
2011-08-31 10:10:39 +02:00
|
|
|
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
|
|
|
|
|
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
|
|
|
|
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
2010-02-28 23:49:06 +01:00
|
|
|
$sql.= ")";
|
2011-09-21 15:16:13 +02:00
|
|
|
|
2011-09-14 23:50:17 +02:00
|
|
|
$resql=$db->query($sql);
|
|
|
|
|
if (! $resql) dol_print_error($db);
|
2010-02-24 17:41:19 +01:00
|
|
|
}
|
|
|
|
|
|
2010-03-10 21:36:30 +01:00
|
|
|
// Disable a document generator module
|
2011-08-17 09:50:29 +02:00
|
|
|
if ($action== 'del')
|
2010-03-10 21:36:30 +01:00
|
|
|
{
|
|
|
|
|
$type='company';
|
|
|
|
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
2011-08-31 10:10:39 +02:00
|
|
|
$sql.= " WHERE nom='".$db->escape($value)."' AND type='".$type."' AND entity=".$conf->entity;
|
2011-09-14 23:50:18 +02:00
|
|
|
$resql=$db->query($sql);
|
|
|
|
|
if (! $resql) dol_print_error($db);
|
2010-03-10 21:36:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Define default generator
|
2011-08-17 09:50:29 +02:00
|
|
|
if ($action == 'setdoc')
|
2010-02-24 17:41:19 +01:00
|
|
|
{
|
2012-03-28 10:57:02 +02:00
|
|
|
$label = GETPOST('label','alpha');
|
|
|
|
|
$scandir = GETPOST('scandir','alpha');
|
2011-09-03 02:19:56 +02:00
|
|
|
|
2010-02-24 17:41:19 +01:00
|
|
|
$db->begin();
|
|
|
|
|
|
2011-08-31 10:10:39 +02:00
|
|
|
if (dolibarr_set_const($db, "COMPANY_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
2010-02-24 17:41:19 +01:00
|
|
|
{
|
2011-08-31 10:10:39 +02:00
|
|
|
$conf->global->COMPANY_ADDON_PDF = $value;
|
2010-02-24 17:41:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// On active le modele
|
|
|
|
|
$type='company';
|
|
|
|
|
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
2012-03-28 10:57:02 +02:00
|
|
|
$sql_del.= " WHERE nom = '".$db->escape(GETPOST('value','alpha'))."'";
|
2010-02-24 17:41:19 +01:00
|
|
|
$sql_del.= " AND type = '".$type."'";
|
|
|
|
|
$sql_del.= " AND entity = ".$conf->entity;
|
2011-02-20 20:04:14 +01:00
|
|
|
dol_syslog("societe.php ".$sql);
|
2010-02-24 17:41:19 +01:00
|
|
|
$result1=$db->query($sql_del);
|
2010-02-27 23:53:27 +01:00
|
|
|
|
2010-02-28 23:49:06 +01:00
|
|
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
2011-08-31 10:10:39 +02:00
|
|
|
$sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
|
|
|
|
|
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
|
|
|
|
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
2010-02-28 23:49:06 +01:00
|
|
|
$sql.= ")";
|
2011-02-20 20:04:14 +01:00
|
|
|
dol_syslog("societe.php ".$sql);
|
2010-02-24 17:41:19 +01:00
|
|
|
$result2=$db->query($sql);
|
|
|
|
|
if ($result1 && $result2)
|
|
|
|
|
{
|
|
|
|
|
$db->commit();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2011-02-20 20:04:14 +01:00
|
|
|
dol_syslog("societe.php ".$db->lasterror(), LOG_ERR);
|
|
|
|
|
$db->rollback();
|
2010-02-24 17:41:19 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-16 18:49:22 +02:00
|
|
|
//Activate ProfId
|
2011-08-17 09:50:29 +02:00
|
|
|
if ($action == 'setprofid')
|
2011-08-16 18:49:22 +02:00
|
|
|
{
|
2012-03-28 10:57:02 +02:00
|
|
|
$status = GETPOST('status','alpha');
|
2011-09-03 02:19:56 +02:00
|
|
|
|
2011-08-31 10:10:39 +02:00
|
|
|
$idprof="SOCIETE_IDPROF".$value."_UNIQUE";
|
|
|
|
|
if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0)
|
2011-08-16 18:49:22 +02:00
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
2011-08-16 18:49:22 +02:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-02-24 17:41:19 +01:00
|
|
|
|
2013-08-30 18:18:58 +02:00
|
|
|
//Activate Set ref in list
|
|
|
|
|
if ($action=="setaddrefinlist") {
|
|
|
|
|
$setaddrefinlist = GETPOST('value','int');
|
|
|
|
|
$res = dolibarr_set_const($db, "SOCIETE_ADD_REF_IN_LIST", $setaddrefinlist,'yesno',0,'',$conf->entity);
|
|
|
|
|
if (! $res > 0) $error++;
|
|
|
|
|
if (! $error)
|
|
|
|
|
{
|
|
|
|
|
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2013-02-21 11:03:14 +01:00
|
|
|
//Activate ProfId mandatory
|
2012-12-02 11:03:23 +01:00
|
|
|
if ($action == 'setprofidmandatory')
|
|
|
|
|
{
|
|
|
|
|
$status = GETPOST('status','alpha');
|
|
|
|
|
|
|
|
|
|
$idprof="SOCIETE_IDPROF".$value."_MANDATORY";
|
|
|
|
|
if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0)
|
|
|
|
|
{
|
|
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
2012-11-30 18:46:05 +01:00
|
|
|
}
|
|
|
|
|
|
2013-02-21 11:03:14 +01:00
|
|
|
//Activate ProfId invoice mandatory
|
|
|
|
|
if ($action == 'setprofidinvoicemandatory')
|
|
|
|
|
{
|
|
|
|
|
$status = GETPOST('status','alpha');
|
|
|
|
|
|
|
|
|
|
$idprof="SOCIETE_IDPROF".$value."_INVOICE_MANDATORY";
|
|
|
|
|
if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0)
|
|
|
|
|
{
|
|
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-12-07 16:27:05 +01:00
|
|
|
|
2013-05-11 17:10:11 +02:00
|
|
|
//Set hide closed customer into combox or select
|
|
|
|
|
if ($action == 'sethideinactivethirdparty')
|
|
|
|
|
{
|
|
|
|
|
$status = GETPOST('status','alpha');
|
|
|
|
|
|
|
|
|
|
if (dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX",$status,'chaine',0,'',$conf->entity) > 0)
|
|
|
|
|
{
|
|
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-01 17:50:33 +01:00
|
|
|
/*
|
2008-07-27 22:47:13 +02:00
|
|
|
* View
|
2004-12-01 17:50:33 +01:00
|
|
|
*/
|
|
|
|
|
|
2011-09-28 14:13:48 +02:00
|
|
|
clearstatcache();
|
|
|
|
|
|
2006-04-09 00:47:51 +02:00
|
|
|
$form=new Form($db);
|
2006-03-12 16:28:54 +01:00
|
|
|
|
2011-08-17 09:50:29 +02:00
|
|
|
$help_url='EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers|ES:Configuración_del_módulo_terceros';
|
2011-07-04 09:38:22 +02:00
|
|
|
llxHeader('',$langs->trans("CompanySetup"),$help_url);
|
2006-04-09 00:47:51 +02:00
|
|
|
|
2008-01-26 16:10:18 +01:00
|
|
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
|
|
|
|
print_fiche_titre($langs->trans("CompanySetup"),$linkback,'setup');
|
2004-12-01 17:50:33 +01:00
|
|
|
|
2011-06-22 18:24:20 +02:00
|
|
|
|
2011-08-27 18:03:47 +02:00
|
|
|
$head = societe_admin_prepare_head(null);
|
2011-06-22 18:24:20 +02:00
|
|
|
|
2012-10-16 01:36:42 +02:00
|
|
|
dol_fiche_head($head, 'general', $langs->trans("ThirdParties"), 0, 'company');
|
2004-12-01 17:50:33 +01:00
|
|
|
|
2011-08-27 18:03:47 +02:00
|
|
|
dol_htmloutput_mesg($mesg);
|
|
|
|
|
|
2006-03-12 16:28:54 +01:00
|
|
|
|
2013-01-07 13:28:14 +01:00
|
|
|
$dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']);
|
2012-03-01 00:03:16 +01:00
|
|
|
|
2011-08-27 18:03:47 +02:00
|
|
|
// Module to manage customer/supplier code
|
2006-03-12 16:28:54 +01:00
|
|
|
|
2006-03-25 13:29:53 +01:00
|
|
|
print_titre($langs->trans("CompanyCodeChecker"));
|
2004-12-01 17:50:33 +01:00
|
|
|
|
2012-01-12 11:50:10 +01:00
|
|
|
print '<table class="noborder" width="100%">'."\n";
|
|
|
|
|
print '<tr class="liste_titre">'."\n";
|
2005-02-13 20:30:36 +01:00
|
|
|
print ' <td>'.$langs->trans("Name").'</td>';
|
|
|
|
|
print ' <td>'.$langs->trans("Description").'</td>';
|
2006-03-25 13:29:53 +01:00
|
|
|
print ' <td>'.$langs->trans("Example").'</td>';
|
2011-08-27 18:03:47 +02:00
|
|
|
print ' <td align="center" width="80">'.$langs->trans("Status").'</td>';
|
2013-05-07 22:04:08 +02:00
|
|
|
print ' <td align="center" width="60">'.$langs->trans("ShortInfo").'</td>';
|
2004-12-01 17:50:33 +01:00
|
|
|
print "</tr>\n";
|
|
|
|
|
|
2011-09-28 14:13:48 +02:00
|
|
|
$var = true;
|
2012-03-01 00:03:16 +01:00
|
|
|
foreach ($dirsociete as $dirroot)
|
2004-12-01 17:50:33 +01:00
|
|
|
{
|
2012-03-01 00:03:16 +01:00
|
|
|
$dir = dol_buildpath($dirroot,0);
|
|
|
|
|
|
2011-12-28 17:59:57 +01:00
|
|
|
$handle = @opendir($dir);
|
2011-09-28 14:13:48 +02:00
|
|
|
if (is_resource($handle))
|
|
|
|
|
{
|
|
|
|
|
// Loop on each module find in opened directory
|
|
|
|
|
while (($file = readdir($handle))!==false)
|
|
|
|
|
{
|
|
|
|
|
if (substr($file, 0, 15) == 'mod_codeclient_' && substr($file, -3) == 'php')
|
|
|
|
|
{
|
|
|
|
|
$file = substr($file, 0, dol_strlen($file)-4);
|
|
|
|
|
|
2011-11-05 03:15:11 +01:00
|
|
|
try {
|
2012-08-23 02:04:35 +02:00
|
|
|
dol_include_once($dirroot.$file.'.php');
|
2011-11-05 03:15:11 +01:00
|
|
|
}
|
|
|
|
|
catch(Exception $e)
|
|
|
|
|
{
|
|
|
|
|
dol_syslog($e->getMessage(), LOG_ERR);
|
|
|
|
|
}
|
2011-09-28 14:13:48 +02:00
|
|
|
|
|
|
|
|
$modCodeTiers = new $file;
|
|
|
|
|
|
|
|
|
|
// Show modules according to features level
|
|
|
|
|
if ($modCodeTiers->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
|
|
|
|
if ($modCodeTiers->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
|
|
|
|
|
|
|
|
|
$var = !$var;
|
2012-01-12 11:50:10 +01:00
|
|
|
print '<tr '.$bc[$var].'>'."\n";
|
|
|
|
|
print '<td width="140">'.$modCodeTiers->nom.'</td>'."\n";
|
|
|
|
|
print '<td>'.$modCodeTiers->info($langs).'</td>'."\n";
|
2013-04-25 01:13:13 +02:00
|
|
|
print '<td class="nowrap">'.$modCodeTiers->getExample($langs).'</td>'."\n";
|
2011-09-28 14:13:48 +02:00
|
|
|
|
|
|
|
|
if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file")
|
|
|
|
|
{
|
2012-01-12 11:50:10 +01:00
|
|
|
print '<td align="center">'."\n";
|
2011-09-28 14:13:48 +02:00
|
|
|
print img_picto($langs->trans("Activated"),'switch_on');
|
|
|
|
|
print "</td>\n";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2012-02-06 16:22:20 +01:00
|
|
|
$disabled = false;
|
|
|
|
|
if (! empty($conf->multicompany->enabled) && (is_object($mc) && ! empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true);
|
2012-01-12 11:50:10 +01:00
|
|
|
print '<td align="center">';
|
2012-06-02 14:56:36 +02:00
|
|
|
if (! $disabled) print '<a href="'.$_SERVER['PHP_SELF'].'?action=setcodeclient&value='.$file.'">';
|
2011-09-28 14:13:48 +02:00
|
|
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
2012-01-12 11:50:10 +01:00
|
|
|
if (! $disabled) print '</a>';
|
|
|
|
|
print '</td>';
|
2011-09-28 14:13:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '<td align="center">';
|
|
|
|
|
$s=$modCodeTiers->getToolTip($langs,null,-1);
|
|
|
|
|
print $form->textwithpicto('',$s,1);
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '</tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
closedir($handle);
|
|
|
|
|
}
|
2004-12-07 16:27:05 +01:00
|
|
|
}
|
|
|
|
|
print '</table>';
|
|
|
|
|
|
2006-03-12 16:28:54 +01:00
|
|
|
|
2004-12-07 16:27:05 +01:00
|
|
|
print "<br>";
|
|
|
|
|
|
2006-03-12 16:28:54 +01:00
|
|
|
|
2011-08-27 18:03:47 +02:00
|
|
|
// Select accountancy code numbering module
|
2006-03-12 16:28:54 +01:00
|
|
|
|
2005-02-13 20:30:36 +01:00
|
|
|
print_titre($langs->trans("AccountCodeManager"));
|
2004-12-07 16:27:05 +01:00
|
|
|
|
2005-02-13 20:30:36 +01:00
|
|
|
print '<table class="noborder" width="100%">';
|
2004-12-07 16:27:05 +01:00
|
|
|
print '<tr class="liste_titre">';
|
2010-03-06 20:33:45 +01:00
|
|
|
print '<td width="140">'.$langs->trans("Name").'</td>';
|
2005-02-13 20:30:36 +01:00
|
|
|
print '<td>'.$langs->trans("Description").'</td>';
|
2006-03-25 13:29:53 +01:00
|
|
|
print '<td>'.$langs->trans("Example").'</td>';
|
2011-08-27 18:03:47 +02:00
|
|
|
print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
|
2013-05-07 22:04:08 +02:00
|
|
|
print '<td align="center" width="60">'.$langs->trans("ShortInfo").'</td>';
|
2004-12-07 16:27:05 +01:00
|
|
|
print "</tr>\n";
|
|
|
|
|
|
2012-03-01 00:03:16 +01:00
|
|
|
foreach ($dirsociete as $dirroot)
|
2004-12-07 16:27:05 +01:00
|
|
|
{
|
2012-03-01 00:03:16 +01:00
|
|
|
$dir = dol_buildpath($dirroot,0);
|
|
|
|
|
|
|
|
|
|
$handle = @opendir($dir);
|
2011-09-28 14:13:48 +02:00
|
|
|
if (is_resource($handle))
|
|
|
|
|
{
|
|
|
|
|
while (($file = readdir($handle))!==false)
|
|
|
|
|
{
|
|
|
|
|
if (substr($file, 0, 15) == 'mod_codecompta_' && substr($file, -3) == 'php')
|
|
|
|
|
{
|
|
|
|
|
$file = substr($file, 0, dol_strlen($file)-4);
|
|
|
|
|
|
2012-03-01 00:03:16 +01:00
|
|
|
try {
|
2012-08-23 02:04:35 +02:00
|
|
|
dol_include_once($dirroot.$file.'.php');
|
2012-03-01 00:03:16 +01:00
|
|
|
}
|
|
|
|
|
catch(Exception $e)
|
|
|
|
|
{
|
|
|
|
|
dol_syslog($e->getMessage(), LOG_ERR);
|
|
|
|
|
}
|
2011-09-28 14:13:48 +02:00
|
|
|
|
|
|
|
|
$modCodeCompta = new $file;
|
|
|
|
|
$var = !$var;
|
|
|
|
|
|
|
|
|
|
print '<tr '.$bc[$var].'>';
|
|
|
|
|
print '<td>'.$modCodeCompta->nom."</td><td>\n";
|
|
|
|
|
print $modCodeCompta->info($langs);
|
|
|
|
|
print '</td>';
|
2013-04-25 01:13:13 +02:00
|
|
|
print '<td class="nowrap">'.$modCodeCompta->getExample($langs)."</td>\n";
|
2011-09-28 14:13:48 +02:00
|
|
|
|
|
|
|
|
if ($conf->global->SOCIETE_CODECOMPTA_ADDON == "$file")
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center">';
|
|
|
|
|
print img_picto($langs->trans("Activated"),'switch_on');
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2012-06-02 14:56:36 +02:00
|
|
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setcodecompta&value='.$file.'">';
|
2011-09-28 14:13:48 +02:00
|
|
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
|
|
|
|
print '</a></td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td align="center">';
|
|
|
|
|
$s=$modCodeCompta->getToolTip($langs,null,-1);
|
|
|
|
|
print $form->textwithpicto('',$s,1);
|
|
|
|
|
print '</td>';
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
closedir($handle);
|
|
|
|
|
}
|
2004-12-01 17:50:33 +01:00
|
|
|
}
|
2004-12-06 21:19:19 +01:00
|
|
|
print "</table>\n";
|
2009-01-31 16:23:05 +01:00
|
|
|
|
2010-02-24 17:41:19 +01:00
|
|
|
|
|
|
|
|
/*
|
2010-10-27 22:53:23 +02:00
|
|
|
* Document templates generators
|
2010-02-24 17:41:19 +01:00
|
|
|
*/
|
2006-04-09 00:47:51 +02:00
|
|
|
print '<br>';
|
2010-02-24 17:41:19 +01:00
|
|
|
print_titre($langs->trans("ModelModules"));
|
|
|
|
|
|
2010-10-27 22:53:23 +02:00
|
|
|
// Load array def with activated templates
|
2010-02-24 17:41:19 +01:00
|
|
|
$def = array();
|
|
|
|
|
$sql = "SELECT nom";
|
|
|
|
|
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
|
|
|
|
$sql.= " WHERE type = 'company'";
|
|
|
|
|
$sql.= " AND entity = ".$conf->entity;
|
|
|
|
|
$resql=$db->query($sql);
|
|
|
|
|
if ($resql)
|
|
|
|
|
{
|
|
|
|
|
$i = 0;
|
|
|
|
|
$num_rows=$db->num_rows($resql);
|
|
|
|
|
while ($i < $num_rows)
|
|
|
|
|
{
|
|
|
|
|
$array = $db->fetch_array($resql);
|
|
|
|
|
array_push($def, $array[0]);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
print '<tr class="liste_titre">';
|
2010-03-06 20:33:45 +01:00
|
|
|
print '<td width="140">'.$langs->trans("Name").'</td>';
|
2010-02-24 17:41:19 +01:00
|
|
|
print '<td>'.$langs->trans("Description").'</td>';
|
2011-08-27 18:03:47 +02:00
|
|
|
print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
|
2013-05-07 22:04:08 +02:00
|
|
|
print '<td align="center" width="60">'.$langs->trans("ShortInfo").'</td>';
|
2013-05-07 22:38:34 +02:00
|
|
|
print '<td align="center" width="60">'.$langs->trans("Preview").'</td>';
|
2010-02-24 17:41:19 +01:00
|
|
|
print "</tr>\n";
|
|
|
|
|
|
2012-03-01 00:03:16 +01:00
|
|
|
foreach ($dirsociete as $dirroot)
|
2010-02-24 17:41:19 +01:00
|
|
|
{
|
2012-03-01 00:03:16 +01:00
|
|
|
$dir = dol_buildpath($dirroot.'doc/',0);
|
2010-02-24 17:41:19 +01:00
|
|
|
|
2012-03-01 00:03:16 +01:00
|
|
|
$handle=@opendir($dir);
|
|
|
|
|
if (is_resource($handle))
|
2010-02-24 17:41:19 +01:00
|
|
|
{
|
2012-03-01 00:03:16 +01:00
|
|
|
while (($file = readdir($handle))!==false)
|
2010-02-24 17:41:19 +01:00
|
|
|
{
|
2012-03-01 00:03:16 +01:00
|
|
|
if (preg_match('/\.modules\.php$/i',$file))
|
2010-02-24 17:41:19 +01:00
|
|
|
{
|
2012-03-01 00:03:16 +01:00
|
|
|
$name = substr($file, 4, dol_strlen($file) -16);
|
|
|
|
|
$classname = substr($file, 0, dol_strlen($file) -12);
|
2010-02-24 17:41:19 +01:00
|
|
|
|
2012-03-01 00:03:16 +01:00
|
|
|
try {
|
|
|
|
|
dol_include_once($dirroot.'doc/'.$file);
|
|
|
|
|
}
|
|
|
|
|
catch(Exception $e)
|
|
|
|
|
{
|
|
|
|
|
dol_syslog($e->getMessage(), LOG_ERR);
|
|
|
|
|
}
|
2010-02-24 21:46:14 +01:00
|
|
|
|
2012-03-01 00:03:16 +01:00
|
|
|
$module = new $classname($db);
|
2010-02-24 17:41:19 +01:00
|
|
|
|
2012-03-01 00:03:16 +01:00
|
|
|
$modulequalified=1;
|
2012-08-15 09:06:36 +02:00
|
|
|
if (! empty($module->version)) {
|
2012-08-20 01:29:13 +02:00
|
|
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
2012-08-15 09:06:36 +02:00
|
|
|
else if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
|
|
|
|
}
|
2012-03-01 00:03:16 +01:00
|
|
|
|
|
|
|
|
if ($modulequalified)
|
|
|
|
|
{
|
|
|
|
|
$var = !$var;
|
|
|
|
|
print '<tr '.$bc[$var].'><td width="100">';
|
|
|
|
|
print $module->name;
|
|
|
|
|
print "</td><td>\n";
|
|
|
|
|
if (method_exists($module,'info')) print $module->info($langs);
|
|
|
|
|
else print $module->description;
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
// Activate / Disable
|
|
|
|
|
if (in_array($name, $def))
|
2010-02-24 17:41:19 +01:00
|
|
|
{
|
2012-03-01 00:03:16 +01:00
|
|
|
print "<td align=\"center\">\n";
|
|
|
|
|
//if ($conf->global->COMPANY_ADDON_PDF != "$name")
|
|
|
|
|
//{
|
2012-06-02 14:56:36 +02:00
|
|
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
2012-03-01 00:03:16 +01:00
|
|
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
|
|
|
|
print '</a>';
|
|
|
|
|
//}
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
// print img_picto($langs->trans("Enabled"),'on');
|
|
|
|
|
//}
|
|
|
|
|
print "</td>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (versioncompare($module->phpmin,versionphparray()) > 0)
|
2010-03-10 22:59:34 +01:00
|
|
|
{
|
|
|
|
|
print "<td align=\"center\">\n";
|
2012-03-01 00:03:16 +01:00
|
|
|
print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion",join('.',$module->phpmin))),'switch_off');
|
2010-03-10 22:59:34 +01:00
|
|
|
print "</td>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2012-03-01 00:03:16 +01:00
|
|
|
print "<td align=\"center\">\n";
|
2012-06-02 14:56:36 +02:00
|
|
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
2012-03-01 00:03:16 +01:00
|
|
|
print "</td>";
|
2010-03-10 22:59:34 +01:00
|
|
|
}
|
2012-03-01 00:03:16 +01:00
|
|
|
}
|
2010-02-24 17:41:19 +01:00
|
|
|
|
2012-03-01 00:03:16 +01:00
|
|
|
// Info
|
|
|
|
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
|
|
|
|
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
2012-08-15 09:06:36 +02:00
|
|
|
if ($module->type == 'pdf')
|
2012-03-01 00:03:16 +01:00
|
|
|
{
|
|
|
|
|
$htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
|
|
|
|
|
}
|
|
|
|
|
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
2012-08-15 09:06:36 +02:00
|
|
|
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraft").': '.yn((! empty($module->option_draft_watermark)?$module->option_draft_watermark:''), 1, 1);
|
2013-05-07 22:38:34 +02:00
|
|
|
|
|
|
|
|
print '<td align="center" class="nowrap">';
|
|
|
|
|
print $form->textwithpicto('',$htmltooltip,1,0);
|
|
|
|
|
print '</td>';
|
2010-02-24 17:41:19 +01:00
|
|
|
|
2013-05-07 22:38:34 +02:00
|
|
|
// Preview
|
2013-04-25 01:13:13 +02:00
|
|
|
print '<td align="center" class="nowrap">';
|
2012-08-15 09:06:36 +02:00
|
|
|
if ($module->type == 'pdf')
|
2012-03-01 00:03:16 +01:00
|
|
|
{
|
|
|
|
|
$linkspec='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$linkspec=img_object($langs->trans("PreviewNotAvailable"),'generic');
|
2010-10-27 22:53:23 +02:00
|
|
|
}
|
2013-05-07 22:38:34 +02:00
|
|
|
print $linkspec;
|
2012-03-01 00:03:16 +01:00
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print "</tr>\n";
|
2010-02-24 17:41:19 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-03-01 00:03:16 +01:00
|
|
|
closedir($handle);
|
2010-02-24 17:41:19 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
print '</table>';
|
|
|
|
|
|
|
|
|
|
print '<br>';
|
2006-04-09 00:47:51 +02:00
|
|
|
|
2011-08-16 18:49:22 +02:00
|
|
|
//IDProf
|
|
|
|
|
print_titre($langs->trans("CompanyIdProfChecker"));
|
|
|
|
|
|
|
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
print '<td>'.$langs->trans("Name").'</td>';
|
|
|
|
|
print '<td>'.$langs->trans("Description").'</td>';
|
2011-08-26 13:48:36 +02:00
|
|
|
print '<td align="center">'.$langs->trans("MustBeUnique").'</td>';
|
2012-11-30 18:46:05 +01:00
|
|
|
print '<td align="center">'.$langs->trans("MustBeMandatory").'</td>';
|
2013-02-21 11:03:14 +01:00
|
|
|
print '<td align="center">'.$langs->trans("MustBeInvoiceMandatory").'</td>';
|
2011-08-16 18:49:22 +02:00
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
$profid[0][0]=$langs->trans("ProfId1");
|
2011-12-29 18:07:41 +01:00
|
|
|
$profid[0][1]=$langs->transcountry('ProfId1', $mysoc->country_code);
|
2011-08-16 18:49:22 +02:00
|
|
|
$profid[1][0]=$langs->trans("ProfId2");
|
2011-12-29 18:07:41 +01:00
|
|
|
$profid[1][1]=$langs->transcountry('ProfId2', $mysoc->country_code);
|
2011-08-16 18:49:22 +02:00
|
|
|
$profid[2][0]=$langs->trans("ProfId3");
|
2011-12-29 18:07:41 +01:00
|
|
|
$profid[2][1]=$langs->transcountry('ProfId3', $mysoc->country_code);
|
2011-08-16 18:49:22 +02:00
|
|
|
$profid[3][0]=$langs->trans("ProfId4");
|
2011-12-29 18:07:41 +01:00
|
|
|
$profid[3][1]=$langs->transcountry('ProfId4', $mysoc->country_code);
|
2012-12-02 11:03:23 +01:00
|
|
|
$profid[4][0]=$langs->trans("ProfId5");
|
2012-11-30 21:23:12 +01:00
|
|
|
$profid[4][1]=$langs->transcountry('ProfId5', $mysoc->country_code);
|
2012-12-02 11:03:23 +01:00
|
|
|
$profid[5][0]=$langs->trans("ProfId6");
|
2012-11-30 21:23:12 +01:00
|
|
|
$profid[5][1]=$langs->transcountry('ProfId6', $mysoc->country_code);
|
2011-08-16 18:49:22 +02:00
|
|
|
|
|
|
|
|
$var = true;
|
|
|
|
|
$i=0;
|
|
|
|
|
|
2011-09-03 02:19:56 +02:00
|
|
|
$nbofloop=count($profid);
|
|
|
|
|
while ($i < $nbofloop)
|
2011-08-16 18:49:22 +02:00
|
|
|
{
|
2012-11-30 21:23:12 +01:00
|
|
|
if ($profid[$i][1]!='-')
|
2012-12-01 15:45:05 +01:00
|
|
|
{
|
2012-11-30 21:23:12 +01:00
|
|
|
$var = !$var;
|
2012-11-30 18:46:05 +01:00
|
|
|
|
2012-11-30 21:23:12 +01:00
|
|
|
print '<tr '.$bc[$var].'>';
|
|
|
|
|
print '<td>'.$profid[$i][0]."</td><td>\n";
|
|
|
|
|
print $profid[$i][1];
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
$idprof_unique ='SOCIETE_IDPROF'.($i+1).'_UNIQUE';
|
|
|
|
|
$idprof_mandatory ='SOCIETE_IDPROF'.($i+1).'_MANDATORY';
|
2013-02-21 11:03:14 +01:00
|
|
|
$idprof_invoice_mandatory ='SOCIETE_IDPROF'.($i+1).'_INVOICE_MANDATORY';
|
2012-11-30 21:23:12 +01:00
|
|
|
$verif=(empty($conf->global->$idprof_unique)?false:true);
|
|
|
|
|
$mandatory=(empty($conf->global->$idprof_mandatory)?false:true);
|
2013-02-21 11:03:14 +01:00
|
|
|
$invoice_mandatory=(empty($conf->global->$idprof_invoice_mandatory)?false:true);
|
2012-11-30 21:23:12 +01:00
|
|
|
|
|
|
|
|
if ($verif)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"),'switch_on');
|
|
|
|
|
print '</a></td>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
|
|
|
|
print '</a></td>';
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-02 11:03:23 +01:00
|
|
|
if ($mandatory)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"),'switch_on');
|
|
|
|
|
print '</a></td>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
|
|
|
|
print '</a></td>';
|
2012-11-30 21:23:12 +01:00
|
|
|
}
|
2013-02-21 11:03:14 +01:00
|
|
|
|
|
|
|
|
if ($invoice_mandatory)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&value='.($i+1).'&status=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"),'switch_on');
|
|
|
|
|
print '</a></td>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&value='.($i+1).'&status=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
|
|
|
|
print '</a></td>';
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-30 21:23:12 +01:00
|
|
|
print "</tr>\n";
|
2012-11-30 18:46:05 +01:00
|
|
|
}
|
2011-08-16 18:49:22 +02:00
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-26 13:48:36 +02:00
|
|
|
print "</table><br>\n";
|
2011-08-16 18:49:22 +02:00
|
|
|
|
|
|
|
|
|
2010-02-25 00:29:46 +01:00
|
|
|
print_titre($langs->trans("Other"));
|
|
|
|
|
|
2006-08-05 18:44:43 +02:00
|
|
|
// Autres options
|
2011-11-08 10:18:45 +01:00
|
|
|
$form=new Form($db);
|
2006-04-09 00:47:51 +02:00
|
|
|
$var=true;
|
2014-01-31 13:02:48 +01: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="updateoptions">';
|
|
|
|
|
|
2006-04-09 00:47:51 +02:00
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
|
|
print '<tr class="liste_titre">';
|
2010-01-30 12:06:59 +01:00
|
|
|
print "<td>".$langs->trans("Parameters")."</td>\n";
|
|
|
|
|
print '<td align="right" width="60">'.$langs->trans("Value").'</td>'."\n";
|
|
|
|
|
print '<td width="80"> </td></tr>'."\n";
|
2006-04-09 00:47:51 +02:00
|
|
|
|
2009-05-16 14:52:53 +02:00
|
|
|
// Utilisation formulaire Ajax sur choix societe
|
2006-04-09 00:47:51 +02:00
|
|
|
$var=!$var;
|
2007-06-23 09:03:20 +02:00
|
|
|
print "<tr ".$bc[$var].">";
|
|
|
|
|
print '<td width="80%">'.$langs->trans("UseSearchToSelectCompany").'</td>';
|
2008-01-06 16:24:23 +01:00
|
|
|
if (! $conf->use_javascript_ajax)
|
2007-06-23 09:03:20 +02:00
|
|
|
{
|
2013-04-25 01:13:13 +02:00
|
|
|
print '<td class="nowrap" align="right" colspan="2">';
|
2009-02-02 03:04:26 +01:00
|
|
|
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
|
|
|
|
print "</td>";
|
2007-06-23 09:03:20 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-02-02 03:04:26 +01:00
|
|
|
print '<td width="60" align="right">';
|
2010-10-22 10:11:51 +02:00
|
|
|
$arrval=array('0'=>$langs->trans("No"),
|
|
|
|
|
'1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",1).')',
|
|
|
|
|
'2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",2).')',
|
|
|
|
|
'3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",3).')',
|
|
|
|
|
);
|
2011-11-08 10:18:45 +01:00
|
|
|
print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT",$arrval,$conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
2009-02-02 03:04:26 +01:00
|
|
|
print '</td><td align="right">';
|
2014-01-31 13:02:48 +01:00
|
|
|
print '<input type="submit" class="button" name="COMPANY_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
2009-02-02 03:04:26 +01:00
|
|
|
print "</td>";
|
2007-06-23 09:03:20 +02:00
|
|
|
}
|
|
|
|
|
print '</tr>';
|
2006-04-09 00:47:51 +02:00
|
|
|
|
2013-08-30 18:18:58 +02:00
|
|
|
$var=!$var;
|
|
|
|
|
print "<tr ".$bc[$var].">";
|
2013-02-12 09:49:27 +01:00
|
|
|
print '<td width="80%">'.$langs->trans("UseSearchToSelectContact").'</td>';
|
|
|
|
|
if (! $conf->use_javascript_ajax)
|
|
|
|
|
{
|
2013-04-25 01:13:13 +02:00
|
|
|
print '<td class="nowrap" align="right" colspan="2">';
|
2013-02-12 09:49:27 +01:00
|
|
|
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
|
|
|
|
print "</td>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print '<td width="60" align="right">';
|
|
|
|
|
$arrval=array('0'=>$langs->trans("No"),
|
|
|
|
|
'1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",1).')',
|
|
|
|
|
'2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",2).')',
|
|
|
|
|
'3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",3).')',
|
|
|
|
|
);
|
|
|
|
|
print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT",$arrval,$conf->global->CONTACT_USE_SEARCH_TO_SELECT);
|
|
|
|
|
print '</td><td align="right">';
|
2014-01-31 13:02:48 +01:00
|
|
|
print '<input type="submit" class="button" name="CONTACT_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
2013-02-12 09:49:27 +01:00
|
|
|
print "</td>";
|
|
|
|
|
}
|
|
|
|
|
print '</tr>';
|
2013-05-11 17:10:11 +02:00
|
|
|
|
2014-01-31 13:02:48 +01:00
|
|
|
|
|
|
|
|
$var=!$var;
|
|
|
|
|
print "<tr ".$bc[$var].">";
|
|
|
|
|
print '<td width="80%">'.$langs->trans("AddRefInList").'</td>';
|
|
|
|
|
if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST))
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center" colspan="2"><a href="'.$_SERVER['PHP_SELF'].'?action=setaddrefinlist&value=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"),'switch_on');
|
|
|
|
|
print '</a></td>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center" colspan="2"><a href="'.$_SERVER['PHP_SELF'].'?action=setaddrefinlist&value=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
|
|
|
|
print '</a></td>';
|
|
|
|
|
}
|
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
|
2013-05-14 09:24:05 +02:00
|
|
|
/*
|
2013-05-11 17:10:11 +02:00
|
|
|
// COMPANY_USE_SEARCH_TO_SELECT
|
|
|
|
|
$var=!$var;
|
|
|
|
|
print "<tr ".$bc[$var].">";
|
|
|
|
|
print '<td width="80%">'.$langs->trans("HideClosedThirdpartyComboBox").'</td>';
|
|
|
|
|
if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX))
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=sethideinactivethirdparty&status=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"),'switch_on');
|
|
|
|
|
print '</a></td>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=sethideinactivethirdparty&status=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
|
|
|
|
print '</a></td>';
|
|
|
|
|
}
|
|
|
|
|
print '</tr>';
|
2013-05-14 09:24:05 +02:00
|
|
|
*/
|
2013-05-11 17:10:11 +02:00
|
|
|
|
2007-06-23 09:03:20 +02:00
|
|
|
print '</table>';
|
2004-12-07 16:27:05 +01:00
|
|
|
|
2014-01-31 13:02:48 +01:00
|
|
|
print '</form>';
|
2011-06-22 18:24:20 +02:00
|
|
|
|
2013-02-12 09:49:27 +01:00
|
|
|
|
2011-06-22 18:24:20 +02:00
|
|
|
dol_fiche_end();
|
|
|
|
|
|
2004-12-01 17:50:33 +01:00
|
|
|
$db->close();
|
|
|
|
|
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2004-12-01 17:50:33 +01:00
|
|
|
?>
|