Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
86d59afec9
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -40,10 +40,13 @@ $object = new Subscription($db);
|
|||||||
$errmsg = '';
|
$errmsg = '';
|
||||||
|
|
||||||
$action = GETPOST("action", 'alpha');
|
$action = GETPOST("action", 'alpha');
|
||||||
$rowid = GETPOST("rowid", "int") ?GETPOST("rowid", "int") : GETPOST("id", "int");
|
$rowid = GETPOST("rowid", "int") ? GETPOST("rowid", "int") : GETPOST("id", "int");
|
||||||
$typeid = GETPOST("typeid", "int");
|
$typeid = GETPOST("typeid", "int");
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$confirm = GETPOST('confirm');
|
$confirm = GETPOST('confirm');
|
||||||
|
$note = GETPOST('note', 'alpha');
|
||||||
|
$typeid = (int) GETPOST('typeid', 'int');
|
||||||
|
$amount = price2num(GETPOST('amount', 'alpha'), 'MT');
|
||||||
|
|
||||||
if (!$user->rights->adherent->cotisation->lire)
|
if (!$user->rights->adherent->cotisation->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
@ -84,7 +87,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance
|
|||||||
} else {
|
} else {
|
||||||
$accountline->datev = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
|
$accountline->datev = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
|
||||||
$accountline->dateo = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
|
$accountline->dateo = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
|
||||||
$accountline->amount = $_POST["amount"];
|
$accountline->amount = $amount;
|
||||||
$result = $accountline->update($user);
|
$result = $accountline->update($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$errmsg = $accountline->error;
|
$errmsg = $accountline->error;
|
||||||
@ -96,9 +99,9 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance
|
|||||||
// Modify values
|
// Modify values
|
||||||
$object->dateh = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
|
$object->dateh = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
|
||||||
$object->datef = dol_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']);
|
$object->datef = dol_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']);
|
||||||
$object->fk_type = $_POST["typeid"];
|
$object->fk_type = $typeid;
|
||||||
$object->note = $_POST["note"];
|
$object->note = $note;
|
||||||
$object->amount = $_POST["amount"];
|
$object->amount = $amount;
|
||||||
//print 'datef='.$object->datef.' '.$_POST['datesubendday'];
|
//print 'datef='.$object->datef.' '.$_POST['datesubendday'];
|
||||||
|
|
||||||
$result = $object->update($user);
|
$result = $object->update($user);
|
||||||
@ -216,18 +219,16 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') {
|
|||||||
print '<input type="text" class="flat" size="60" name="note" value="'.$object->note.'"></td></tr>';
|
print '<input type="text" class="flat" size="60" name="note" value="'.$object->note.'"></td></tr>';
|
||||||
|
|
||||||
// Bank line
|
// Bank line
|
||||||
if (!empty($conf->banque->enabled)) {
|
if (!empty($conf->banque->enabled) && ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)) {
|
||||||
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank) {
|
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
|
||||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
|
if ($object->fk_bank) {
|
||||||
if ($object->fk_bank) {
|
$bankline = new AccountLine($db);
|
||||||
$bankline = new AccountLine($db);
|
$result = $bankline->fetch($object->fk_bank);
|
||||||
$result = $bankline->fetch($object->fk_bank);
|
print $bankline->getNomUrl(1, 0, 'showall');
|
||||||
print $bankline->getNomUrl(1, 0, 'showall');
|
} else {
|
||||||
} else {
|
print $langs->trans("NoneF");
|
||||||
print $langs->trans("NoneF");
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -316,18 +317,16 @@ if ($rowid && $action != 'edit') {
|
|||||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
||||||
|
|
||||||
// Bank line
|
// Bank line
|
||||||
if (!empty($conf->banque->enabled)) {
|
if (!empty($conf->banque->enabled) && ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)) {
|
||||||
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank) {
|
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
|
||||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
|
if ($object->fk_bank) {
|
||||||
if ($object->fk_bank) {
|
$bankline = new AccountLine($db);
|
||||||
$bankline = new AccountLine($db);
|
$result = $bankline->fetch($object->fk_bank);
|
||||||
$result = $bankline->fetch($object->fk_bank);
|
print $bankline->getNomUrl(1, 0, 'showall');
|
||||||
print $bankline->getNomUrl(1, 0, 'showall');
|
} else {
|
||||||
} else {
|
print $langs->trans("NoneF");
|
||||||
print $langs->trans("NoneF");
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
/* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -75,6 +75,9 @@ class Establishment extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $rowid;
|
public $rowid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Label
|
||||||
|
*/
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,9 +85,21 @@ class Establishment extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $address;
|
public $address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Zip
|
||||||
|
*/
|
||||||
public $zip;
|
public $zip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Town
|
||||||
|
*/
|
||||||
public $town;
|
public $town;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int country id
|
||||||
|
*/
|
||||||
|
public $country_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Status 0=open, 1=closed
|
* @var int Status 0=open, 1=closed
|
||||||
*/
|
*/
|
||||||
@ -95,8 +110,20 @@ class Establishment extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $entity;
|
public $entity;
|
||||||
|
|
||||||
public $country_id;
|
/**
|
||||||
|
* @var int user mod id
|
||||||
|
*/
|
||||||
|
public $fk_user_mod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int user author id
|
||||||
|
*/
|
||||||
|
public $fk_user_author;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int date create
|
||||||
|
*/
|
||||||
|
public $datec;
|
||||||
|
|
||||||
const STATUS_OPEN = 1;
|
const STATUS_OPEN = 1;
|
||||||
const STATUS_CLOSED = 0;
|
const STATUS_CLOSED = 0;
|
||||||
@ -148,6 +175,7 @@ class Establishment extends CommonObject
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
|
$this->label = trim($this->label);
|
||||||
$this->address = trim($this->address);
|
$this->address = trim($this->address);
|
||||||
$this->zip = trim($this->zip);
|
$this->zip = trim($this->zip);
|
||||||
$this->town = trim($this->town);
|
$this->town = trim($this->town);
|
||||||
@ -189,10 +217,6 @@ class Establishment extends CommonObject
|
|||||||
$this->errors[] = "Error ".$this->db->lasterror();
|
$this->errors[] = "Error ".$this->db->lasterror();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."establishment");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
foreach ($this->errors as $errmsg) {
|
foreach ($this->errors as $errmsg) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user