From e512f1082fe0a46f1d4cacf2aa946d5c3bc6b0d0 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 30 Aug 2018 02:33:22 +0200 Subject: [PATCH 1/8] Fix multicompany we can need to use multicompany with evry modulepart ex. newpayment.php, ticket, onlinesign... --- htdocs/viewimage.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 45cbcd1c6a5..dbe76ae49c4 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -56,11 +56,12 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) if (! defined("NOLOGIN")) define("NOLOGIN",1); if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",1); // We accept to go on this page from external web site. if (! defined("NOIPCHECK")) define("NOIPCHECK",1); // Do not check IP defined into conf $dolibarr_main_restrict_ip - // For multicompany - $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); - if (is_numeric($entity)) define("DOLENTITY", $entity); } +// For multicompany +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) define("DOLENTITY", $entity); + /** * Header empty * From d2859276b57530842cb4e3946a25cfaaee41ceae Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 30 Aug 2018 02:35:42 +0200 Subject: [PATCH 2/8] add logo with multicompany this fix push entity to viewimage.php --- htdocs/public/payment/newpayment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 45aeb0d1321..55882e3d4f9 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -682,12 +682,12 @@ else if (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global-> $urllogo=''; if (! empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('thumbs/'.$logosmall); + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('thumbs/'.$logosmall); $width=150; } elseif (! empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode($logo); + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode($logo); $width=150; } // Output html code for logo From fc804d8eebb03151772f7c60d21757835160ccee Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 30 Aug 2018 02:37:11 +0200 Subject: [PATCH 3/8] Fix image if multicompany + no login in onlinesign --- htdocs/public/onlinesign/newonlinesign.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 7571f466c46..9535ae16583 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -180,11 +180,11 @@ else if (! empty($conf->global->ONLINE_SIGN_LOGO)) $logosmall=$conf->global->ONL $urllogo=''; if (! empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('thumbs/'.$logosmall); + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('thumbs/'.$logosmall); } elseif (! empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode($logo); + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode($logo); $width=96; } // Output html code for logo From de73f1545fca54ab7efbc8eef21fcd870702c357 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 30 Aug 2018 02:42:14 +0200 Subject: [PATCH 4/8] fix multicompany and footer - fix viewimage and multicompany + no login - delete ticket footer for common payment.lib.php footer --- htdocs/core/lib/ticket.lib.php | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 6ae66803c39..19e8cb3002f 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -160,9 +160,9 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ $urllogo = DOL_URL_ROOT . '/theme/login_logo.png'; if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=companylogo&file=' . urlencode('thumbs/' . $mysoc->logo_small); + $urllogo = DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file=' . urlencode('thumbs/' . $mysoc->logo_small); } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $mysoc->logo)) { - $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=companylogo&file=' . urlencode($mysoc->logo); + $urllogo = DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file=' . urlencode($mysoc->logo); $width = 128; } elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.png')) { $urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.png'; @@ -175,20 +175,3 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '
'; } - -/** - * Show footer for new member - * - * @return void - */ -function llxFooterTicket() -{ - print '
'; - - printCommonFooter('public'); - - dol_htmloutput_events(); - - print "\n"; - print "\n"; -} From 302179c73995a0278d906b9d6f8db1d23e01b836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Aug 2018 08:10:51 +0200 Subject: [PATCH 5/8] Create index.html --- htdocs/stripe/class/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/stripe/class/index.html diff --git a/htdocs/stripe/class/index.html b/htdocs/stripe/class/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/stripe/class/index.html @@ -0,0 +1 @@ + From 8af6c170ff4d261a4e13601d360ce6d84c3fc135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Aug 2018 12:19:54 +0200 Subject: [PATCH 6/8] restore build badge for develop --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5feec47e56f..b68e8b65558 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DOLIBARR ERP & CRM -![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/8.0.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) +![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). From 49729c311836e3edc79b926115b846fec52fd3bc Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 30 Aug 2018 13:54:10 +0200 Subject: [PATCH 7/8] Add shipping_method label --- htdocs/expedition/class/expedition.class.php | 21 +++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index a4bcfeb2281..f56689cd461 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -476,10 +476,12 @@ class Expedition extends CommonObject $sql.= ", e.note_private, e.note_public"; $sql.= ', e.fk_incoterms, e.location_incoterms'; $sql.= ', i.libelle as libelle_incoterms'; + $sql.= ', s.libelle as shipping_method'; $sql.= ", el.fk_source as origin_id, el.sourcetype as origin"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = e.rowid AND el.targettype = '".$this->db->escape($this->element)."'"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON e.fk_incoterms = i.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_shipment_mode as s ON e.fk_shipping_method = s.rowid'; $sql.= " WHERE e.entity IN (".getEntity('expedition').")"; if ($id) $sql.= " AND e.rowid=".$id; if ($ref) $sql.= " AND e.ref='".$this->db->escape($ref)."'"; @@ -497,9 +499,9 @@ class Expedition extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->ref; $this->socid = $obj->socid; - $this->ref_customer = $obj->ref_customer; - $this->ref_ext = $obj->ref_ext; - $this->ref_int = $obj->ref_int; + $this->ref_customer = $obj->ref_customer; + $this->ref_ext = $obj->ref_ext; + $this->ref_int = $obj->ref_int; $this->statut = $obj->fk_statut; $this->user_author_id = $obj->fk_user_author; $this->date_creation = $this->db->jdate($obj->date_creation); @@ -509,12 +511,13 @@ class Expedition extends CommonObject $this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed $this->fk_delivery_address = $obj->fk_address; $this->modelpdf = $obj->model_pdf; - $this->shipping_method_id = $obj->fk_shipping_method; + $this->shipping_method_id = $obj->fk_shipping_method; + $this->shipping_method = $obj->shipping_method; $this->tracking_number = $obj->tracking_number; $this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility $this->origin_id = $obj->origin_id; $this->billed = $obj->billed; - $this->fk_project = $obj->fk_projet; + $this->fk_project = $obj->fk_projet; $this->trueWeight = $obj->weight; $this->weight_units = $obj->weight_units; @@ -530,13 +533,13 @@ class Expedition extends CommonObject $this->note_private = $obj->note_private; // A denormalized value - $this->trueSize = $obj->size."x".$obj->width."x".$obj->height; + $this->trueSize = $obj->size."x".$obj->width."x".$obj->height; $this->size_units = $obj->size_units; //Incoterms - $this->fk_incoterms = $obj->fk_incoterms; - $this->location_incoterms = $obj->location_incoterms; - $this->libelle_incoterms = $obj->libelle_incoterms; + $this->fk_incoterms = $obj->fk_incoterms; + $this->location_incoterms = $obj->location_incoterms; + $this->libelle_incoterms = $obj->libelle_incoterms; $this->db->free($result); From d70e548f94f90ac8ba3c1bf38ac6f28d1068de2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Thu, 30 Aug 2018 18:12:02 +0200 Subject: [PATCH 8/8] Fix: undefined rights_class on modules When a module has the permission variable rights_class undefined, on unactivate the module are deleted all rows in cronjobs and menu tables with module=''. --- htdocs/core/modules/DolibarrModules.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index c810405d42b..3d29a827a9f 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Raphaël Doursenaud + * Copyright (C) 2018 Josep Lluís Amador * * 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 @@ -1328,7 +1329,7 @@ class DolibarrModules // Can not be abstract, because we need to insta // Search if cron entry already present $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob"; - $sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module_name = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; if ($class) $sql.= " AND classesname = '".$this->db->escape($class)."'"; if ($objectname) $sql.= " AND objectname = '".$this->db->escape($objectname)."'"; if ($method) $sql.= " AND methodename = '".$this->db->escape($method)."'"; @@ -1354,7 +1355,7 @@ class DolibarrModules // Can not be abstract, because we need to insta if(is_int($status)){ $sql.= ' status,'; } $sql.= " entity, test)"; $sql.= " VALUES ("; - $sql.= "'".$this->db->escape($this->rights_class)."', "; + $sql.= "'".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."', "; $sql.= "'".$this->db->idate($now)."', "; $sql.= ($datestart ? "'".$this->db->idate($datestart)."'" : "NULL").", "; $sql.= ($dateend ? "'".$this->db->idate($dateend)."'" : "NULL").", "; @@ -1417,7 +1418,7 @@ class DolibarrModules // Can not be abstract, because we need to insta if (is_array($this->cronjobs)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."cronjob"; - $sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module_name = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; $sql.= " AND entity = ".$conf->entity; dol_syslog(get_class($this)."::delete_cronjobs", LOG_DEBUG); @@ -1795,7 +1796,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $err=0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."rights_def"; - $sql.= " WHERE module = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; $sql.= " AND entity = ".$conf->entity; dol_syslog(get_class($this)."::delete_permissions", LOG_DEBUG); if (! $this->db->query($sql)) @@ -1833,7 +1834,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $menu->menu_handler='all'; //$menu->module=strtolower($this->name); TODO When right_class will be same than module name - $menu->module=$this->rights_class; + $menu->module=empty($this->rights_class)?strtolower($this->name):$this->rights_class; if (! $this->menu[$key]['fk_menu']) { @@ -1929,7 +1930,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $err=0; //$module=strtolower($this->name); TODO When right_class will be same than module name - $module=$this->rights_class; + $module=empty($this->rights_class)?strtolower($this->name):$this->rights_class; $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; $sql.= " WHERE module = '".$this->db->escape($module)."'";