maintenant j'ai un autre souci
Fatal error: Call to a member function transnoentitiesnoconv() on a non-object in /var/www/html/dev/dolibarr/core/lib/functions.lib.php on line 2771
[code]class Dolibarr {
function __construct() {
$this->CI=& get_instance();
$this->_path = $this->CI->config->item('dolibarr_path');
$this->_user = $this->CI->config->item('dolibarr_user');
}
public function createSociete($name,$firstname,$lastname,$civility_id,$address,$zip,$town,$country_id,$phone,$email) {
$version='1.7';
$error=0;
include_once('../dolibarr/master.inc.php');
$langs->load("main");// To load language file for default language
@set_time_limit(0);
// Load user and its permissions
$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
if (! $result > 0)
$user->getrights();
require_once(DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php');
//var_dump($db);
$company = new Societe($db);
$company->name=$name;
$company->firstname=$firstname;
$company->lastname=$lastname;
$company->civility_id=$civility_id;
$company->address=$address;
$company->zip=$zip;
$company->country_id=$country_id;
$company->phone=$phone;
$company->email=$email;
$company->client=1;
$idobject=$company->create($user);
if ($idobject > 0){
// Change status to validated
$result=$company->setStatut(1);
dol_print_error($db,$obj->error);
if ($result > 0) print "OK Object created with id ".$idobject."\n";
else {
$error++;
dol_print_error($db,$obj->error);
}
}
echo $company->error;
if (! $error)
{
var_dump($db);
$db->commit();
print '--- end ok'."\n";
}
else
{
print '--- end error code='.$error."\n";
$db->rollback();
}
$db->close();
}
}
[/code]
↧