This commit is contained in:
Frédéric FRANCE 2020-11-02 12:47:42 +01:00 committed by GitHub
parent fc08a358e5
commit 3d1dbd62ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@ -75,6 +75,9 @@ class Establishment extends CommonObject
*/
public $rowid;
/**
* @var string Label
*/
public $label;
/**
@ -82,9 +85,21 @@ class Establishment extends CommonObject
*/
public $address;
/**
* @var string Zip
*/
public $zip;
/**
* @var string Town
*/
public $town;
/**
* @var int country id
*/
public $country_id;
/**
* @var int Status 0=open, 1=closed
*/
@ -95,8 +110,15 @@ class Establishment extends CommonObject
*/
public $entity;
public $country_id;
/**
* @var int user mod id
*/
public $fk_user_mod;
/**
* @var int user author id
*/
public $fk_user_author;
const STATUS_OPEN = 1;
const STATUS_CLOSED = 0;
@ -148,6 +170,7 @@ class Establishment extends CommonObject
$now = dol_now();
// Clean parameters
$this->label = trim($this->label);
$this->address = trim($this->address);
$this->zip = trim($this->zip);
$this->town = trim($this->town);
@ -189,10 +212,6 @@ class Establishment extends CommonObject
$this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."establishment");
}
// Commit or rollback
if ($error) {
foreach ($this->errors as $errmsg) {