diff --git a/ChangeLog b/ChangeLog index eca42af81a7..4ae175c119f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -231,6 +231,7 @@ WARNING: -------- The following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* The hook changeHelpURL is replaced by llxHeader * The property ->brouillon has been removed from all classes. It was not reliable and was a duplicate of ->status == self::STATUS_DRAFT. * The duplicated and deprecated property ->date_livraison that was renamed into ->delivery_date has been completely removed. * The property ->user_close to store ID of closing user has been renamed into ->user_closing_id. diff --git a/README.md b/README.md index 4645176a3f5..1d7ea4b321c 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Batches / Lots / Serials - Product Variants - Bill of Materials (BOM) -- Manufacturing Orders +- Manufacturing Orders (MO) Customer/Sales Management @@ -114,7 +114,8 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Customer Orders management - Contracts/Subscription management - Interventions management -- Ticket System +- Ticket System (+ Knowledge management) +- Partnership management - Shipping management - Customer Invoices/Credit notes and payment management - Point of Sale (POS) @@ -143,14 +144,16 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Shared calendar/agenda (with ical and vcal import/export for third-party tools integration) - Projects & Tasks management +- Event organization - Ticket System - Surveys - HR + HR - Human Resources Management - Employee's leaves management - Expense reports - Recruitment management +- Employee/staff management - Timesheets ### Other application/modules @@ -168,7 +171,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Payment platforms integration (PayPal, Stripe, Paybox...) - Email-Collector -(around 100 modules available by default, 1000+ on the addon marketplace) +(around 100 modules available by default, 1000+ addons at the official marketplace Dolistore.com) ### Other general features diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index e294a216f92..ed23307cf8a 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -302,7 +302,7 @@ $html .= '

Lines of code

