forked from Wavyzz/dolibarr
Merge branch 'develop' into develop_takepos_search_term_is_not_same_as_term_variable
This commit is contained in:
@@ -1188,18 +1188,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../htdocs/adherents/partnership.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$label might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../htdocs/adherents/stats/geo.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$theme_datacolor might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 2
|
||||
path: ../../htdocs/adherents/stats/geo.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
@@ -7626,12 +7614,6 @@ parameters:
|
||||
count: 3
|
||||
path: ../../htdocs/compta/tva/payments.php
|
||||
|
||||
-
|
||||
message: '#^Call to function is_array\(\) with list\<array\{id\: mixed, descr\: mixed, pid\: mixed, pref\: mixed, ptype\: int, payment_id\: mixed, payment_ref\: mixed, payment_amount\: mixed, \.\.\.\}\|array\{id\: mixed, descr\: mixed, pid\: mixed, pref\: mixed, ptype\: mixed, payment_id\: mixed, payment_ref\: mixed, payment_amount\: mixed, \.\.\.\}\> will always evaluate to true\.$#'
|
||||
identifier: function.alreadyNarrowedType
|
||||
count: 1
|
||||
path: ../../htdocs/compta/tva/quadri_detail.php
|
||||
|
||||
-
|
||||
message: '#^Call to function is_array\(\) with list\<array\{id\: mixed, descr\: mixed, pid\: mixed, pref\: mixed, ptype\: mixed, payment_id\: mixed, payment_ref\: mixed, payment_amount\: mixed, \.\.\.\}\> will always evaluate to true\.$#'
|
||||
identifier: function.alreadyNarrowedType
|
||||
@@ -35682,114 +35664,18 @@ parameters:
|
||||
count: 1
|
||||
path: ../../scripts/bank/export-bank-receipts.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$conf might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 6
|
||||
path: ../../scripts/company/sync_contacts_dolibarr2ldap.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$db might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 5
|
||||
path: ../../scripts/company/sync_contacts_dolibarr2ldap.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$hookmanager might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../scripts/company/sync_contacts_dolibarr2ldap.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$langs might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 4
|
||||
path: ../../scripts/company/sync_contacts_dolibarr2ldap.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$user might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 2
|
||||
path: ../../scripts/company/sync_contacts_dolibarr2ldap.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$conf might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 3
|
||||
path: ../../scripts/contracts/email_expire_services_to_customers.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$db might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 8
|
||||
path: ../../scripts/contracts/email_expire_services_to_customers.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$hookmanager might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../scripts/contracts/email_expire_services_to_customers.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$langs might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 3
|
||||
path: ../../scripts/contracts/email_expire_services_to_customers.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$conf might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 3
|
||||
path: ../../scripts/contracts/email_expire_services_to_representatives.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$hookmanager might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../scripts/contracts/email_expire_services_to_representatives.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$langs might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 4
|
||||
path: ../../scripts/contracts/email_expire_services_to_representatives.php
|
||||
|
||||
-
|
||||
message: '#^Result of \|\| is always false\.$#'
|
||||
identifier: booleanOr.alwaysFalse
|
||||
count: 1
|
||||
path: ../../scripts/doc/regenerate_docs.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$conf might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../scripts/doc/regenerate_docs.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$db might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 4
|
||||
path: ../../scripts/doc/regenerate_docs.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$dir in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 1
|
||||
path: ../../scripts/doc/regenerate_docs.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$hookmanager might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../scripts/doc/regenerate_docs.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$langs might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 2
|
||||
path: ../../scripts/doc/regenerate_docs.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#'
|
||||
identifier: empty.variable
|
||||
@@ -35808,30 +35694,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../scripts/emailings/mailing-send.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$conf might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 2
|
||||
path: ../../scripts/emailings/mailing-send.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$db might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../scripts/emailings/mailing-send.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$hookmanager might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../scripts/emailings/mailing-send.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$langs might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 4
|
||||
path: ../../scripts/emailings/mailing-send.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$mesg might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
|
||||
@@ -54,14 +54,6 @@ $search_subaccount = GETPOST('search_subaccount', 'alpha');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
$search_type = GETPOST('search_type', 'intcomma');
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
@@ -92,6 +84,14 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||
unset($arrayfields['reconcilable']);
|
||||
}
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) { // after this test, $user->hasRight('accounting', 'chartofaccount') is always valid
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -124,6 +124,13 @@ if (empty($reshook)) {
|
||||
$search_type = "";
|
||||
$search_array_options = array();
|
||||
}
|
||||
|
||||
if ($action == 'enable' /* && $user->hasRight('accounting', 'chartofaccount') */) { // test useless
|
||||
setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'errors');
|
||||
}
|
||||
if ($action == 'disable' /* && $user->hasRight('accounting', 'chartofaccount') */) {
|
||||
setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +149,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-adm
|
||||
|
||||
|
||||
// Customer
|
||||
$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity, sa.client as nature";
|
||||
$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity, sa.client as nature, sa.fournisseur as nature2";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe sa";
|
||||
$sql .= " WHERE sa.entity IN (".getEntity('societe').")";
|
||||
$sql .= " AND sa.code_compta <> ''";
|
||||
@@ -163,7 +170,6 @@ if (strlen(trim($search_subaccount))) {
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($search_subaccount); exit;
|
||||
if ($search_subaccount_tmp) {
|
||||
if ($weremovedsomezero) {
|
||||
$search_subaccount_tmp_clean = $search_subaccount_tmp;
|
||||
@@ -190,7 +196,8 @@ if (!empty($search_type) && $search_type >= 0) {
|
||||
|
||||
// Supplier
|
||||
$sql .= " UNION ";
|
||||
$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity, '0' as nature FROM ".MAIN_DB_PREFIX."societe sa";
|
||||
$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity, sa.client as nature, sa.fournisseur as nature2";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe sa";
|
||||
$sql .= " WHERE sa.entity IN (".getEntity('societe').")";
|
||||
$sql .= " AND sa.code_compta_fournisseur <> ''";
|
||||
//print $sql;
|
||||
@@ -237,7 +244,8 @@ if (!empty($search_type) && $search_type >= 0) {
|
||||
|
||||
// User - Employee
|
||||
$sql .= " UNION ";
|
||||
$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity, '0' as nature FROM ".MAIN_DB_PREFIX."user u";
|
||||
$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity, '0' as nature, '0' as nature2";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user u";
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
$sql .= " AND u.accountancy_code <> ''";
|
||||
//print $sql;
|
||||
@@ -368,7 +376,7 @@ if ($resql) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
|
||||
}
|
||||
if (!empty($arrayfields['type']['checked'])) {
|
||||
print '<td class="liste_titre center">'.$form->selectarray('search_type', array('1'=>$langs->trans('Customer'), '2'=>$langs->trans('Supplier'), '3'=>$langs->trans('Employee')), $search_type, 1).'</td>';
|
||||
print '<td class="liste_titre center">'.$form->selectarray('search_type', array('1'=>$langs->trans('Customer').' / '.$langs->trans("Prospect"), '2'=>$langs->trans('Supplier'), '3'=>$langs->trans('Employee')), $search_type, 1).'</td>';
|
||||
}
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
if (!empty($arrayfields['reconcilable']['checked'])) {
|
||||
@@ -409,12 +417,25 @@ if ($resql) {
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
$companystatic = new Societe($db);
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$i = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
if ($obj->type == 1) {
|
||||
$companystatic->id = $obj->id;
|
||||
$companystatic->client = $obj->nature;
|
||||
$companystatic->fournisseur = 0;
|
||||
}
|
||||
if ($obj->type == 2) {
|
||||
$companystatic->id = $obj->id;
|
||||
$companystatic->client = 0;
|
||||
$companystatic->fournisseur = $obj->nature2;
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Action column
|
||||
@@ -466,7 +487,12 @@ if ($resql) {
|
||||
|
||||
// Customer
|
||||
if ($obj->type == 1) {
|
||||
$s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
|
||||
$s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">';
|
||||
$s .= $langs->trans("Customer");
|
||||
$s .= '</a>';
|
||||
if ($obj->nature == 2) {
|
||||
$s .= ' <span class="warning">('.$langs->trans("Prospect").')</span>';
|
||||
}
|
||||
} elseif ($obj->type == 2) {
|
||||
// Supplier
|
||||
$s .= '<a class="vendor-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
|
||||
@@ -475,9 +501,6 @@ if ($resql) {
|
||||
$s .= '<a class="user-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->rowid.'">'.$langs->trans("Employee").'</a>';
|
||||
}
|
||||
print $s;
|
||||
if ($obj->nature == 2) {
|
||||
print ' <span class="warning bold">('.$langs->trans("Prospect").')</span>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@@ -489,11 +512,11 @@ if ($resql) {
|
||||
if (!empty($arrayfields['reconcilable']['checked'])) {
|
||||
print '<td class="center">';
|
||||
if (empty($obj->reconcilable)) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=1&token='.newToken().'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=1&page='.$page.'&token='.newToken().'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=1&token='.newToken().'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=1&page='.$page.'&token='.newToken().'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
@@ -3300,7 +3300,7 @@ class Adherent extends CommonObject
|
||||
$return .= '<div class="info-box info-box-sm">';
|
||||
$return .= '<span class="info-box-icon bg-infobox-action">';
|
||||
if (property_exists($this, 'photo') || !empty($this->photo)) {
|
||||
$return .= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1);
|
||||
$return .= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photowithmargin photologintooltip', 'small', 0, 1);
|
||||
} else {
|
||||
$return .= img_picto('', 'user');
|
||||
}
|
||||
|
||||
@@ -95,6 +95,7 @@ print load_fiche_titre($title, '', $memberstatic->picto);
|
||||
//dol_mkdir($dir);
|
||||
$data = array();
|
||||
$tab = null;
|
||||
$label = '';
|
||||
|
||||
if ($mode) {
|
||||
// Define sql
|
||||
@@ -263,6 +264,7 @@ if ($mode && !count($data)) {
|
||||
|
||||
// Show graphics
|
||||
if (count($arrayjs) && $mode == 'memberbycountry') {
|
||||
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
|
||||
$color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||
if (is_readable($color_file)) {
|
||||
include $color_file;
|
||||
|
||||
@@ -418,6 +418,6 @@ class DolibarrApi
|
||||
*/
|
||||
protected static function _forge_criteria_callback($matches)
|
||||
{
|
||||
return dolForgeCriteriaCallback($matches);
|
||||
return dolForgeSQLCriteriaCallback($matches);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1311,7 +1311,7 @@ class FactureRec extends CommonInvoice
|
||||
if (empty($this->date_when)) {
|
||||
return false;
|
||||
}
|
||||
return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency);
|
||||
return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -136,7 +136,7 @@ class FactureStats extends Stats
|
||||
}
|
||||
|
||||
if ($categid) {
|
||||
$this->where .= ' AND EXISTS (SELECT rowid FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')';
|
||||
$this->where .= ' AND EXISTS (SELECT cats.fk_categorie FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -990,7 +990,7 @@ if ($object->id > 0) {
|
||||
|
||||
// Iban
|
||||
print '<td class="center"><span class="iban">';
|
||||
print $obj->iban;
|
||||
print dolDecrypt($obj->iban);
|
||||
if ($obj->iban && $obj->bic) {
|
||||
print " / ";
|
||||
}
|
||||
@@ -1119,7 +1119,7 @@ if ($object->id > 0) {
|
||||
|
||||
// Iban
|
||||
print '<td class="center"><span class="iban">';
|
||||
print $obj->iban;
|
||||
print dolDecrypt($obj->iban);
|
||||
if ($obj->iban && $obj->bic) {
|
||||
print " / ";
|
||||
}
|
||||
|
||||
@@ -1068,7 +1068,7 @@ class BonPrelevement extends CommonObject
|
||||
// phpcs:enable
|
||||
global $conf, $langs, $user;
|
||||
|
||||
dol_syslog(__METHOD__ . " Bank=" . $banque . " Office=" . $agence . " mode=" . $mode . " format=" . $format, LOG_DEBUG);
|
||||
dol_syslog(__METHOD__ . " Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format." type=".$type." did=".$did." fk_bank_account=".$fk_bank_account." sourcetype=".$sourcetype, LOG_DEBUG);
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . "/compta/facture/class/facture.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT . "/societe/class/societe.class.php";
|
||||
@@ -1150,7 +1150,7 @@ class BonPrelevement extends CommonObject
|
||||
dol_syslog(__METHOD__ . " Read invoices for did=" . ((int) $did), LOG_DEBUG);
|
||||
|
||||
$sql = "SELECT f.rowid, pd.rowid as pfdrowid";
|
||||
$sql .= ", f.".$this->db->sanitize($socOrUser);
|
||||
$sql .= ", f.".$this->db->sanitize($socOrUser); // fk_soc or fk_user
|
||||
$sql .= ", pd.code_banque, pd.code_guichet, pd.number, pd.cle_rib";
|
||||
$sql .= ", pd.amount";
|
||||
if ($sourcetype != 'salary') {
|
||||
@@ -1200,7 +1200,12 @@ class BonPrelevement extends CommonObject
|
||||
while ($i < $num) {
|
||||
$row = $this->db->fetch_row($resql); // TODO Replace with fetch_object()
|
||||
'@phan-var-force array<int<0,12>,string> $row';
|
||||
$factures[$i] = $row; // All fields
|
||||
|
||||
// All fields: 0=rowid, 1=pfdrowid, 2=$socOrUser, 3=code_banque, 4=code_guichet, 5=number, 6=key, 7=amount, 8=name, 9=ref, 10=bic, 11=iban, 12=frstrecur
|
||||
$factures[$i] = $row;
|
||||
|
||||
// Decode BAN
|
||||
$factures[$i][11] = dolDecrypt($factures[$i][11]);
|
||||
|
||||
if ($row[7] == 0) {
|
||||
$error++;
|
||||
@@ -1232,20 +1237,10 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
// Check BAN
|
||||
$i = 0;
|
||||
dol_syslog(__METHOD__ . " Check BAN", LOG_DEBUG);
|
||||
dol_syslog(__METHOD__ . " Check BAN for each invoices or salary", LOG_DEBUG);
|
||||
|
||||
if (count($factures) > 0) {
|
||||
foreach ($factures as $key => $fac) {
|
||||
/*
|
||||
if ($type != 'bank-transfer') {
|
||||
$tmpinvoice = new Facture($this->db);
|
||||
} else {
|
||||
$tmpinvoice = new FactureFournisseur($this->db);
|
||||
}
|
||||
$resfetch = $tmpinvoice->fetch($fac[0]);
|
||||
if ($resfetch >= 0) { // Field 0 of $fac is rowid of invoice
|
||||
*/
|
||||
|
||||
// Check if $fac[8] s.nom is null
|
||||
if ($fac[8] != null) {
|
||||
if ($type != 'bank-transfer') {
|
||||
@@ -1259,6 +1254,7 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
$verif = checkSwiftForAccount(null, $fac[10]);
|
||||
if ($verif || (empty($fac[10]) && getDolGlobalInt("WITHDRAWAL_WITHOUT_BIC"))) {
|
||||
dol_syslog(__METHOD__." now call checkIbanForAccount(null, ".$fac[11].")");
|
||||
$verif = checkIbanForAccount(null, $fac[11]);
|
||||
}
|
||||
|
||||
@@ -1312,7 +1308,7 @@ class BonPrelevement extends CommonObject
|
||||
$ok = 0;
|
||||
|
||||
// Withdraw invoices in factures_prev array
|
||||
$out = count($factures_prev) . " invoices will be included.";
|
||||
$out = count($factures_prev) . " invoices or salaries will be included.";
|
||||
//print $out."\n";
|
||||
dol_syslog($out);
|
||||
|
||||
@@ -1901,8 +1897,9 @@ class BonPrelevement extends CommonObject
|
||||
$cachearraytotestduplicate[$obj->idfac] = $obj->rowid;
|
||||
|
||||
$daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec);
|
||||
$iban = dolDecrypt($obj->iban);
|
||||
|
||||
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->reffac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type);
|
||||
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->reffac, $obj->idfac, $iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type);
|
||||
|
||||
$this->total += $obj->somme;
|
||||
$i++;
|
||||
@@ -2044,12 +2041,13 @@ class BonPrelevement extends CommonObject
|
||||
$cachearraytotestduplicate[$obj->idfac] = $obj->rowid;
|
||||
|
||||
$daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec);
|
||||
$iban = dolDecrypt($obj->iban);
|
||||
$refobj = $obj->reffac;
|
||||
if (empty($refobj) && !empty($forsalary)) { // If ref of salary not defined, we force a value
|
||||
$refobj = "SAL" . $obj->idfac;
|
||||
}
|
||||
|
||||
$fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $refobj, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type, $obj->fac_ref_supplier);
|
||||
$fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $refobj, $obj->idfac, $iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type, $obj->fac_ref_supplier);
|
||||
|
||||
$this->total += $obj->somme;
|
||||
$i++;
|
||||
|
||||
@@ -1531,7 +1531,7 @@ class Contact extends CommonObject
|
||||
* @param string $morecss Add more css on link
|
||||
* @return string String with URL
|
||||
*/
|
||||
public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '')
|
||||
public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = 'valignmiddle')
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
|
||||
@@ -166,26 +166,22 @@ if ($type == "p") {
|
||||
$contextpage = 'contactprospectlist';
|
||||
}
|
||||
$title .= ' ('.$langs->trans("ThirdPartyProspects").')';
|
||||
$urlfiche = "card.php";
|
||||
}
|
||||
if ($type == "c") {
|
||||
if (empty($contextpage) || $contextpage == 'contactlist') {
|
||||
$contextpage = 'contactcustomerlist';
|
||||
}
|
||||
$title .= ' ('.$langs->trans("ThirdPartyCustomers").')';
|
||||
$urlfiche = "card.php";
|
||||
} elseif ($type == "f") {
|
||||
if (empty($contextpage) || $contextpage == 'contactlist') {
|
||||
$contextpage = 'contactsupplierlist';
|
||||
}
|
||||
$title .= ' ('.$langs->trans("ThirdPartySuppliers").')';
|
||||
$urlfiche = "card.php";
|
||||
} elseif ($type == "o") {
|
||||
if (empty($contextpage) || $contextpage == 'contactlist') {
|
||||
$contextpage = 'contactotherlist';
|
||||
}
|
||||
$title .= ' ('.$langs->trans("OthersNotLinkedToThirdParty").')';
|
||||
$urlfiche = "";
|
||||
}
|
||||
|
||||
// Initialize a technical object
|
||||
@@ -1453,7 +1449,6 @@ while ($i < $imaxinloop) {
|
||||
}
|
||||
} else {
|
||||
// Show here line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven"';
|
||||
if ($contextpage == 'poslist') {
|
||||
print ' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->socid.'&idcontact='.$obj->rowid.'&place='.urlencode($place).'\'"';
|
||||
|
||||
@@ -1823,9 +1823,9 @@ abstract class CommonInvoice extends CommonObject
|
||||
$s .= ''; // ecda public key
|
||||
$s .= ''; // ecda signature of public key stamp
|
||||
*/
|
||||
|
||||
$mysocname = $mysoc->name ?? '';
|
||||
// Using TLV format
|
||||
$s = pack('C1', 1).pack('C1', strlen($mysoc->name)).$mysoc->name;
|
||||
$s = pack('C1', 1).pack('C1', strlen($mysocname)).$mysocname;
|
||||
$s .= pack('C1', 2).pack('C1', strlen($mysoc->tva_intra)).$mysoc->tva_intra;
|
||||
$s .= pack('C1', 3).pack('C1', strlen($datestring)).$datestring;
|
||||
$s .= pack('C1', 4).pack('C1', strlen($pricewithtaxstring)).$pricewithtaxstring;
|
||||
|
||||
@@ -6856,28 +6856,52 @@ abstract class CommonObject
|
||||
}
|
||||
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] == 'point') { // for point type
|
||||
if (!empty($new_array_options[$key])) {
|
||||
$sql .= ",ST_PointFromText('".$this->db->escape($new_array_options[$key])."')";
|
||||
if (!preg_match('/error/i', $new_array_options[$key])) {
|
||||
// Text must be a WKT string, so "POINT(15 20)"
|
||||
$sql .= ",ST_PointFromText('".$this->db->escape($new_array_options[$key])."')";
|
||||
} else {
|
||||
dol_syslog("Bad syntax string for point ".$new_array_options[$key]." to generate SQL request", LOG_WARNING);
|
||||
$sql .= ",null";
|
||||
}
|
||||
} else {
|
||||
$sql .= ",null";
|
||||
}
|
||||
}
|
||||
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] == 'multipts') { // for point type
|
||||
if (!empty($new_array_options[$key])) {
|
||||
$sql .= ",ST_MultiPointFromText('".$this->db->escape($new_array_options[$key])."')";
|
||||
if (!preg_match('/error/i', $new_array_options[$key])) {
|
||||
// Text must be a WKT string, so "MULTIPOINT(0 0, 20 20, 60 60)"
|
||||
$sql .= ",ST_MultiPointFromText('".$this->db->escape($new_array_options[$key])."')";
|
||||
} else {
|
||||
dol_syslog("Bad syntax string for multipoint ".$new_array_options[$key]." to generate SQL request", LOG_WARNING);
|
||||
$sql .= ",null";
|
||||
}
|
||||
} else {
|
||||
$sql .= ",null";
|
||||
}
|
||||
}
|
||||
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] == 'linestrg') { // for linestring type
|
||||
if (!empty($new_array_options[$key])) {
|
||||
$sql .= ",ST_LineFromText('".$this->db->escape($new_array_options[$key])."')";
|
||||
if (!preg_match('/error/i', $new_array_options[$key])) {
|
||||
// Text must be a WKT string, so "LINESTRING(0 0, 10 10, 20 25, 50 60)"
|
||||
$sql .= ",ST_LineFromText('".$this->db->escape($new_array_options[$key])."')";
|
||||
} else {
|
||||
dol_syslog("Bad syntax string for line ".$new_array_options[$key]." to generate SQL request", LOG_WARNING);
|
||||
$sql .= ",null";
|
||||
}
|
||||
} else {
|
||||
$sql .= ",null";
|
||||
}
|
||||
}
|
||||
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] == 'polygon') { // for polygon type
|
||||
if (!empty($new_array_options[$key])) {
|
||||
$sql .= ",ST_PolyFromText('".$this->db->escape($new_array_options[$key])."')";
|
||||
if (!preg_match('/error/i', $new_array_options[$key])) {
|
||||
// Text must be a WKT string, so "POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7, 5 5))"
|
||||
$sql .= ",ST_PolyFromText('".$this->db->escape($new_array_options[$key])."')";
|
||||
} else {
|
||||
dol_syslog("Bad syntax string for polygon ".$new_array_options[$key]." to generate SQL request", LOG_WARNING);
|
||||
$sql .= ",null";
|
||||
}
|
||||
} else {
|
||||
$sql .= ",null";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -152,9 +152,9 @@ trait CommonPeople
|
||||
/**
|
||||
* Return full address for banner
|
||||
*
|
||||
* @param string $htmlkey HTML id to make banner content unique
|
||||
* @param Object $object Object (thirdparty, thirdparty of contact for contact, null for a member)
|
||||
* @return string Full address string
|
||||
* @param string $htmlkey HTML id to make banner content unique
|
||||
* @param CommonObject $object Object (thirdparty, thirdparty of contact for contact, null for a member)
|
||||
* @return string Full address string
|
||||
*/
|
||||
public function getBannerAddress($htmlkey, $object)
|
||||
{
|
||||
@@ -165,20 +165,24 @@ trait CommonPeople
|
||||
$contactid = 0;
|
||||
$thirdpartyid = 0;
|
||||
$elementforaltlanguage = $this->element;
|
||||
if ($this instanceOf Societe && $this->element === 'societe') {
|
||||
/** @var Societe $this */
|
||||
if ($this->element === 'societe' && $this instanceof Societe) {
|
||||
$thirdpartyid = $this->id;
|
||||
}
|
||||
if ($this instanceOf Contact && $this->element === 'contact') {
|
||||
/** @var Contact $this */
|
||||
if ($this->element === 'contact' && $this instanceof Contact) {
|
||||
$contactid = $this->id;
|
||||
$thirdpartyid = empty($this->fk_soc) ? 0 : $this->fk_soc;
|
||||
}
|
||||
if ($this instanceOf User && $this->element === 'user') {
|
||||
/** @var User $this */
|
||||
if ($this->element == 'member' && $this instanceof Adherent) {
|
||||
$contactid = $this->id;
|
||||
$thirdpartyid = empty($this->socid) ? 0 : $this->socid;
|
||||
}
|
||||
if ($this->element === 'user' && $this instanceof User) {
|
||||
$contactid = $this->contact_id;
|
||||
$thirdpartyid = empty($object->fk_soc) ? 0 : $object->fk_soc;
|
||||
}
|
||||
if ($this->element == 'recruitmentcandidature' && $this instanceof RecruitmentCandidature) {
|
||||
$thirdpartyid = 0;
|
||||
}
|
||||
|
||||
$out = '';
|
||||
|
||||
@@ -210,7 +214,7 @@ trait CommonPeople
|
||||
$arrayoflangcode[] = getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE');
|
||||
}
|
||||
|
||||
if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
|
||||
if (/* is_array($arrayoflangcode) && */count($arrayoflangcode)) {
|
||||
if (!is_object($extralanguages)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
|
||||
$extralanguages = new ExtraLanguages($this->db);
|
||||
@@ -258,7 +262,7 @@ trait CommonPeople
|
||||
// Phones
|
||||
$outphonedone = 0;
|
||||
if (!empty($this->phone) && empty($this->phone_pro)) { // For objects that store pro phone into ->phone
|
||||
$out .= ($outphonedone ? ' ' : '');
|
||||
// $out .= ($outphonedone ? ' ' : '');
|
||||
$out .= dol_print_phone($this->phone, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'phone', $langs->trans("PhonePro"));
|
||||
$outdone++;
|
||||
$outphonedone++;
|
||||
@@ -387,7 +391,7 @@ trait CommonPeople
|
||||
$this->address = dol_strtoupper($this->address);
|
||||
$this->town = dol_strtoupper($this->town);
|
||||
}
|
||||
if (isset($this->email)) {
|
||||
if (!empty($this->email)) {
|
||||
$this->email = dol_strtolower($this->email);
|
||||
}
|
||||
if (isset($this->personal_email)) {
|
||||
|
||||
@@ -115,10 +115,15 @@ class DolGeoPHP
|
||||
{
|
||||
$value_key = '';
|
||||
|
||||
$geom = geoPHP::load($geojson, 'json');
|
||||
if ($geom) {
|
||||
'@phan-var-force Geometry $geom';
|
||||
$value_key = $geom->out('wkt');
|
||||
try {
|
||||
$geom = geoPHP::load($geojson, 'json');
|
||||
if ($geom) {
|
||||
'@phan-var-force Geometry $geom';
|
||||
$value_key = $geom->out('wkt');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// Do nothing
|
||||
$value_key = 'Error: Bad value for property';
|
||||
}
|
||||
return $value_key;
|
||||
}
|
||||
|
||||
@@ -2767,9 +2767,9 @@ class Form
|
||||
}
|
||||
|
||||
if (empty($hidelabel)) {
|
||||
$out .= $langs->trans("RefOrLabel") . ' : ';
|
||||
$placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"';
|
||||
} elseif ($hidelabel > 1) {
|
||||
$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
|
||||
$placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"';
|
||||
if ($hidelabel == 2) {
|
||||
$out .= img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
@@ -5263,14 +5263,15 @@ class Form
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$iban = dolDecrypt($obj->iban_prefix);
|
||||
if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
|
||||
$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $obj->iban_prefix . ' data-bic="' . $obj->bic . '" selected>';
|
||||
$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '" selected>';
|
||||
} else {
|
||||
$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $obj->iban_prefix . ' data-bic="' . $obj->bic . '">';
|
||||
$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '">';
|
||||
}
|
||||
$out .= trim($obj->label);
|
||||
if ($showibanbic) {
|
||||
$out .= ' (' . $obj->iban_prefix . '/' .$obj->bic. ')';
|
||||
$out .= ' (' . $iban . '/' .$obj->bic. ')';
|
||||
}
|
||||
$out .= '</option>';
|
||||
$i++;
|
||||
|
||||
@@ -511,7 +511,7 @@ class FormAdmin
|
||||
*/
|
||||
public function selectTypeOfFields($htmlname, $type, $typewecanchangeinto = array())
|
||||
{
|
||||
global $type2label; // TODO Remove this
|
||||
global $type2label; // TODO Remove this global
|
||||
|
||||
$out = '';
|
||||
|
||||
|
||||
@@ -515,7 +515,9 @@ class vCard
|
||||
$this->setOrg($company->name);
|
||||
}
|
||||
|
||||
$this->setURL($company->url, "");
|
||||
if (!empty($company->url)) {
|
||||
$this->setURL($company->url, "");
|
||||
}
|
||||
|
||||
if ($company->phone && empty($object->office_phone)) { // If we already set the type TYPE=WORK,VOICE with office_phone
|
||||
$this->setPhoneNumber($company->phone, "TYPE=WORK,VOICE");
|
||||
|
||||
@@ -639,14 +639,14 @@ function ajax_event($htmlname, $events)
|
||||
* @param string $suffix Suffix to use on the name of the switch picto when option is on. Example: '', '_red'
|
||||
* @param string $mode Add parameter &mode= to the href link (Used for href link)
|
||||
* @param string $morecss More CSS
|
||||
* @param int $userconst 1=OnOff for user constant of user $userconst
|
||||
* @param User|int $userconst If set, use the ajax On/Off for user or user ID $userconst
|
||||
* @param string $showwarning String to show a warning when enabled the option
|
||||
* @return string
|
||||
* @see ajax_object_onoff() to update the status of an object
|
||||
*/
|
||||
function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '', $mode = '', $morecss = 'inline-block', $userconst = 0, $showwarning = '')
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
global $conf, $langs, $user, $db;
|
||||
|
||||
$entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity);
|
||||
if (!isset($input)) {
|
||||
@@ -660,6 +660,15 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
||||
$out = '<a '.($morecss ? 'class="'.$morecss.'" ' : '').' href="'.$_SERVER['PHP_SELF'].'?action=del_'.$code.'&token='.newToken().'&entity='.$entity.($mode ? '&mode='.$mode : '').($forcereload ? '&dol_resetcache=1' : '').'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
}
|
||||
} else {
|
||||
$userconstid = 0;
|
||||
if (is_object($userconst)) {
|
||||
$userconstid = $userconst->id;
|
||||
} elseif (is_numeric($userconst) && $userconst > 0) {
|
||||
$userconstid = $userconst;
|
||||
$userconst = new User($db);
|
||||
$userconst->fetch($userconstid);
|
||||
}
|
||||
|
||||
$out = "\n<!-- Ajax code to switch constant ".$code." -->".'
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
@@ -669,7 +678,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
||||
var entity = \''.dol_escape_js($entity).'\';
|
||||
var strict = \''.dol_escape_js((string) $strict).'\';
|
||||
var userid = \''.dol_escape_js((string) $user->id).'\';
|
||||
var userconst = '.((int) $userconst).';
|
||||
var userconst = '.((int) $userconstid).';
|
||||
var yesButton = \''.dol_escape_js($langs->transnoentities("Yes")).'\';
|
||||
var noButton = \''.dol_escape_js($langs->transnoentities("No")).'\';
|
||||
var token = \''.currentToken().'\';
|
||||
@@ -677,7 +686,6 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
||||
|
||||
// Set constant
|
||||
$("#set_" + code).click(function() {
|
||||
console.log("ee");
|
||||
if (warning) {
|
||||
alert(warning);
|
||||
}
|
||||
@@ -708,8 +716,8 @@ console.log("ee");
|
||||
});
|
||||
</script>'."\n";
|
||||
|
||||
if ($userconst) {
|
||||
$value = getDolUserString($code);
|
||||
if (!empty($userconst) && $userconst instanceof User) {
|
||||
$value = getDolUserString($code, '', $userconst);
|
||||
} else {
|
||||
$value = getDolGlobalString($code);
|
||||
}
|
||||
@@ -726,7 +734,7 @@ console.log("ee");
|
||||
* On/off button to change a property status of an object
|
||||
* This uses the ajax service objectonoff.php (May be called when MAIN_DIRECT_STATUS_UPDATE is set for some pages)
|
||||
*
|
||||
* @param Object $object Object to set
|
||||
* @param CommonObject $object Object to set
|
||||
* @param string $code Name of property in object : 'status' or 'status_buy' for product by example
|
||||
* @param string $field Name of database field : 'tosell' or 'tobuy' for product by example
|
||||
* @param string $text_on Text if on ('Text' or 'Text:Picto on:Css picto on')
|
||||
@@ -746,7 +754,6 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input =
|
||||
if (empty($htmlname)) {
|
||||
$htmlname = $code;
|
||||
}
|
||||
//var_dump($object->module); var_dump($object->element);
|
||||
|
||||
$out = '';
|
||||
|
||||
|
||||
@@ -4039,7 +4039,7 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor
|
||||
$link = str_replace('{socialid}', $value, getDolGlobalString($networkconstname));
|
||||
if (preg_match('/^https?:\/\//i', $link)) {
|
||||
$htmllink .= '<a href="'.dol_sanitizeUrl($link, 0).'" target="_blank" rel="noopener noreferrer">'.dol_escape_htmltag($value).'</a>';
|
||||
} else {
|
||||
} elseif ($link) {
|
||||
$htmllink .= '<a href="'.dol_sanitizeUrl($link, 1).'" target="_blank" rel="noopener noreferrer">'.dol_escape_htmltag($value).'</a>';
|
||||
}
|
||||
} elseif (!empty($dictsocialnetworks[$type]['url'])) {
|
||||
@@ -13777,7 +13777,7 @@ function forgeSQLFromUniversalSearchCriteria($filter, &$errorstr = '', $noand =
|
||||
}
|
||||
}
|
||||
|
||||
$ret = ($noand ? "" : " AND ").($nopar ? "" : '(').preg_replace_callback('/'.$regexstring.'/i', 'dolForgeCriteriaCallback', $filter).($nopar ? "" : ')');
|
||||
$ret = ($noand ? "" : " AND ").($nopar ? "" : '(').preg_replace_callback('/'.$regexstring.'/i', 'dolForgeSQLCriteriaCallback', $filter).($nopar ? "" : ')');
|
||||
|
||||
if (is_object($db)) {
|
||||
$ret = str_replace('__NOW__', $db->idate(dol_now()), $ret);
|
||||
@@ -13938,14 +13938,14 @@ function dolForgeDummyCriteriaCallback($matches)
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to forge a SQL criteria from a Dolibarr filter syntax string.
|
||||
* Function to forge a SQL criteria from a USF (Universal Filter Syntax) string.
|
||||
* This method is called by forgeSQLFromUniversalSearchCriteria()
|
||||
*
|
||||
* @param string[] $matches Array of found string by regex search.
|
||||
* Example: "t.ref:like:'SO-%'" or "t.date_creation:<:'20160101'" or "t.date_creation:<:'2016-01-01 12:30:00'" or "t.nature:is:NULL"
|
||||
* @return string Forged criteria. Example: "t.field LIKE 'abc%'"
|
||||
*/
|
||||
function dolForgeCriteriaCallback($matches)
|
||||
function dolForgeSQLCriteriaCallback($matches)
|
||||
{
|
||||
global $db;
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ if (empty($reshook) && !empty($object->table_element) && isset($extrafields->att
|
||||
print '<input type="hidden" name="attribute" value="'.$tmpkeyextra.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="'.$fieldid.'" value="'.$object->id.'">';
|
||||
print $extrafields->showInputField($tmpkeyextra, $value, '', '', '', 0, $object->id, $object->table_element);
|
||||
print $extrafields->showInputField($tmpkeyextra, $value, '', '', '', 0, $object, $object->table_element);
|
||||
|
||||
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Modify')).'">';
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@ if ($massaction == 'edit_extrafields') {
|
||||
foreach ($extrafields_list as $extraKey => $extraLabel) {
|
||||
$outputShowOutputFields .= '<div class="mass-action-extrafield" data-extrafield="'.$extraKey.'" style="display:none;" >';
|
||||
$outputShowOutputFields .= '<br><span>'. $langs->trans('NewValue').'</span>';
|
||||
$outputShowOutputFields .= $extrafields->showInputField($extraKey, '', '', $keysuffix, '', 0, $objecttmp->id, $objecttmp->table_element);
|
||||
$outputShowOutputFields .= $extrafields->showInputField($extraKey, '', '', $keysuffix, '', 0, $objecttmp, $objecttmp->table_element);
|
||||
$outputShowOutputFields .= '</div>';
|
||||
}
|
||||
$outputShowOutputFields .= '<script>
|
||||
|
||||
@@ -483,7 +483,12 @@ class Shipments extends DolibarrApi
|
||||
$this->shipment->context['caller'] = sanitizeVal($request_data['caller'], 'aZ09');
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->shipment->array_options[$index] = $this->_checkValForAPI($field, $val, $this->shipment);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->shipment->$field = $this->_checkValForAPI($field, $value, $this->shipment);
|
||||
}
|
||||
|
||||
|
||||
@@ -1252,6 +1252,14 @@ class Expedition extends CommonObject
|
||||
$this->errors[] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
// Actions on extra fields
|
||||
if (!$error) {
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('SHIPPING_MODIFY', $user);
|
||||
|
||||
@@ -669,7 +669,7 @@ $companystatic = new Societe($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$shipment = new Expedition($db);
|
||||
|
||||
$title = $langs->trans('ListOfSendings');
|
||||
$title = $langs->trans('Shipments');
|
||||
$help_url = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-expedition page-list');
|
||||
@@ -934,8 +934,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
||||
exit;
|
||||
}
|
||||
|
||||
$expedition = new Expedition($db);
|
||||
|
||||
if ($socid > 0) {
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($socid);
|
||||
@@ -1074,7 +1072,7 @@ print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dolly', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($langs->trans('Shipments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dolly', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$topicmail = "SendShippingRef";
|
||||
$modelmail = "shipping_send";
|
||||
@@ -1085,7 +1083,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
if ($massaction == 'createbills') {
|
||||
print '<input type="hidden" name="massaction" value="confirm_createbills">';
|
||||
|
||||
print '<table class="noborder" width="100%" >';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">';
|
||||
print $langs->trans('DateInvoice');
|
||||
|
||||
@@ -1307,7 +1307,7 @@ class FactureFournisseurRec extends CommonInvoice
|
||||
if (empty($this->date_when)) {
|
||||
return false;
|
||||
}
|
||||
return dol_time_plus_duree((int) $this->date_when, $this->frequency, $this->unit_frequency);
|
||||
return dol_time_plus_duree((int) $this->date_when, $this->frequency, $this->unit_frequency, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -81,7 +81,9 @@ ALTER TABLE llx_product DROP FOREIGN KEY fk_product_default_warehouse;
|
||||
|
||||
DROP TABLE llx_contratdet_log;
|
||||
|
||||
ALTER TABLE llx_societe_rib MODIFY COLUMN iban_prefix varchar(60);
|
||||
ALTER TABLE llx_societe_rib MODIFY COLUMN iban_prefix varchar(80);
|
||||
ALTER TABLE llx_bank_account MODIFY COLUMN iban_prefix varchar(80);
|
||||
ALTER TABLE llx_user_rib MODIFY COLUMN iban_prefix varchar(80);
|
||||
|
||||
ALTER TABLE llx_bom_bom ADD COLUMN last_main_doc varchar(255) AFTER model_pdf;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ create table llx_bank_account
|
||||
cle_rib varchar(5),
|
||||
bic varchar(11), -- 11 according to ISO 9362
|
||||
bic_intermediate varchar(11), -- 11 according to ISO 9362. Same as bic but for intermediate bank
|
||||
iban_prefix varchar(34), -- full iban. 34 according to ISO 13616
|
||||
iban_prefix varchar(80), -- full iban. 34 according to ISO 13616 but we set 80 to allow to store it with encryption information
|
||||
country_iban varchar(2), -- deprecated
|
||||
cle_iban varchar(2),
|
||||
domiciliation varchar(255),
|
||||
|
||||
@@ -39,7 +39,7 @@ create table llx_societe_rib
|
||||
|
||||
bic varchar(20), -- 11 according to ISO 9362 (we keep 20 for backward compatibility)
|
||||
bic_intermediate varchar(11), -- 11 according to ISO 9362. Same as bic but for intermediate bank
|
||||
iban_prefix varchar(60), -- full iban. 34 according to ISO 13616 ut we set 60 to allow to store it with encryption information
|
||||
iban_prefix varchar(80), -- full iban. 34 according to ISO 13616 but we set 80 to allow to store it with encryption information
|
||||
|
||||
domiciliation varchar(255),
|
||||
proprio varchar(60),
|
||||
|
||||
@@ -31,7 +31,7 @@ create table llx_user_rib
|
||||
cle_rib varchar(5), -- key of bank account
|
||||
bic varchar(11), -- 11 according to ISO 9362
|
||||
bic_intermediate varchar(11), -- 11 according to ISO 9362. Same as bic but for intermediate bank
|
||||
iban_prefix varchar(34), -- full iban. 34 according to ISO 13616
|
||||
iban_prefix varchar(80), -- full iban. 34 according to ISO 13616 but we set 80 to allow to store it with encryption information
|
||||
domiciliation varchar(255),
|
||||
proprio varchar(60),
|
||||
owner_address varchar(255),
|
||||
|
||||
@@ -60,7 +60,7 @@ Numberspad=Numbers Pad
|
||||
BillsCoinsPad=Coins and banknotes Pad
|
||||
DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
|
||||
TakeposNeedsCategories=TakePOS needs at least one product category to work
|
||||
TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category <b>%s</b> to work
|
||||
TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 sub-category under the product category <b>%s</b> to work
|
||||
OrderNotes=Can add some notes to each ordered items
|
||||
CashDeskBankAccountFor=Default account to use for payments in
|
||||
NoPaimementModesDefined=No paiment mode defined in TakePOS configuration
|
||||
|
||||
@@ -72,6 +72,7 @@ Language_fr_FR=French
|
||||
Language_fr_GA=French (Gabon)
|
||||
Language_fr_NC=French (New Caledonia)
|
||||
Language_fr_SN=French (Senegal)
|
||||
Language_fr_TN=French (Tunisia)
|
||||
Language_fy_NL=Frisian
|
||||
Language_gl_ES=Galician
|
||||
Language_he_IL=Hebrew
|
||||
|
||||
@@ -97,7 +97,6 @@ ShowService=Show service
|
||||
ProductsAndServicesArea=Product and Services area
|
||||
ProductsArea=Product area
|
||||
ServicesArea=Services area
|
||||
ListOfStockMovements=List of stock movements
|
||||
BuyingPrice=Buying price
|
||||
PriceForEachProduct=Products with specific prices
|
||||
SupplierCard=Vendor card
|
||||
|
||||
@@ -7,7 +7,6 @@ Receptions=Receptions
|
||||
AllReceptions=All Receptions
|
||||
ShowReception=Show Receptions
|
||||
ReceptionsArea=Receptions area
|
||||
ListOfReceptions=List of receptions
|
||||
ReceptionMethod=Reception method
|
||||
LastReceptions=Latest %s receptions
|
||||
StatisticsOfReceptions=Statistics for receptions
|
||||
|
||||
@@ -8,13 +8,12 @@ Shipments=Shipments
|
||||
ShowSending=Show Shipments
|
||||
Receivings=Delivery Receipts
|
||||
SendingsArea=Shipments area
|
||||
ListOfSendings=List of shipments
|
||||
SendingMethod=Shipping method
|
||||
LastSendings=Latest %s shipments
|
||||
StatisticsOfSendings=Statistics for shipments
|
||||
NbOfSendings=Number of shipments
|
||||
NumberOfShipmentsByMonth=Number of shipments by month
|
||||
SendingCard=Shipment card
|
||||
SendingCard=Shipment
|
||||
NewSending=New shipment
|
||||
CreateShipment=Create shipment
|
||||
QtyShipped=Qty shipped
|
||||
|
||||
@@ -27,9 +27,6 @@ LotSerialList=List of lot/serials
|
||||
SubjectToLotSerialOnly=Products subject to lot/serial only
|
||||
Movements=Movements
|
||||
ErrorWarehouseRefRequired=Warehouse reference name is required
|
||||
ListOfWarehouses=List of warehouses
|
||||
ListOfStockMovements=List of stock movements
|
||||
ListOfInventories=List of inventories
|
||||
MovementId=Movement ID
|
||||
StockMovementForId=Movement ID %d
|
||||
ListMouvementStockProject=List of stock movements associated to project
|
||||
|
||||
@@ -60,7 +60,7 @@ Numberspad=Pavé numérique
|
||||
BillsCoinsPad=Pavé avec montant des Pièces et Billets
|
||||
DolistorePosCategory=Modules TakePOS et autres solutions de PDV pour Dolibarr
|
||||
TakeposNeedsCategories=TakePOS a besoin d'au moins une catégorie de produits pour fonctionner
|
||||
TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS a besoin d'au moins 1 catégorie de produits dans la catégorie <b> %s </b> pour fonctionner
|
||||
TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS a besoin d'au moins 1 sous-catégorie dans la catégorie de produit <b> %s </b> pour fonctionner
|
||||
OrderNotes=Il est possible d'ajouter des notes sur chacun des produits commandés
|
||||
CashDeskBankAccountFor=Compte par défaut à utiliser pour les paiements en
|
||||
NoPaimementModesDefined=Aucun mode de paiement défini dans la configuration de TakePOS
|
||||
|
||||
31
htdocs/langs/fr_TN/main.lang
Normal file
31
htdocs/langs/fr_TN/main.lang
Normal file
@@ -0,0 +1,31 @@
|
||||
# Dolibarr language file - Source file is en_US - main
|
||||
DIRECTION=ltr
|
||||
# Default for FONTFORPDF=helvetica
|
||||
# Note for Chinese:
|
||||
# msungstdlight or cid0ct are for traditional Chinese zh_TW (traditional does not render with Ubuntu pdf reader)
|
||||
# stsongstdlight or cid0cs are for simplified Chinese zh_CN
|
||||
# To read Chinese pdf with Linux: sudo apt-get install poppler-data
|
||||
# cid0jp is for Japanish
|
||||
# cid0kr is for Korean
|
||||
# DejaVuSans is for some Eastern languages, some Asian languages and some Arabic languages
|
||||
# freemono is for ru_RU or uk_UA, uz_UZ
|
||||
# freeserif is for Tamil or Ethiopian
|
||||
FONTFORPDF=helvetica
|
||||
FONTSIZEFORPDF=10
|
||||
SeparatorDecimal=,
|
||||
SeparatorThousand=Space
|
||||
FormatDateShort=%d/%m/%Y
|
||||
FormatDateShortInput=%d/%m/%Y
|
||||
FormatDateShortJava=dd/MM/yyyy
|
||||
FormatDateShortJavaInput=dd/MM/yyyy
|
||||
FormatDateShortJQuery=dd/mm/yy
|
||||
FormatDateShortJQueryInput=dd/mm/yy
|
||||
FormatHourShortJQuery=HH:MI
|
||||
FormatHourShort=%H:%M
|
||||
FormatHourShortDuration=%H:%M
|
||||
FormatDateTextShort=%d %b %Y
|
||||
FormatDateText=%d %B %Y
|
||||
FormatDateHourShort=%d/%m/%Y %H:%M
|
||||
FormatDateHourSecShort=%d/%m/%Y %H:%M:%S
|
||||
FormatDateHourTextShort=%d %b %Y %H:%M
|
||||
FormatDateHourText=%d %B %Y %H:%M
|
||||
2
htdocs/langs/fr_TN/sendings.lang
Normal file
2
htdocs/langs/fr_TN/sendings.lang
Normal file
@@ -0,0 +1,2 @@
|
||||
# Dolibarr language file - Source file is en_US - sendings
|
||||
SendingCard=Bon livraison
|
||||
@@ -650,6 +650,9 @@ print '<input type="submit" class="button reposition" value="'.$langs->trans("Mo
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("UserInterface"), '', '');
|
||||
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ if ($result || !($id > 0)) {
|
||||
// Product
|
||||
print '<tr class="nooddeven"><td class="titlefield">'.$langs->trans("ProductOrService").'</td><td>';
|
||||
print img_picto('', 'product', 'class="pictofixedwidth"');
|
||||
print $form->select_produits($id, 'id', '', 0, 0, 1, 2, '', ($conf->dol_optimize_smallscreen ? 1 : 0), array(), 0, '1', 0, 'widthcentpercentminusx maxwidth400');
|
||||
print $form->select_produits($id, 'id', '', 0, 0, 1, 2, '', 0, array(), 0, $langs->trans("RefOrLabel"), 0, 'widthcentpercentminusx maxwidth400');
|
||||
print '</td></tr>';
|
||||
|
||||
// Tag
|
||||
|
||||
@@ -560,7 +560,7 @@ if ($resql) {
|
||||
if ($msid) {
|
||||
$texte = $langs->trans('StockMovementForId', $msid);
|
||||
} else {
|
||||
$texte = $langs->trans("ListOfStockMovements");
|
||||
$texte = $langs->trans("StockMovements");
|
||||
if ($id) {
|
||||
$texte .= ' ('.$langs->trans("ForThisWarehouse").')';
|
||||
}
|
||||
|
||||
@@ -832,7 +832,7 @@ $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
||||
if ($msid) {
|
||||
$title = $langs->trans('StockMovementForId', $msid);
|
||||
} else {
|
||||
$title = $langs->trans("ListOfStockMovements");
|
||||
$title = $langs->trans("StockMovements");
|
||||
if ($id) {
|
||||
if (!empty($warehouse->ref)) {
|
||||
$title .= ' ('.$warehouse->ref.')';
|
||||
@@ -1236,7 +1236,7 @@ if (!empty($arrayfields['pl.sellby']['checked'])) {
|
||||
if (!empty($arrayfields['e.ref']['checked'])) {
|
||||
print '<td class="liste_titre maxwidthonsmartphone left">';
|
||||
//print '<input class="flat" type="text" size="8" name="search_warehouse" value="'.($search_warehouse).'">';
|
||||
print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'maxwidth200');
|
||||
print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'maxwidth150');
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.fk_user_author']['checked'])) {
|
||||
@@ -1564,7 +1564,7 @@ while ($i < $imaxinloop) {
|
||||
}
|
||||
// Warehouse
|
||||
if (!empty($arrayfields['e.ref']['checked'])) {
|
||||
print '<td class="tdoverflowmax100">';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $warehousestatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
}
|
||||
@@ -1591,7 +1591,7 @@ while ($i < $imaxinloop) {
|
||||
if (!empty($arrayfields['origin']['checked'])) {
|
||||
print '<td class="nowraponall">'.$origin.'</td>';
|
||||
}
|
||||
// fk_project
|
||||
// Project
|
||||
if (!empty($arrayfields['m.fk_projet']['checked'])) {
|
||||
print '<td>';
|
||||
if ($obj->fk_project != 0) {
|
||||
|
||||
@@ -225,13 +225,13 @@ if (is_array($object->lines) && (count($object->lines) > 0)) {
|
||||
// We re-program the next execution and stores the last execution time for this job
|
||||
$result = $cronjob->reprogram_jobs($userlogin, $now);
|
||||
if ($result < 0) {
|
||||
echo "Error cronjobid: ".$line->id." cronjob->reprogram_job: ".$cronjob->error."\n";
|
||||
echo " - Error cronjobid: ".$line->id." cronjob->reprogram_job: ".$cronjob->error."\n";
|
||||
echo "Enable module Log if not yet enabled, run again and take a look into dolibarr.log file\n";
|
||||
dol_syslog("cron_run_jobs.php::reprogram_jobs Error".$cronjob->error, LOG_ERR);
|
||||
exit;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
echo "Job re-scheduled\n";
|
||||
echo " - Job re-scheduled\n";
|
||||
} else {
|
||||
echo " - not qualified (datenextrunok=".($datenextrunok ?: 0).", datestartok=".($datestartok ?: 0).", dateendok=".($dateendok ?: 0).")\n";
|
||||
|
||||
|
||||
@@ -99,7 +99,6 @@ if ($cancel) {
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$v = new vCard();
|
||||
|
||||
$company = $mysoc;
|
||||
@@ -157,9 +156,20 @@ if (getDolUserInt('USER_PUBLIC_HIDE_USER_MOBILE', 0, $object)) {
|
||||
}
|
||||
if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
|
||||
$object->socialnetworks = [];
|
||||
} else {
|
||||
// Show list of social networks for company
|
||||
$listofnetworks = $object->socialnetworks;
|
||||
|
||||
if (!empty($listofnetworks)) {
|
||||
foreach ($listofnetworks as $key => $networkVal) {
|
||||
if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), 0, $object)) {
|
||||
unset($object->socialnetworks[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// By default, personal address not visible
|
||||
// By default, personal birthdate and address is not visible
|
||||
if (!getDolUserInt('USER_PUBLIC_SHOW_BIRTH', 0, $object)) {
|
||||
$object->birth = null;
|
||||
}
|
||||
@@ -174,10 +184,32 @@ if (!getDolUserInt('USER_PUBLIC_SHOW_ADDRESS', 0, $object)) {
|
||||
if (getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
|
||||
$company = null;
|
||||
}
|
||||
if (getDolUserInt('SOCIETE_PUBLIC_HIDE_EMAIL', 0, $object)) {
|
||||
$mysoc->email = '';
|
||||
}
|
||||
if (getDolUserInt('SOCIETE_PUBLIC_HIDE_OFFICE_PHONE', 0, $object)) {
|
||||
$mysoc->phone = '';
|
||||
}
|
||||
if (getDolUserInt('SOCIETE_PUBLIC_HIDE_OFFICE_FAX', 0, $object)) {
|
||||
$mysoc->fax = '';
|
||||
}
|
||||
if (getDolUserInt('SOCIETE_PUBLIC_HIDE_URL', 0, $object)) {
|
||||
$mysoc->url = '';
|
||||
}
|
||||
if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS', 0, $object) && is_object($company)) {
|
||||
$company->socialnetworks = [];
|
||||
}
|
||||
} else {
|
||||
// Show list of social networks for company
|
||||
$listofnetworks = $mysoc->socialnetworks;
|
||||
|
||||
if (!empty($listofnetworks)) {
|
||||
foreach ($listofnetworks as $key => $networkVal) {
|
||||
if (getDolUserInt('SOCIETE_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), 0, $object)) {
|
||||
unset($mysoc->socialnetworks[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Output vcard
|
||||
if ($mode == 'vcard') {
|
||||
@@ -220,7 +252,7 @@ $arrayofjs = array();
|
||||
$arrayofcss = array();
|
||||
|
||||
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
|
||||
llxHeader($head, $object->getFullName($langs).' - '.$langs->trans("PublicVirtualCard"), '', '', 0, 0, '', '', '', 'onlinepaymentbody'.(GETPOST('mode')=='preview' ? ' scalepreview cursorpointer virtualcardpreview' : ''), $replacemainarea, 1, 1);
|
||||
llxHeader($head, $object->getFullName($langs).' - '.$langs->trans("PublicVirtualCard"), '', '', 0, 0, $arrayofjs, $arrayofcss, '', 'onlinepaymentbody'.(GETPOST('mode') == 'preview' ? ' scalepreview cursorpointer virtualcardpreview' : ''), $replacemainarea, 1, 1);
|
||||
|
||||
print '
|
||||
<style>
|
||||
@@ -351,10 +383,10 @@ if (getDolUserInt('USER_PUBLIC_SHOW_ADDRESS', 0, $object) && $object->address) {
|
||||
|
||||
// Social networks
|
||||
if (!empty($object->socialnetworks) && is_array($object->socialnetworks)) {
|
||||
if (!getDolGlobalInt('USER_PUBLIC_HIDE_SOCIALNETWORKS')) {
|
||||
if (!getDolUserString('USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
|
||||
$listOfSocialNetworks = $object->socialnetworks;
|
||||
foreach ($listOfSocialNetworks as $key => $value) {
|
||||
if (getDolGlobalString('USER_SOCIALNETWORK_'.strtoupper($key))) {
|
||||
if (!getDolUserString('USER_HIDE_SOCIALNETWORK_'.strtoupper($key), 0, $object)) {
|
||||
$usersection .= '<div class="flexitemsmall">'.dol_print_socialnetworks($key, 0, $object->id, strtolower($key), $socialnetworksdict).'</div>';
|
||||
}
|
||||
}
|
||||
@@ -424,9 +456,9 @@ if (!getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
|
||||
|
||||
// Social networks
|
||||
if (!empty($mysoc->socialnetworks) && is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
|
||||
if (!getDolGlobalInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS', 0)) {
|
||||
if (!getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS', 0, $object)) {
|
||||
foreach ($mysoc->socialnetworks as $key => $value) {
|
||||
if (getDolGlobalString('SOCIETE_PUBLIC_SOCIALNETWORKS_'.strtoupper($key))) {
|
||||
if (!getDolUserInt('SOCIETE_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), 0, $object)) {
|
||||
$companysection .= '<div class="flexitemsmall wordbreak">'.dol_print_socialnetworks($value, 0, $mysoc->id, $key, $socialnetworksdict).'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,9 +608,9 @@ $reception = new Reception($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
|
||||
$title = $langs->trans('Receptions');
|
||||
$helpurl = 'EN:Module_Receptions|FR:Module_Receptions|ES:Módulo_Receptiones';
|
||||
llxHeader('', $langs->trans('ListOfReceptions'), $helpurl, '', 0, 0, '', '', '', 'bodyforlist mod-reception page-list');
|
||||
llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'bodyforlist mod-reception page-list');
|
||||
|
||||
$sql = "SELECT e.rowid, e.ref, e.ref_supplier, e.date_reception as date_reception, e.date_delivery as delivery_date, l.date_delivery as date_reception2, e.fk_statut as status, e.billed,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,";
|
||||
@@ -906,13 +906,13 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
print_barre_liste($langs->trans('ListOfReceptions'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dollyrevert', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dollyrevert', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
if ($massaction == 'createbills') {
|
||||
//var_dump($_REQUEST);
|
||||
print '<input type="hidden" name="massaction" value="confirm_createbills">';
|
||||
|
||||
print '<table class="noborder" width="100%" >';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr>';
|
||||
print '<td class="titlefieldmiddle">';
|
||||
print $langs->trans('DateInvoice');
|
||||
|
||||
@@ -1410,6 +1410,7 @@ class Thirdparties extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$account = new CompanyBankAccount($this->db);
|
||||
if ($account->fetch($obj->rowid)) {
|
||||
$accounts[] = $account;
|
||||
|
||||
@@ -407,6 +407,8 @@ class CompanyPaymentMode extends CommonObject
|
||||
|
||||
$result = $this->fetchCommon($id, $ref, $morewhere);
|
||||
|
||||
$this->iban_prefix = dolDecrypt($this->iban_prefix);
|
||||
|
||||
// For backward compatibility
|
||||
$this->iban = $this->iban_prefix;
|
||||
$this->date_modification = $this->tms;
|
||||
|
||||
@@ -3175,7 +3175,7 @@ class Societe extends CommonObject
|
||||
*/
|
||||
public function getTypeUrl($withpicto = 0, $option = '', $notooltip = 0, $tag = 'a')
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $langs;
|
||||
|
||||
$s = '';
|
||||
if (empty($option) || preg_match('/prospect/', $option)) {
|
||||
@@ -5294,7 +5294,7 @@ class Societe extends CommonObject
|
||||
$dbs->query('DELETE FROM '.MAIN_DB_PREFIX.'societe_commerciaux WHERE rowid = '.((int) $obj->rowid));
|
||||
}
|
||||
|
||||
// llx_societe_extrafields table must not be here because we don't care about the old thirdparty extrafields that are managed directly into mergeCompany.
|
||||
// The table llx_societe_extrafields must NOT be in this list because we don't care about the old thirdparty extrafields that are managed directly into mergeCompany.
|
||||
// Do not include llx_societe because it will be replaced later.
|
||||
$tables = array(
|
||||
'societe_account',
|
||||
@@ -5305,6 +5305,8 @@ class Societe extends CommonObject
|
||||
'societe_rib'
|
||||
);
|
||||
|
||||
// TODO When we merge societe_account, we may get 2 lines for the stripe account. Must fix this.
|
||||
|
||||
return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
|
||||
@@ -359,7 +359,7 @@ class SocieteAccount extends CommonObject
|
||||
$sql .= " AND sa.site = '".$this->db->escape($site)."' AND sa.status = ".((int) $status);
|
||||
$sql .= " AND sa.key_account IS NOT NULL AND sa.key_account <> ''";
|
||||
$sql .= " AND (sa.site_account = '' OR sa.site_account IS NULL OR sa.site_account = '".$this->db->escape($site_account)."')";
|
||||
$sql .= " ORDER BY sa.site_account DESC"; // To get the entry with a site_account defined in priority
|
||||
$sql .= " ORDER BY sa.site_account DESC, sa.rowid DESC"; // To get the entry with a site_account defined in priority
|
||||
|
||||
dol_syslog(get_class($this)."::getCustomerAccount Try to find the first system customer id for ".$site." of thirdparty id=".$id." (example: cus_.... for stripe)", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@@ -396,6 +396,7 @@ class SocieteAccount extends CommonObject
|
||||
$sql .= " AND sa.entity IN (".getEntity('societe').")";
|
||||
$sql .= " AND sa.site = '".$this->db->escape($site)."' AND sa.status = ".((int) $status);
|
||||
$sql .= " AND sa.fk_soc > 0";
|
||||
$sql .= " ORDER BY sa.site_account DESC, sa.rowid DESC"; // To get the entry with a site_account defined in priority
|
||||
|
||||
dol_syslog(get_class($this)."::getCustomerAccount Try to find the first thirdparty id for ".$site." for external id=".$id, LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@@ -666,16 +666,18 @@ if (empty($reshook)) {
|
||||
$db->begin();
|
||||
|
||||
if (empty($newcu)) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$db->escape($tmpsite_account)."') AND fk_soc = ".$object->id." AND status = ".((int) $tmpservicestatus)." AND entity = ".$conf->entity;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account";
|
||||
$sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$db->escape($tmpsite_account)."') AND fk_soc = ".((int) $object->id)." AND status = ".((int) $tmpservicestatus)." AND entity = ".$conf->entity;
|
||||
} else {
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX."societe_account";
|
||||
$sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$db->escape($tmpsite_account)."') AND fk_soc = ".((int) $object->id)." AND status = ".((int) $tmpservicestatus)." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
|
||||
$sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$db->escape($tmpsite_account)."') AND fk_soc = ".((int) $object->id)." AND status = ".((int) $tmpservicestatus)." AND entity = ".$conf->entity; // Keep the = here for entity. Only 1 record must be modified !
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$num = $db->num_rows($resql); // Note: $num is always 0 on an update and delete, it is defined for select only.
|
||||
if (!empty($newcu)) {
|
||||
if (empty($num)) {
|
||||
|
||||
if (!empty($newcu)) { // If we did a select
|
||||
if (empty($num)) { // and found nothing
|
||||
$societeaccount = new SocieteAccount($db);
|
||||
$societeaccount->fk_soc = $object->id;
|
||||
$societeaccount->login = '';
|
||||
@@ -733,7 +735,7 @@ if (empty($reshook)) {
|
||||
$db->begin();
|
||||
|
||||
if (empty($newsup)) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".$object->id." AND service = '".$db->escape($tmpservice)."' AND entity = ".$conf->entity;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".((int) $object->id)." AND service = '".$db->escape($tmpservice)."' AND entity = ".((int) $conf->entity);
|
||||
// TODO Add site and site_account on oauth_token table
|
||||
//$sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE site = 'stripe' AND (site_account IS NULL or site_account = '".$db->escape($site_account)."') AND fk_soc = ".((int) $object->id)." AND service = '".$db->escape($service)."' AND entity = ".$conf->entity;
|
||||
} else {
|
||||
|
||||
@@ -198,6 +198,7 @@ class Stripe extends CommonObject
|
||||
$sql .= " AND sa.site = 'stripe' AND sa.status = ".((int) $status);
|
||||
$sql .= " AND (sa.site_account IS NULL OR sa.site_account = '' OR sa.site_account = '".$this->db->escape($stripearrayofkeysbyenv[$status]['publishable_key'])."')";
|
||||
$sql .= " AND sa.key_account IS NOT NULL AND sa.key_account <> ''";
|
||||
$sql .= " ORDER BY sa.site_account DESC, sa.rowid DESC"; // To get the entry with a site_account defined in priority
|
||||
|
||||
dol_syslog(get_class($this)."::customerStripe search stripe customer id for thirdparty id=".$object->id, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -1097,6 +1098,7 @@ class Stripe extends CommonObject
|
||||
$sepa = $s->paymentMethods->create($dataforcard);
|
||||
if (!$sepa) {
|
||||
$this->error = 'Creation of payment method sepa_debit on Stripe has failed';
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
} else {
|
||||
// link customer and src
|
||||
//$cs = $this->getSetupIntent($description, $soc, $cu, '', $status);
|
||||
@@ -1109,6 +1111,7 @@ class Stripe extends CommonObject
|
||||
|
||||
if (!$cs) {
|
||||
$this->error = 'Link SEPA <-> Customer failed';
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
} else {
|
||||
dol_syslog("Update the payment mode of the customer");
|
||||
|
||||
@@ -1188,6 +1191,7 @@ class Stripe extends CommonObject
|
||||
$sql .= " WHERE sa.key_account = '".$this->db->escape($customer)."'";
|
||||
//$sql.= " AND sa.entity IN (".getEntity('societe').")";
|
||||
$sql .= " AND sa.site = 'stripe' AND sa.status = ".((int) $status);
|
||||
$sql .= " ORDER BY sa.site_account DESC, sa.rowid DESC"; // To get the entry with a site_account defined in priority
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@@ -137,10 +137,13 @@ if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) {
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print $langs->trans("OrderPrinters").' (<a href="'.DOL_URL_ROOT.'/takepos/admin/orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
|
||||
print $langs->trans("OrderPrinters");
|
||||
print '</td>';
|
||||
print '<td class="">';
|
||||
print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0);
|
||||
if (getDolGlobalString('TAKEPOS_ORDER_PRINTERS')) {
|
||||
print' <a href="'.DOL_URL_ROOT.'/takepos/admin/orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if (getDolGlobalString('TAKEPOS_ORDER_PRINTERS')) {
|
||||
@@ -179,9 +182,9 @@ if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("SupplementCategory");
|
||||
print '</td>';
|
||||
print '<td class="">';
|
||||
print '<td class="nowrap">';
|
||||
print img_picto('', 'category', 'class="pictofixedwidth"');
|
||||
print $form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalString('TAKEPOS_SUPPLEMENTS_CATEGORY'), 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
|
||||
print $form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalString('TAKEPOS_SUPPLEMENTS_CATEGORY'), 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0, 0, 'minwidth 200 maxwidth500 widthcentpercentminusx');
|
||||
print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY');
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ print "</tr>\n";
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("NumberOfTerminals");
|
||||
print '<td>';
|
||||
print '<input type="number" name="TAKEPOS_NUM_TERMINALS" min="1" value="' . (!getDolGlobalString('TAKEPOS_NUM_TERMINALS') ? '1' : $conf->global->TAKEPOS_NUM_TERMINALS) . '">';
|
||||
print '<input type="number" name="TAKEPOS_NUM_TERMINALS" min="1" class="width50" value="' . getDolGlobalString('TAKEPOS_NUM_TERMINALS', '1') . '">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Services
|
||||
|
||||
@@ -59,7 +59,7 @@ $action = GETPOST('action', 'aZ09');
|
||||
$left = GETPOST('left', 'alpha');
|
||||
$top = GETPOST('top', 'alpha');
|
||||
|
||||
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
|
||||
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant
|
||||
|
||||
$newname = GETPOST('newname', 'alpha');
|
||||
$mode = GETPOST('mode', 'alpha');
|
||||
@@ -74,15 +74,22 @@ if (!$user->hasRight('takepos', 'run')) {
|
||||
*/
|
||||
|
||||
if ($action == "getTables" && $user->hasRight('takepos', 'run')) {
|
||||
$sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables WHERE floor = ".((int) $floor)." AND entity IN (".getEntity('takepos').")";
|
||||
$resql = $db->query($sql);
|
||||
$rows = array();
|
||||
|
||||
$sql = "SELECT rowid, entity, label, leftpos, toppos, floor";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."takepos_floor_tables";
|
||||
$sql .= " WHERE floor = ".((int) $floor)." AND entity IN (".getEntity('takepos').")";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
while ($row = $db->fetch_array($resql)) {
|
||||
$tmpplace = (int) $row['rowid'];
|
||||
|
||||
$invoice = new Facture($db);
|
||||
$result = $invoice->fetch('', '(PROV-POS'.$_SESSION['takeposterminal'].'-'.$row['rowid'].')');
|
||||
$result = $invoice->fetch('', '(PROV-POS'.$_SESSION['takeposterminal'].'-'.$tmpplace.')');
|
||||
if ($result > 0) {
|
||||
$row['occupied'] = "red";
|
||||
}
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ if (empty($reshook)) {
|
||||
|
||||
$conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock during invoice validation
|
||||
|
||||
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
|
||||
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
|
||||
dol_syslog("Validate invoice with stock change. Warehouse defined into constant ".$constantforkey." = ".getDolGlobalString($constantforkey));
|
||||
|
||||
// Validate invoice with stock change into warehouse getDolGlobalInt($constantforkey)
|
||||
@@ -624,7 +624,9 @@ if (empty($reshook)) {
|
||||
if ($placeid < 0) {
|
||||
dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid = ".((int) $placeid);
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture";
|
||||
$sql .= " SET ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
||||
$sql .= " WHERE rowid = ".((int) $placeid);
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
@@ -797,7 +799,7 @@ if (empty($reshook)) {
|
||||
$line = array('description' => $prod->description, 'price' => $price, 'tva_tx' => $tva_tx, 'localtax1_tx' => $localtax1_tx, 'localtax2_tx' => $localtax2_tx, 'remise_percent' => $customer->remise_percent, 'price_ttc' => $price_ttc, 'array_options' => $array_options);
|
||||
|
||||
/* setup of margin calculation */
|
||||
if (isset($conf->global->MARGIN_TYPE)) {
|
||||
if (getDolGlobalString('MARGIN_TYPE')) {
|
||||
if (getDolGlobalString('MARGIN_TYPE') == 'pmp' && !empty($prod->pmp)) {
|
||||
$line['fk_fournprice'] = null;
|
||||
$line['pa_ht'] = $prod->pmp;
|
||||
@@ -898,7 +900,7 @@ if (empty($reshook)) {
|
||||
if ($invoice->status == $invoice::STATUS_DRAFT && $invoice->pos_source && $invoice->module_source == 'takepos') {
|
||||
$permissiontoupdateline = true;
|
||||
// TODO Add also a test on $_SESSION('publicobjectid'] defined at creation of object
|
||||
// TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the invoice ID
|
||||
// TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the table ID
|
||||
}
|
||||
}*/
|
||||
|
||||
@@ -928,11 +930,12 @@ if (empty($reshook)) {
|
||||
|
||||
// Action to delete or discard an invoice
|
||||
if ($action == "delete" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
|
||||
// $placeid is the invoice id (it differs from place) and is defined if the place is set and the ref of invoice is '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')', so the fetch at beginning of page works.
|
||||
// $placeid is the invoice id (it differs from place) and is defined if the place is set and
|
||||
// the ref of invoice is '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')', so the fetch at beginning of page works.
|
||||
if ($placeid > 0) {
|
||||
$result = $invoice->fetch($placeid);
|
||||
|
||||
if ($result > 0 && $invoice->statut == Facture::STATUS_DRAFT) {
|
||||
if ($result > 0 && $invoice->status == Facture::STATUS_DRAFT) {
|
||||
$db->begin();
|
||||
|
||||
// We delete the lines
|
||||
@@ -973,7 +976,7 @@ if (empty($reshook)) {
|
||||
if ($invoice->status == $invoice::STATUS_DRAFT && $invoice->pos_source && $invoice->module_source == 'takepos') {
|
||||
$permissiontoupdateline = true;
|
||||
// TODO Add also a test on $_SESSION('publicobjectid'] defined at creation of object
|
||||
// TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the invoice ID
|
||||
// TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the table ID
|
||||
}
|
||||
}
|
||||
if (!$permissiontoupdateline) {
|
||||
@@ -1023,7 +1026,7 @@ if (empty($reshook)) {
|
||||
if ($invoice->status == $invoice::STATUS_DRAFT && $invoice->pos_source && $invoice->module_source == 'takepos') {
|
||||
$permissiontoupdateline = true;
|
||||
// TODO Add also a test on $_SESSION('publicobjectid'] defined at creation of object
|
||||
// TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the invoice ID
|
||||
// TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the table ID
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1074,7 +1077,7 @@ if (empty($reshook)) {
|
||||
if ($invoice->status == $invoice::STATUS_DRAFT && $invoice->pos_source && $invoice->module_source == 'takepos') {
|
||||
$permissiontoupdateline = true;
|
||||
// TODO Add also a test on $_SESSION('publicobjectid'] defined at creation of object
|
||||
// TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the invoice ID
|
||||
// TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the table ID
|
||||
}
|
||||
}
|
||||
if (!$permissiontoupdateline) {
|
||||
@@ -1256,7 +1259,7 @@ if (empty($reshook)) {
|
||||
if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) {
|
||||
$sectionwithinvoicelink .= ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>';
|
||||
} elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
|
||||
if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
|
||||
if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
|
||||
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposConnector('.$placeid.')">'.$langs->trans('PrintTicket').'</button>';
|
||||
} else {
|
||||
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposPrinting('.$placeid.')">'.$langs->trans('PrintTicket').'</button>';
|
||||
@@ -1354,11 +1357,11 @@ $(document).ready(function() {
|
||||
<?php
|
||||
|
||||
if ($action == "order" && !empty($order_receipt_printer1)) {
|
||||
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
|
||||
if (filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
|
||||
?>
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php',
|
||||
url: '<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>/printer/index.php',
|
||||
data: 'invoice='+orderprinter1esc
|
||||
});
|
||||
<?php
|
||||
@@ -1366,7 +1369,7 @@ if ($action == "order" && !empty($order_receipt_printer1)) {
|
||||
?>
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: 'http://<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>:8111/print',
|
||||
url: 'http://<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>:8111/print',
|
||||
data: '<?php
|
||||
print $headerorder.$order_receipt_printer1.$footerorder; ?>'
|
||||
});
|
||||
@@ -1375,11 +1378,11 @@ if ($action == "order" && !empty($order_receipt_printer1)) {
|
||||
}
|
||||
|
||||
if ($action == "order" && !empty($order_receipt_printer2)) {
|
||||
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
|
||||
if (filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
|
||||
?>
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php?printer=2',
|
||||
url: '<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>/printer/index.php?printer=2',
|
||||
data: 'invoice='+orderprinter2esc
|
||||
});
|
||||
<?php
|
||||
@@ -1387,7 +1390,7 @@ if ($action == "order" && !empty($order_receipt_printer2)) {
|
||||
?>
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: 'http://<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>:8111/print2',
|
||||
url: 'http://<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>:8111/print2',
|
||||
data: '<?php
|
||||
print $headerorder.$order_receipt_printer2.$footerorder; ?>'
|
||||
});
|
||||
@@ -1396,11 +1399,11 @@ if ($action == "order" && !empty($order_receipt_printer2)) {
|
||||
}
|
||||
|
||||
if ($action == "order" && !empty($order_receipt_printer3)) {
|
||||
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
|
||||
if (filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
|
||||
?>
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php?printer=3',
|
||||
url: '<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>/printer/index.php?printer=3',
|
||||
data: 'invoice='+orderprinter3esc
|
||||
});
|
||||
<?php
|
||||
@@ -1419,7 +1422,7 @@ if ($action == "temp" && !empty($ticket_printer1)) {
|
||||
?>
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: 'http://<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>:8111/print',
|
||||
url: 'http://<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>:8111/print',
|
||||
data: '<?php
|
||||
print $header_soc.$header_ticket.$body_ticket.$ticket_printer1.$ticket_total.$footer_ticket; ?>'
|
||||
});
|
||||
@@ -1981,7 +1984,7 @@ if ($placeid > 0) {
|
||||
if ($line->product_label && $line->desc) {
|
||||
$htmlforlines .= '<br>';
|
||||
}
|
||||
$firstline = dolGetFirstLineOfText($line->desc, $conf->global->TAKEPOS_SHOW_N_FIRST_LINES);
|
||||
$firstline = dolGetFirstLineOfText($line->desc, getDolGlobalInt('TAKEPOS_SHOW_N_FIRST_LINES'));
|
||||
if ($firstline != $line->desc) {
|
||||
$htmlforlines .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc);
|
||||
} else {
|
||||
|
||||
@@ -187,7 +187,7 @@ if ($usestripeterminals && $invoice->type != $invoice::TYPE_CREDIT_NOTE) {
|
||||
if (!getDolGlobalString($keyforstripeterminalbank)) { ?>
|
||||
const config = {
|
||||
simulated: <?php if (empty($servicestatus) && getDolGlobalString('STRIPE_TERMINAL_SIMULATED')) { ?> true <?php } else { ?> false <?php } ?>
|
||||
<?php if (getDolGlobalString('STRIPE_LOCATION')) { ?>, location: '<?php echo $conf->global->STRIPE_LOCATION; ?>'<?php } ?>
|
||||
<?php if (getDolGlobalString('STRIPE_LOCATION')) { ?>, location: '<?php echo dol_escape_js(getDolGlobalString('STRIPE_LOCATION')); ?>'<?php } ?>
|
||||
}
|
||||
terminal.discoverReaders(config).then(function(discoverResult) {
|
||||
if (discoverResult.error) {
|
||||
@@ -233,8 +233,8 @@ if ($usestripeterminals && $invoice->type != $invoice::TYPE_CREDIT_NOTE) {
|
||||
</script>
|
||||
<?php
|
||||
|
||||
// Define list of possible payments
|
||||
$arrayOfValidPaymentModes = array();
|
||||
// Define list of possible payments
|
||||
$arrayOfValidPaymentModes = array();
|
||||
$arrayOfValidBankAccount = array();
|
||||
|
||||
$sql = "SELECT code, libelle as label FROM ".MAIN_DB_PREFIX."c_paiement";
|
||||
@@ -301,10 +301,10 @@ if (!getDolGlobalInt("TAKEPOS_NUMPAD")) {
|
||||
$('.change1').val(parseFloat(received));
|
||||
alreadypaydplusreceived=price2numjs(alreadypayed + parseFloat(received));
|
||||
//console.log("already+received = "+alreadypaydplusreceived);
|
||||
//console.log("total_ttc = "+<?php echo $invoice->total_ttc; ?>);
|
||||
if (alreadypaydplusreceived > <?php echo $invoice->total_ttc; ?>)
|
||||
//console.log("total_ttc = "+<?php echo (float) $invoice->total_ttc; ?>);
|
||||
if (alreadypaydplusreceived > <?php echo (float) $invoice->total_ttc; ?>)
|
||||
{
|
||||
var change=parseFloat(alreadypayed + parseFloat(received) - <?php echo $invoice->total_ttc; ?>);
|
||||
var change=parseFloat(alreadypayed + parseFloat(received) - <?php echo (float) $invoice->total_ttc; ?>);
|
||||
$('.change2').html(pricejs(change, 'MT'));
|
||||
$('.change2').val(change);
|
||||
$('.change1').removeClass('colorred');
|
||||
@@ -439,7 +439,7 @@ if (!getDolGlobalInt("TAKEPOS_NUMPAD")) {
|
||||
|
||||
fetchPaymentIntentClientSecret(amountpayed, invoiceid).then(function(client_secret) {
|
||||
<?php if (empty($servicestatus) && getDolGlobalString('STRIPE_TERMINAL_SIMULATED')) { ?>
|
||||
terminal.setSimulatorConfiguration({testCardNumber: '<?php echo $conf->global->STRIPE_TERMINAL_SIMULATED; ?>'});
|
||||
terminal.setSimulatorConfiguration({testCardNumber: '<?php echo dol_escape_js(getDolGlobalString('STRIPE_TERMINAL_SIMULATED')); ?>'});
|
||||
<?php } ?>
|
||||
document.getElementById("card-present-alert").innerHTML = '<div class="warning clearboth"><?php echo $langs->trans('PaymentSendToStripeTerminal'); ?></div>';
|
||||
terminal.collectPaymentMethod(client_secret).then(function(result) {
|
||||
|
||||
@@ -78,8 +78,11 @@ if (!$user->hasRight('takepos', 'run')) {
|
||||
|
||||
top_htmlhead('', '', 1);
|
||||
|
||||
if ($place > 0) {
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'";
|
||||
if ((string) $place != '') {
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql .= " WHERE ref = '(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'";
|
||||
$sql .= " AND entity IN (".getEntity('invoice').")";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
|
||||
@@ -69,7 +69,10 @@ $invoice = new Facture($db);
|
||||
if ($invoiceid > 0) {
|
||||
$invoice->fetch($invoiceid);
|
||||
} else {
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql .= " WHERE ref = '(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
||||
$sql .= " AND entity IN (".getEntity('invoice').")";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
|
||||
@@ -62,7 +62,7 @@ if (!$user->hasRight('takepos', 'run')) {
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action=="split" && $user->hasRight('takepos', 'run')) {
|
||||
if ($action == "split" && $user->hasRight('takepos', 'run')) {
|
||||
$line = GETPOSTINT('line');
|
||||
$split = GETPOSTINT('split');
|
||||
if ($split==1) { // Split line
|
||||
@@ -85,16 +85,17 @@ if ($action=="split" && $user->hasRight('takepos', 'run')) {
|
||||
if ($placeid < 0) {
|
||||
dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-SPLIT)' where rowid=".$placeid;
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture SET ref='(PROV-POS".$_SESSION["takeposterminal"]."-SPLIT)'";
|
||||
$sql .= " WHERE rowid = ".((int) $placeid);
|
||||
$db->query($sql);
|
||||
}
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set fk_facture=".$placeid." where rowid=".$line;
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET fk_facture = ".((int) $placeid)." WHERE rowid = ".((int) $line);
|
||||
$db->query($sql);
|
||||
} elseif ($split==0) { // Unsplit line
|
||||
$invoice = new Facture($db);
|
||||
if ($place=="SPLIT") {
|
||||
$place="0";
|
||||
if ($place == "SPLIT") {
|
||||
$place = "0";
|
||||
} // Avoid move line to the same place (from SPLIT to SPLIT place)
|
||||
$ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')');
|
||||
if ($ret > 0) {
|
||||
@@ -114,7 +115,9 @@ if ($action=="split" && $user->hasRight('takepos', 'run')) {
|
||||
if ($placeid < 0) {
|
||||
dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid;
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture SET ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
||||
$sql .= " WHERE rowid = ".((int) $placeid);
|
||||
$db->query($sql);
|
||||
}
|
||||
}
|
||||
@@ -123,6 +126,7 @@ if ($action=="split" && $user->hasRight('takepos', 'run')) {
|
||||
}
|
||||
$invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-SPLIT)');
|
||||
$invoice->update_price();
|
||||
|
||||
$invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')');
|
||||
$invoice->update_price();
|
||||
}
|
||||
|
||||
@@ -5363,7 +5363,7 @@ img.boxhandle, img.boxclose {
|
||||
.add-filter-btn {
|
||||
margin: 0 !important;
|
||||
}
|
||||
.search-component-assistance .operand, .operator, .value {
|
||||
.search-component-assistance .operand, .search-component-assistance .operator, .search-component-assistance .value {
|
||||
display: contents;
|
||||
}
|
||||
.search-component-assistance .btn-div{
|
||||
@@ -5410,7 +5410,8 @@ div.info {
|
||||
color: #558;
|
||||
}
|
||||
div.fiche div.info {
|
||||
box-shadow: 4px 4px 12px #ddd;
|
||||
box-shadow: 4px 4px 12px #e4e4e4;
|
||||
margin: 1em 0em 1.2em 0em;
|
||||
}
|
||||
|
||||
/* Warning message */
|
||||
@@ -8700,7 +8701,11 @@ table.jPicker {
|
||||
.side-nav {
|
||||
z-index: 200;
|
||||
background: var(--colorbackvmenu1);
|
||||
padding-top: 70px;
|
||||
/* padding-top: 70px; */
|
||||
position: relative;
|
||||
top: 70px;
|
||||
width: 245px; /* must be same than div.login_block */
|
||||
box-shadow: none;
|
||||
}
|
||||
#id-left {
|
||||
z-index: 201;
|
||||
|
||||
@@ -5352,7 +5352,7 @@ img.boxhandle, img.boxclose {
|
||||
.add-filter-btn {
|
||||
margin: 0 !important;
|
||||
}
|
||||
.search-component-assistance .operand, .operator, .value {
|
||||
.search-component-assistance .operand, .search-component-assistance .operator, .search-component-assistance .value {
|
||||
display: contents;
|
||||
}
|
||||
.search-component-assistance .btn-div{
|
||||
@@ -5395,9 +5395,11 @@ div.info, div.warning, div.error {
|
||||
div.info {
|
||||
border-<?php print $left; ?>: solid 5px #87cfd2;
|
||||
background: #eff8fc;
|
||||
color: #558;
|
||||
}
|
||||
div.fiche div.info {
|
||||
box-shadow: 4px 4px 12px #ddd;
|
||||
box-shadow: 4px 4px 12px #e4e4e4;
|
||||
margin: 1em 0em 1.2em 0em;
|
||||
}
|
||||
|
||||
/* Warning message */
|
||||
|
||||
@@ -223,7 +223,7 @@ class UserBankAccount extends Account
|
||||
$this->number = $obj->number;
|
||||
$this->cle_rib = $obj->cle_rib;
|
||||
$this->bic = $obj->bic;
|
||||
$this->iban = $obj->iban;
|
||||
$this->iban = dolDecrypt($obj->iban);
|
||||
$this->courant = self::TYPE_CURRENT;
|
||||
$this->type = self::TYPE_CURRENT;
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ if (!getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
|
||||
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
$enabledisablehtml .= '</a>';
|
||||
|
||||
$enabledisablehtml .= '<br><br><span class="opacitymedium">'.$langs->trans("UserPublicPageDesc").'</span><br><br>';
|
||||
$enabledisablehtml .= '<br><br><div class="opacitymedium justify">'.$langs->trans("UserPublicPageDesc").'</div>';
|
||||
} else {
|
||||
// Button on, click to disable
|
||||
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setUSER_ENABLE_PUBLIC&token='.newToken().'&value=0'.$param.'">';
|
||||
@@ -139,13 +139,14 @@ if (!getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
|
||||
$enabledisablehtml .= '</a>';
|
||||
}
|
||||
print $enabledisablehtml;
|
||||
print '<input type="hidden" id="USER_ENABLE_PUBLIC" name="USER_ENABLE_PUBLIC" value="'.(getDolGlobalString('USER_ENABLE_PUBLIC') ? 1 : 0).'">';
|
||||
print '<input type="hidden" id="USER_ENABLE_PUBLIC" name="USER_ENABLE_PUBLIC" value="'.(getDolUserInt('USER_ENABLE_PUBLIC') ? 1 : 0).'">';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
|
||||
print '<br><br>';
|
||||
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@@ -216,60 +217,59 @@ if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("Photo"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_PHOTO", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_PHOTO", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Job position
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("PostOrFunction"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_JOBPOSITION", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_JOBPOSITION", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Email
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("Email"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_EMAIL", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_EMAIL", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Office phone
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("PhonePro"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_OFFICE_PHONE", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_OFFICE_PHONE", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Office fax
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("Fax"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_OFFICE_FAX", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_OFFICE_FAX", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// User mobile
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("PhoneMobile"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_USER_MOBILE", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_USER_MOBILE", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Social networks
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("SocialNetworksInformation"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_SOCIALNETWORKS", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_SOCIALNETWORKS", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Show list of socialnetworks for user
|
||||
if ($showUserSocialNetworks) {
|
||||
$socialnetworks = $object->socialnetworks;
|
||||
|
||||
if (!empty($socialnetworks)) {
|
||||
foreach ($socialnetworks as $key => $networkVal) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td> '.$langs->trans("Hide").' '.dol_escape_htmltag($key).'</td><td>';
|
||||
print ajax_constantonoff('USER_SOCIALNETWORK_'.strtoupper($key), array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff('USER_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
}
|
||||
@@ -280,14 +280,14 @@ if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("ShowOnVCard", $langs->transnoentitiesnoconv("Birthdate"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_SHOW_BIRTH", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_SHOW_BIRTH", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Address
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("ShowOnVCard", $langs->transnoentitiesnoconv("Address"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_SHOW_ADDRESS", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_SHOW_ADDRESS", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@@ -299,18 +299,46 @@ if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
|
||||
print '<tr class="oddeven" id="tramount"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("CompanySection"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_COMPANY", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_COMPANY", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
if (!getDolUserString('USER_PUBLIC_HIDE_COMPANY', '', $object)) {
|
||||
// Email
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("Email"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("SOCIETE_PUBLIC_HIDE_EMAIL", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// URL
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("URL"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("SOCIETE_PUBLIC_HIDE_URL", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Office phone
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("Phone"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("SOCIETE_PUBLIC_HIDE_OFFICE_PHONE", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Office fax
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("Fax"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("SOCIETE_PUBLIC_HIDE_OFFICE_FAX", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Social networks
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("HideOnVCard", $langs->transnoentitiesnoconv("SocialNetworksInformation"));
|
||||
print '</td><td>';
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff("USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS", array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// show list of social networks for company
|
||||
// Show list of social networks for company
|
||||
if ($showSocieteSocialNetworks) {
|
||||
$listofnetworks = $mysoc->socialnetworks;
|
||||
|
||||
@@ -318,7 +346,7 @@ if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
|
||||
foreach ($listofnetworks as $key => $networkVal) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td> '.$langs->trans("Hide").' '.dol_escape_htmltag($key).'</td><td>';
|
||||
print ajax_constantonoff('SOCIETE_PUBLIC_SOCIALNETWORKS_'.strtoupper($key), array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object->id);
|
||||
print ajax_constantonoff('SOCIETE_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), array(), null, 0, 0, 1, 2, 0, 0, '', '', 'reposition', $object);
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
|
||||
@@ -44,6 +45,14 @@ require_once DOL_DOCUMENT_ROOT."/contact/class/contact.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
// Global variables
|
||||
$version = DOL_VERSION;
|
||||
$error = 0;
|
||||
|
||||
@@ -57,6 +57,13 @@ $targettype = $argv[2];
|
||||
require $path."../../htdocs/master.inc.php";
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functionscli.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
$langs->loadLangs(array('main', 'contracts'));
|
||||
|
||||
|
||||
@@ -55,6 +55,13 @@ $mode = $argv[1];
|
||||
require $path."../../htdocs/master.inc.php";
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functionscli.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
$langs->loadLangs(array('main', 'contracts'));
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ if (is_array($object->lines) && (count($object->lines) > 0)) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
echo "Job re-scheduled\n";
|
||||
echo " - Job re-scheduled\n";
|
||||
|
||||
$parameters = array('cronjob' => $cronjob, 'line' => $line);
|
||||
$reshook = $hookmanager->executeHooks('afterRunCronJob', $parameters, $object);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Jean Heimburger <http://tiaris.eu>
|
||||
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Jean Heimburger <http://tiaris.eu>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
|
||||
@@ -46,6 +47,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functionscli.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/images.lib.php";
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
|
||||
// $user is created but empty.
|
||||
|
||||
|
||||
@@ -66,7 +66,13 @@ require_once $path."../../htdocs/master.inc.php";
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functionscli.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php";
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
// Global variables
|
||||
$version = DOL_VERSION;
|
||||
$error = 0;
|
||||
|
||||
@@ -208,11 +208,11 @@ class FunctionsLibTest extends CommonClassTest
|
||||
}
|
||||
|
||||
/**
|
||||
* testDolForgeCriteriaCallback
|
||||
* testDolForgeSQLCriteriaCallback
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function testDolForgeCriteriaCallback()
|
||||
public function testDolForgeSQLCriteriaCallback()
|
||||
{
|
||||
global $conf, $langs, $db;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user