diff --git a/ChangeLog b/ChangeLog
index 6862efc47c5..b379c13036e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -121,7 +121,7 @@ NEW: Add constant XFRAMEOPTIONS_ALLOWALL
NEW: Add function isValidVATID()
NEW: ADD document's product support in APIs
NEW: REST API: get the list of objects in a category.
-NEW: Update Stripe library to 6.34.3
+NEW: Update Stripe library to 6.35
NEW: Upgrade jquery lib to 3.3.1
NEW: Add hook 'addHtmlHeader()'
NEW: Add hook 'createRecurringInvoices()'
diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php
new file mode 100644
index 00000000000..a1db711dd3e
--- /dev/null
+++ b/htdocs/bom/bom_agenda.php
@@ -0,0 +1,261 @@
+
+ * Copyright (C) ---Put here your own copyright and developer email---
+ *
+ * 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 3 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/modulebuilder/template/myobject_agenda.php
+ * \ingroup bom
+ * \brief Page of MyObject events
+ */
+
+// Load Dolibarr environment
+$res=0;
+// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
+// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
+$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
+while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
+// Try main.inc.php using relative path
+if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
+if (! $res) die("Include of main fails");
+
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+dol_include_once('/bom/class/bom.class.php');
+dol_include_once('/bom/lib/bom.lib.php');
+
+
+// Load translation files required by the page
+$langs->loadLangs(array("mrp","other"));
+
+// Get parameters
+$id = GETPOST('id', 'int');
+$ref = GETPOST('ref', 'alpha');
+$action = GETPOST('action', 'alpha');
+$cancel = GETPOST('cancel', 'aZ09');
+$backtopage = GETPOST('backtopage', 'alpha');
+
+if (GETPOST('actioncode', 'array'))
+{
+ $actioncode=GETPOST('actioncode', 'array', 3);
+ if (! count($actioncode)) $actioncode='0';
+}
+else
+{
+ $actioncode=GETPOST("actioncode", "alpha", 3)?GETPOST("actioncode", "alpha", 3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+}
+$search_agenda_label=GETPOST('search_agenda_label');
+
+// Security check - Protection if external user
+//if ($user->societe_id > 0) access_forbidden();
+//if ($user->societe_id > 0) $socid = $user->societe_id;
+//$result = restrictedArea($user, 'bom', $id);
+
+$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
+$sortfield = GETPOST("sortfield", 'alpha');
+$sortorder = GETPOST("sortorder", 'alpha');
+$page = GETPOST("page", 'int');
+if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+if (! $sortfield) $sortfield='a.datep,a.id';
+if (! $sortorder) $sortorder='DESC';
+
+// Initialize technical objects
+$object=new BOM($db);
+$extrafields = new ExtraFields($db);
+$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
+$hookmanager->initHooks(array('bomagenda','globalcard')); // Note that conf->hooks_modules contains array
+// Fetch optionals attributes and labels
+$extralabels = $extrafields->fetch_name_optionals_label('bom');
+
+// Load object
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
+if ($id > 0 || ! empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity] . "/" . $object->id;
+
+
+
+/*
+ * Actions
+ */
+
+$parameters=array('id'=>$socid);
+$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+
+if (empty($reshook))
+{
+ // Cancel
+ if (GETPOST('cancel', 'alpha') && ! empty($backtopage))
+ {
+ header("Location: ".$backtopage);
+ exit;
+ }
+
+ // Purge search criteria
+ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
+ {
+ $actioncode='';
+ $search_agenda_label='';
+ }
+}
+
+
+
+/*
+ * View
+ */
+
+$contactstatic = new Contact($db);
+
+$form = new Form($db);
+
+if ($object->id > 0)
+{
+ $title=$langs->trans("Agenda");
+ //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
+ $help_url = '';
+ llxHeader('', $title, $help_url);
+
+ if (! empty($conf->notification->enabled)) $langs->load("mails");
+ $head = bomPrepareHead($object);
+
+
+ dol_fiche_head($head, 'agenda', $langs->trans("BillOfMaterials"), -1, 'bom');
+
+ // Object card
+ // ------------------------------------------------------------
+ $linkback = '' . $langs->trans("BackToList") . '';
+
+ $morehtmlref='
';
+ /*
+ // Ref customer
+ $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
+ $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
+ // Thirdparty
+ $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+ // Project
+ if (! empty($conf->projet->enabled))
+ {
+ $langs->load("projects");
+ $morehtmlref.='
'.$langs->trans('Project') . ' ';
+ if ($user->rights->bom->creer)
+ {
+ if ($action != 'classify')
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.=' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='
';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (! empty($object->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($object->fk_project);
+ $morehtmlref.='
';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.='';
+ }
+ }
+ }*/
+ $morehtmlref.='
';
+
+
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+ print '';
+ print '
';
+
+ $object->info($object->id);
+ print dol_print_object_info($object, 1);
+
+ print '
';
+
+ dol_fiche_end();
+
+
+
+ // Actions buttons
+
+ $objthirdparty=$object;
+ $objcon=new stdClass();
+
+ $out='';
+ $permok=$user->rights->agenda->myactions->create;
+ if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
+ {
+ //$out.='trans("AddAnAction"),'filenew');
+ //$out.="";
+ }
+
+
+ print '';
+
+ if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
+ {
+ $param='&socid='.$socid;
+ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
+ if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
+
+
+ //print load_fiche_titre($langs->trans("ActionsOnBom"), '', '');
+
+ // List of all actions
+ $filters=array();
+ $filters['search_agenda_label']=$search_agenda_label;
+
+ // TODO Replace this with same code than into list.php
+ //show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder);
+ }
+}
+
+// End of page
+llxFooter();
+$db->close();
diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php
index 017d4e22569..9036b513961 100644
--- a/htdocs/compta/facture/class/api_invoices.class.php
+++ b/htdocs/compta/facture/class/api_invoices.class.php
@@ -73,10 +73,10 @@ class Invoices extends DolibarrApi
}
// Get payment details
- $this->invoice->totalpaye = $this->invoice->getSommePaiement();
+ $this->invoice->totalpaid = $this->invoice->getSommePaiement();
$this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
$this->invoice->totaldeposits = $this->invoice->getSumDepositsUsed();
- $this->invoice->resteapayer = price2num($this->invoice->total_ttc - $this->invoice->totalpaye - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
+ $this->invoice->remaintopay = price2num($this->invoice->total_ttc - $this->invoice->totalpaid - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
if (! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php
index f022d2c3791..f9b0a59280f 100644
--- a/htdocs/core/class/html.formmargin.class.php
+++ b/htdocs/core/class/html.formmargin.class.php
@@ -96,7 +96,7 @@ class FormMargin
$line->pa_ht = $line->subprice * (1 - ($line->remise_percent / 100));
}
- $pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
+ $pv = $line->total_ht;
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
$pa = $line->qty * $pa_ht;
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 4ce610aaf90..7da112fa255 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -145,8 +145,8 @@ function user_prepare_head($object)
if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|| (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read))
- || (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && $user->id == $object->id)
- || (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && $user->id == $object->id )
+ || (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
+ || (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->read_all))
)
{
// Bank
diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
index 10a2ce752d8..dfbe97c3fd5 100644
--- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
@@ -301,7 +301,7 @@ class pdf_beluga extends ModelePDFProjects
'table'=>'commande',
'datefieldname'=>'date_commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire,
- 'lang'=>'order'),
+ 'lang'=>'orders'),
'invoice'=>array(
'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject",
diff --git a/htdocs/debugbar/class/DebugBar.php b/htdocs/debugbar/class/DebugBar.php
index d36583d9852..8882b5f4f1e 100644
--- a/htdocs/debugbar/class/DebugBar.php
+++ b/htdocs/debugbar/class/DebugBar.php
@@ -33,7 +33,7 @@ class DolibarrDebugBar extends DebugBar
//$this->addCollector(new PhpInfoCollector());
//$this->addCollector(new DolMessagesCollector());
$this->addCollector(new DolRequestDataCollector());
- $this->addCollector(new DolConfigCollector());
+ //$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
$this->addCollector(new DolTimeDataCollector());
$this->addCollector(new DolMemoryCollector());
//$this->addCollector(new DolExceptionsCollector());
diff --git a/htdocs/install/mysql/tables/llx_asset.sql b/htdocs/install/mysql/tables/llx_asset.sql
index a0891ef4b0e..b6b2de3fcb3 100644
--- a/htdocs/install/mysql/tables/llx_asset.sql
+++ b/htdocs/install/mysql/tables/llx_asset.sql
@@ -26,7 +26,7 @@ CREATE TABLE llx_asset(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_bom_bom.sql b/htdocs/install/mysql/tables/llx_bom_bom.sql
index 89a2f8e8bab..a406229a0e4 100644
--- a/htdocs/install/mysql/tables/llx_bom_bom.sql
+++ b/htdocs/install/mysql/tables/llx_bom_bom.sql
@@ -24,7 +24,7 @@ CREATE TABLE llx_bom_bom(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
date_valid datetime,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql
index 2a7bc6a4693..df4640a14f4 100644
--- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql
+++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql
@@ -34,7 +34,7 @@ CREATE TABLE llx_emailcollector_emailcollector(
note_public text,
note_private text,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql
index e0239cf98f6..011f2d827ce 100644
--- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql
+++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.sql
@@ -21,7 +21,7 @@ CREATE TABLE llx_emailcollector_emailcollectoraction(
type varchar(128) NOT NULL,
actionparam varchar(255) NULL,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
position integer DEFAULT 0,
diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql
index e4071e5500a..8ecccedb6d5 100644
--- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql
+++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.sql
@@ -21,7 +21,7 @@ CREATE TABLE llx_emailcollector_emailcollectorfilter(
type varchar(128) NOT NULL,
rulevalue varchar(128) NULL,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/mysql/tables/llx_pos_cash_fence.sql b/htdocs/install/mysql/tables/llx_pos_cash_fence.sql
index 607060adab6..f9967ec968b 100644
--- a/htdocs/install/mysql/tables/llx_pos_cash_fence.sql
+++ b/htdocs/install/mysql/tables/llx_pos_cash_fence.sql
@@ -33,6 +33,6 @@ CREATE TABLE llx_pos_cash_fence(
posnumber VARCHAR(30),
fk_user_creat integer,
fk_user_valid integer,
- tms TIMESTAMP NOT NULL,
+ tms TIMESTAMP,
import_key VARCHAR(14)
) ENGINE=innodb;
\ No newline at end of file
diff --git a/htdocs/install/mysql/tables/llx_societe_account.sql b/htdocs/install/mysql/tables/llx_societe_account.sql
index 4123a3b05e2..b307613ba6e 100644
--- a/htdocs/install/mysql/tables/llx_societe_account.sql
+++ b/htdocs/install/mysql/tables/llx_societe_account.sql
@@ -32,7 +32,7 @@ CREATE TABLE llx_societe_account(
date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
+ tms timestamp,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql
index de6d98edf04..66b1fbaf370 100644
--- a/htdocs/install/pgsql/functions/functions.sql
+++ b/htdocs/install/pgsql/functions/functions.sql
@@ -69,6 +69,12 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent_type_extraf
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank_account FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank_account_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_blockedlog FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_blockedlog_authority FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bom FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bom_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bomline FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bomline_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bordereau_cheque FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_boxes_def FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_c_email_templates FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -96,6 +102,9 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_deplacement FOR EACH
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_element_resources FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollector FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollectoraction FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollectorfilter FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_entrepot FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_events FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expedition FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
index 1718a6a72d5..93f43711a78 100644
--- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
+++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
@@ -292,6 +292,9 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
//case 'TASK_TIMESPENT_CREATE':
//case 'TASK_TIMESPENT_MODIFY':
//case 'TASK_TIMESPENT_DELETE':
+ //case 'PROJECT_ADD_CONTACT':
+ //case 'PROJECT_DELETE_CONTACT':
+ //case 'PROJECT_DELETE_RESOURCE':
// Shipping
//case 'SHIPPING_CREATE':
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index f4f4e8c34e5..212e86ca93c 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -127,7 +127,7 @@ if (empty($reshook))
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php', 1);
if (empty($backtopage)) {
if (empty($id)) $backtopage = $backurlforlist;
- else $backtopage = dol_buildpath('/mymodule/myobject_card.php', 1).($id > 0 ? $id : '__ID__');
+ else $backtopage = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
}
$triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record
diff --git a/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql b/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql
index 0470739573a..b380b1280f2 100644
--- a/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql
+++ b/htdocs/modulebuilder/template/sql/llx_mymodule_myobject.sql
@@ -22,7 +22,7 @@ CREATE TABLE llx_mymodule_myobject(
qty INTEGER,
status INTEGER,
date_creation DATETIME NOT NULL,
- tms TIMESTAMP NOT NULL,
+ tms TIMESTAMP,
import_key VARCHAR(14)
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
\ No newline at end of file
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 6bdaa92f508..51b4c0580e0 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -1943,241 +1943,249 @@ if (preg_match('/^dopayment/', $action))
print ''."\n";
- print ''."\n";
-
- // Code to ask the credit card. This use the default "API version". No way to force API version when using JS code.
- print ''."\n";
+
+ // Code to ask the credit card. This use the default "API version". No way to force API version when using JS code.
+ print '';
}
- else
- {
- ?>
-
-
- // Create a Stripe client.
- var stripe = Stripe('');
-
- // Create an instance of Elements
- var elements = stripe.elements();
-
- // Custom styling can be passed to options when creating an Element.
- // (Note that this demo uses a wider set of styles than the guide below.)
- var style = {
- base: {
- color: '#32325d',
- lineHeight: '24px',
- fontFamily: '"Helvetica Neue", Helvetica, sans-serif',
- fontSmoothing: 'antialiased',
- fontSize: '16px',
- '::placeholder': {
- color: '#aab7c4'
- }
- },
- invalid: {
- color: '#fa755a',
- iconColor: '#fa755a'
- }
- };
-
- // Create an instance of the card Element
- var card = elements.create('card', {style: style});
-
- // Add an instance of the card Element into the `card-element`
- card.mount('#card-element');
-
- // Handle real-time validation errors from the card Element.
- card.addEventListener('change', function(event) {
- var displayError = document.getElementById('card-errors');
- if (event.error) {
- displayError.textContent = event.error.message;
- } else {
- displayError.textContent = '';
- }
- });
-
- // Handle form submission
- var form = document.getElementById('payment-form');
- console.log(form);
- form.addEventListener('submit', function(event) {
- event.preventDefault();
- global->STRIPE_USE_3DSECURE)) // Ask credit card directly, no 3DS test
- {
- ?>
- /* Use token */
- stripe.createToken(card).then(function(result) {
- if (result.error) {
- // Inform the user if there was an error
- var errorElement = document.getElementById('card-errors');
- errorElement.textContent = result.error.message;
- } else {
- // Send the token to your server
- stripeTokenHandler(result.token);
- }
- });
-
- /* Use 3DS source */
- stripe.createSource(card).then(function(result) {
- if (result.error) {
- // Inform the user if there was an error
- var errorElement = document.getElementById('card-errors');
- errorElement.textContent = result.error.message;
- } else {
- // Send the source to your server
- stripeSourceHandler(result.source);
- }
- });
-
- });
-
-
- /* Insert the Token into the form so it gets submitted to the server */
- function stripeTokenHandler(token) {
- // Insert the token ID into the form so it gets submitted to the server
- var form = document.getElementById('payment-form');
- var hiddenInput = document.createElement('input');
- hiddenInput.setAttribute('type', 'hidden');
- hiddenInput.setAttribute('name', 'stripeToken');
- hiddenInput.setAttribute('value', token.id);
- form.appendChild(hiddenInput);
-
- // Submit the form
- jQuery('#buttontopay').hide();
- jQuery('#hourglasstopay').show();
- console.log("submit token");
- form.submit();
- }
-
- /* Insert the Source into the form so it gets submitted to the server */
- function stripeSourceHandler(source) {
- // Insert the source ID into the form so it gets submitted to the server
- var form = document.getElementById('payment-form');
- var hiddenInput = document.createElement('input');
- hiddenInput.setAttribute('type', 'hidden');
- hiddenInput.setAttribute('name', 'stripeSource');
- hiddenInput.setAttribute('value', source.id);
- form.appendChild(hiddenInput);
-
- // Submit the form
- jQuery('#buttontopay').hide();
- jQuery('#hourglasstopay').show();
- console.log("submit source");
- form.submit();
- }
-
- ';
}
}
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index 290d07ab857..591a57f59f3 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -408,6 +408,7 @@ class Dolresource extends CommonObject
public function delete($rowid, $notrigger = 0)
{
global $user,$langs,$conf;
+ require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$error=0;
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 292d109fd74..e0309ded815 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1207,7 +1207,7 @@ else
{
// Supplier
print '
';
- print '| '.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).' | ';
+ print ' | '.$form->editfieldkey('Vendor', 'fournisseur', '', $object, 0, 'string', '', 1).' | ';
$default = -1;
if (! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default=1;
print $form->selectyesno("fournisseur", (GETPOST('fournisseur', 'int')!=''?GETPOST('fournisseur', 'int'):(GETPOST("type", 'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type", 'alpha') == '' ? 1 : 0));
diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php
index 37676f1b1e1..83f4aefb5f5 100644
--- a/htdocs/takepos/pay.php
+++ b/htdocs/takepos/pay.php
@@ -84,7 +84,7 @@ if ($resql) {
if ($paycode == 'CB') $paycode = 'CB';
if ($paycode == 'CHQ') $paycode = 'CHEQUE';
- $accountname="CASHDESK_ID_BANKACCOUNT_".$paycode;
+ $accountname="CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
if (! empty($conf->global->$accountname) && $conf->global->$accountname > 0) array_push($paiements, $obj);
}
}
diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php
index 9601c6d0f36..dd2d6524f46 100644
--- a/htdocs/takepos/takepos.php
+++ b/htdocs/takepos/takepos.php
@@ -624,7 +624,7 @@ if ($resql){
if ($paycode == 'CB') $paycode = 'CARD';
if ($paycode == 'CHQ') $paycode = 'CHEQUE';
- $accountname="CASHDESK_ID_BANKACCOUNT_".$paycode;
+ $accountname="CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
if (! empty($conf->global->$accountname) && $conf->global->$accountname > 0) array_push($paiementsModes, $obj);
}
}
|