';
if ($user->rights->fournisseur->facture->creer && $_GET["action"] <> 'edit')
diff --git a/htdocs/includes/modules/modMantis.class.php b/htdocs/includes/modules/modMantis.class.php
deleted file mode 100644
index 239dab8abb7..00000000000
--- a/htdocs/includes/modules/modMantis.class.php
+++ /dev/null
@@ -1,132 +0,0 @@
-
- * Copyright (C) 2004-2007 Laurent Destailleur
- *
- * 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 2 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, see .
- */
-
-/**
- * \defgroup mantis Module mantis
- * \brief Module to include Mantis into Dolibarr
- * \file htdocs/includes/modules/modMantis.class.php
- * \ingroup mantis
- * \brief Description and activation file for module Mantis
- */
-
-include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
-
-
-/**
- * \class modMantis
- * \brief Description and activation class for module Mantis
- */
-
-class modMantis extends DolibarrModules
-{
-
- /**
- * \brief Constructor. Define names, constants, directories, boxes, permissions
- * \param DB Database handler
- */
- function modMantis($DB)
- {
- $this->db = $DB;
-
- // Id for module (must be unique).
- // Use here a free id.
- $this->numero = 50300;
-
- // Family can be 'crm','financial','hr','projects','product','technic','other'
- // It is used to sort modules in module setup page
- $this->family = "projects";
- // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
- $this->name = preg_replace('/^mod/i','',get_class($this));
- // Module description used translation string 'ModuleXXXDesc' not found (XXX is id value)
- $this->description = "Interfacage avec le bug tracking Mantis";
- // Possible values for version are: 'experimental' or 'dolibarr' or version
- $this->version = 'development';
- // Id used in llx_const table to manage module status (enabled/disabled)
- $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=other)
- $this->special = 1;
- // Name of png file (without png) used for this module
- $this->picto='calendar';
-
- // Data directories to create when module is enabled
- $this->dirs = array();
-
- // Config pages
- $this->config_page_url = array("mantis.php@mantis");
-
- // Dependencies
- $this->depends = array(); // List of modules id that must be enabled
- $this->requiredby = array(); // List of modules id to disable if this one is disabled
-
- // Constants
- $this->const = array(); // List of parameters
-
- // Boxes
- $this->boxes = array(); // List of boxes
-
- // Permissions
- $this->rights_class = 'mantis'; // Permission key
- $this->rights = array(); // Permission array used by this module
-
- // Menus
- //------
- $r=0;
-
- $this->menu[$r]=array('fk_menu'=>0,
- 'type'=>'top',
- 'titre'=>'BugTracker',
- 'mainmenu'=>'mantis',
- 'leftmenu'=>'1',
- 'url'=>'/mantis/mantis.php',
- 'langs'=>'other',
- 'position'=>100,
- 'enabled'=>'$conf->mantis->enabled',
- 'perms'=>'',
- 'target'=>'',
- 'user'=>0);
- $r++;
-
- }
-
- /**
- * \brief Function called when module is enabled.
- * Add constants, boxes and permissions into Dolibarr database.
- * It also creates data directories.
- */
- function init()
- {
- $sql = array();
-
- return $this->_init($sql);
- }
-
- /**
- * \brief Function called when module is disabled.
- * Remove from database constants, boxes and permissions from Dolibarr database.
- * Data directories are not deleted.
- */
- function remove()
- {
- $sql = array();
-
- return $this->_remove($sql);
- }
-
-}
-
-?>
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 0e2f6ee691f..59ca0510c23 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -676,7 +676,7 @@ if (! defined('NOLOGIN'))
{
// If not active, we refuse the user
$langs->load("other");
- dol_syslog ("Authentification ko as login is disabled");
+ dol_syslog("Authentification ko as login is disabled");
accessforbidden($langs->trans("ErrorLoginDisabled"));
exit;
}
@@ -763,11 +763,13 @@ if (! function_exists("llxHeader"))
* @param string $help_url Url links to help page
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
* For other external page: http://server/url
+ * @param string $target Target to use on links
* @param int $disablejs More content into html header
* @param int $disablehead More content into html header
* @param array $arrayofjs Array of complementary js files
* @param array $arrayofcss Array of complementary css files
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
+ * @return void
*/
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
{
@@ -781,6 +783,8 @@ if (! function_exists("llxHeader"))
/**
* Show HTTP header
+ *
+ * @return void
*/
function top_httphead()
{
@@ -1047,6 +1051,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
* @param array $arrayofjs Array of js files to add in header
* @param array $arrayofcss Array of css files to add in header
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
+ * @return void
*/
function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
{
@@ -1275,14 +1280,16 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
/**
* Show left menu bar
- * @param menu_array_before Table of menu entries to show before entries of menu handler
- * @param helppagename Name of wiki page for help ('' by default).
- * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
- * For other external page: http://server/url
- * @param moresearchform Search Form Permanent Supplemental
- * @param menu_array_after Table of menu entries to show after entries of menu handler
- * @param leftmenuwithoutmainarea Must be set to 1. 0 by default for backward compatibility with old modules.
- * @param title Title of web page
+ *
+ * @param array $menu_array_before Table of menu entries to show before entries of menu handler
+ * @param string $helppagename Name of wiki page for help ('' by default).
+ * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
+ * For other external page: http://server/url
+ * @param string $moresearchform Search Form Permanent Supplemental
+ * @param array $menu_array_after Table of menu entries to show after entries of menu handler
+ * @param int $leftmenuwithoutmainarea Must be set to 1. 0 by default for backward compatibility with old modules.
+ * @param string $title Title of web page
+ * @return void
*/
function left_menu($menu_array_before, $helppagename='', $moresearchform='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='')
{
@@ -1305,30 +1312,26 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire)
{
$langs->load("companies");
- $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php',
- img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');
+ $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');
}
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT && $user->rights->societe->lire)
{
$langs->load("companies");
- $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php',
- img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname');
+ $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname');
}
if ((($conf->product->enabled && $user->rights->produit->lire) || ($conf->service->enabled && $user->rights->service->lire))
&& $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)
{
$langs->load("products");
- $searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php',
- img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall');
+ $searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall');
}
if ($conf->adherent->enabled && $conf->global->MAIN_SEARCHFORM_ADHERENT && $user->rights->adherent->lire)
{
$langs->load("members");
- $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php',
- img_object('','user').' '.$langs->trans("Members"), 'member', 'sall');
+ $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall');
}
// Execute hook printSearchForm
@@ -1460,8 +1463,12 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
if (empty($leftmenuwithoutmainarea)) main_area($title);
}
+
/**
* Begin main area
+ *
+ * @param string $title Title
+ * @return void
*/
function main_area($title='')
{
@@ -1499,8 +1506,10 @@ function main_area($title='')
/**
* Return helpbaseurl, helppage and mode
- * @param helppagename Page name (EN:xxx,ES:eee,FR:fff...)
- * @param langs Language
+ *
+ * @param string $helppagename Page name (EN:xxx,ES:eee,FR:fff...)
+ * @param Translate $langs Language
+ * @return array Array of help urls
*/
function getHelpParamFor($helppagename,$langs)
{
@@ -1538,13 +1547,14 @@ function getHelpParamFor($helppagename,$langs)
/**
* Show a search area
*
- * @param urlaction Url post
- * @param urlobject Url of the link under the search box
- * @param title Title search area
- * @param htmlmodesearch 'search'
- * @param htmlinputname Field Name input form
+ * @param string $urlaction Url post
+ * @param string $urlobject Url of the link under the search box
+ * @param string $title Title search area
+ * @param string $htmlmodesearch Value to set into parameter "mode_search" ('soc','contact','products','member',...)
+ * @param string $htmlinputname Field Name input form
+ * @return void
*/
-function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$htmlinputname)
+function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinputname)
{
global $conf,$langs;
@@ -1567,14 +1577,16 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$
}
-/**
- * Show HTML footer
- * Close div /DIV data-role=page + /DIV class=fiche + /DIV /DIV main layout + /BODY + /HTML
- * @param foot A text to add in HTML generated page
- */
if (! function_exists("llxFooter"))
{
- function llxFooter($foot='')
+ /**
+ * Show HTML footer
+ * Close div /DIV data-role=page + /DIV class=fiche + /DIV /DIV main layout + /BODY + /HTML
+ *
+ * @param string $foot A text to add in HTML generated page
+ * @return void
+ */
+ function llxFooter($foot='')
{
global $conf, $langs, $dolibarr_auto_user, $micro_start_time;
diff --git a/htdocs/mantis/admin/mantis.php b/htdocs/mantis/admin/mantis.php
deleted file mode 100644
index c26cc6ba146..00000000000
--- a/htdocs/mantis/admin/mantis.php
+++ /dev/null
@@ -1,206 +0,0 @@
-
- * Copyright (C) 2003 �ric Seigne
- * Copyright (C) 2004-2008 Laurent Destailleur
- * Copyright (C) 2004 Sebastien Di Cintio
- * Copyright (C) 2004 Benoit Mortier
- *
- * 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 2 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, see .
- *
- */
-
-/**
- * \file htdocs/mantis/admin/mantis.php
- * \ingroup mantis
- * \brief Page de configuration du module mantis
- */
-
-require("../../main.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
-require_once(DOL_DOCUMENT_ROOT.'/mantis/class/mantis.class.php');
-
-
-if (!$user->admin)
- accessforbidden();
-
-
-$langs->load("admin");
-$langs->load("other");
-
-$def = array();
-$actiontest=$_POST["test"];
-$actionsave=$_POST["save"];
-
-// Sauvegardes parametres
-if ($actionsave)
-{
- $i=0;
-
- $db->begin();
-
- $i+=dolibarr_set_const($db,'PHPMANTIS_URL',trim($_POST["phpmantis_url"]),'chaine',0,'',$conf->entity);
- $i+=dolibarr_set_const($db,'PHPMANTIS_HOST',trim($_POST["phpmantis_host"]),'chaine',0,'',$conf->entity);
- $i+=dolibarr_set_const($db,'PHPMANTIS_DBNAME',trim($_POST["phpmantis_dbname"]),'chaine',0,'',$conf->entity);
- $i+=dolibarr_set_const($db,'PHPMANTIS_USER',trim($_POST["phpmantis_user"]),'chaine',0,'',$conf->entity);
- $i+=dolibarr_set_const($db,'PHPMANTIS_PASS',trim($_POST["phpmantis_pass"]),'chaine',0,'',$conf->entity);
-
- if ($i >= 5)
- {
- $db->commit();
- $mesg = "".$langs->trans("MantisSetupSaved")."";
- }
- else
- {
- $db->rollback();
- header("Location: ".$_SERVER["PHP_SELF"]);
- exit;
- }
-}
-elseif ($actiontest)
-{
- //$resql=$db->query("select count(*) from llx_const");
- //print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error()."> \n";
-
- // Test de la connexion a la database mantis
- $conf->mantis->db->type=$dolibarr_main_db_type;
- $conf->mantis->db->host=$_POST["phpmantis_host"];
- $conf->mantis->db->port=$_POST["phpmantis_port"];
- $conf->mantis->db->user=$_POST["phpmantis_user"];
- $conf->mantis->db->pass=$_POST["phpmantis_pass"];
- $conf->mantis->db->name=$_POST["phpmantis_dbname"];
-
- $mantis=new Mantis();
-
- //print "D ".$db." - ".$db->db." \n";
- //print "W ".$mantis->localdb." - ".$mantis->localdb->db." \n";
-
- if ($mantis->localdb->connected == 1 && $mantis->localdb->database_selected == 1)
- {
- // V�rifie si bonne base
- $sql="SELECT value FROM mantis_config_table WHERE config_id='database_version'";
- $resql=$mantis->localdb->query($sql);
- if ($resql) {
- $mesg ="
";
- }
-
- //$mantis->localdb->close(); Ne pas fermer car la conn de mantis est la meme que dolibarr si parametre host/user/pass identique
- }
- elseif ($mantis->connected == 1 && $mantis->database_selected != 1)
- {
- $mesg ="
";
- //$mantis->localdb->close(); Ne pas fermer car la conn de mantis est la meme que dolibarr si parametre host/user/pass identique
- }
- else
- {
- $mesg ="
";
- }
-
- //$resql=$db->query("select count(*) from llx_const");
- //print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error()."> \n";
-}
-
-
-/**
- * Affichage du formulaire de saisie
- */
-
-llxHeader();
-
-$linkback=''.$langs->trans("BackToModuleList").'';
-print_fiche_titre($langs->trans("MantisSetup"),$linkback,'setup');
-print ' ';
-
-
-print '\n";
-
-
-clearstatcache();
-
-if ($mesg) print " $mesg ";
-print " ";
-
-$db->close();
-
-llxFooter();
-?>
diff --git a/htdocs/mantis/class/mantis.class.php b/htdocs/mantis/class/mantis.class.php
deleted file mode 100644
index 53c2c715852..00000000000
--- a/htdocs/mantis/class/mantis.class.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
- * Copyright (C) 2004-2008 Laurent Destailleur
- *
- * 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 2 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, see .
- *
- */
-
-/**
- * \file htdocs/mantis/class/mantis.class.php
- * \ingroup mantis
- * \brief Ensemble des fonctions permettant d'acceder a la database mantis.
- * \author Laurent Destailleur.
- */
-
-
-/**
- * \class Mantis
- * \brief Classe permettant d'acceder a la database mantis
- */
-
-class Mantis {
-
- var $localdb;
-
- var $date;
- var $duree = 0; // Secondes
- var $texte;
- var $desc;
-
- var $error;
-
-
- /**
- \brief Constructeur de la classe d'interface a mantisendar
- */
- function Mantis()
- {
- global $conf;
- global $dolibarr_main_db_type,$dolibarr_main_db_host,$dolibarr_main_db_user;
- global $dolibarr_main_db_pass,$dolibarr_main_db_name;
-
- // Defini parametres mantis (avec substitution eventuelle)
- $mantistype=preg_replace('/__dolibarr_main_db_type__/i',$dolibarr_main_db_type,$conf->mantis->db->type);
- $mantishost=preg_replace('/__dolibarr_main_db_host__/i',$dolibarr_main_db_host,$conf->mantis->db->host);
- $mantisport=preg_replace('/__dolibarr_main_db_port__/i',$dolibarr_main_db_port,$conf->mantis->db->port);
- $mantisuser=preg_replace('/__dolibarr_main_db_user__/i',$dolibarr_main_db_user,$conf->mantis->db->user);
- $mantispass=preg_replace('/__dolibarr_main_db_pass__/i',$dolibarr_main_db_pass,$conf->mantis->db->pass);
- $mantisname=preg_replace('/__dolibarr_main_db_name__/i',$dolibarr_main_db_name,$conf->mantis->db->name);
-
- // On initie la connexion a la base mantisendar
- require_once (DOL_DOCUMENT_ROOT ."/lib/databases/".$mantistype.".lib.php");
- $this->localdb = new DoliDb($mantistype,$mantishost,$mantisuser,$mantispass,$mantisname,$mantisport);
- }
-
-}
-?>
diff --git a/htdocs/mantis/index.php b/htdocs/mantis/index.php
deleted file mode 100644
index 7db0dd9ebf9..00000000000
--- a/htdocs/mantis/index.php
+++ /dev/null
@@ -1 +0,0 @@
-Url not available
\ No newline at end of file
diff --git a/htdocs/mantis/mantis.php b/htdocs/mantis/mantis.php
deleted file mode 100644
index 707517133a1..00000000000
--- a/htdocs/mantis/mantis.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
- *
- * 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 2 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, see .
- *
- */
-
-/**
- * \file htdocs/mantis/mantis.php
- * \ingroup mantis
- * \brief Page generant 2 frames, une pour le menu Dolibarr, l'autre pour l'affichage de Mantis
- * \author Laurent Destailleur
- */
-
-require("../main.inc.php");
-
-if (empty($conf->global->PHPMANTIS_URL))
-{
- llxHeader();
- print '
- Sorry, your browser is too old or not correctly configured to view this area.
- Your browser must support frames.
-
-
-
-
-
-";
-
-
-?>
diff --git a/htdocs/mantis/mantistop.php b/htdocs/mantis/mantistop.php
deleted file mode 100644
index 7020b1b93d0..00000000000
--- a/htdocs/mantis/mantistop.php
+++ /dev/null
@@ -1,39 +0,0 @@
-
- *
- * 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 2 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, see .
- */
-
-/**
- * \file htdocs/mantis/mantistop.php
- * \ingroup mantis
- * \brief Top frame to show mantis application
- */
-
-require ("../main.inc.php");
-
-top_htmlhead("","");
-top_menu("","","_top");
-
-?>
-
-
-
-
-
-
-
-
-
-
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index a8d7823341a..36b8bf3a7d0 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -298,7 +298,8 @@ class Societe extends CommonObject
$result = 0;
$this->name = trim($this->name);
-
+ $this->nom=$this->name; // For backward compatibility
+
if (! $this->name)
{
$this->errors[] = 'ErrorBadThirdPartyName';
@@ -393,11 +394,16 @@ class Societe extends CommonObject
// Clean parameters
$this->id = $id;
- $this->name = trim($this->name);
- $this->address = trim($this->address);
- $this->zip = trim($this->zip);
- $this->town = trim($this->town);
- $this->state_id = trim($this->state_id);
+ $this->name=$this->name?trim($this->name):trim($this->nom);
+ $this->nom=trim($this->nom); // TODO obsolete
+ $this->address=$this->address?trim($this->address):trim($this->adresse);
+ $this->adresse=$this->address; // TODO obsolete
+ $this->zip=$this->zip?trim($this->zip):trim($this->cp);
+ $this->cp=$this->zip; // TODO obsolete
+ $this->town=$this->town?trim($this->town):trim($this->ville);
+ $this->ville=$this->town; // TODO obsolete
+ $this->state_id=trim($this->state_id);
+ $this->pays_id=trim($this->pays_id);
$this->country_id = trim($this->country_id);
$this->tel = trim($this->tel);
$this->fax = trim($this->fax);
@@ -407,6 +413,9 @@ class Societe extends CommonObject
$this->fax = preg_replace("/\./","",$this->fax);
$this->email = trim($this->email);
$this->url = $this->url?clean_url($this->url,0):'';
+ $this->siren=trim($this->siren); // TODO obsolete
+ $this->siret=trim($this->siret); // TODO obsolete
+ $this->ape=trim($this->ape); // TODO obsolete
$this->idprof1 = trim($this->idprof1);
$this->idprof2 = trim($this->idprof2);
$this->idprof3 = trim($this->idprof3);
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index b289e334c60..42ea9fb8465 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -104,6 +104,7 @@ if (empty($reshook))
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
if ($action == 'update') $object->fetch($socid);
+ else $object->canvas=$canvas;
if (GETPOST("private") == 1)
{
@@ -474,9 +475,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists())
// -----------------------------------------
// When used with CANVAS
// -----------------------------------------
-
- $objcanvas->assign_values($action, $socid); // Set value for templates
- $objcanvas->display_canvas(); // Show template
+ if (! $objcanvas->hasActions() && $socid)
+ {
+ $object = new Societe($db);
+ $object->fetch($socid); // For use with "pure canvas" (canvas that contains templates only)
+ }
+ $objcanvas->assign_values($action, $socid); // Set value for templates
+ $objcanvas->display_canvas(); // Show template
}
else
{
@@ -1898,4 +1903,4 @@ else
$db->close();
llxFooter();
-?>
\ No newline at end of file
+?>