'."\n"; $html .= '
'."\n"; $html .= ''; $html .= ''; -$html .= ''; $html .= ''; $html .= ''; $html .= ''; @@ -310,7 +310,7 @@ $html .= ''; $html .= ''; $html .= ''; //$html .= ''; -$html .= ''; +$html .= ''; foreach (array('proj', 'dep') as $source) { $html .= ''; if ($source == 'proj') { @@ -400,7 +400,7 @@ $( ".seedetail" ).on( "click", function() { }); '; -$html .= ''; +$html .= ''; $html .= ''; $fh = fopen($outputpath, 'w'); diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index c6262e0f6d1..711b6a8601a 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -197,10 +197,6 @@ class BookKeeping extends CommonObject */ public $picto = 'generic'; - /** - * @var array List of active fiscal periods cached [[date_start, date_end], ...] - */ - public static $active_fiscal_period_cached; /** * @var string[] SQL filter used for check if the bookkeeping record can be created/inserted/modified/deleted (cached) */ @@ -2280,6 +2276,8 @@ class BookKeeping extends CommonObject */ public function getCanModifyBookkeepingSQL($alias = '', $force = false) { + global $conf; + $alias = trim($alias); $alias = !empty($alias) && strpos($alias, '.') < 0 ? $alias . "." : $alias; @@ -2290,8 +2288,8 @@ class BookKeeping extends CommonObject } $sql_list = array(); - if (is_array(self::$active_fiscal_period_cached)) { - foreach (self::$active_fiscal_period_cached as $fiscal_period) { + if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) { + foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { $sql_list[] = "('" . $this->db->idate($fiscal_period['date_start']) . "' <= {$alias}doc_date AND {$alias}doc_date <= '" . $this->db->idate($fiscal_period['date_end']) . "')"; } } @@ -2309,26 +2307,52 @@ class BookKeeping extends CommonObject */ public function canModifyBookkeeping($id) { - $result = $this->loadFiscalPeriods(false, 'active'); - if ($result < 0) { - return -1; - } + global $conf; - $bookkeeping = new BookKeeping($this->db); - $result = $bookkeeping->fetch($id); - if ($result <= 0) { - return $result; - } + if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') == 'blockedonclosed') { + $result = $this->loadFiscalPeriods(false, 'closed'); - if (is_array(self::$active_fiscal_period_cached)) { - foreach (self::$active_fiscal_period_cached as $fiscal_period) { - if ($fiscal_period['date_start'] <= $bookkeeping->doc_date && $bookkeeping->doc_date <= $fiscal_period['date_end']) { - return 1; + if ($result < 0) { + return -1; + } + + $bookkeeping = new BookKeeping($this->db); + $result = $bookkeeping->fetch($id); + if ($result <= 0) { + return $result; + } + + if (!empty($conf->cache['closed_fiscal_period_cached']) && is_array($conf->cache['closed_fiscal_period_cached'])) { + foreach ($conf->cache['closed_fiscal_period_cached'] as $fiscal_period) { + if ($fiscal_period['date_start'] <= $bookkeeping->doc_date && $bookkeeping->doc_date <= $fiscal_period['date_end']) { + return 0; + } } } - } - return 0; + return 1; + } else { + $result = $this->loadFiscalPeriods(false, 'active'); + if ($result < 0) { + return -1; + } + + $bookkeeping = new BookKeeping($this->db); + $result = $bookkeeping->fetch($id); + if ($result <= 0) { + return $result; + } + + if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) { + foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { + if ($fiscal_period['date_start'] <= $bookkeeping->doc_date && $bookkeeping->doc_date <= $fiscal_period['date_end']) { + return 1; + } + } + } + + return 0; + } } /** @@ -2339,10 +2363,23 @@ class BookKeeping extends CommonObject */ public function validBookkeepingDate($date) { + global $conf; + if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') == 'blockedonclosed') { $result = $this->loadFiscalPeriods(false, 'closed'); - // TODO + if ($result < 0) { + return -1; + } + + if (!empty($conf->cache['closed_fiscal_period_cached']) && is_array($conf->cache['closed_fiscal_period_cached'])) { + foreach ($conf->cache['closed_fiscal_period_cached'] as $fiscal_period) { + if ($fiscal_period['date_start'] <= $date && $date <= $fiscal_period['date_end']) { + return 0; + } + } + } + return 1; } else { $result = $this->loadFiscalPeriods(false, 'active'); @@ -2350,16 +2387,16 @@ class BookKeeping extends CommonObject return -1; } - if (is_array(self::$active_fiscal_period_cached)) { - foreach (self::$active_fiscal_period_cached as $fiscal_period) { + if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) { + foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { if ($fiscal_period['date_start'] <= $date && $date <= $fiscal_period['date_end']) { return 1; } } } - } - return 0; + return 0; + } } /** @@ -2374,7 +2411,7 @@ class BookKeeping extends CommonObject global $conf; if ($mode == 'active') { - if (!isset(self::$active_fiscal_period_cached) || $force) { + if (!isset($conf->cache['active_fiscal_period_cached']) || $force) { $sql = "SELECT date_start, date_end"; $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; $sql .= " WHERE entity = " . ((int) $conf->entity); @@ -2393,12 +2430,31 @@ class BookKeeping extends CommonObject 'date_end' => $this->db->jdate($obj->date_end), ); } - self::$active_fiscal_period_cached = $list; + $conf->cache['active_fiscal_period_cached'] = $list; } } if ($mode == 'closed') { - // TODO + if (!isset($conf->cache['closed_fiscal_period_cached']) || $force) { + $sql = "SELECT date_start, date_end"; + $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; + $sql .= " WHERE entity = " . ((int) $conf->entity); + $sql .= " AND statut = 1"; + $resql = $this->db->query($sql); + if (!$resql) { + $this->errors[] = $this->db->lasterror(); + return -1; + } + + $list = array(); + while ($obj = $this->db->fetch_object($resql)) { + $list[] = array( + 'date_start' => $this->db->jdate($obj->date_start), + 'date_end' => $this->db->jdate($obj->date_end), + ); + } + $conf->cache['closed_fiscal_period_cached'] = $list; + } } return 1; diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 62d68c76b36..7551765fc8d 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -100,6 +100,7 @@ if (empty($reshook)) { // Action mise a jour d'une categorie if ($action == 'update' && $user->hasRight('categorie', 'creer')) { $object->oldcopy = dol_clone($object, 2); + $object->label = $label; $object->description = dol_htmlcleanlastbr($description); $object->color = $color; diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index e05a911ffee..cd6ebd9c3bf 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -23,7 +23,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; /** * API class for accounts * - * @property DoliDB db + * @property DoliDB $db * @access protected * @class DolibarrApiAccess {@requires user,external} */ diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index b499ca17c71..00f71708085 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -630,18 +630,18 @@ if (count($amount)) { } else { $linkname = $langs->trans("PaymentsNotLinkedToInvoice"); } - print "\n"; + print '\n"; print ''; - print ''; - print ''; // Amount w/o VAT diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index 86f02628ff2..171aeddaf9b 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -71,20 +71,20 @@ class DolGeoIP } } else { print 'ErrorBadParameterInConstructor'; - return 0; + return; } // Here, function exists (embedded into PHP or exists because we made include) if (empty($type) || empty($datfile)) { $this->errorlabel = 'Constructor was called with no datafile parameter'; dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR); - return 0; + return; } if (!file_exists($datfile) || !is_readable($datfile)) { $this->error = 'ErrorGeoIPClassNotInitialized'; $this->errorlabel = "Datafile ".$datfile." not found"; dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR); - return 0; + return; } if ($geoipversion == '2') { @@ -93,7 +93,7 @@ class DolGeoIP } catch (Exception $e) { $this->error = $e->getMessage(); dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR); - return 0; + return; } } elseif (function_exists('geoip_open') && defined('GEOIP_STANDARD')) { $this->gi = geoip_open($datfile, constant('GEOIP_STANDARD')); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8644b88da7f..c9f00ad0d0f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3995,57 +3995,8 @@ class Form } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - - /** - * Return list of delivery address - * - * @param string $selected Id contact pre-selectionn - * @param int $socid Id of company - * @param string $htmlname Name of HTML field - * @param int $showempty Add an empty field - * @return integer - */ - public function select_address($selected, $socid, $htmlname = 'address_id', $showempty = 0) - { - // phpcs:enable - // looking for users - $sql = "SELECT a.rowid, a.label"; - $sql .= " FROM " . $this->db->prefix() . "societe_address as a"; - $sql .= " WHERE a.fk_soc = " . ((int) $socid); - $sql .= " ORDER BY a.label ASC"; - - dol_syslog(get_class($this) . "::select_address", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { - print ''; - return $num; - } else { - dol_print_error($this->db); - return -1; - } - } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** * Load into cache list of payment terms * diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index d8dfe544584..e9a531303ae 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -371,7 +371,7 @@ class FormOther public function select_percent($selected = 0, $htmlname = 'percent', $disabled = 0, $increment = 5, $start = 0, $end = 100, $showempty = 0) { // phpcs:enable - $return = ''; if ($showempty) { $return .= ''; } diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 807d1c66646..7f80422432b 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -172,7 +172,6 @@ class Menubase { $this->db = $db; $this->menu_handler = $menu_handler; - return 1; } diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 2db5a1a8d04..4e2201cf638 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -101,7 +101,7 @@ class DoliDBPgsql extends DoliDB $this->ok = false; $this->error = "Pgsql PHP functions are not available in this version of PHP"; dol_syslog(get_class($this)."::DoliDBPgsql : Pgsql PHP functions are not available in this version of PHP", LOG_ERR); - return $this->ok; + return; } if (!$host) { @@ -109,7 +109,7 @@ class DoliDBPgsql extends DoliDB $this->ok = false; $this->error = $langs->trans("ErrorWrongHostParameter"); dol_syslog(get_class($this)."::DoliDBPgsql : Erreur Connect, wrong host parameters", LOG_ERR); - return $this->ok; + return; } // Essai connexion serveur @@ -144,8 +144,6 @@ class DoliDBPgsql extends DoliDB // Pas de selection de base demandee, ok ou ko $this->database_selected = false; } - - return $this->ok; } diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 5d2502cf935..9d8f5fcb81d 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -86,7 +86,7 @@ class DoliDBSqlite3 extends DoliDB $this->ok = false; $this->error="Sqlite PHP functions for using Sqlite driver are not available in this version of PHP. Try to use another driver."; dol_syslog(get_class($this)."::DoliDBSqlite3 : Sqlite PHP functions for using Sqlite driver are not available in this version of PHP. Try to use another driver.",LOG_ERR); - return $this->ok; + return; }*/ /*if (! $host) @@ -95,7 +95,7 @@ class DoliDBSqlite3 extends DoliDB $this->ok = false; $this->error=$langs->trans("ErrorWrongHostParameter"); dol_syslog(get_class($this)."::DoliDBSqlite3 : Erreur Connect, wrong host parameters",LOG_ERR); - return $this->ok; + return; }*/ // Essai connexion serveur @@ -126,8 +126,6 @@ class DoliDBSqlite3 extends DoliDB //$this->error=sqlite_connect_error(); dol_syslog(get_class($this)."::DoliDBSqlite3 : Error Connect ".$this->error, LOG_ERR); } - - return $this->ok; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a5638960e10..8b0ee3e0748 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -224,8 +224,7 @@ function isModEnabled($module) 'category' => 'categorie', 'contract' => 'contrat', 'project' => 'projet', - 'bank' => 'banque', - 'category' => 'categorie' + 'delivery_note' => 'expedition' ); if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { $arrayconv['supplier_order'] = 'fournisseur'; diff --git a/htdocs/core/lib/parsemd.lib.php b/htdocs/core/lib/parsemd.lib.php index 284ea81e6d3..4015227a104 100644 --- a/htdocs/core/lib/parsemd.lib.php +++ b/htdocs/core/lib/parsemd.lib.php @@ -37,7 +37,7 @@ function dolMd2Html($content, $parser = 'parsedown', $replaceimagepath = null) $content = preg_replace('/([^<]+)<\/a>/', '[\3](\1)', $content); // Replace HTML coments - $content = preg_replace('//ms', '', $content); // We remove HTML comment that are not MD comment because they will be escaped and output when setSafeMode is set to true. + $content = preg_replace('//Ums', '', $content); // We remove HTML comment that are not MD comment because they will be escaped and output when setSafeMode is set to true. if (is_array($replaceimagepath)) { foreach ($replaceimagepath as $key => $val) { diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index bae6cf56f99..ba4961cc5f6 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1502,8 +1502,12 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, } else { $textwasnotmodified = ($desc == $prodser->description); } - if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($textwasnotmodified || $translatealsoifmodified)) { - $desc = $prodser->multilangs[$outputlangs->defaultlang]["description"]; + if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"])) { + if ($textwasnotmodified) { + $desc = str_replace($prodser->description, $prodser->multilangs[$outputlangs->defaultlang]["description"], $desc); + } elseif ($translatealsoifmodified) { + $desc = $prodser->multilangs[$outputlangs->defaultlang]["description"]; + } } // Set note diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index cc9a03ca441..8416df31b72 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1265,20 +1265,17 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec // Ref print '\n"; // Date @@ -1583,14 +1580,14 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr // Ref print ''; print ''; diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index ea620d9800d..d68f3796536 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -491,7 +491,7 @@ print ''; print ''; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 0e5c9a37b12..14f1efea5e1 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -663,7 +663,7 @@ if (!empty($arrayfields['timeconsumed']['checked'])) { print ''; print 'Photo'; //print '
'.img_object('', 'user', 'class=""', 0, 0, $notooltip ? 0 : 1).'
'; - print ''.$langs->trans("Everybody").''; + print ''.$langs->trans("EverybodySmall").''; print '
'; print ''; print '
'; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 60aa52567c1..c5993ecd1e3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -104,7 +104,6 @@ class Societe extends CommonObject */ protected $childtablesoncascade = array( 'societe_prices', - 'societe_address', 'product_fournisseur_price', 'product_customer_price_log', 'product_customer_price', @@ -5208,7 +5207,6 @@ class Societe extends CommonObject * Do not include llx_societe because it will be replaced later */ $tables = array( - 'societe_address', 'societe_commerciaux', 'societe_prices', 'societe_remise', diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index b1d1d9e6201..ca6addc5118 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -55,7 +55,6 @@ $pagenext = $page + 1; $optioncss = GETPOST('optioncss', 'alpha'); $param = ""; $num = 0; -$totalnboflines = 0; $result = restrictedArea($user, 'banque'); @@ -85,6 +84,9 @@ $stripeacc = $stripe->getStripeAccount($service); print $langs->trans('ErrorStripeAccountNotDefined'); }*/ +$moreforfilter = ''; +$totalnboflines = -1; + if (!$rowid) { print '
'; if ($optioncss != '') { diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index b24e10ce452..93db8d61250 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -69,7 +69,7 @@ $colortexttitle = '40, 40, 60'; $colortexttitlelink = '10, 20, 100'; $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; -$fontsize = '0.94em'; +$fontsize = '0.92em'; $fontsizesmaller = '0.75em'; $topMenuFontSize = '1.1em'; $toolTipBgColor = 'rgba(255, 255, 255, 0.96)'; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index d5aa0513ceb..c2ae5a046a5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -419,11 +419,11 @@ class User extends CommonObject * @param string $sid If defined, sid to used for search * @param int $loadpersonalconf 1=also load personal conf of user (in $user->conf->xxx), 0=do not load personal conf. * @param int $entity If a value is >= 0, we force the search on a specific entity. If -1, means search depens on default setup. - * @param int $email If defined, email to used for search + * @param string $email If defined, email to used for search * @param int $fk_socpeople If defined, id of contact for search * @return int <0 if KO, 0 not found, >0 if OK */ - public function fetch($id = '', $login = '', $sid = '', $loadpersonalconf = 0, $entity = -1, $email = '', $fk_socpeople = 0) + public function fetch($id = 0, $login = '', $sid = '', $loadpersonalconf = 0, $entity = -1, $email = '', $fk_socpeople = 0) { global $conf, $user; diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index c06cda641ad..8854c724471 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -163,7 +163,7 @@ class UserGroup extends CommonObject * @param boolean $load_members Load all members of the group * @return int <0 if KO, >0 if OK */ - public function fetch($id = '', $groupname = '', $load_members = false) + public function fetch($id = 0, $groupname = '', $load_members = false) { global $conf; diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index b6ded243233..ec9b46c49a2 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -374,7 +374,7 @@ $server->register( * @param string $ref_ext Ref_ext * @return array Array result */ -function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') +function getOrder($authentication, $id = 0, $ref = '', $ref_ext = '') { global $db, $conf; @@ -806,7 +806,7 @@ function createOrder($authentication, $order) * @param int $id_warehouse Id of warehouse to use for stock decrease * @return array Array result */ -function validOrder($authentication, $id = '', $id_warehouse = 0) +function validOrder($authentication, $id = 0, $id_warehouse = 0) { global $db, $conf, $langs;
Language'; +$html .= 'LanguageBytesFilesLinesBlanksCommentsCode'.$val['Complexity'].'
".$linkname."'.$linkname."'; - print $address_zip[$key]; + print $address_pays($address_zip[$key]); print ''; - print $address_town[$key]; + print ''; + print $address_pays($address_town[$key]); print ''; - print $address_pays[$key]; + print ''; + print $address_pays($address_pays[$key]); print ''; - print ''; + print ''; for ($k = 0; $k < $level; $k++) { - print "   "; + print '
'; } print $taskstatic->getNomUrl(1, 'withproject', 'time'); // Label task print '
'; + print '
'.dol_escape_htmltag($taskstatic->label).'
'; for ($k = 0; $k < $level; $k++) { - print "   "; + print "
"; } - print $taskstatic->label; - //print "
"; - //for ($k = 0 ; $k < $level ; $k++) print "   "; - //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); print "
'; - print ''; + print ''; for ($k = 0; $k < $level; $k++) { print '
'; } print $taskstatic->getNomUrl(1, 'withproject', 'time'); // Label task print '
'; - print ''.$taskstatic->label.''; + print '
'.dol_escape_htmltag($taskstatic->label).'
'; for ($k = 0; $k < $level; $k++) { print "
"; } @@ -1981,15 +1978,15 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ } // Ref - print '
'; - print ''; + print ''; + print ''; for ($k = 0; $k < $level; $k++) { print '
'; } print $taskstatic->getNomUrl(1, 'withproject', 'time'); // Label task print '
'; - print ''.$taskstatic->label.''; + print '
'.dol_escape_htmltag($taskstatic->label).'
'; for ($k = 0; $k < $level; $k++) { print "
"; } @@ -2023,7 +2020,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print '
'; // $lines[$i]->duration_effective is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user if ($lines[$i]->duration_effective) { - print ''; + print ''; print convertSecondToTime($lines[$i]->duration_effective, 'allhourmin'); print ''; } else { @@ -2035,7 +2032,9 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print ''; $tmptimespent = $taskstatic->getSummaryOfTimeSpent($fuser->id); if ($tmptimespent['total_duration']) { + print ''; print convertSecondToTime($tmptimespent['total_duration'], 'allhourmin'); + print ''; } else { print '--:--'; } @@ -2286,14 +2285,14 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & // Ref print ''; - print ''; + print ''; for ($k = 0; $k < $level; $k++) { print '
'; } print $taskstatic->getNomUrl(1, 'withproject', 'time'); // Label task print '
'; - print ''.$taskstatic->label.''; + print '
'.dol_escape_htmltag($taskstatic->label).'
'; for ($k = 0; $k < $level; $k++) { print "
"; } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 879edcd0fe5..43379266484 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -429,7 +429,7 @@ 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 ('', 'isModEnabled("project") && !getDolGlobalInt("PROJECT_HIDE_TASK")', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->hasRight("projet","lire")', '', 2, 2, __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 ('', 'isModEnabled("project") && !getDolGlobalInt("PROJECT_HIDE_TASK")', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->hasRight("projet","lire")', '', 2, 4, __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 ('', 'isModEnabled("project") && !getDolGlobalInt("PROJECT_HIDE_TASK")', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->hasRight("projet","lire")', '', 2, 3, __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 ('', 'isModEnabled("project") && !getDolGlobalInt("PROJECT_HIDE_TASK")', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'TimeEntry', 0, 'projects', '$user->hasRight("projet","lire")', '', 2, 3, __ENTITY__); -- Project - Categories insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->hasRight("categorie","lire")', '', 2, 4, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 4557075657f..45ce276611d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2273,13 +2273,13 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } if (empty($conf->global->PROJECT_HIDE_TASKS)) { - // Project affected to user + // Project assigned to user $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'tasks', 0, '', '', '', img_picto('', 'projecttask', 'class="paddingright pictofixedwidth"')); $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->hasRight('projet', 'creer')); $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("TimeEntry"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); } } @@ -2387,7 +2387,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $search_project_user = GETPOST('search_project_user', 'int'); - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("TimeEntry"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); } } } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 08abdcb40ab..807291469e1 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2139,6 +2139,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it global $langs, $conf; $err = 0; + $name = ''; if (isset($this->dirs) && is_array($this->dirs)) { foreach ($this->dirs as $key => $value) { diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 1ffbc0cc028..f57b5f02c70 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -116,7 +116,7 @@ class ImportXlsx extends ModeleImports if (!class_exists('ZipArchive')) { // For Excel2007 $langs->load("errors"); $this->error = $langs->trans('ErrorPHPNeedModule', 'zip'); - return -1; + return; } $this->label_lib = 'PhpSpreadSheet'; $this->version_lib = '1.8.0'; diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 1324ea1b010..43abea4d860 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -337,9 +337,9 @@ class modTakePos extends DolibarrModules $searchaccountid = $cashaccount->create($user); } if ($searchaccountid > 0) { - dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH1", $result, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH1", $searchaccountid, 'chaine', 0, '', $conf->entity); } else { - setEventMessages($societe->error, $category->errors, 'errors'); + setEventMessages($cashaccount->error, $cashaccount->errors, 'errors'); } } diff --git a/htdocs/core/modules/project/task/modules_task.php b/htdocs/core/modules/project/task/modules_task.php index 5752b03dec3..f42e094ea21 100644 --- a/htdocs/core/modules/project/task/modules_task.php +++ b/htdocs/core/modules/project/task/modules_task.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php'; /** - * Parent class for projects models + * Parent class for task models */ abstract class ModelePDFTask extends CommonDocGenerator { @@ -58,7 +58,7 @@ abstract class ModelePDFTask extends CommonDocGenerator /** - * Classe mere des modeles de numerotation des references de projets + * Parent class of task reference numbering models */ abstract class ModeleNumRefTask extends CommonNumRefGenerator { diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index b4d2a01a8e2..011d1fb2f7f 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2698,7 +2698,7 @@ class ExpenseReport extends CommonObject //Clean $qty = price2num($qty); - $sql = " SELECT r.range_ik, t.ikoffset as ikoffset, t.coef"; + $sql = " SELECT r.range_ik, t.ikoffset, t.coef"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_ik t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_exp_tax_range r ON r.rowid = t.fk_range"; $sql .= " WHERE t.fk_c_exp_tax_cat = ".(int) $fk_cat; @@ -2725,6 +2725,7 @@ class ExpenseReport extends CommonObject $obj = $this->db->fetch_object($resql); $cumulYearQty = $obj->cumul; } + $qty = $cumulYearQty + $qty; } diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index a09b8d4fbf6..098ab394683 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -24,7 +24,7 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php'; /** * API class for supplier invoices * - * @property DoliDB db + * @property DoliDB $db * @access protected * @class DolibarrApiAccess {@requires user,external} */ diff --git a/htdocs/install/mysql/tables/llx_societe_address.sql b/htdocs/install/mysql/tables/llx_societe_address.sql deleted file mode 100644 index 2b5f2d57146..00000000000 --- a/htdocs/install/mysql/tables/llx_societe_address.sql +++ /dev/null @@ -1,37 +0,0 @@ --- ======================================================================== --- Copyright (C) 2000-2004 Rodolphe Quiedeville --- Copyright (C) 2005-2013 Houssin Regis --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- ======================================================================== - -create table llx_societe_address -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - datec datetime, -- creation date - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date - label varchar(30), -- - fk_soc integer DEFAULT 0, -- - name varchar(60), -- company name - address varchar(255), -- company adresse - zip varchar(10), -- zipcode - town varchar(50), -- town - fk_pays integer DEFAULT 0, -- - phone varchar(20), -- phone number - fax varchar(20), -- fax number - note text, -- - fk_user_creat integer, - fk_user_modif integer -)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_societe_contacts.sql b/htdocs/install/mysql/tables/llx_societe_contacts.sql index 3f301c0cf34..cd8b92667e3 100644 --- a/htdocs/install/mysql/tables/llx_societe_contacts.sql +++ b/htdocs/install/mysql/tables/llx_societe_contacts.sql @@ -17,7 +17,7 @@ -- ======================================================================== -- This table contains the contacts by default of a thirdparty --- Such contacts will be added to document automatiall if their role match the one expected by the document. +-- Such contacts will be added to document automatically if their role match the one expected by the document. create table llx_societe_contacts ( diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index b8f5dc60eae..6727d486d35 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -161,7 +161,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_propaldet_extrafield CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_resource FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_salary FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_address FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_prices FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_remise FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index cf8262261e1..07f3690a671 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -366,6 +366,11 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) { dol_print_error($db, 'Error in setup program'); } + // May fail if parameter already defined + dolibarr_install_syslog('step5: set the default language'); + $resql = $db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_LANG_DEFAULT').", ".$db->encrypt($setuplang).", 'chaine', 0, 'Default language', 1)"); + //if (! $resql) dol_print_error($db,'Error in setup program'); + $db->commit(); } } else { @@ -414,11 +419,6 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) { dol_print_error($db, 'Error in setup program'); } } - - // May fail if parameter already defined - dolibarr_install_syslog('step5: set the default language'); - $resql = $db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_LANG_DEFAULT').", ".$db->encrypt($setuplang).", 'chaine', 0, 'Default language', 1)"); - //if (! $resql) dol_print_error($db,'Error in setup program'); } else { print $langs->trans("ErrorFailedToConnect")."
"; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 22de1d56036..d75a6ef25c8 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2426,6 +2426,6 @@ ExtrafieldsDeleted=Extrafields %s has been deleted LargeModern=Large - Modern SpecialCharActivation=Enable the button to open a virtual keyboard to enter special characters DeleteExtrafield=Delete extrafield -ConfirmDeleteExtrafield=Confirm delete %s extrafield ? All data is going to be lost +ConfirmDeleteExtrafield=Do you confirm deletion of the field %s ? All data aved into this field will be definitely deleted ExtraFieldsSupplierInvoicesRec=Complementary attributes (templates invoices) ExtraFieldsSupplierInvoicesLinesRec=Complementary attributes (invoice lines) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index bd530592d2c..de0505e4f9e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1082,6 +1082,7 @@ CommentPage=Comments space CommentAdded=Comment added CommentDeleted=Comment deleted Everybody=Everybody +EverybodySmall=Everybody PayedBy=Paid by PayedTo=Paid to Monthly=Monthly diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 55d002b2554..935995ea3ae 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -128,5 +128,10 @@ Manufacturing=Manufacturing Disassemble=Disassemble ProducedBy=Produced by QtyTot=Qty Total + +QtyCantBeSplit= Quantity cannot be split +NoRemainQtyToDispatch=No quantity remaining to divide + THMOperatorEstimatedHelp=Estimated cost of operator per hour. Will be used to estimate cost of a BOM using this workstation. -THMMachineEstimatedHelp=Estimated cost of machine per hour. Will be used to estimate cost of a BOM using this workstation. \ No newline at end of file +THMMachineEstimatedHelp=Estimated cost of machine per hour. Will be used to estimate cost of a BOM using this workstation. + diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 8e60cbbba56..6d60b8f0fd1 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -81,7 +81,7 @@ PurchasedAmount=Purchased amount NewPrice=New price MinPrice=Min. selling price MinPriceHT=Min. selling price (excl. tax) -MinPriceTTC=Prix de vente min (inc. tax) +MinPriceTTC=Min. selling price (inc. tax) EditSellingPriceLabel=Edit selling price label CantBeLessThanMinPrice=The selling price can't be lower than minimum allowed for this product (%s without tax). This message can also appear if you type a significant discount. CantBeLessThanMinPriceInclTax=The selling price can't be lower than minimum allowed for this product (%s including taxes). This message can also appears if you type a too important discount. diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 5d7b4b41b7b..4e56f346cea 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -45,6 +45,7 @@ OutOfProject=Out of project NoProject=No project defined or owned NbOfProjects=Number of projects NbOfTasks=Number of tasks +TimeEntry=Time tracking TimeSpent=Time spent TimeSpentByYou=Time spent by you TimeSpentByUser=Time spent by user diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index b9e43ce69db..0236c90550f 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -127,4 +127,4 @@ BOMServicesList=Les services de BOM Manufacturing=Fabrication Disassemble=Déassemblage ProducedBy=Produit par -QtyTot=Qté totale +QtyTot=Qté totale \ No newline at end of file diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index fc6a5aaea04..c9105d32e4b 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; /** * Class to manage mailman and spip diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 654648a35f7..9a1c6f49d6d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1460,6 +1460,28 @@ if (!function_exists("llxHeader")) { { global $conf, $hookmanager; + $parameters = array( + 'head' =>& $head, + 'title' =>& $title, + 'help_url' =>& $help_url, + 'target' =>& $target, + 'disablej' =>& $disablej, + 'disablehea' =>& $disablehea, + 'arrayofjs' =>& $arrayofjs, + 'arrayofcss' =>& $arrayofcss, + 'morequerystring' =>& $morequerystring, + 'morecssonbody' =>& $morecssonbody, + 'replacemainareaby' =>& $replacemainareaby, + 'disablenofollow' =>& $disablenofollow, + 'disablenoindex' =>& $disablenoindex + + ); + $reshook = $hookmanager->executeHooks('llxHeader', $parameters); + if ($reshook > 0) { + print $hookmanager->resPrint; + return; + } + // html header top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, $disablenofollow, $disablenoindex); @@ -1478,12 +1500,6 @@ if (!function_exists("llxHeader")) { print ''."\n"; - $parameters = array('help_url' => $help_url); - $reshook = $hookmanager->executeHooks('changeHelpURL', $parameters); - if ($reshook > 0) { - $help_url = $hookmanager->resPrint; - } - // top menu and left menu area if ((empty($conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int')) && !GETPOST('dol_openinpopup', 'aZ09')) { top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss, $morequerystring, $help_url); diff --git a/htdocs/modulebuilder/template/README.md b/htdocs/modulebuilder/template/README.md index 2e63e69bd0b..30f081abd78 100644 --- a/htdocs/modulebuilder/template/README.md +++ b/htdocs/modulebuilder/template/README.md @@ -22,10 +22,13 @@ For more information, see the [translator's documentation](https://wiki.dolibarr There is a [Transifex project](https://transifex.com/projects/p/dolibarr-module-template) for this module. --> - + + + +### Final steps From your browser: @@ -73,7 +83,7 @@ From your browser: - Go to "Setup" -> "Modules" - You should now be able to find and enable the module ---> + ## Licenses diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index a985dfe3998..68b28ea758c 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -91,39 +91,40 @@ if (!class_exists('FormSetup')) { $formSetup = new FormSetup($db); -// HTTP HOST -$item = $formSetup->newItem('NO_PARAM_JUST_TEXT'); +// Enter here all parameters in your setup page + +// Setup conf for selection of an URL +$item = $formSetup->newItem('MYMODULE_MYPARAM1'); $item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST']; $item->cssClass = 'minwidth500'; -// Setup conf MYMODULE_MYPARAM1 as a simple string input -$item = $formSetup->newItem('MYMODULE_MYPARAM1'); +// Setup conf for selection of a simple string input +$item = $formSetup->newItem('MYMODULE_MYPARAM2'); $item->defaultFieldValue = 'default value'; -// Setup conf MYMODULE_MYPARAM2 as a simple textarea input but we replace the text of field title -$item = $formSetup->newItem('MYMODULE_MYPARAM2'); +// Setup conf for selection of a simple textarea input but we replace the text of field title +$item = $formSetup->newItem('MYMODULE_MYPARAM3'); $item->nameText = $item->getNameText().' more html text '; -// Setup conf MYMODULE_MYPARAM3 -$item = $formSetup->newItem('MYMODULE_MYPARAM3'); +// Setup conf for a selection of a thirdparty +$item = $formSetup->newItem('MYMODULE_MYPARAM4'); $item->setAsThirdpartyType(); -// Setup conf MYMODULE_MYPARAM4 : exemple of quick define write style -$formSetup->newItem('MYMODULE_MYPARAM4')->setAsYesNo(); +// Setup conf for a selection of a boolean +$formSetup->newItem('MYMODULE_MYPARAM5')->setAsYesNo(); -// Setup conf MYMODULE_MYPARAM5 -$formSetup->newItem('MYMODULE_MYPARAM5')->setAsEmailTemplate('thirdparty'); +// Setup conf for a selection of an email template of type thirdparty +$formSetup->newItem('MYMODULE_MYPARAM6')->setAsEmailTemplate('thirdparty'); -// Setup conf MYMODULE_MYPARAM6 -//$formSetup->newItem('MYMODULE_MYPARAM6')->setAsSecureKey(); +// Setup conf for a selection of a secured key +//$formSetup->newItem('MYMODULE_MYPARAM7')->setAsSecureKey(); -// Setup conf MYMODULE_MYPARAM7 -$formSetup->newItem('MYMODULE_MYPARAM7')->setAsProduct(); +// Setup conf for a selection of a product +$formSetup->newItem('MYMODULE_MYPARAM8')->setAsProduct(); -$formSetup->newItem('Title')->setAsTitle(); +// Add a title for a new section +$formSetup->newItem('NewSection')->setAsTitle(); -// Setup conf MYMODULE_MYPARAM8 -$item = $formSetup->newItem('MYMODULE_MYPARAM8'); $TField = array( 'test01' => $langs->trans('test01'), 'test02' => $langs->trans('test02'), @@ -132,13 +133,16 @@ $TField = array( 'test05' => $langs->trans('test05'), 'test06' => $langs->trans('test06'), ); -$item->setAsMultiSelect($TField); -$item->helpText = $langs->transnoentities('MYMODULE_MYPARAM8'); - -// Setup conf MYMODULE_MYPARAM9 +// Setup conf for a simple combo list $formSetup->newItem('MYMODULE_MYPARAM9')->setAsSelect($TField); +// Setup conf for a multiselect combo list +$item = $formSetup->newItem('MYMODULE_MYPARAM10'); +$item->setAsMultiSelect($TField); +$item->helpText = $langs->transnoentities('MYMODULE_MYPARAM10'); + + // Setup conf MYMODULE_MYPARAM10 $item = $formSetup->newItem('MYMODULE_MYPARAM10'); diff --git a/htdocs/mrp/js/lib_dispatch.js.php b/htdocs/mrp/js/lib_dispatch.js.php index 1dd2d9d164c..58c3abc68f5 100644 --- a/htdocs/mrp/js/lib_dispatch.js.php +++ b/htdocs/mrp/js/lib_dispatch.js.php @@ -47,6 +47,9 @@ session_cache_limiter('public'); require_once '../../main.inc.php'; +// Load translation files required by the page +$langs->loadLangs(array("mrp")); + // Define javascript type top_httphead('text/javascript; charset=UTF-8'); // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. @@ -153,10 +156,12 @@ function addDispatchLine(index, type, mode) */ function addDispatchTR(qtyOrdered, qtyDispatched, index, nbrTrs, warehouseId, inputId, type, qty, mode, $row) { if (qtyOrdered <= 1) { - window.alert("Quantity can't be split"); + let errormsg = 'trans('QtyCantBeSplit')); ?>'; + $.jnotify(errormsg, 'error', true); return -1; } else if (qtyDispatched >= qtyOrdered) { - window.alert("No remain qty to dispatch"); + let errormsg = 'trans('NoRemainQtyToDispatch')); ?>; + $.jnotify(errormsg, 'error', true); return -1; } else if (qtyDispatched < qtyOrdered) { //replace tr suffix nbr diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 84b6cbe7123..a3df01938ad 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -577,6 +577,6 @@ class PropalmergepdfproductLine */ public function __construct() { - return 1; + return; } } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index e10d02e3a3a..b1a844cd2ac 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -814,6 +814,11 @@ if ($search_finished) { // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; + // List of mass actions available $arrayofmassactions = array( 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index 0e63cb8dbe8..507dc556d5e 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -153,7 +153,7 @@ class StockTransferLine extends CommonObjectLine // Translate some data of arrayofkeyval if (is_object($langs)) { foreach ($this->fields as $key => $val) { - if (is_array($val['arrayofkeyval'])) { + if (isset($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { foreach ($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index cf428668cd4..f4f6898e12b 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -195,7 +195,7 @@ if (empty($reshook)) { $line->pmp = $prod->pmp; if ($line->id > 0) $line->update($user); else { - $line->rang = count($object->lines) + 1; + $line->rang = (is_array($object->lines) || $object->lines instanceof Countable) ? count($object->lines) + 1 : 1; $line->create($user); } $object->fetchLines(); diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 2f9e083828b..806bda880fb 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -609,7 +609,7 @@ if (!empty($arrayfields['timeconsumed']['checked'])) { print '
'.$langs->trans("TimeSpent").'
'; print ''; print 'Photo'; - print ''.$langs->trans("Everybody").''; + print ''.$langs->trans("EverybodySmall").''; print ''; print '
'.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').'
'.$langs->trans("ProgressDeclared"). print ''.$langs->trans("TimeSpent").'
'; print ''; print 'Photo'; -print ''.$langs->trans("Everybody").''; +print ''.$langs->trans("EverybodySmall").''; print ''; print '
'.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').'
'.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.$usertoprocess->getNomUrl(-2).''.dol_trunc($usertoprocess->firstname, 10).'' : '').'