*
* 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
@@ -68,9 +69,11 @@ $search_phone_pro=GETPOST("search_phone_pro", 'alpha');
$search_phone_mobile=GETPOST("search_phone_mobile", 'alpha');
$search_fax=GETPOST("search_fax", 'alpha');
$search_email=GETPOST("search_email", 'alpha');
+$search_no_email=GETPOST("search_no_email", 'int');
$search_skype=GETPOST("search_skype", 'alpha');
$search_twitter=GETPOST("search_twitter", 'alpha');
$search_facebook=GETPOST("search_facebook", 'alpha');
+$search_linkedin=GETPOST("search_linkedin", 'alpha');
$search_priv=GETPOST("search_priv", 'alpha');
$search_categ=GETPOST("search_categ", 'int');
$search_categ_thirdparty=GETPOST("search_categ_thirdparty", 'int');
@@ -159,10 +162,12 @@ $arrayfields=array(
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1),
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
'p.email'=>array('label'=>"EMail", 'checked'=>1),
+ 'p.no_email'=>array('label'=>"No_Email", 'checked'=>0, 'enabled'=>(! empty($conf->mailing->enabled))),
'p.jabberid'=>array('label'=>"Jabber", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
'p.twitter'=>array('label'=>"Twitter", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
'p.facebook'=>array('label'=>"Facebook", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
+ 'p.linkedin'=>array('label'=>"LinkedIn", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200),
'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500),
@@ -222,9 +227,11 @@ if (empty($reshook))
$search_phone_mobile="";
$search_fax="";
$search_email="";
+ $search_no_email=-1;
$search_skype="";
$search_twitter="";
$search_facebook="";
+ $search_linkedin="";
$search_priv="";
$search_status=-1;
$search_categ='';
@@ -258,7 +265,7 @@ $contactstatic=new Contact($db);
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
$sql = "SELECT s.rowid as socid, s.nom as name,";
-$sql.= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.skype,";
+$sql.= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.no_email, p.skype,";
$sql.= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,";
$sql.= " co.code as country_code";
// Add fields from extrafields
@@ -321,10 +328,12 @@ if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);
if (strlen($search_twitter)) $sql.= natural_search('p.twitter', $search_twitter);
if (strlen($search_facebook)) $sql.= natural_search('p.facebook', $search_facebook);
+if (strlen($search_linkedin)) $sql.= natural_search('p.linkedin', $search_linkedin);
if (strlen($search_email)) $sql.= natural_search('p.email', $search_email);
if (strlen($search_zip)) $sql.= natural_search("p.zip", $search_zip);
if (strlen($search_town)) $sql.= natural_search("p.town", $search_town);
+if ($search_no_email != '' && $search_no_email >= 0) $sql.= " AND p.no_email = ".$db->escape($search_no_email);
if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status);
if ($search_import_key) $sql.= natural_search("p.import_key", $search_import_key);
if ($type == "o") // filtre sur type
@@ -422,6 +431,7 @@ if ($search_phone_perso != '') $param.='&search_phone_perso='.urlencode($sea
if ($search_phone_mobile != '') $param.='&search_phone_mobile='.urlencode($search_phone_mobile);
if ($search_fax != '') $param.='&search_fax='.urlencode($search_fax);
if ($search_email != '') $param.='&search_email='.urlencode($search_email);
+if ($search_no_email != '') $param.='&search_no_email='.urlencode($search_no_email);
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv);
if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key);
@@ -607,6 +617,12 @@ if (! empty($arrayfields['p.email']['checked']))
print ' ';
print '';
}
+if (! empty($arrayfields['p.no_email']['checked']))
+{
+ print '';
+ print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email);
+ print ' ';
+}
if (! empty($arrayfields['p.skype']['checked']))
{
print '';
@@ -625,6 +641,12 @@ if (! empty($arrayfields['p.facebook']['checked']))
print ' ';
print ' ';
}
+if (! empty($arrayfields['p.linkedin']['checked']))
+{
+ print '';
+ print ' ';
+ print ' ';
+}
if (! empty($arrayfields['p.thirdparty']['checked']))
{
print '';
@@ -696,9 +718,11 @@ if (! empty($arrayfields['p.phone_perso']['checked'])) print_liste_field
if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['p.phone_mobile']['label'], $_SERVER["PHP_SELF"], "p.phone_mobile", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.fax']['checked'])) print_liste_field_titre($arrayfields['p.fax']['label'], $_SERVER["PHP_SELF"], "p.fax", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.email']['checked'])) print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder);
+if (! empty($arrayfields['p.no_email']['checked'])) print_liste_field_titre($arrayfields['p.no_email']['label'],$_SERVER["PHP_SELF"], "p.no_email", $begin, $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['p.skype']['checked'])) print_liste_field_titre($arrayfields['p.skype']['label'], $_SERVER["PHP_SELF"], "p.skype", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.twitter']['checked'])) print_liste_field_titre($arrayfields['p.twitter']['label'], $_SERVER["PHP_SELF"], "p.twitter", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.facebook']['checked'])) print_liste_field_titre($arrayfields['p.facebook']['label'], $_SERVER["PHP_SELF"], "p.facebook", $begin, $param, '', $sortfield, $sortorder);
+if (! empty($arrayfields['p.linkedin']['checked'])) print_liste_field_titre($arrayfields['p.linkedin']['label'], $_SERVER["PHP_SELF"], "p.linkedin", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.thirdparty']['checked'])) print_liste_field_titre($arrayfields['p.thirdparty']['label'], $_SERVER["PHP_SELF"], "s.nom", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.priv']['checked'])) print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, '', $sortfield, $sortorder, 'center ');
// Extra fields
@@ -839,7 +863,12 @@ while ($i < min($num, $limit))
print ' '.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18).' ';
if (! $i) $totalarray['nbfield']++;
}
-
+ // No EMail
+ if (! empty($arrayfields['p.no_email']['checked']))
+ {
+ print ''.yn($obj->no_email).' ';
+ if (! $i) $totalarray['nbfield']++;
+ }
// Skype
if (! empty($arrayfields['p.skype']['checked']))
{
@@ -859,12 +888,18 @@ while ($i < min($num, $limit))
if (! $i) $totalarray['nbfield']++;
}
// Facebook
- if (! empty($arrayfields['p.facebook']['checked']))
- {
- if (! empty($conf->socialnetworks->enabled)) { print ''.dol_print_socialnetworks($obj->facebook, $obj->rowid, $obj->socid, 'facebook').' '; }
- if (! $i) $totalarray['nbfield']++;
- }
- // Company
+ if (! empty($arrayfields['p.facebook']['checked']))
+ {
+ if (! empty($conf->socialnetworks->enabled)) { print ''.dol_print_socialnetworks($obj->facebook, $obj->rowid, $obj->socid, 'facebook').' '; }
+ if (! $i) $totalarray['nbfield']++;
+ }
+ // LinkedIn
+ if (! empty($arrayfields['p.linkedin']['checked']))
+ {
+ if (! empty($conf->socialnetworks->enabled)) { print ''.dol_print_socialnetworks($obj->linkedin, $obj->rowid, $obj->socid, 'linkedin').' '; }
+ if (! $i) $totalarray['nbfield']++;
+ }
+ // Company
if (! empty($arrayfields['p.thirdparty']['checked']))
{
print '';
diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php
index f08586ba9b0..f03915b7b2a 100644
--- a/htdocs/core/boxes/box_project.php
+++ b/htdocs/core/boxes/box_project.php
@@ -89,21 +89,17 @@ class box_project extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$projectstatic = new Project($this->db);
- $socid=$user->societe_id;
+ $socid=0;
+ //if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
- // Get list of project id allowed to user (in a string list separated by coma)
+ // Get list of project id allowed to user (in a string list separated by coma)
$projectsListId='';
if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
- if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc";
- $sql.= " WHERE p.entity IN (".getEntity('project').')';
- if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
- if ($user->socid) $sql.= " AND s.rowid = ".$user->socid;
- $sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
- if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
- if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
+ $sql.= " WHERE p.fk_statut = 1"; // Only open projects
+ if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
$sql.= " ORDER BY p.datec DESC";
//$sql.= $db->plimit($max, 0);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index b5a166e764b..69d0c49e6e7 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -672,6 +672,8 @@ abstract class CommonObject
$outdone++;
if ($this->facebook) $out.=dol_print_socialnetworks($this->facebook, $this->id, $object->id, 'facebook');
$outdone++;
+ if ($this->linkedin) $out.=dol_print_socialnetworks($this->linkedin, $this->id, $object->id, 'linkedin');
+ $outdone++;
}
$out.='';
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 0ef7f8d295b..c23f40a0283 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -148,7 +148,7 @@ class ExtraFields
public $errors = array();
/**
- * @var integer DB Error number
+ * @var string DB Error number
*/
public $errno;
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 6eac9761b48..12a1604d84d 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -4755,7 +4755,7 @@ class Form
$out='';
$out.= '';
- if ($useempty) $out .= ' ';
+ if ($useempty) $out .= ' ';
// If company current currency not in table, we add it into list. Should always be available.
if (! in_array($conf->currency, $TCurrency))
{
diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php
index 028e6569378..a5b0a574c35 100644
--- a/htdocs/core/class/html.formaccounting.class.php
+++ b/htdocs/core/class/html.formaccounting.class.php
@@ -89,7 +89,7 @@ class FormAccounting extends Form
$sql.= " FROM " . MAIN_DB_PREFIX . "accounting_journal";
$sql.= " WHERE active = 1";
$sql.= " AND entity = ".$conf->entity;
- //if ($nature && is_numeric($nature)) $sql .= " AND nature = ".$nature;
+ if ($nature && is_numeric($nature)) $sql .= " AND nature = ".$nature;
$sql.= " ORDER BY code";
dol_syslog(get_class($this) . "::select_journal", LOG_DEBUG);
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index 8d021d48841..cdbf35dc32b 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -1,6 +1,7 @@
- * Copyright (C) 2016 Christophe Battarel
+/* Copyright (C) 2013-2015 Jean-François FERRY
+ * Copyright (C) 2016 Christophe Battarel
+ * Copyright (C) 2019 Frédéric France
*
* 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
@@ -291,17 +292,17 @@ class FormTicket
// Type
print '' . $langs->trans("TicketTypeRequest") . ' ';
- print $this->selectTypesTickets((GETPOST('type_code') ? GETPOST('type_code') : $this->type_code), 'type_code', '', '2');
+ $this->selectTypesTickets((GETPOST('type_code') ? GETPOST('type_code') : $this->type_code), 'type_code', '', '2');
print ' ';
// Severity
print '' . $langs->trans("TicketSeverity") . ' ';
- print $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', '2');
+ $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', '2');
print ' ';
// Group
print '' . $langs->trans("TicketGroup") . ' ';
- print $this->selectGroupTickets((GETPOST('category_code') ? GETPOST('category_code') : $this->category_code), 'category_code', '', '2');
+ $this->selectGroupTickets((GETPOST('category_code') ? GETPOST('category_code') : $this->category_code), 'category_code', '', '2');
print ' ';
// Notify thirdparty at creation
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index c541808399d..d12aeb6be41 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2981,7 +2981,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (empty($srconly) && in_array($pictowithoutext, array(
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
'note', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow',
- 'jabber','skype','twitter','facebook'
+ 'jabber','skype','twitter','facebook','linkedin'
)
)) {
$fa='fa';
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index b5c0ee813c9..fd51506bd01 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -257,7 +257,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 54, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2463__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 55, __ENTITY__);
- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__);
+ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__);
+ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2465__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_closure', 2451__+MAX_llx_menu__, '/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuClosureAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__);
-- Accounting period
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__);
-- Binding
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index b8cbafae488..2e15586b4cd 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1077,6 +1077,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
}
$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55);
$newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60);
+ $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_closure', 70);
// Fiscal year
if ($conf->global->MAIN_FEATURES_LEVEL > 1) {
diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php
index e9cb8cc631a..d9b27b729e3 100644
--- a/htdocs/core/modules/modBom.class.php
+++ b/htdocs/core/modules/modBom.class.php
@@ -59,7 +59,7 @@ class modBom extends DolibarrModules
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
// Module label (no space allowed), used if translation string 'ModuleBomName' not found (Bom is name of module).
- $this->name = preg_replace('/^mod/i','',get_class($this));
+ $this->name = preg_replace('/^mod/i', '', get_class($this));
// Module description, used if translation string 'ModuleBomDesc' not found (Bom is name of module).
$this->description = "Bill of Materials (BOM) definitions for Manufacturing Resource Planning";
// Used only if file README.md and README-LL.md not found.
diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
index 3071257839e..f94c96f0da1 100644
--- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
@@ -21,8 +21,9 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
$align=$extrafields->getAlignFlag($key, $extrafieldsobjectkey);
print '';
- $tmpkey='options_'.$key;
+ print ' data-key="'.$key.'"';
+ print '>';
+ $tmpkey='options_'.$key;
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey))
{
$datenotinstring = $obj->$tmpkey;
diff --git a/htdocs/core/tpl/extrafields_list_search_title.tpl.php b/htdocs/core/tpl/extrafields_list_search_title.tpl.php
index 5bf73d94bd2..bfae5faa944 100644
--- a/htdocs/core/tpl/extrafields_list_search_title.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_search_title.tpl.php
@@ -22,7 +22,7 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
$sortonfield = "ef.".$key;
if (! empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) $sortonfield='';
if ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] == 'separate') print ' ';
- else print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n";
+ else print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'" data-titlekey="'.$key.'"':'data-titlekey="'.$key.'"'), $sortfield, $sortorder)."\n";
}
}
}
diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php
index b3cb0ce3cd9..01953fba0ee 100644
--- a/htdocs/datapolicy/class/datapolicy.class.php
+++ b/htdocs/datapolicy/class/datapolicy.class.php
@@ -219,44 +219,46 @@ Class DataPolicy
*/
function sendMailDataPolicyCompany($societe)
{
- global $langs, $conf, $db, $user;
+ global $langs, $conf, $db, $user;
- $error = 0;
+ $error = 0;
- $from = $user->getFullName($langs) . ' <' . $user->email . '>';
+ $from = $user->getFullName($langs) . ' <' . $user->email . '>';
- $sendto = $societe->email;
+ $sendto = $societe->email;
- $code= md5($societe->email);
- if (!empty($societe->default_lang)) {
- $l = $societe->default_lang;
- } else {
- $l = $langs->defaultlang;
- }
- $s = "DATAPOLICIESSUBJECT_" . $l;
- $ma = "DATAPOLICIESCONTENT_" . $l;
- $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
- $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
+ $code= md5($societe->email);
+ if (!empty($societe->default_lang)) {
+ $l = $societe->default_lang;
+ } else {
+ $l = $langs->defaultlang;
+ }
+ $s = "DATAPOLICIESSUBJECT_" . $l;
+ $ma = "DATAPOLICIESCONTENT_" . $l;
+ $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
+ $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
- $subject = $conf->global->$s;
- $message = $conf->global->$ma;
- $linka = $conf->global->$la;
- $linkr = $conf->global->$lr;
- $sendtocc = $sendtobcc = '';
- $filepath = $mimetype = $filename = array();
- $deliveryreceipt = 0;
+ $subject = $conf->global->$s;
+ $message = $conf->global->$ma;
+ $linka = $conf->global->$la;
+ $linkr = $conf->global->$lr;
+ $sendtocc = $sendtobcc = '';
+ $filepath = $mimetype = $filename = array();
+ $deliveryreceipt = 0;
- $substitutionarray = array(
+ $substitutionarray = array(
'__LINKACCEPT__' => ''.$linka.' ',
'__LINKREFUSED__' => ''.$linkr.' ',
- );
- $subject = make_substitutions($subject, $substitutionarray);
- $message = make_substitutions($message, $substitutionarray);
+ );
+ $subject = make_substitutions($subject, $substitutionarray);
+ $message = make_substitutions($message, $substitutionarray);
- $actiontypecode = 'AC_EMAIL';
- $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
- if ($message) {
- if ($sendtocc) {
+ $actiontypecode = 'AC_EMAIL';
+ $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
+ if ($message)
+ {
+ if ($sendtocc)
+ {
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
}
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
@@ -264,23 +266,23 @@ Class DataPolicy
$actionmsg .= dol_concatdesc($actionmsg, $message);
}
- // Send mail
- require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
- $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
- if ($mailfile->error) {
- $resultmasssend .= '' . $mailfile->error . '
';
- } else {
- $result4 = $mailfile->sendfile();
+ // Send mail
+ require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
+ $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
+ if ($mailfile->error) {
+ $resultmasssend .= '' . $mailfile->error . '
';
+ } else {
+ $result4 = $mailfile->sendfile();
- if (!$error) {
- $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . " ";
- $societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
- $societe->update($societe->id);
- } else {
- dol_print_error($db);
- }
- }
- setEventMessage($resultmasssend);
+ if (!$error) {
+ $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . " ";
+ $societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
+ $societe->update($societe->id);
+ } else {
+ dol_print_error($db);
+ }
+ }
+ setEventMessage($resultmasssend);
}
/**
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index 62f56d04844..02a35deb70d 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -154,7 +154,7 @@ if ($action == 'add')
if (! $error)
{
- $object->fk_soc = GETPOST("fk_soc", 'int');
+ $object->socid = GETPOST("socid", 'int');
$object->firstname = GETPOST("firstname", 'alpha');
$object->lastname = GETPOST("lastname", 'alpha');
$object->societe = GETPOST("societe", 'alpha');
@@ -164,7 +164,7 @@ if ($action == 'add')
$object->town = GETPOST("town", 'alpha');
$object->country_id = GETPOST('country_id', 'int');
$object->email = GETPOST('email', 'alpha');
- $object->date = $donation_date;
+ $object->date = $donation_date;
$object->note_private = GETPOST("note_private", 'none');
$object->note_public = GETPOST("note_public", 'none');
$object->public = GETPOST("public", 'alpha');
@@ -531,10 +531,10 @@ if (! empty($id) && $action == 'edit')
print " ";
print "\n";
-if ( $object->fk_soc && ! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES) ) {
+if ( $object->socid && ! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES) ) {
$company=new Societe($db);
- $result=$company->fetch($object->fk_soc);
+ $result=$company->fetch($object->socid);
print ''.$langs->trans("LinkedToDolibarrThirdParty").' '.$company->getNomUrl(1).' ';
} else {
@@ -693,10 +693,10 @@ if (! empty($id) && $action != 'edit')
print yn($object->public);
print '';
-if ($object->fk_soc) {
+if ($object->socid) {
$company=new Societe($db);
- $result=$company->fetch($object->fk_soc);
+ $result=$company->fetch($object->socid);
print ''.$langs->trans("LinkedToDolibarrThirdParty").' '.$company->getNomUrl(1).' ';
} else {
diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php
index 8d722e31a0f..06ddd5616c0 100644
--- a/htdocs/don/class/api_donations.class.php
+++ b/htdocs/don/class/api_donations.class.php
@@ -72,7 +72,7 @@ class Donations extends DolibarrApi
throw new RestException(404, 'Donation not found');
}
- if( ! DolibarrApi::_checkAccessToResource('donation', $this->don->id)) {
+ if( ! DolibarrApi::_checkAccessToResource('don', $this->don->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php
index 872d8ad8b38..834f16c7737 100644
--- a/htdocs/don/class/don.class.php
+++ b/htdocs/don/class/don.class.php
@@ -396,7 +396,7 @@ class Don extends CommonObject
$sql.= ", ".$conf->entity;
$sql.= ", ".price2num($this->amount);
$sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null");
- $sql.= ", '".$this->db->escape($this->fk_soc)."'";
+ $sql.= ", '".$this->db->escape($this->socid)."'";
$sql.= ", '".$this->db->escape($this->firstname)."'";
$sql.= ", '".$this->db->escape($this->lastname)."'";
$sql.= ", '".$this->db->escape($this->societe)."'";
@@ -645,7 +645,7 @@ class Don extends CommonObject
global $conf;
$sql = "SELECT d.rowid, d.datec, d.date_valid, d.tms as datem, d.datedon,";
- $sql.= " d.fk_soc,d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, ";
+ $sql.= " d.fk_soc as socid,d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, ";
$sql.= " d.fk_country, d.country as country_olddata, d.public, d.amount, d.fk_payment, d.paid, d.note_private, d.note_public, d.email, d.phone, ";
$sql.= " d.phone_mobile, d.fk_projet as fk_project, d.model_pdf,";
$sql.= " p.ref as project_ref,";
@@ -673,40 +673,42 @@ class Don extends CommonObject
{
$obj = $this->db->fetch_object($resql);
- $this->id = $obj->rowid;
- $this->ref = $obj->rowid;
- $this->datec = $this->db->jdate($obj->datec);
- $this->date_valid = $this->db->jdate($obj->date_valid);
- $this->datem = $this->db->jdate($obj->datem);
- $this->date = $this->db->jdate($obj->datedon);
- $this->fk_soc = $obj->fk_soc;
- $this->firstname = $obj->firstname;
- $this->lastname = $obj->lastname;
- $this->societe = $obj->societe;
- $this->statut = $obj->fk_statut;
- $this->address = $obj->address;
- $this->town = $obj->town;
- $this->zip = $obj->zip;
- $this->town = $obj->town;
- $this->country_id = $obj->fk_country;
- $this->country_code = $obj->country_code;
- $this->country = $obj->country;
- $this->country_olddata= $obj->country_olddata; // deprecated
- $this->email = $obj->email;
- $this->phone = $obj->phone;
- $this->phone_mobile = $obj->phone_mobile;
- $this->project = $obj->project_ref;
- $this->fk_projet = $obj->fk_project; // deprecated
- $this->fk_project = $obj->fk_project;
- $this->public = $obj->public;
- $this->modepaymentid = $obj->fk_payment;
- $this->modepaymentcode = $obj->payment_code;
- $this->modepayment = $obj->payment_label;
- $this->paid = $obj->paid;
- $this->amount = $obj->amount;
- $this->note_private = $obj->note_private;
- $this->note_public = $obj->note_public;
- $this->modelpdf = $obj->model_pdf;
+ $this->id = $obj->rowid;
+ $this->ref = $obj->rowid;
+ $this->date_creation = $this->db->jdate($obj->datec);
+ $this->datec = $this->db->jdate($obj->datec);
+ $this->date_validation = $this->db->jdate($obj->date_valid);
+ $this->date_modification = $this->db->jdate($obj->datem);
+ $this->datem = $this->db->jdate($obj->datem);
+ $this->date = $this->db->jdate($obj->datedon);
+ $this->socid = $obj->socid;
+ $this->firstname = $obj->firstname;
+ $this->lastname = $obj->lastname;
+ $this->societe = $obj->societe;
+ $this->statut = $obj->fk_statut;
+ $this->address = $obj->address;
+ $this->town = $obj->town;
+ $this->zip = $obj->zip;
+ $this->town = $obj->town;
+ $this->country_id = $obj->fk_country;
+ $this->country_code = $obj->country_code;
+ $this->country = $obj->country;
+ $this->country_olddata = $obj->country_olddata; // deprecated
+ $this->email = $obj->email;
+ $this->phone = $obj->phone;
+ $this->phone_mobile = $obj->phone_mobile;
+ $this->project = $obj->project_ref;
+ $this->fk_projet = $obj->fk_project; // deprecated
+ $this->fk_project = $obj->fk_project;
+ $this->public = $obj->public;
+ $this->mode_reglement_id = $obj->fk_payment;
+ $this->mode_reglement_code= $obj->payment_code;
+ $this->mode_reglement = $obj->payment_label;
+ $this->paid = $obj->paid;
+ $this->amount = $obj->amount;
+ $this->note_private = $obj->note_private;
+ $this->note_public = $obj->note_public;
+ $this->modelpdf = $obj->model_pdf;
// Retreive all extrafield
// fetch optionals attributes and labels
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index bfe7fb4df85..4d5a3d32c78 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -368,7 +368,7 @@ if (! $search_all)
$sql.= " typent.code,";
$sql.= " state.code_departement, state.nom,";
$sql.= ' country.code,';
- $sql.= " p.rowid, p.ref";
+ $sql.= " p.rowid, p.ref, p.title";
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
{
diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql
index e00ebc91828..575573c41c9 100644
--- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql
+++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql
@@ -267,8 +267,12 @@ CREATE TABLE llx_pos_cash_fence(
UPDATE llx_const set name = 'PRELEVEMENT_END_TO_END' where name = 'END_TO_END';
UPDATE llx_const set name = 'PRELEVEMENT_USTRD' where name = 'USTRD';
--- Delete duplicate accounting account not used
+-- Delete duplicate accounting account, but only if not used
+DROP TABLE tmp_llx_accouting_account;
+CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version;
+--SELECT * from tmp_llx_accouting_account;
+DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det));
ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account;
diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
index b2ba0bf3a58..fe7cdb9faf6 100644
--- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
+++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
@@ -94,7 +94,6 @@ ALTER TABLE llx_don ADD COLUMN fk_soc integer NULL;
ALTER TABLE llx_payment_various ADD COLUMN subledger_account varchar(32);
-
ALTER TABLE llx_prelevement_facture_demande ADD COLUMN entity integer(11);
ALTER TABLE llx_prelevement_facture_demande ADD COLUMN sourcetype varchar(32);
ALTER TABLE llx_prelevement_facture_demande ADD COLUMN ext_payment_id varchar(128) NULL;
@@ -166,6 +165,11 @@ ALTER TABLE llx_commande ADD COLUMN module_source varchar(32);
ALTER TABLE llx_commande ADD COLUMN pos_source varchar(32);
+ALTER TABLE llx_societe ADD COLUMN linkedin varchar(255) after whatsapp;
+ALTER TABLE llx_socpeople ADD COLUMN linkedin varchar(255) after whatsapp;
+ALTER TABLE llx_adherent ADD COLUMN linkedin varchar(255) after whatsapp;
+ALTER TABLE llx_user ADD COLUMN linkedin varchar(255) after whatsapp;
+
diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql
index f54523d2230..387f8e159ec 100755
--- a/htdocs/install/mysql/migration/repair.sql
+++ b/htdocs/install/mysql/migration/repair.sql
@@ -376,6 +376,16 @@ update llx_bank_url as bu set url_id = (select e.fk_user_author from tmp_bank_ur
drop table tmp_bank_url_expense_user;
+-- Delete duplicate accounting account, but only if not used
+DROP TABLE tmp_llx_accouting_account;
+CREATE TABLE tmp_llx_accouting_account AS SELECT MIN(rowid) as MINID, account_number, entity, fk_pcg_version, count(*) AS NB FROM llx_accounting_account group BY account_number, entity, fk_pcg_version HAVING count(*) >= 2 order by account_number, entity, fk_pcg_version;
+--SELECT * from tmp_llx_accouting_account;
+DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_accouting_account where minid NOT IN (SELECT fk_code_ventilation from llx_facturedet) AND minid NOT IN (SELECT fk_code_ventilation from llx_facture_fourn_det) AND minid NOT IN (SELECT fk_code_ventilation from llx_expensereport_det));
+
+ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account;
+ALTER TABLE llx_accounting_account ADD UNIQUE INDEX uk_accounting_account (account_number, entity, fk_pcg_version);
+
+
-- VMYSQL4.1 update llx_projet_task_time set task_datehour = task_date where task_datehour < task_date or task_datehour > DATE_ADD(task_date, interval 1 day);
diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql
index ede4de2e487..588fb323dae 100644
--- a/htdocs/install/mysql/tables/llx_adherent.sql
+++ b/htdocs/install/mysql/tables/llx_adherent.sql
@@ -51,6 +51,7 @@ create table llx_adherent
skype varchar(255),
twitter varchar(255), --
facebook varchar(255), --
+ linkedin varchar(255), --
instagram varchar(255), --
snapchat varchar(255), --
googleplus varchar(255), --
diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql
index 6225ae416e8..ed4919c3fc5 100644
--- a/htdocs/install/mysql/tables/llx_societe.sql
+++ b/htdocs/install/mysql/tables/llx_societe.sql
@@ -54,6 +54,7 @@ create table llx_societe
skype varchar(255), --
twitter varchar(255), --
facebook varchar(255), --
+ linkedin varchar(255), --
instagram varchar(255), --
snapchat varchar(255), --
googleplus varchar(255), --
diff --git a/htdocs/install/mysql/tables/llx_socpeople.sql b/htdocs/install/mysql/tables/llx_socpeople.sql
index 00456e3ece6..4ed401e39da 100644
--- a/htdocs/install/mysql/tables/llx_socpeople.sql
+++ b/htdocs/install/mysql/tables/llx_socpeople.sql
@@ -46,6 +46,7 @@ create table llx_socpeople
skype varchar(255),
twitter varchar(255), --
facebook varchar(255), --
+ linkedin varchar(255), --
instagram varchar(255), --
snapchat varchar(255), --
googleplus varchar(255), --
diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql
index cb9bf35ccd0..0beffd73428 100644
--- a/htdocs/install/mysql/tables/llx_user.sql
+++ b/htdocs/install/mysql/tables/llx_user.sql
@@ -58,6 +58,7 @@ create table llx_user
skype varchar(255),
twitter varchar(255), --
facebook varchar(255), --
+ linkedin varchar(255), --
instagram varchar(255), --
snapchat varchar(255), --
googleplus varchar(255), --
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index 472e2166f6b..524979e610d 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -96,6 +96,7 @@ MenuTaxAccounts=Tax accounts
MenuExpenseReportAccounts=Expense report accounts
MenuLoanAccounts=Loan accounts
MenuProductsAccounts=Product accounts
+MenuClosureAccounts=Closure accounts
ProductsBinding=Products accounts
Ventilation=Binding to accounts
Binding=Binding to accounts
@@ -142,6 +143,7 @@ ACCOUNTING_LENGTH_AACCOUNT=Length of the third-party accounting accounts (If you
ACCOUNTING_MANAGE_ZERO=Allow to manage different number of zeros at the end of an accounting account. Needed by some countries (like Switzerland). If set to off (default), you can set the following two parameters to ask the application to add virtual zeros.
BANK_DISABLE_DIRECT_INPUT=Disable direct recording of transaction in bank account
ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL=Enable draft export on journal
+ACCOUNTANCY_COMBO_FOR_AUX=Enable combo list for subsidiary account (may be slow if you have a lot of third parties)
ACCOUNTING_SELL_JOURNAL=Sell journal
ACCOUNTING_PURCHASE_JOURNAL=Purchase journal
@@ -150,7 +152,12 @@ ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal
ACCOUNTING_SOCIAL_JOURNAL=Social journal
ACCOUNTING_HAS_NEW_JOURNAL=Has new Journal
+ACCOUNTING_RESULT_PROFIT=Result accounting account (Profit)
+ACCOUNTING_RESULT_LOSS=Result accounting account (Loss)
+ACCOUNTING_CLOSURE_DEFAULT_JOURNAL=Journal of closure
+
ACCOUNTING_ACCOUNT_TRANSFER_CASH=Accounting account of transitional bank transfer
+
ACCOUNTING_ACCOUNT_SUSPENSE=Accounting account of wait
DONATION_ACCOUNTINGACCOUNT=Accounting account to register donations
ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT=Accounting account to register subscriptions
@@ -288,6 +295,7 @@ ChartofaccountsId=Chart of accounts Id
InitAccountancy=Init accountancy
InitAccountancyDesc=This page can be used to initialize an accounting account on products and services that does not have accounting account defined for sales and purchases.
DefaultBindingDesc=This page can be used to set a default account to use to link transactions record about payment salaries, donation, taxes and vat when no specific accounting account were already set.
+DefaultClosureDesc=This page can be used to set parameters to use to enclose a balance sheet.
Options=Options
OptionModeProductSell=Mode sales
OptionModeProductBuy=Mode purchases
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index a63b858e488..066aebdde6a 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -625,7 +625,7 @@ while ($i < min($num, $limit))
$userAccess = $projectstatic->restrictedProjectArea($user); // why this ?
if ($userAccess >= 0)
{
- print '';
+ print ' ';
// Ref
if (! empty($arrayfields['t.ref']['checked']))
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index dc3627c4922..e5caac88387 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -146,7 +146,7 @@ if (empty($reshook))
$object->client = $object->client | $soc_origin->client;
$object->fournisseur = $object->fournisseur | $soc_origin->fournisseur;
$listofproperties=array(
- 'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'twitter', 'facebook', 'url', 'barcode',
+ 'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'twitter', 'facebook', 'linkedin', 'url', 'barcode',
'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6',
'tva_intra', 'effectif_id', 'forme_juridique', 'remise_percent', 'remise_supplier_percent', 'mode_reglement_supplier_id', 'cond_reglement_supplier_id', 'name_bis',
'stcomm_id', 'outstanding_limit', 'price_level', 'parent', 'default_lang', 'ref', 'ref_ext', 'import_key', 'fk_incoterms', 'fk_multicurrency',
@@ -407,6 +407,7 @@ if (empty($reshook))
$object->skype = GETPOST('skype', 'alpha');
$object->twitter = GETPOST('twitter', 'alpha');
$object->facebook = GETPOST('facebook', 'alpha');
+ $object->linkedin = GETPOST('linkedin', 'alpha');
$object->phone = GETPOST('phone', 'alpha');
$object->fax = GETPOST('fax', 'alpha');
$object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
@@ -970,6 +971,7 @@ else
$object->skype = GETPOST('skype', 'alpha');
$object->twitter = GETPOST('twitter', 'alpha');
$object->facebook = GETPOST('facebook', 'alpha');
+ $object->linkedin = GETPOST('linkedin', 'alpha');
$object->phone = GETPOST('phone', 'alpha');
$object->fax = GETPOST('fax', 'alpha');
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
@@ -1304,13 +1306,21 @@ else
print ' ';
}
// Facebook
- if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
- {
- print ''.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).' ';
- print '';
- print ' facebook).'">';
- print ' ';
- }
+ if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
+ {
+ print ''.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).' ';
+ print '';
+ print ' facebook).'">';
+ print ' ';
+ }
+ // LinkedIn
+ if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN))
+ {
+ print ''.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).' ';
+ print '';
+ print ' linkedin).'">';
+ print ' ';
+ }
}
// Phone / Fax
@@ -1591,6 +1601,7 @@ else
$object->skype = GETPOST('skype', 'alpha');
$object->twitter = GETPOST('twitter', 'alpha');
$object->facebook = GETPOST('facebook', 'alpha');
+ $object->linkedin = GETPOST('linkedin', 'alpha');
$object->phone = GETPOST('phone', 'alpha');
$object->fax = GETPOST('fax', 'alpha');
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
@@ -1916,6 +1927,12 @@ else
print ''.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).' ';
print ' ';
}
+ // LinkedIn
+ if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN))
+ {
+ print ''.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).' ';
+ print ' ';
+ }
}
// Phone / Fax
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 36c81216f9c..1aacca2c895 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -203,6 +203,11 @@ class Societe extends CommonObject
* @var string
*/
public $facebook;
+ /**
+ * LinkedIn username
+ * @var string
+ */
+ public $linkedin;
/**
* Webpage
* @var string
@@ -848,6 +853,7 @@ class Societe extends CommonObject
$this->skype = trim($this->skype);
$this->twitter = trim($this->twitter);
$this->facebook = trim($this->facebook);
+ $this->linkedin = trim($this->linkedin);
$this->url = $this->url?clean_url($this->url, 0):'';
$this->note_private = trim($this->note_private);
$this->note_public = trim($this->note_public);
@@ -991,6 +997,7 @@ class Societe extends CommonObject
$sql .= ",skype = ".(! empty($this->skype)?"'".$this->db->escape($this->skype)."'":"null");
$sql .= ",twitter = ".(! empty($this->twitter)?"'".$this->db->escape($this->twitter)."'":"null");
$sql .= ",facebook = ".(! empty($this->facebook)?"'".$this->db->escape($this->facebook)."'":"null");
+ $sql .= ",linkedin = ".(! empty($this->linkedin)?"'".$this->db->escape($this->linkedin)."'":"null");
$sql .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null");
$sql .= ",parent = " . ($this->parent > 0 ? $this->parent : "null");
@@ -1132,6 +1139,7 @@ class Societe extends CommonObject
$lmember->skype=$this->skype;
$lmember->twitter=$this->twitter;
$lmember->facebook=$this->facebook;
+ $lmember->linkedin=$this->linkedin;
$lmember->phone=$this->phone;
$result=$lmember->update($user, 0, 1, 1, 1); // Use nosync to 1 to avoid cyclic updates
@@ -1235,7 +1243,7 @@ class Societe extends CommonObject
$sql .= ', s.status';
$sql .= ', s.price_level';
$sql .= ', s.tms as date_modification, s.fk_user_creat, s.fk_user_modif';
- $sql .= ', s.phone, s.fax, s.email, s.skype, s.twitter, s.facebook, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur';
+ $sql .= ', s.phone, s.fax, s.email, s.skype, s.twitter, s.facebook, s.linkedin, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur';
$sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6';
$sql .= ', s.capital, s.tva_intra';
$sql .= ', s.fk_typent as typent_id';
@@ -1332,6 +1340,7 @@ class Societe extends CommonObject
$this->skype = $obj->skype;
$this->twitter = $obj->twitter;
$this->facebook = $obj->facebook;
+ $this->linkedin = $obj->linkedin;
$this->url = $obj->url;
$this->phone = $obj->phone;
$this->fax = $obj->fax;
@@ -3337,6 +3346,7 @@ class Societe extends CommonObject
$this->skype=$member->skype;
$this->twitter=$member->twitter;
$this->facebook=$member->facebook;
+ $this->linkedin=$member->linkedin;
$this->client = 1; // A member is a customer by default
$this->code_client = ($customercode?$customercode:-1);
@@ -3480,6 +3490,7 @@ class Societe extends CommonObject
$this->skype='tom.hanson';
$this->twitter='tomhanson';
$this->facebook='tomhanson';
+ $this->linkedin='tomhanson';
$this->url='http://www.specimen.com';
$this->phone='0909090901';
diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php
index 100a85f6c30..5e2c27dd392 100644
--- a/htdocs/stripe/admin/stripe.php
+++ b/htdocs/stripe/admin/stripe.php
@@ -78,9 +78,6 @@ if ($action == 'setvalue' && $user->admin)
$result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", GETPOST('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 'int'), 'chaine', 0, '', $conf->entity);
if (! $result > 0)
$error ++;
- $result = dolibarr_set_const($db, "STRIPE_MINIMAL_3DSECURE", GETPOST('STRIPE_MINIMAL_3DSECURE', 'int'), 'chaine', 0, '', $conf->entity);
- if (! $result > 0)
- $error ++;
$result = dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity);
if (! $result > 0)
$error ++;
@@ -97,9 +94,9 @@ if ($action == 'setvalue' && $user->admin)
if (! $result > 0)
$error ++;
// Stock decrement
- $result = dolibarr_set_const($db, "ONLINE_PAYMENT_WAREHOUSE", (GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') > 0 ? GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
- if (! $result > 0)
- $error ++;
+ //$result = dolibarr_set_const($db, "ONLINE_PAYMENT_WAREHOUSE", (GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') > 0 ? GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
+ //if (! $result > 0)
+ // $error ++;
// Payment token for URL
$result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity);
@@ -166,18 +163,12 @@ print "\n";
print '';
print '';
print $langs->trans("StripeLiveEnabled").' ';
-if (!empty($conf->global->STRIPE_LIVE))
-{
- print '';
- print img_picto($langs->trans("Activated"), 'switch_on');
- print ' ';
-}
-else
-{
- print '';
- print img_picto($langs->trans("Disabled"), 'switch_off');
- print ' ';
-}
+ if ($conf->use_javascript_ajax) {
+ print ajax_constantonoff('STRIPE_LIVE');
+ } else {
+ $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
+ print $form->selectarray("STRIPE_LIVE", $arrval, $conf->global->STRIPE_LIVE);
+ }
print ' ';
if (empty($conf->stripeconnect->enabled))
@@ -195,9 +186,14 @@ if (empty($conf->stripeconnect->enabled))
print '';
print '';
- print ''.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").' ';
- print ' ';
+ print ''.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").' ';
+ print ' ';
print ' '.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx';
+ $out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForTestWebhook").' ';
+ $url = dol_buildpath('/public/stripe/ipn.php?test', 2);
+ $out.= ' ';
+ $out.= ajax_autoselect("onlinetestwebhookurl", 0);
+ print ' '.$out;
print ' ';
} else {
print ''.$langs->trans("StripeConnect").' ';
@@ -225,9 +221,14 @@ if (empty($conf->stripeconnect->enabled))
print ' ';
print '';
- print ''.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").' ';
- print ' ';
+ print ''.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").' ';
+ print ' ';
print ' '.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx';
+ $out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForLiveWebhook").' ';
+ $url = dol_buildpath('/public/stripe/ipn.php', 2);
+ $out.= ' ';
+ $out.= ajax_autoselect("onlinelivewebhookurl", 0);
+ print ' '.$out;
print ' ';
}
else
@@ -272,22 +273,42 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ?
print '';
}
-// Minimal amount for force 3Dsecure if it's optionnal
+// Activate Payment Request API
+if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code
+{
+ print '';
+ print $langs->trans("STRIPE_PAYMENT_REQUEST_API").' ';
+ if ($conf->use_javascript_ajax) {
+ print ajax_constantonoff('STRIPE_PAYMENT_REQUEST_API');
+ } else {
+ $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
+ print $form->selectarray("STRIPE_PAYMENT_REQUEST_API", $arrval, $conf->global->STRIPE_PAYMENT_REQUEST_API);
+ }
+ print ' ';
+}
+
+// Activate SEPA DIRECT_DEBIT
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code
{
print '';
- print $langs->trans("STRIPE_MINIMAL_3DSECURE").' ';
- print ' '.$langs->getCurrencySymbol($conf->currency).' ';
+ print $langs->trans("STRIPE_SEPA_DIRECT_DEBIT").'';
+ if ($conf->use_javascript_ajax) {
+ print ajax_constantonoff('STRIPE_SEPA_DIRECT_DEBIT');
+ } else {
+ $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
+ print $form->selectarray("STRIPE_SEPA_DIRECT_DEBIT", $arrval, $conf->global->STRIPE_SEPA_DIRECT_DEBIT);
+ }
+ print ' ';
}
// Warehouse for automatic decrement
-if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ?
-{
- print '';
- print $langs->trans("ONLINE_PAYMENT_WAREHOUSE").' ';
- print $formproduct->selectWarehouses($conf->global->ONLINE_PAYMENT_WAREHOUSE, 'ONLINE_PAYMENT_WAREHOUSE', '', 1, $disabled);
- print ' ';
-}
+//if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // warehouse to reduce stock for online payment
+//{
+// print '';
+// print $langs->trans("ONLINE_PAYMENT_WAREHOUSE").' ';
+// print $formproduct->selectWarehouses($conf->global->ONLINE_PAYMENT_WAREHOUSE, 'ONLINE_PAYMENT_WAREHOUSE', '', 1, $disabled);
+// print ' ';
+//}
print '';
print $langs->trans("CSSUrlForPaymentForm").' ';
@@ -329,7 +350,12 @@ print ' ';
print '';
print $langs->trans("SecurityTokenIsUnique").' ';
-print $form->selectyesno("PAYMENT_SECURITY_TOKEN_UNIQUE", (empty($conf->global->PAYMENT_SECURITY_TOKEN)?0:$conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE), 1);
+if ($conf->use_javascript_ajax) {
+ print ajax_constantonoff('PAYMENT_SECURITY_TOKEN_UNIQUE');
+} else {
+ $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
+ print $form->selectarray("PAYMENT_SECURITY_TOKEN_UNIQUE", $arrval, $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE);
+}
print ' ';
print '';
diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php
index 646e5c19b12..fa881a834ea 100644
--- a/htdocs/stripe/class/stripe.class.php
+++ b/htdocs/stripe/class/stripe.class.php
@@ -309,7 +309,10 @@ class Stripe extends CommonObject
else $stripeamount = $object->multicurrency_total_ttc;
$fee = round(($object->total_ttc * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100);
- if ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) {
+ if ($fee >= ($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100) && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL>$conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
+ $fee = round($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100);
+ }
+ elseif ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) {
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100);
}
@@ -584,9 +587,11 @@ class Stripe extends CommonObject
$charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$ref"));
}
} else {
-
- $fee = round(($amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100);
- if ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) {
+ $fee = round(($object->total_ttc * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100);
+ if ($fee >= ($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100) && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL>$conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
+ $fee = round($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100);
+ }
+ elseif ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) {
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100);
}
diff --git a/htdocs/takepos/css/pos.css b/htdocs/takepos/css/pos.css
index 87c74c8952d..cac9a23a8d9 100644
--- a/htdocs/takepos/css/pos.css
+++ b/htdocs/takepos/css/pos.css
@@ -110,6 +110,18 @@ div.description{
text-align:center;
}
+div.catwatermark{
+ position:absolute;
+ top:3%;
+ left:3%;
+ width:20%;
+ background-color:black;
+ color:white;
+ text-align:center;
+ font-size: 20px;
+ display: none;
+}
+
@media only screen and (max-aspect-ratio: 6/4) {
div.description{
min-height:20%;
diff --git a/htdocs/takepos/genimg/add.jpg b/htdocs/takepos/genimg/add.jpg
deleted file mode 100644
index 976fd10697d..00000000000
Binary files a/htdocs/takepos/genimg/add.jpg and /dev/null differ
diff --git a/htdocs/takepos/genimg/empty.jpg b/htdocs/takepos/genimg/empty.jpg
deleted file mode 100644
index 8883f7c9957..00000000000
Binary files a/htdocs/takepos/genimg/empty.jpg and /dev/null differ
diff --git a/htdocs/takepos/genimg/empty.png b/htdocs/takepos/genimg/empty.png
new file mode 100644
index 00000000000..63163e9f869
Binary files /dev/null and b/htdocs/takepos/genimg/empty.png differ
diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php
index d5dee43ffa8..546c5ed6fca 100644
--- a/htdocs/takepos/genimg/index.php
+++ b/htdocs/takepos/genimg/index.php
@@ -27,10 +27,10 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
require '../../main.inc.php'; // Load $user and permissions
-$id= GETPOST('id');
-$w= GETPOST('w');
-$h= GETPOST('h');
-$query= GETPOST('query');
+$id = GETPOST('id', 'int');
+$w = GETPOST('w', 'int');
+$h = GETPOST('h', 'int');
+$query= GETPOST('query', 'alpha');
@@ -38,7 +38,6 @@ $query= GETPOST('query');
* View
*/
-header('Content-Type: image/jpeg');
header('Cache-Control: max-age=604800, public, must-revalidate');
header('Pragma: cache');
@@ -49,39 +48,26 @@ if ($query=="cat")
$object = new Categorie($db);
$result = $object->fetch($id);
+
$upload_dir = $conf->categorie->multidir_output[$object->entity];
$pdir = get_exdir($object->id, 2, 0, 0, $object, 'category') . $object->id ."/photos/";
$dir = $upload_dir.'/'.$pdir;
+
foreach ($object->liste_photos($dir) as $key => $obj)
- {
- $filename=$obj['photo'];
- }
-
- // The file
- $filename = $dir.$filename;
- if (!file_exists($filename)) $filename="empty.jpg";
-
- // Dimensions
- list($width, $height) = getimagesize($filename);
- $new_width = $w;
- $new_height = $h;
-
- // Resample
- $image_p = imagecreatetruecolor($new_width, $new_height);
- $image = imagecreatefromjpeg($filename);
- imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
-
- // Add icon
- $icon = imagecreatefromjpeg('add.jpg');
- list($width, $height) = getimagesize('add.jpg');
- $new_width = $w*0.3;
- $new_height = $h*0.3;
- $icon_p = imagecreatetruecolor($new_width, $new_height);
- imagecopyresampled($icon_p, $icon, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
- imagecopymerge($image_p, $icon_p, 0, 0, 0, 0, $new_width, $new_height, 100);
-
- // Output
- imagejpeg($image_p, null, 100);
+ {
+ if ($obj['photo_vignette'])
+ {
+ $filename=$obj['photo_vignette'];
+ }
+ else
+ {
+ $filename=$obj['photo'];
+ }
+ $file=DOL_URL_ROOT.'/viewimage.php?modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename);
+ header('Location: '.$file);
+ exit;
+ }
+ header('Location: ../../public/theme/common/nophoto.png');
}
elseif ($query=="pro")
{
@@ -89,42 +75,18 @@ elseif ($query=="pro")
$objProd = new Product($db);
$objProd->fetch($id);
+ $image=$objProd->show_photos('product', $conf->product->multidir_output[$entity], 'small', 1);
- $dir .= get_exdir(0, 0, 0, 0, $objProd, 'product').$objProd->ref.'/';
- $pdir .= get_exdir(0, 0, 0, 0, $objProd, 'product').$objProd->ref.'/';
+ preg_match('@src="([^"]+)"@', $image, $match);
+ $file = array_pop($match);
+ if ($file=="") header('Location: ../../public/theme/common/nophoto.png');
+ else header('Location: '.$file);
- foreach ($objProd->liste_photos($dir) as $key => $obj)
- {
- $filename=$obj['photo'];
- }
- $filename = $dir.$filename;
-
- if (!file_exists($filename)){
- $dir = $conf->product->multidir_output[$objProd->entity].'/'.$pdir;
- foreach ($objProd->liste_photos($dir) as $key => $obj)
- {
- $filename=$obj['photo'];
- }
- $filename = $dir.$filename;
- }
-
- if (!file_exists($filename)) $filename="empty.jpg";
-
- // Dimensions
- list($width, $height) = getimagesize($filename);
- $new_width = $w;
- $new_height = $h;
-
- // Resample
- $image_p = imagecreatetruecolor($new_width, $new_height);
- $image = imagecreatefromjpeg($filename);
- imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
-
- // Output
- imagejpeg($image_p, null, 100);
}
else
{
+ // TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded.
+
// The file
$filename = $query.".jpg";
diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php
index 4edab6c9bee..fe6bf6b0a19 100644
--- a/htdocs/takepos/takepos.php
+++ b/htdocs/takepos/takepos.php
@@ -93,8 +93,9 @@ function PrintCategories(first){
for (i = 0; i < 14; i++) {
if (typeof (categories[parseInt(i)+parseInt(first)]) == "undefined") break;
$("#catdesc"+i).text(categories[parseInt(i)+parseInt(first)]['label']);
- $("#catimg"+i).attr("src","genimg/?query=cat&w=55&h=50&id="+categories[parseInt(i)+parseInt(first)]['rowid']);
+ $("#catimg"+i).attr("src","genimg/index.php?query=cat&id="+categories[parseInt(i)+parseInt(first)]['rowid']);
$("#catdiv"+i).data("rowid",categories[parseInt(i)+parseInt(first)]['rowid']);
+ $("#catwatermark"+i).show();
}
}
@@ -117,12 +118,14 @@ function MoreCategories(moreorless){
for (i = 0; i < 14; i++) {
if (typeof (categories[i+(14*pagecategories)]) == "undefined"){
$("#catdesc"+i).text("");
- $("#catimg"+i).attr("src","");
+ $("#catimg"+i).attr("src","genimg/empty.png");
+ $("#catwatermark"+i).hide();
continue;
}
$("#catdesc"+i).text(categories[i+(14*pagecategories)]['label']);
- $("#catimg"+i).attr("src","genimg/?query=cat&w=55&h=50&id="+categories[i+(14*pagecategories)]['rowid']);
+ $("#catimg"+i).attr("src","genimg/index.php?query=cat&id="+categories[i+(14*pagecategories)]['rowid']);
$("#catdiv"+i).data("rowid",categories[i+(14*pagecategories)]['rowid']);
+ $("#catwatermark"+i).show();
}
}
@@ -131,16 +134,17 @@ function LoadProducts(position, issubcat=false){
$('#catimg'+position).animate({opacity: '1'}, 100);
if (issubcat==true) currentcat=$('#prodiv'+position).data('rowid');
else currentcat=$('#catdiv'+position).data('rowid');
- if (currentcat=="") return;
+ if (currentcat==undefined) return;
pageproducts=0;
ishow=0; //product to show counter
jQuery.each(subcategories, function(i, val) {
if (currentcat==val.fk_parent){
$("#prodesc"+ishow).text(val.label);
- $("#proimg"+ishow).attr("src","genimg/?query=cat&w=55&h=50&id="+val.rowid);
+ $("#proimg"+ishow).attr("src","genimg/index.php?query=cat&id="+val.rowid);
$("#prodiv"+ishow).data("rowid",val.rowid);
$("#prodiv"+ishow).data("iscat",1);
+ $("#prowatermark"+ishow).show();
ishow++;
}
});
@@ -150,18 +154,19 @@ function LoadProducts(position, issubcat=false){
while (idata < 30 && ishow < 30) {
if (typeof (data[idata]) == "undefined") {
$("#prodesc"+ishow).text("");
- $("#proimg"+ishow).attr("src","");
+ $("#proimg"+ishow).attr("src","genimg/empty.png");
$("#prodiv"+ishow).data("rowid","");
ishow++; //Next product to show after print data product
}
else if ((data[idata]['status']) == "1") {
//Only show products with status=1 (for sell)
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
- $("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']);
+ $("#proimg"+ishow).attr("src","genimg/index.php?query=pro&id="+data[idata]['id']);
$("#prodiv"+ishow).data("rowid",data[idata]['id']);
$("#prodiv"+ishow).data("iscat",0);
ishow++; //Next product to show after print data product
}
+ $("#prowatermark"+ishow).hide();
idata++; //Next data everytime
}
});
@@ -189,18 +194,19 @@ function MoreProducts(moreorless){
while (idata < (30*pageproducts)+30) {
if (typeof (data[idata]) == "undefined") {
$("#prodesc"+ishow).text("");
- $("#proimg"+ishow).attr("src","");
+ $("#proimg"+ishow).attr("src","genimg/empty.png");
$("#prodiv"+ishow).data("rowid","");
ishow++; //Next product to show after print data product
}
else if ((data[idata]['status']) == "1") {
//Only show products with status=1 (for sell)
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
- $("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']);
+ $("#proimg"+ishow).attr("src","genimg/index.php?query=pro&id="+data[idata]['id']);
$("#prodiv"+ishow).data("rowid",data[idata]['id']);
$("#prodiv"+ishow).data("iscat",0);
ishow++; //Next product to show after print data product
}
+ $("#prowatermark"+ishow).hide();
idata++; //Next data everytime
}
});
@@ -261,12 +267,12 @@ function Search2(){
for (i = 0; i < 30; i++) {
if (typeof (data[i]) == "undefined"){
$("#prodesc"+i).text("");
- $("#proimg"+i).attr("src","");
+ $("#proimg"+i).attr("src","genimg/empty.png");
$("#prodiv"+i).data("rowid","");
continue;
}
$("#prodesc"+i).text(data[parseInt(i)]['label']);
- $("#proimg"+i).attr("src","genimg/?query=pro&w=55&h=50&id="+data[i]['rowid']);
+ $("#proimg"+i).attr("src","genimg/?query=pro&id="+data[i]['rowid']);
$("#prodiv"+i).data("rowid",data[i]['rowid']);
$("#prodiv"+i).data("iscat",0);
}
@@ -491,10 +497,11 @@ foreach($menus as $menu) {
{
?>
id='catdiv'>
-
width="98%" id='catimg'/>
+
width="100%" height="85%" id='catimg'/>
+
+
onclick="MoreProducts('less');" onclick="MoreProducts('more');" >
-
width="95%" id='proimg'/>
+
width="100%" height="85%" id='proimg'/>
+
+
getOptionalsFromPost($object->table_element,
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
if (! $sortorder) $sortorder="ASC";
-if (GETPOST('search_fk_status','alpha') == 'non_closed') $_GET['search_fk_statut'][]='openall'; // For backward compatibility
+if (GETPOST('search_fk_status', 'alpha') == 'non_closed') $_GET['search_fk_statut'][]='openall'; // For backward compatibility
// Initialize array of search criterias
$search_all=trim(GETPOST("search_all", 'alpha'));
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 9de64588931..2f91cf9af61 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -214,6 +214,7 @@ if (empty($reshook)) {
$object->skype = GETPOST("skype", 'alphanohtml');
$object->twitter = GETPOST("twitter", 'alphanohtml');
$object->facebook = GETPOST("facebook", 'alphanohtml');
+ $object->linkedin = GETPOST("linkedin", 'alphanohtml');
$object->email = preg_replace('/\s+/', '', GETPOST("email", 'alpha'));
$object->job = GETPOST("job", 'alpha');
@@ -364,6 +365,7 @@ if (empty($reshook)) {
$object->skype = GETPOST("skype", 'alpha');
$object->twitter = GETPOST("twitter", 'alpha');
$object->facebook = GETPOST("facebook", 'alpha');
+ $object->linkedin = GETPOST("linkedin", 'alpha');
$object->email = preg_replace('/\s+/', '', GETPOST("email", 'alpha'));
$object->job = GETPOST("job", 'alpha');
$object->signature = GETPOST("signature", 'none');
@@ -606,6 +608,7 @@ if (empty($reshook)) {
$ldap_skype = $attribute[$conf->global->LDAP_FIELD_SKYPE];
$ldap_twitter = $attribute[$conf->global->LDAP_FIELD_TWITTER];
$ldap_facebook = $attribute[$conf->global->LDAP_FIELD_FACEBOOK];
+ $ldap_linkedin = $attribute[$conf->global->LDAP_FIELD_LINKEDIN];
$ldap_mail = $attribute[$conf->global->LDAP_FIELD_MAIL];
$ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID];
}
@@ -1067,6 +1070,23 @@ if ($action == 'create' || $action == 'adduserldap')
print '';
}
+ // LinkedIn
+ if (! empty($conf->socialnetworks->enabled))
+ {
+ print ''.$langs->trans("LinkedIn").' ';
+ print '';
+ if (! empty($ldap_linkedin))
+ {
+ print ' ';
+ print $ldap_linkedin;
+ }
+ else
+ {
+ print ' ';
+ }
+ print ' ';
+ }
+
// EMail
print 'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").' ';
print '';
@@ -2286,7 +2306,7 @@ else
print ' ';
}
- // Skype
+ // Facebook
if (! empty($conf->socialnetworks->enabled))
{
print ''.$langs->trans("Facebook").' ';
@@ -2303,6 +2323,23 @@ else
print ' ';
}
+ // LinkedIn
+ if (! empty($conf->socialnetworks->enabled))
+ {
+ print ''.$langs->trans("LinkedIn").' ';
+ print '';
+ if ($caneditfield && empty($object->ldap_sid))
+ {
+ print ' ';
+ }
+ else
+ {
+ print ' ';
+ print $object->linkedin;
+ }
+ print ' ';
+ }
+
// EMail
print "".'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").' ';
print '';
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 3b26bb8cdfb..e7f927b2f60 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -73,6 +73,7 @@ class User extends CommonObject
public $skype;
public $twitter;
public $facebook;
+ public $linkedin;
public $job; // job position
public $signature;
@@ -227,7 +228,7 @@ class User extends CommonObject
$login=trim($login);
// Get user
- $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.job, u.skype, u.twitter, u.facebook,";
+ $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.job, u.skype, u.twitter, u.facebook, u.linkedin,";
$sql.= " u.signature, u.office_phone, u.office_fax, u.user_mobile,";
$sql.= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,";
$sql.= " u.admin, u.login, u.note,";
@@ -335,6 +336,7 @@ class User extends CommonObject
$this->skype = $obj->skype;
$this->twitter = $obj->twitter;
$this->facebook = $obj->facebook;
+ $this->linkedin = $obj->linkedin;
$this->job = $obj->job;
$this->signature = $obj->signature;
$this->admin = $obj->admin;
@@ -1250,6 +1252,7 @@ class User extends CommonObject
$this->skype = $contact->skype;
$this->twitter = $contact->twitter;
$this->facebook = $contact->facebook;
+ $this->linkedin = $contact->linkedin;
$this->office_phone = $contact->phone_pro;
$this->office_fax = $contact->fax;
$this->user_mobile = $contact->phone_mobile;
@@ -1467,6 +1470,7 @@ class User extends CommonObject
$this->skype = trim($this->skype);
$this->twitter = trim($this->twitter);
$this->facebook = trim($this->facebook);
+ $this->linkedin = trim($this->linkedin);
$this->job = trim($this->job);
$this->signature = trim($this->signature);
@@ -1519,6 +1523,7 @@ class User extends CommonObject
$sql.= ", skype = '".$this->db->escape($this->skype)."'";
$sql.= ", twitter = '".$this->db->escape($this->twitter)."'";
$sql.= ", facebook = '".$this->db->escape($this->facebook)."'";
+ $sql.= ", linkedin = '".$this->db->escape($this->linkedin)."'";
$sql.= ", job = '".$this->db->escape($this->job)."'";
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
@@ -1607,6 +1612,7 @@ class User extends CommonObject
$adh->skype=$this->skype;
$adh->twitter=$this->twitter;
$adh->facebook=$this->facebook;
+ $adh->linkedin=$this->linkedin;
$adh->phone=$this->office_phone;
$adh->phone_mobile=$this->user_mobile;
@@ -1659,6 +1665,7 @@ class User extends CommonObject
$tmpobj->skype=$this->skype;
$tmpobj->twitter=$this->twitter;
$tmpobj->facebook=$this->facebook;
+ $tmpobj->linkedin=$this->linkedin;
$tmpobj->phone_pro=$this->office_phone;
$tmpobj->phone_mobile=$this->user_mobile;
@@ -2426,15 +2433,15 @@ class User extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
- /**
- * Renvoi le libelle d'un statut donne
- *
- * @param int $statut Id statut
- * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
- * @return string Label of status
- */
- public function LibStatut($statut, $mode = 0)
- {
+ /**
+ * Renvoi le libelle d'un statut donne
+ *
+ * @param int $statut Id statut
+ * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @return string Label of status
+ */
+ public function LibStatut($statut, $mode = 0)
+ {
// phpcs:enable
global $langs;
$langs->load('users');
@@ -2526,7 +2533,8 @@ class User extends CommonObject
'LDAP_FIELD_SID' => 'ldap_sid',
'LDAP_FIELD_SKYPE' => 'skype',
'LDAP_FIELD_TWITTER' => 'twitter',
- 'LDAP_FIELD_FACEBOOK' => 'facebook'
+ 'LDAP_FIELD_FACEBOOK' => 'facebook',
+ 'LDAP_FIELD_LINKEDIN' => 'linkedin'
);
// Champs
@@ -2640,6 +2648,7 @@ class User extends CommonObject
$this->skype='skypepseudo';
$this->twitter='twitterpseudo';
$this->facebook='facebookpseudo';
+ $this->linkedin='linkedinpseudo';
$this->office_phone='0999999999';
$this->office_fax='0999999998';
$this->user_mobile='0999999997';
@@ -2794,6 +2803,7 @@ class User extends CommonObject
$this->skype=$ldapuser->{$conf->global->LDAP_FIELD_SKYPE};
$this->twitter=$ldapuser->{$conf->global->LDAP_FIELD_TWITTER};
$this->facebook=$ldapuser->{$conf->global->LDAP_FIELD_FACEBOOK};
+ $this->linkedin=$ldapuser->{$conf->global->LDAP_FIELD_LINKEDIN};
$this->ldap_sid=$ldapuser->{$conf->global->LDAP_FIELD_SID};
$this->job=$ldapuser->{$conf->global->LDAP_FIELD_TITLE};
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index 43abb1f9e75..c53193411ff 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -1,7 +1,7 @@
- * Copyright (C) 2017 Laurent Destailleur
- * Copyright (C) 2018 Frédéric France
+/* Copyright (C) 2016 Marcos García
+ * Copyright (C) 2017 Laurent Destailleur
+ * Copyright (C) 2018-2019 Frédéric France
*
* 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
@@ -29,9 +29,9 @@ $langs->loadLangs(array("products", "other"));
$id = GETPOST('id', 'int');
$valueid = GETPOST('valueid', 'int');
-$ref = GETPOST('ref');
-$weight_impact = (float) GETPOST('weight_impact');
-$price_impact = (float) GETPOST('price_impact');
+$ref = GETPOST('ref', 'alpha');
+$weight_impact = GETPOST('weight_impact', 'alpha');
+$price_impact = GETPOST('price_impact', 'alpha');
$price_impact_percent = (bool) GETPOST('price_impact_percent');
$form = new Form($db);