From 74ac69fc5a27768c5644865933b3980109d483f6 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 27 Feb 2020 09:16:15 +0100 Subject: [PATCH 001/116] Add Entity in list_product_fournisseur_price() Select too the entity value to add const NOTMODIFYOTHERENTITYFOURNPRICE --- .../fourn/class/fournisseur.product.class.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 9f49fb31b83..f11f88464f3 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1,12 +1,13 @@ - * Copyright (C) 2006-2011 Laurent Destailleur - * Copyright (C) 2009-2014 Regis Houssin - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2015 Marcos García - * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2019 Frédéric France +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2009-2014 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2015 Marcos García + * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2019 Frédéric France + * Copyright (C) 2020 Pierre Ardoin * * 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 @@ -590,7 +591,7 @@ class ProductFournisseur extends Product global $conf; $sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,"; - $sql.= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,"; + $sql.= " pfp.rowid as product_fourn_pri_id, pfp.entity, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,"; $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,"; $sql.= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,"; $sql.= " pfp.barcode, pfp.fk_barcode_type"; @@ -616,6 +617,7 @@ class ProductFournisseur extends Product $prodfourn->product_fourn_price_id = $record["product_fourn_pri_id"]; $prodfourn->product_fourn_id = $record["product_fourn_id"]; + $prodfourn->product_fourn_entity = $record["entity"]; $prodfourn->fourn_ref = $record["ref_fourn"]; $prodfourn->ref_supplier = $record["ref_fourn"]; $prodfourn->desc_supplier = $record["desc_fourn"]; From 84764771373f06b9fd62ea691ddac377bbdfe848 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Thu, 27 Feb 2020 09:19:39 +0100 Subject: [PATCH 002/116] add const NOTMODIFYOTHERENTITYFOURNPRICE if const NOTMODIFYOTHERENTITYFOURNPRICE, can't modify other shared fourn prices. --- htdocs/product/fournisseurs.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 0bda7d44564..797f350627e 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -1,14 +1,15 @@ - * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2012 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2014 Ion Agorria - * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2016 Ferran Marcet - * Copyright (C) 2019 Frédéric France +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2014 Ion Agorria + * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2019 Frédéric France + * Copyright (C) 2020 Pierre Ardoin * * 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 @@ -933,7 +934,14 @@ SCRIPT; // Modify-Remove print ''; - if ($usercancreate) + + if (!empty($conf->global->NOTMODIFYOTHERENTITYFOURNPRICE) && $productfourn->product_fourn_entity!=$conf->entity) { + $canmodifyotherentityfournprice = 0; + }else{ + $canmodifyotherentityfournprice = 1; + } + + if ($usercancreate && $canmodifyotherentityfournprice == 1) { print ''.img_edit().""; print '   '; From 5dc403cb664fe3c1397fc3cbb9b7469dfc816466 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Mar 2020 12:19:24 +0100 Subject: [PATCH 003/116] FIX #13304 --- htdocs/expensereport/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index a05fd1393bb..03cafb6b60d 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -277,7 +277,9 @@ $sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.tota $sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,"; $sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.email, u.statut, u.photo"; // Add fields from extrafields -foreach ($extrafields->attributes['expensereport']['type'] as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); +if (is_array($extrafields->attributes['expensereport']['type'])) { + foreach ($extrafields->attributes['expensereport']['type'] as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); +} // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook From c2b11782730b80a1f8df6a0e38b5f44cd99eacc7 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Mon, 16 Mar 2020 07:55:15 +0100 Subject: [PATCH 004/116] Add substitution for user_civility for ODT --- .../core/class/commondocgenerator.class.php | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 279eb1f7a6b..bd3dcb01e76 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -267,33 +267,34 @@ abstract class CommonDocGenerator $object->state = getState($object->state_code, 0); } - $array_contact = array( - $array_key.'_fullname' => $object->getFullName($outputlangs, 1), - $array_key.'_lastname' => $object->lastname, - $array_key.'_firstname' => $object->firstname, - $array_key.'_address' => $object->address, - $array_key.'_zip' => $object->zip, - $array_key.'_town' => $object->town, - $array_key.'_state_id' => $object->state_id, - $array_key.'_state_code' => $object->state_code, - $array_key.'_state' => $object->state, - $array_key.'_country_id' => $object->country_id, - $array_key.'_country_code' => $object->country_code, - $array_key.'_country' => $object->country, - $array_key.'_poste' => $object->poste, - $array_key.'_socid' => $object->socid, - $array_key.'_statut' => $object->statut, - $array_key.'_code' => $object->code, - $array_key.'_email' => $object->email, - $array_key.'_jabberid' => $object->jabberid, - $array_key.'_phone_pro' => $object->phone_pro, - $array_key.'_phone_perso' => $object->phone_perso, - $array_key.'_phone_mobile' => $object->phone_mobile, - $array_key.'_fax' => $object->fax, - $array_key.'_birthday' => $object->birthday, - $array_key.'_default_lang' => $object->default_lang, - $array_key.'_note_public' => $object->note_public, - $array_key.'_note_private' => $object->note_private + $array_contact = array ( + $array_key . '_fullname' => $object->getFullName($outputlangs, 1), + $array_key . '_lastname' => $object->lastname, + $array_key . '_firstname' => $object->firstname, + $array_key . '_address' => $object->address, + $array_key . '_zip' => $object->zip, + $array_key . '_town' => $object->town, + $array_key . '_state_id' => $object->state_id, + $array_key . '_state_code' => $object->state_code, + $array_key . '_state' => $object->state, + $array_key . '_country_id' => $object->country_id, + $array_key . '_country_code' => $object->country_code, + $array_key . '_country' => $object->country, + $array_key . '_poste' => $object->poste, + $array_key . '_socid' => $object->socid, + $array_key . '_statut' => $object->statut, + $array_key . '_code' => $object->code, + $array_key . '_email' => $object->email, + $array_key . '_jabberid' => $object->jabberid, // deprecated + $array_key . '_phone_pro' => $object->phone_pro, + $array_key . '_phone_perso' => $object->phone_perso, + $array_key . '_phone_mobile' => $object->phone_mobile, + $array_key . '_fax' => $object->fax, + $array_key . '_birthday' => $object->birthday, + $array_key . '_default_lang' => $object->default_lang, + $array_key . '_note_public' => $object->note_public, + $array_key . '_note_private' => $object->note_private, + $array_key . '_civility' => $object->civility, ); // Retrieve extrafields From 564f4129578cd1b5de730af0807ac3d673ef8a07 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Tue, 17 Mar 2020 10:04:43 +0100 Subject: [PATCH 005/116] correction due to comments @hregis and @eldy --- htdocs/product/fournisseurs.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 797f350627e..843a32c57a4 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -53,6 +53,7 @@ $socid=GETPOST('socid', 'int'); $cost_price=GETPOST('cost_price', 'alpha'); $backtopage=GETPOST('backtopage', 'alpha'); $error=0; +$canmodifyotherentityfournprice = 1 // If socid provided by ajax company selector if (! empty($_REQUEST['search_fourn_id'])) @@ -935,12 +936,6 @@ SCRIPT; // Modify-Remove print ''; - if (!empty($conf->global->NOTMODIFYOTHERENTITYFOURNPRICE) && $productfourn->product_fourn_entity!=$conf->entity) { - $canmodifyotherentityfournprice = 0; - }else{ - $canmodifyotherentityfournprice = 1; - } - if ($usercancreate && $canmodifyotherentityfournprice == 1) { print ''.img_edit().""; From 26f6f04486448c4071c8ac5c35fd63daebf5082e Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Tue, 17 Mar 2020 10:08:18 +0100 Subject: [PATCH 006/116] forgot ";" --- htdocs/product/fournisseurs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 843a32c57a4..d7238a72174 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -53,7 +53,7 @@ $socid=GETPOST('socid', 'int'); $cost_price=GETPOST('cost_price', 'alpha'); $backtopage=GETPOST('backtopage', 'alpha'); $error=0; -$canmodifyotherentityfournprice = 1 +$canmodifyotherentityfournprice = 1 ; // If socid provided by ajax company selector if (! empty($_REQUEST['search_fourn_id'])) From f7b4e48d599844a532a5ee8e8d1b9e3dfb99c7cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 10:51:26 +0100 Subject: [PATCH 007/116] Code comment --- build/makepack-dolibarr.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index f68ca6a77f5..c6b8cd330c8 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -2,7 +2,7 @@ #---------------------------------------------------------------------------- # \file build/makepack-dolibarr.pl # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps) -# \author (c)2004-2015 Laurent Destailleur +# \author (c)2004-2020 Laurent Destailleur # # This is list of constant you can set to have generated packages moved into a specific dir: #DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild' @@ -430,12 +430,14 @@ if ($nboftargetok) { $ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`; print 'Run git push -f --tags'."\n"; $ret=`git push -f --tags`; + #$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`; } } else { print 'Run git push --tags'."\n"; $ret=`git push --tags`; + #$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`; } chdir("$olddir"); } From ac5d2fedc5da8a62319183e2671bfed2cc89bd48 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Fri, 20 Mar 2020 15:40:46 +0100 Subject: [PATCH 008/116] NEW add category type from hook --- htdocs/categories/class/categorie.class.php | 42 +++++++++++++++++++ htdocs/categories/index.php | 23 +++------- htdocs/categories/photos.php | 30 ++++++------- htdocs/categories/traduction.php | 25 +++++------ htdocs/categories/viewcat.php | 9 ++-- .../install/mysql/migration/11.0.0-12.0.0.sql | 1 + 6 files changed, 82 insertions(+), 48 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index e8296b96beb..2e8afdb0089 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -243,7 +243,49 @@ class Categorie extends CommonObject */ public function __construct($db) { + global $hookmanager; + $this->db = $db; + + if (is_object($hookmanager)) { + $hookmanager->initHooks(array('category')); + $parameters = array(); + $reshook = $hookmanager->executeHooks('constructCategory', $parameters, $this); // Note that $action and $object may have been modified by some hooks + if ($reshook >= 0 && !empty($hookmanager->resArray)) { + $mapList = $hookmanager->resArray; + $mapId = $mapList['id']; + $mapCode = $mapList['code']; + self::$MAP_ID_TO_CODE[$mapId] = $mapCode; + $this->MAP_ID[$mapCode] = $mapId; + $this->MAP_CAT_FK[$mapCode] = $mapList['cat_fk']; + $this->MAP_CAT_TABLE[$mapCode] = $mapList['cat_table']; + $this->MAP_OBJ_CLASS[$mapCode] = $mapList['obj_class']; + $this->MAP_OBJ_TABLE[$mapCode] = $mapList['obj_table']; + } + } + } + + /** + * Get map list + * + * @return array + */ + public function getMapList() + { + $mapList = array(); + + foreach ($this->MAP_ID as $mapCode => $mapId) { + $mapList[] = array( + 'id' => $mapId, + 'code' => $mapCode, + 'cat_fk' => $this->MAP_CAT_FK[$mapCode], + 'cat_table' => $this->MAP_CAT_TABLE[$mapCode], + 'obj_class' => $this->MAP_OBJ_CLASS[$mapCode], + 'obj_table' => $this->MAP_OBJ_TABLE[$mapCode] + ); + } + + return $mapList; } /** diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index d96fddca150..54a4ff9f1d2 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -40,6 +40,7 @@ $id = GETPOST('id', 'int'); $type = (GETPOST('type', 'aZ09') ? GETPOST('type', 'aZ09') : Categorie::TYPE_PRODUCT); $catname = GETPOST('catname', 'alpha'); +$categstatic = new Categorie($db); if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility @@ -47,25 +48,13 @@ if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backwar * View */ -$categstatic = new Categorie($db); $form = new Form($db); -if ($type == Categorie::TYPE_PRODUCT) { $title=$langs->trans("ProductsCategoriesArea"); $typetext='product'; } -elseif ($type == Categorie::TYPE_SUPPLIER) { $title=$langs->trans("SuppliersCategoriesArea"); $typetext='supplier'; } -elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; } -elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; } -elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; } -elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='bank_account'; } -elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; } -elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; } -elseif ($type == Categorie::TYPE_WAREHOUSE) { $title=$langs->trans("StocksCategoriesArea"); $typetext='warehouse'; } -elseif ($type == Categorie::TYPE_ACTIONCOMM) { - $title = $langs->trans("ActionCommCategoriesArea"); - $typetext = 'actioncomm'; -} else { - $title = $langs->trans("CategoriesArea"); - $typetext = 'unknown'; -} +$typetext = $type; +if ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans('AccountsCategoriesArea'); +elseif ($type == Categorie::TYPE_WAREHOUSE) $title = $langs->trans('StocksCategoriesArea'); +elseif ($type == Categorie::TYPE_ACTIONCOMM) $title = $langs->trans('ActionCommCategoriesArea'); +else $title = $langs->trans(ucfirst($type). 'sCategoriesArea'); $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index ed6091e3568..b9fd23c1a3d 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -36,15 +36,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php'; $langs->loadlangs(array('categories', 'bills')); -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref'); -$type = GETPOST('type'); -$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id', 'int'); +$label = GETPOST('label', 'alpha'); +$type = GETPOST('type'); +$action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility - -if ($id == "") +if ($id == '' && $label == '') { dol_print_error('', 'Missing parameter id'); exit(); @@ -54,13 +52,17 @@ if ($id == "") $result = restrictedArea($user, 'categorie', $id, '&category'); $object = new Categorie($db); -if ($id > 0) -{ - $result = $object->fetch($id); - - $upload_dir = $conf->categorie->multidir_output[$object->entity]; +$result = $object->fetch($id, $label, $type); +if ($result <= 0) { + dol_print_error($db, $object->error); exit; } +$object->fetch_optionals(); +if ($result <= 0) { + dol_print_error($db, $object->error); exit; +} +$upload_dir = $conf->categorie->multidir_output[$object->entity]; +if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility /* * Actions @@ -126,7 +128,7 @@ if ($object->id) dol_fiche_head($head, 'photos', $title, -1, 'category'); $linkback = ''.$langs->trans("BackToList").''; - + $object->next_prev_filter = ' type = ' . $object->type; $object->ref = $object->label; $morehtmlref='
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); @@ -136,7 +138,7 @@ if ($object->id) } $morehtmlref.='
'; - dol_banner_tab($object, 'ref', $linkback, ($user->socid?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); + dol_banner_tab($object, 'label', $linkback, ($user->socid?0:1), 'label', 'label', $morehtmlref, '&type=' . $type, 0, '', '', 1); /* * Confirmation de la suppression de photo diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 03ca6e977bd..697db116881 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -36,18 +36,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->loadLangs(array('categories', 'languages')); $id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +$label = GETPOST('label', 'alpha'); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $type = GETPOST('type', 'aZ09'); -if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility - -// Security check -$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); -$fieldtype = (!empty($ref) ? 'ref' : 'rowid'); - -if ($id == "") +if ($id == '' && $label == '') { dol_print_error('', 'Missing parameter id'); exit(); @@ -57,7 +51,16 @@ if ($id == "") $result = restrictedArea($user, 'categorie', $id, '&category'); $object = new Categorie($db); +$result = $object->fetch($id, $label, $type); +if ($result <= 0) { + dol_print_error($db, $object->error); exit; +} +$object->fetch_optionals(); +if ($result <= 0) { + dol_print_error($db, $object->error); exit; +} +if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility /* * Actions @@ -159,8 +162,6 @@ $cancel != $langs->trans("Cancel") && } } -$result = $object->fetch($id, $ref); - /* * View @@ -197,7 +198,7 @@ if (!empty($object->multilangs)) dol_fiche_head($head, 'translation', $title, -1, 'category'); $linkback = ''.$langs->trans("BackToList").''; - +$object->next_prev_filter = ' type = ' . $object->type; $object->ref = $object->label; $morehtmlref = '
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); @@ -207,7 +208,7 @@ foreach ($ways as $way) } $morehtmlref .= '
'; -dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); +dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'label', $morehtmlref, '&type=' . $type, 0, '', '', 1); print '
'; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 62538da0273..727ef8b0610 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -71,7 +71,7 @@ if ($id == "" && $label == "") $result = restrictedArea($user, 'categorie', $id, '&category'); $object = new Categorie($db); -$result = $object->fetch($id, $label); +$result = $object->fetch($id, $label, $type); if ($result <= 0) { dol_print_error($db, $object->error); exit; } @@ -80,7 +80,6 @@ if ($result <= 0) { dol_print_error($db, $object->error); exit; } -$type = $object->type; if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility $extrafields = new ExtraFields($db); @@ -222,8 +221,8 @@ $head = categories_prepare_head($object, $type); dol_fiche_head($head, 'card', $title, -1, 'category'); $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type); -$linkback = ''.$langs->trans("BackToList").''; -$object->next_prev_filter=" type = ".$object->type; +$linkback = ''.$langs->trans("BackToList").''; +$object->next_prev_filter = ' type = ' . $object->type; $object->ref = $object->label; $morehtmlref='
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); @@ -233,7 +232,7 @@ foreach ($ways as $way) } $morehtmlref.='
'; -dol_banner_tab($object, 'label', $linkback, ($user->socid?0:1), 'label', 'label', $morehtmlref, '', 0, '', '', 1); +dol_banner_tab($object, 'label', $linkback, ($user->socid?0:1), 'label', 'label', $morehtmlref, '&type=' . $type, 0, '', '', 1); /* diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index b2d0b9b0bd1..aef9692bf75 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -198,3 +198,4 @@ ALTER TABLE llx_entrepot ADD COLUMN phone varchar(20) DEFAULT NULL AFTER fk_pays ALTER TABLE llx_accounting_account ADD COLUMN reconcilable tinyint DEFAULT 0 NOT NULL after active; +ALTER TABLE llx_categorie CHANGE type type integer NOT NULL DEFAULT '1'; From d28eaf5824df48d59da0f14c162ec2e39c58c93f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 15:47:50 +0100 Subject: [PATCH 009/116] FIX Backto link --- htdocs/website/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ac255693b0d..88a369efdf2 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3397,6 +3397,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print ''.$answerrecord->description.''; print ''; $param = '?action=replacesiteconfirm'; + $param .= '&websiteid='.$website->id; $param .= '&optioncontent='.GETPOST('optioncontent'); $param .= '&optionmeta='.GETPOST('optionmeta'); $param .= '&optionsitefiles='.GETPOST('optionsitefiles'); From 5d9e713a1c6a52e31fdd67ad1f74ff6e22d6c1de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 20:36:26 +0100 Subject: [PATCH 010/116] Fix better default sort order --- htdocs/comm/mailing/cibles.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 41e49ed09b3..b9f6396578e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -48,8 +48,8 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortfield) $sortfield = "email"; -if (!$sortorder) $sortorder = "ASC"; +if (!$sortfield) $sortfield = "mc.statut,email"; +if (!$sortorder) $sortorder = "DESC,ASC"; $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); From 599bf89f60e2a28973ac86926fa12d8d78068f77 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 20:46:21 +0100 Subject: [PATCH 011/116] Fix can edit emailing after sending has started --- htdocs/comm/mailing/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 0900c5b032c..a21ea9d7d0a 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -992,7 +992,7 @@ else print ''.$langs->trans("SetToDraft").''; } - if (($object->statut == 0 || $object->statut == 1) && $user->rights->mailing->creer) + if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) { if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { From 3e807b00ba9dd3e998176b85b10f5bbe81bf2f87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 21:16:52 +0100 Subject: [PATCH 012/116] FIX Look and feel v11 --- htdocs/opensurvey/fonctions.php | 69 +++++++++++++++++++----- htdocs/opensurvey/results.php | 2 +- htdocs/opensurvey/wizard/choix_autre.php | 2 +- htdocs/public/opensurvey/studs.php | 7 ++- 4 files changed, 60 insertions(+), 20 deletions(-) diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 69dd0d4e0a7..22cd78ae8d7 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -67,31 +67,70 @@ function opensurvey_prepare_head(Opensurveysondage $object) * @param int $disablehead More content into html header * @param array $arrayofjs Array of complementary js files * @param array $arrayofcss Array of complementary css files + * @param string $numsondage Num survey * @return void */ -function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $numsondage = '') { - global $conf, $mysoc; + global $conf, $langs, $mysoc; + global $dolibarr_main_url_root; + + //$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - print ''; + print ''; - // Print logo - if ($mysoc->logo) { - if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } - } - if (!$urllogo && (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))) + + print ''."\n"; + print '
'."\n"; + print '
'."\n"; + print ''; + print ''."\n"; + print "\n"; + + + // Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) + $width = 0; + // Define logo and logosmall + $logosmall = $mysoc->logo_small; + $logo = $mysoc->logo; + $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; + if (!empty($conf->global->$paramlogo)) $logosmall = $conf->global->$paramlogo; + elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; + //print ''."\n"; + // Define urllogo + $urllogo = ''; + $urllogofull = ''; + if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $width = 150; + } + elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) + { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $width = 150; } - print '
Logo
'; - print '
'; + // Output html code for logo + if ($urllogo) + { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } - print '
'; + print '

'; } /** @@ -102,6 +141,8 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ function llxFooterSurvey() { print '
'; + print ''; + print '
'; printCommonFooter('public'); diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index a9b726a646b..beed90e3fdd 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1093,6 +1093,6 @@ print ''."\n"; print ''."\n"; -llxFooterSurvey(); +llxFooter(); $db->close(); diff --git a/htdocs/opensurvey/wizard/choix_autre.php b/htdocs/opensurvey/wizard/choix_autre.php index cb3ed346a52..7a31e21c843 100644 --- a/htdocs/opensurvey/wizard/choix_autre.php +++ b/htdocs/opensurvey/wizard/choix_autre.php @@ -110,7 +110,7 @@ llxHeader('', $langs->trans("OpenSurvey"), "", '', 0, 0, $arrayofjs, $arrayofcss if (empty($_SESSION['titre'])) { dol_print_error('', $langs->trans('ErrorOpenSurveyFillFirstSection')); - llxFooterSurvey(); + llxFooter(); exit; } diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index ab011dd219a..c9697e2e1e4 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -250,7 +250,8 @@ $form = new Form($db); $arrayofjs = array(); $arrayofcss = array('/opensurvey/css/style.css'); -llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss); + +llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss, $numsondage); if (empty($object->ref)) // For survey, id is a hex string { @@ -274,6 +275,7 @@ foreach ($toutsujet as $value) $toutsujet = str_replace("°", "'", $toutsujet); + print '
'.$langs->trans("YouAreInivitedToVote").'
'; print $langs->trans("OpenSurveyHowTo").'

'; @@ -301,9 +303,6 @@ if (!$canbemodified) { exit; } -print '
'."\n"; -print ''; - print '
'."\n"; print '

'."\n"; From ade07865d6367d400d2c13738d336b30228189d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 21:19:43 +0100 Subject: [PATCH 013/116] FIX Look and feel v11 --- htdocs/opensurvey/fonctions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 22cd78ae8d7..eb1a20800ce 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -130,7 +130,7 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '
'; } - print '

'; + print '

'; } /** From 4b7de1e5f5cea42b5c70d38fe26d5e94adb51fda Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 21 Mar 2020 15:48:25 +0100 Subject: [PATCH 014/116] Remove vars to avoid conficts in TakePOS setup --- htdocs/takepos/admin/setup.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index a7967169db8..cec301cb934 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -71,20 +71,12 @@ if ($action == 'set') $db->begin(); if (GETPOST('socid', 'int') < 0) $_POST["socid"] = ''; - $res = dolibarr_set_const($db, "CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_ROOT_CATEGORY_ID", GETPOST('TAKEPOS_ROOT_CATEGORY_ID', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_BAR_RESTAURANT", GETPOST('TAKEPOS_BAR_RESTAURANT', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_TICKET_VAT_GROUPPED", GETPOST('TAKEPOS_TICKET_VAT_GROUPPED', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_ORDER_NOTES", GETPOST('TAKEPOS_ORDER_NOTES', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_PHONE_BASIC_LAYOUT", GETPOST('TAKEPOS_PHONE_BASIC_LAYOUT', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_SUPPLEMENTS", GETPOST('TAKEPOS_SUPPLEMENTS', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_SUPPLEMENTS_CATEGORY", GETPOST('TAKEPOS_SUPPLEMENTS_CATEGORY', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_SORTPRODUCTFIELD", GETPOST('TAKEPOS_SORTPRODUCTFIELD', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_COLOR_THEME", GETPOST('TAKEPOS_COLOR_THEME', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_DIRECT_PAYMENT", GETPOST('TAKEPOS_DIRECT_PAYMENT', 'int'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_ADDON", GETPOST('TAKEPOS_ADDON', 'alpha'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity); if (!empty($conf->global->TAKEPOS_ENABLE_SUMUP)) { From 4ce1665a1578b2a884b166c7c491d622dff3eec6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 21 Mar 2020 17:31:09 +0100 Subject: [PATCH 015/116] Fix charset in RSS export --- htdocs/core/lib/xcal.lib.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 7e7cbd9672e..e3f53b7588d 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -330,7 +330,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) * @param string $format "rss" * @param string $title Title of export * @param string $desc Description of export - * @param array $events_array Array of events ("uid","startdate","summary","url","desc","author","category") + * @param array $events_array Array of events ("uid","startdate","summary","url","desc","author","category") or Array of WebsitePage * @param string $outputfile Output file * @param string $filter (optional) Filter * @return int < 0 if ko, Nb of events in file if ok @@ -355,7 +355,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt $date = date("r"); // Print header - fwrite($fichier, 'charset_output.""?>'); + fwrite($fichier, 'charset_output.'"?>'); fwrite($fichier, "\n"); fwrite($fichier, ''); @@ -363,11 +363,13 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt fwrite($fichier, "\n".$title."\n"); - $form = ""."\n". + /* + fwrite($fichier, ""."\n". // "fr"."\n". "Dolibarr"."\n". "".$date.""."\n". - "Dolibarr"."\n"; + "Dolibarr"."\n"); + */ // Define $urlwithroot $urlwithouturlroot = preg_replace("/".preg_quote(DOL_URL_ROOT, "/")."$/i", "", trim($dolibarr_main_url_root)); @@ -392,6 +394,19 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt if ($eventqualified) { + if (is_object($event) && get_class($event) == 'WebsitePage') { + // Convert object into an array + $tmpevent = array(); + $tmpevent['uid'] = $event->id; + $tmpevent['startdate'] = $event->date_creation; + $tmpevent['summary'] = $event->title; + $tmpevent['url'] = $event->urlpage.'.php'; + $tmpevent['author'] = $event->author_alias ? $event->author_alias : 'unknown'; + //$tmpevent['category'] = ''; + + $event = $tmpevent; + } + $uid = $event["uid"]; $startdate = $event["startdate"]; $summary = $event["summary"]; From 16c4e3a5b01c96924cff5e7cab09988947b97f1d Mon Sep 17 00:00:00 2001 From: glu000 Date: Sat, 21 Mar 2020 17:55:10 +0100 Subject: [PATCH 016/116] Fix #13394 --- scripts/emailings/mailing-send.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 4e5069b4fdc..eb5b794d3d1 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -328,7 +328,7 @@ if ($resql) { dol_syslog("error for emailing id " . $id . " #" . $i . ($mail->error ? ' - ' . $mail->error : ''), LOG_DEBUG); $sqlerror = "UPDATE " . MAIN_DB_PREFIX . "mailing_cibles"; - $sqlerror .= " SET statut=-1, date_envoi=" . $db->idate($now) . " WHERE rowid=" . $obj->rowid; + $sqlerror .= " SET statut=-1, date_envoi='" . $db->idate($now) . "' WHERE rowid=" . $obj->rowid; $resqlerror = $db->query($sqlerror); if (! $resqlerror) { dol_print_error($db); From bcf17c79ef53d40799a626f5ee5c3ccf27e52109 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Mar 2020 02:44:00 +0100 Subject: [PATCH 017/116] FIX closing tags --- htdocs/core/lib/company.lib.php | 149 +++++++++++++++++--------------- 1 file changed, 77 insertions(+), 72 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index a3771d53cff..561cc0a02b3 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1317,6 +1317,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } $sortfield_new = implode(',', $sortfield_new_list); + $sql = ''; + if (!empty($conf->agenda->enabled)) { // Recherche histo sur actioncomm @@ -1468,85 +1470,88 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } //TODO Add limit in nb of results - $sql .= $db->order($sortfield_new, $sortorder); - dol_syslog("company.lib::show_actions_done", LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) + if ($sql) { - $i = 0; - $num = $db->num_rows($resql); + $sql .= $db->order($sortfield_new, $sortorder); + dol_syslog("company.lib::show_actions_done", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) + { + $i = 0; + $num = $db->num_rows($resql); - while ($i < $num) - { - $obj = $db->fetch_object($resql); + while ($i < $num) + { + $obj = $db->fetch_object($resql); - if ($obj->type == 'action') { - $contactaction = new ActionComm($db); - $contactaction->id = $obj->id; - $result = $contactaction->fetchResources(); - if ($result < 0) { - dol_print_error($db); - setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors'); - } + if ($obj->type == 'action') { + $contactaction = new ActionComm($db); + $contactaction->id = $obj->id; + $result = $contactaction->fetchResources(); + if ($result < 0) { + dol_print_error($db); + setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors'); + } - //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; - //elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; - $tododone = ''; - if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone = 'todo'; + //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; + //elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; + $tododone = ''; + if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone = 'todo'; - $histo[$numaction] = array( - 'type'=>$obj->type, - 'tododone'=>$tododone, - 'id'=>$obj->id, - 'datestart'=>$db->jdate($obj->dp), - 'dateend'=>$db->jdate($obj->dp2), - 'note'=>$obj->label, - 'percent'=>$obj->percent, + $histo[$numaction] = array( + 'type'=>$obj->type, + 'tododone'=>$tododone, + 'id'=>$obj->id, + 'datestart'=>$db->jdate($obj->dp), + 'dateend'=>$db->jdate($obj->dp2), + 'note'=>$obj->label, + 'percent'=>$obj->percent, - 'userid'=>$obj->user_id, - 'login'=>$obj->user_login, - 'userfirstname'=>$obj->user_firstname, - 'userlastname'=>$obj->user_lastname, - 'userphoto'=>$obj->user_photo, + 'userid'=>$obj->user_id, + 'login'=>$obj->user_login, + 'userfirstname'=>$obj->user_firstname, + 'userlastname'=>$obj->user_lastname, + 'userphoto'=>$obj->user_photo, - 'contact_id'=>$obj->fk_contact, - 'socpeopleassigned' => $contactaction->socpeopleassigned, - 'lastname'=>$obj->lastname, - 'firstname'=>$obj->firstname, - 'fk_element'=>$obj->fk_element, - 'elementtype'=>$obj->elementtype, - // Type of event - 'acode'=>$obj->acode, - 'alabel'=>$obj->alabel, - 'libelle'=>$obj->alabel, // deprecated - 'apicto'=>$obj->apicto - ); - } else { - $histo[$numaction] = array( - 'type'=>$obj->type, - 'tododone'=>'done', - 'id'=>$obj->id, - 'datestart'=>$db->jdate($obj->dp), - 'dateend'=>$db->jdate($obj->dp2), - 'note'=>$obj->label, - 'percent'=>$obj->percent, - 'acode'=>$obj->acode, + 'contact_id'=>$obj->fk_contact, + 'socpeopleassigned' => $contactaction->socpeopleassigned, + 'lastname'=>$obj->lastname, + 'firstname'=>$obj->firstname, + 'fk_element'=>$obj->fk_element, + 'elementtype'=>$obj->elementtype, + // Type of event + 'acode'=>$obj->acode, + 'alabel'=>$obj->alabel, + 'libelle'=>$obj->alabel, // deprecated + 'apicto'=>$obj->apicto + ); + } else { + $histo[$numaction] = array( + 'type'=>$obj->type, + 'tododone'=>'done', + 'id'=>$obj->id, + 'datestart'=>$db->jdate($obj->dp), + 'dateend'=>$db->jdate($obj->dp2), + 'note'=>$obj->label, + 'percent'=>$obj->percent, + 'acode'=>$obj->acode, - 'userid'=>$obj->user_id, - 'login'=>$obj->user_login, - 'userfirstname'=>$obj->user_firstname, - 'userlastname'=>$obj->user_lastname, - 'userphoto'=>$obj->user_photo - ); - } + 'userid'=>$obj->user_id, + 'login'=>$obj->user_login, + 'userfirstname'=>$obj->user_firstname, + 'userlastname'=>$obj->user_lastname, + 'userphoto'=>$obj->user_photo + ); + } - $numaction++; - $i++; - } - } - else - { - dol_print_error($db); + $numaction++; + $i++; + } + } + else + { + dol_print_error($db); + } } if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email))) @@ -1781,9 +1786,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } $out .= "\n"; $out .= "
\n"; - } - $out .= ''; + $out .= ''; + } if ($noprint) return $out; else print $out; From a2b973f9f7e31d305e715ea786cf0fd0b23ac564 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Sun, 22 Mar 2020 14:50:09 +0100 Subject: [PATCH 018/116] NEW: Multiple sales in TakePOS --- htdocs/societe/list.php | 4 ++-- htdocs/takepos/floors.php | 2 +- htdocs/takepos/freezone.php | 2 +- htdocs/takepos/index.php | 6 ++++-- htdocs/takepos/invoice.php | 23 +++++++++++++++++++++-- htdocs/takepos/pay.php | 2 +- htdocs/takepos/phone.php | 2 +- htdocs/takepos/receipt.php | 2 +- htdocs/takepos/reduction.php | 2 +- 9 files changed, 33 insertions(+), 12 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 04ad577bff9..63641f27625 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -228,7 +228,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); if ($action == "change") // Change customer for TakePOS { $idcustomer = GETPOST('idcustomer', 'int'); - $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant + $place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant // Check if draft invoice already exists, if not create it $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' AND entity IN (".getEntity('invoice').")"; @@ -1031,7 +1031,7 @@ while ($i < min($num, $limit)) print ' 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Bar or Restaurant + $place = (GETPOST('place', 'alpha') > 0 ? GETPOST('place', 'alpha') : 0); // $place is id of table for Bar or Restaurant print ' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->rowid.'&place='.$place.'\'"'; } print '>'; diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index 260813dd3b6..ac74a8d2203 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -42,7 +42,7 @@ $action = GETPOST('action', 'alpha'); $left = GETPOST('left', 'alpha'); $top = GETPOST('top', 'alpha'); -$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant +$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant $newname = GETPOST('newname', 'alpha'); $mode = GETPOST('mode', 'alpha'); diff --git a/htdocs/takepos/freezone.php b/htdocs/takepos/freezone.php index 1d4e0dfc7be..ee9b61581e2 100644 --- a/htdocs/takepos/freezone.php +++ b/htdocs/takepos/freezone.php @@ -40,7 +40,7 @@ global $mysoc; $langs->loadLangs(array("bills", "cashdesk")); -$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant +$place = (GETPOST('place', 'alpha') > 0 ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant $idline = GETPOST('idline', 'int'); $action = GETPOST('action', 'alpha'); diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 9615f90d539..03f90e7bd96 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; -$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Bar or Restaurant +$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Bar or Restaurant or multiple sales $action = GETPOST('action', 'alpha'); $setterminal = GETPOST('setterminal', 'int'); @@ -732,7 +732,9 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { echo ' - '.dol_print_date(dol_now(), "day").''; ?>
-
+
+ +
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 683b74edc4b..d295333af57 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -44,7 +44,7 @@ $langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks" $id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); $idproduct = GETPOST('idproduct', 'int'); -$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Bar or Restaurant +$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Bar or Restaurant $placeid = 0; // $placeid is ID of invoice if (empty($user->rights->takepos->run)) { @@ -713,9 +713,28 @@ $( document ).ready(function() { } ?> - $("a#customer").html(''); + $("#customerandsales").html(''); query($sql); + if ($resql) { + while ($obj = $db->fetch_object($resql)) { + echo '$("#customerandsales").append(\''; + if ($placeid==$obj->rowid) echo ""; + echo 'ref)); + echo $num_sale; + if (str_replace("-","",$num_sale)>$max_sale) $max_sale=str_replace("-","",$num_sale); + echo '\\\'">'.date('H:i', strtotime($obj->datec)); + if ($placeid==$obj->rowid) echo ""; + echo '\');'; + } + echo '$("#customerandsales").append(\'\');'; + } + $s = ''; $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index f79e310f36b..a3bac766aaf 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -34,7 +34,7 @@ if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant +$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant $invoiceid = GETPOST('invoiceid', 'int'); diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index c32561d3f52..424282d27cf 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; -$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant +$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant $action = GETPOST('action', 'alpha'); $setterminal = GETPOST('setterminal', 'int'); diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 31390c347bd..50010cf1712 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -30,7 +30,7 @@ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->loadLangs(array("main", "cashdesk", "companies")); -$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant +$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant $facid = GETPOST('facid', 'int'); diff --git a/htdocs/takepos/reduction.php b/htdocs/takepos/reduction.php index 7ad3e88d2b5..f4a83a09c52 100644 --- a/htdocs/takepos/reduction.php +++ b/htdocs/takepos/reduction.php @@ -34,7 +34,7 @@ if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant +$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant $invoiceid = GETPOST('invoiceid', 'int'); From 40e5e7a46bdd0bd1336e26e91fd70047b3c67816 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 22 Mar 2020 15:24:32 +0100 Subject: [PATCH 019/116] Travis fixes --- htdocs/takepos/invoice.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index d295333af57..501984d9460 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -723,18 +723,18 @@ $( document ).ready(function() { echo '$("#customerandsales").append(\''; if ($placeid==$obj->rowid) echo ""; echo 'ref)); + $num_sale=str_replace(")", "", str_replace("(PROV-POS".$_SESSION["takeposterminal"]."-", "", $obj->ref)); echo $num_sale; - if (str_replace("-","",$num_sale)>$max_sale) $max_sale=str_replace("-","",$num_sale); + if (str_replace("-", "", $num_sale)>$max_sale) $max_sale=str_replace("-", "", $num_sale); echo '\\\'">'.date('H:i', strtotime($obj->datec)); if ($placeid==$obj->rowid) echo ""; echo '\');'; } - echo '$("#customerandsales").append(\'\');'; + echo '$("#customerandsales").append(\'\');'; } - + $s = ''; $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; From 700e3846394541889a2ddfd5abae23608c0579f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Mar 2020 19:11:21 +0100 Subject: [PATCH 020/116] WIP Edit fields into alternate language --- htdocs/core/class/html.form.class.php | 26 +++++++++++++++++++ htdocs/langs/en_US/admin.lang | 2 +- htdocs/societe/card.php | 36 ++++++++++++++++++-------- htdocs/societe/class/societe.class.php | 1 + 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2c22e83f786..09cac93b0b2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -316,6 +316,32 @@ class Form return $ret; } + /** + * Output edit in place form + * + * @param string $fieldname Name of the field + * @param object $object Object + * @param boolean $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field. + * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...) + * @return string HTML code for the edit of alternative language + */ + public function widgetForTranslation($htmlname, $object, $perm, $typeofdata = 'string') { + global $conf, $langs; + + $result = ''; + + if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE)) { + $result ='
'; + + $s=picto_from_langcode($conf->global->PDF_USE_ALSO_LANGUAGE_CODE); + $result .= $s; + + $result .= '
'; + } + + return $result; + } + /** * Output edit in place form * diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b1eb3778af8..7e46cdefbad 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1982,5 +1982,5 @@ MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled EmailTemplate=Template for email EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax -PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some text title in your PDF duplicated in 2 different languages in the same generate PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF. +PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated in 2 different languages in the same generated PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF. FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book. diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index edc00088c39..d8c9ec9da70 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -98,6 +98,13 @@ if (!empty($canvas)) // Security check $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas); +$permissiontoread = $user->rights->societe->lire; +$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->societe->delete || ($permissiontoadd && isset($object->status) && $object->status == 0); +$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php +$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; + /* * Actions @@ -1186,7 +1193,7 @@ else print ''; // Name, firstname - print 'global->SOCIETE_USEPREFIX) ? ' colspan="3"' : '').'>'; - print ''; + print ''; + print $form->widgetForTranslation("name", $object, $permissiontoadd); + print ''; if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''; @@ -1249,7 +1258,7 @@ else { // Supplier print ''; - print ''; // Barcode if (!empty($conf->barcode->enabled)) { - print ''; + print ''; print ''; } // Address - print ''; + print ''; print ''; + print ''; + print $form->widgetForTranslation("address", $object, $permissiontoadd); + print ''; // Zip / Town - print ''; if ($conf->browser->layout == 'phone') print ''; - print ''; // Country - print ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ad5c66a50b8..e61c98e3267 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -712,6 +712,7 @@ class Societe extends CommonObject */ public $multicurrency_code; + /** * Constructor * From 6f3cbe69e8731a5d0f8fbe7b0d3b1c1592486c3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Mar 2020 19:40:58 +0100 Subject: [PATCH 021/116] Fix phpcs --- htdocs/core/class/html.form.class.php | 5 +++-- htdocs/core/lib/website2.lib.php | 17 ----------------- htdocs/societe/card.php | 16 ++++++++-------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 09cac93b0b2..4d1c573eedc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -325,13 +325,14 @@ class Form * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...) * @return string HTML code for the edit of alternative language */ - public function widgetForTranslation($htmlname, $object, $perm, $typeofdata = 'string') { + public function widgetForTranslation($fieldname, $object, $perm, $typeofdata = 'string') + { global $conf, $langs; $result = ''; if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE)) { - $result ='
'; + $result ='
'; $s=picto_from_langcode($conf->global->PDF_USE_ALSO_LANGUAGE_CODE); $result .= $s; diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 9748632fb3f..0a80048cb5a 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -522,20 +522,3 @@ function showWebsiteTemplates(Website $website) print '
'; + print '
'; if ($object->particulier || $private) { print ''.$langs->trans('ThirdPartyName').' / '.$langs->trans('LastName', 'name').''; @@ -1196,7 +1203,9 @@ else print ''.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).''; } print ''.$langs->trans('Prefix').'
'.$form->editfieldkey('Vendor', 'fournisseur', '', $object, 0, 'string', '', 1).''; + print ''.$form->editfieldkey('Vendor', 'fournisseur', '', $object, $permissiontoadd, 'string', '', 1).''; $default = -1; if (!empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default = 1; print $form->selectyesno("fournisseur", (GETPOST('fournisseur', 'int') != '' ?GETPOST('fournisseur', 'int') : (GETPOST("type", 'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type", 'alpha') == '' ? 1 : 0)); @@ -1261,7 +1270,7 @@ else print ''; if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { - print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); + print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, $permissiontoadd); } print ''; if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) @@ -1279,35 +1288,40 @@ else } // Status - print '
'.$form->editfieldkey('Status', 'status', '', $object, 0).''; + print '
'.$form->editfieldkey('Status', 'status', '', $object, $permissiontoadd).''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), 1); print '
'.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).'
'.$form->editfieldkey('Gencod', 'barcode', '', $object, $permissiontoadd).''; print '
'.$form->editfieldkey('Address', 'address', '', $object, 0).'
'; + print $form->editfieldkey('Address', 'address', '', $object, $permissiontoadd); + print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; + print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, $permissiontoadd).''; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); print '
'.$form->editfieldkey('Town', 'town', '', $object, 0).''; + print ''.$form->editfieldkey('Town', 'town', '', $object, $permissiontoadd).''; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); + print $form->widgetForTranslation("town", $object, $permissiontoadd); print '
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; + print '
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, $permissiontoadd).''; print $form->select_country((GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'; } - - -/** - * Return HTML content to add structured data for an article, news or Blog Post. - * - * @return string HTML content - */ -function getRSSForBlogPosts() -{ - global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers. - - - - return $out; -} - - diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d8c9ec9da70..22da0cd0545 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1258,7 +1258,7 @@ else { // Supplier print ''; - print ''.$form->editfieldkey('Vendor', 'fournisseur', '', $object, $permissiontoadd, 'string', '', 1).''; + print ''.$form->editfieldkey('Vendor', 'fournisseur', '', $object, 0, 'string', '', 1).''; $default = -1; if (!empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default = 1; print $form->selectyesno("fournisseur", (GETPOST('fournisseur', 'int') != '' ?GETPOST('fournisseur', 'int') : (GETPOST("type", 'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type", 'alpha') == '' ? 1 : 0)); @@ -1270,7 +1270,7 @@ else print ''; if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { - print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, $permissiontoadd); + print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print ''; if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) @@ -1288,21 +1288,21 @@ else } // Status - print ''.$form->editfieldkey('Status', 'status', '', $object, $permissiontoadd).''; + print ''.$form->editfieldkey('Status', 'status', '', $object, 0).''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), 1); print ''; // Barcode if (!empty($conf->barcode->enabled)) { - print ''.$form->editfieldkey('Gencod', 'barcode', '', $object, $permissiontoadd).''; + print ''.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).''; print ''; print ''; } // Address print ''; - print $form->editfieldkey('Address', 'address', '', $object, $permissiontoadd); + print $form->editfieldkey('Address', 'address', '', $object, 0); print ''; print ''; + print ''; } else { - include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); - print $doleditor->Create(); + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); + print $doleditor->Create(); } print ''; print ''; diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index 900d66c73b5..b7e874beec2 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -89,9 +89,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -103,10 +103,10 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { - print "
"; - print load_fiche_titre($langs->trans('NewAttribute')); + print "
"; + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -116,10 +116,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } llxFooter(); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index 29940f95d56..b3265479d38 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -45,8 +45,8 @@ $action=GETPOST('action', 'alpha'); // Shipment note if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { - // This option should always be set to on when module is on. - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); + // This option should always be set to on when module is on. + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); } /* if ($action == 'activate_sending') @@ -66,16 +66,16 @@ if ($action == 'disable_sending') // Delivery note if ($action == 'activate_delivery') { - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this - dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this + dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity); header("Location: confexped.php"); exit; } elseif ($action == 'disable_delivery') { dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity); - header("Location: confexped.php"); - exit; + header("Location: confexped.php"); + exit; } diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php index ecba02c712c..8d1122417b5 100644 --- a/htdocs/admin/dolistore/ajax/image.php +++ b/htdocs/admin/dolistore/ajax/image.php @@ -40,19 +40,19 @@ $id_image = GETPOST('id_image', 'int'); $quality = GETPOST('quality', 'alpha'); try { - $url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality; - $api = new PrestaShopWebservice( - $conf->global->MAIN_MODULE_DOLISTORE_API_SRV, - $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api - ); - //echo $url; - $request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); - header('Content-type:image'); - print $request['response']; + $url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality; + $api = new PrestaShopWebservice( + $conf->global->MAIN_MODULE_DOLISTORE_API_SRV, + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api + ); + //echo $url; + $request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); + header('Content-type:image'); + print $request['response']; } catch (PrestaShopWebserviceException $e) { - // Here we are dealing with errors - $trace = $e->getTrace(); - if ($trace[0]['args'][0] == 404) die('Bad ID'); - elseif ($trace[0]['args'][0] == 401) die('Bad auth key'); - else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); + // Here we are dealing with errors + $trace = $e->getTrace(); + if ($trace[0]['args'][0] == 404) die('Bad ID'); + elseif ($trace[0]['args'][0] == 401) die('Bad auth key'); + else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); } diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 2fcf3fe6422..66fa695c5b9 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -36,30 +36,30 @@ if (! $user->admin) accessforbidden(); */ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { - $code=$reg[1]; - if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - dol_print_error($db); - } + $code=$reg[1]; + if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } } if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { - $code=$reg[1]; - if (dolibarr_del_const($db, $code, $conf->entity) > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - dol_print_error($db); - } + $code=$reg[1]; + if (dolibarr_del_const($db, $code, $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } } diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index a34bd841c81..69ad145e7df 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -86,9 +86,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -113,10 +113,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 276a50bc440..61dcf3dcf66 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -80,9 +80,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -95,9 +95,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -107,10 +107,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 4a6a21197a8..d2984cab6bf 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -68,22 +68,22 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++; - // This one must be after the others - $valkey=''; - $key=GETPOST("key"); - if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; + // This one must be after the others + $valkey=''; + $key=GETPOST("key"); + if ($key) $valkey=$conf->global->$key; + if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; - if (! $error) - { - $db->commit(); - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { - $db->rollback(); - dol_print_error($db); - } + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + dol_print_error($db); + } } diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/livraison_extrafields.php index b78e6f1730e..814a865216d 100644 --- a/htdocs/admin/livraison_extrafields.php +++ b/htdocs/admin/livraison_extrafields.php @@ -86,9 +86,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -113,10 +113,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 4a37c761628..7598d2d8588 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -48,7 +48,7 @@ if ($action == 'setvalue') $mailerror = GETPOST('MAILING_EMAIL_ERRORSTO', 'alpha'); $checkread = GETPOST('value', 'alpha'); $checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha'); - $mailingdelay = GETPOST('MAILING_DELAY', 'int'); + $mailingdelay = GETPOST('MAILING_DELAY', 'int'); $res=dolibarr_set_const($db, "MAILING_EMAIL_FROM", $mailfrom, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -61,16 +61,16 @@ if ($action == 'setvalue') $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; - if (! $error) - { - $db->commit(); - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { - $db->rollback(); - setEventMessages($langs->trans("Error"), null, 'errors'); - } + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + setEventMessages($langs->trans("Error"), null, 'errors'); + } } diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 32cd7c35829..ce0136642e2 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -41,8 +41,8 @@ $dirsmartphone = array(); $dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); foreach($dirmenus as $dirmenu) { - $dirstandard[]=$dirmenu.'standard'; - $dirsmartphone[]=$dirmenu.'smartphone'; + $dirstandard[]=$dirmenu.'standard'; + $dirsmartphone[]=$dirmenu.'smartphone'; } $error=0; @@ -85,8 +85,8 @@ if ($action == 'update' && ! $cancel) foreach($dirmenus as $dirmenu) { $file='init_menu_'.$key.'.sql'; - $fullpath=dol_buildpath($dirmenu.$file); - //print 'action='.$action.' Search menu into fullpath='.$fullpath.'
';exit; + $fullpath=dol_buildpath($dirmenu.$file); + //print 'action='.$action.' Search menu into fullpath='.$fullpath.'
';exit; if (file_exists($fullpath)) { diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index b3e6ec312ae..12231079ae0 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -46,15 +46,15 @@ $type = 'paymentorder'; if ($action == "set") { - $db->begin(); + $db->begin(); - $id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT', 'int'); - $account = new Account($db); - if($account->fetch($id)>0) - { - $res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - /* + $id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT', 'int'); + $account = new Account($db); + if($account->fetch($id)>0) + { + $res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + /* $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_GUICHET", $account->code_guichet,'chaine',0,'',$conf->entity); @@ -70,33 +70,33 @@ if ($action == "set") $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; */ - } - else $error++; + } + else $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; + $res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; - if (GETPOST("PRELEVEMENT_USER") > 0) - { - $res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - } - if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="") - { - $res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - } - if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="") - { - $res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - } + if (GETPOST("PRELEVEMENT_USER") > 0) + { + $res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + } + if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="") + { + $res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + } + if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="") + { + $res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + } - if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="") - { - $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - } elseif (! $error) + if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="") + { + $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + } elseif (! $error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -110,20 +110,20 @@ if ($action == "set") if ($action == "addnotif") { - $bon = new BonPrelevement($db); - $bon->AddNotification($db, GETPOST('user', 'int'), $action); + $bon = new BonPrelevement($db); + $bon->AddNotification($db, GETPOST('user', 'int'), $action); - header("Location: prelevement.php"); - exit; + header("Location: prelevement.php"); + exit; } if ($action == "deletenotif") { - $bon = new BonPrelevement($db); - $bon->DeleteNotificationById(GETPOST('notif', 'int')); + $bon = new BonPrelevement($db); + $bon->DeleteNotificationById(GETPOST('notif', 'int')); - header("Location: prelevement.php"); - exit; + header("Location: prelevement.php"); + exit; } /* diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index c00bef75697..9011c6b4e67 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -40,34 +40,34 @@ $upload_dir=$conf->admin->dir_temp; if (GETPOST('action', 'aZ09') == 'set_proxy') { - if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT"))) - { - setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); - $error++; - } - if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT"))) - { - setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); - $error++; - } + if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT"))) + { + setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); + $error++; + } + if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT"))) + { + setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); + $error++; + } - if (! $error) - { - $result=0; - $result+=dolibarr_set_const($db, 'MAIN_USE_CONNECT_TIMEOUT', GETPOST("MAIN_USE_CONNECT_TIMEOUT"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_USE_RESPONSE_TIMEOUT', GETPOST("MAIN_USE_RESPONSE_TIMEOUT"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_PROXY_USE', GETPOST("MAIN_PROXY_USE"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_PROXY_HOST', GETPOST("MAIN_PROXY_HOST"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_PROXY_PORT', GETPOST("MAIN_PROXY_PORT"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_PROXY_USER', GETPOST("MAIN_PROXY_USER"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_PROXY_PASS', GETPOST("MAIN_PROXY_PASS"), 'chaine', 0, '', $conf->entity); - if ($result < 5) dol_print_error($db); - } + if (! $error) + { + $result=0; + $result+=dolibarr_set_const($db, 'MAIN_USE_CONNECT_TIMEOUT', GETPOST("MAIN_USE_CONNECT_TIMEOUT"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_USE_RESPONSE_TIMEOUT', GETPOST("MAIN_USE_RESPONSE_TIMEOUT"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_PROXY_USE', GETPOST("MAIN_PROXY_USE"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_PROXY_HOST', GETPOST("MAIN_PROXY_HOST"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_PROXY_PORT', GETPOST("MAIN_PROXY_PORT"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_PROXY_USER', GETPOST("MAIN_PROXY_USER"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_PROXY_PASS', GETPOST("MAIN_PROXY_PASS"), 'chaine', 0, '', $conf->entity); + if ($result < 5) dol_print_error($db); + } - if (! $error) - { - setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); - } + if (! $error) + { + setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); + } } @@ -99,8 +99,8 @@ dol_fiche_head($head, 'proxy', $langs->trans("Security"), -1); if ($conf->use_javascript_ajax) { - print "\n".''."\n"; + print ''."\n"; } diff --git a/htdocs/admin/reception_extrafields.php b/htdocs/admin/reception_extrafields.php index 454fe1c4a8f..95338903ade 100644 --- a/htdocs/admin/reception_extrafields.php +++ b/htdocs/admin/reception_extrafields.php @@ -89,9 +89,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -103,10 +103,10 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { - print "
"; - print load_fiche_titre($langs->trans('NewAttribute')); + print "
"; + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -116,10 +116,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } llxFooter(); diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index 462326316b2..b64c01c5f00 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -35,7 +35,7 @@ $langs->loadLangs(array("admin","resource")); // Security check if (!$user->admin) - accessforbidden(); + accessforbidden(); $action = GETPOST('action', 'alpha'); diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index bcb3b5769ee..39a757bbf9c 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -86,9 +86,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -113,10 +113,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 78c31291414..8924741df52 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -84,9 +84,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -99,9 +99,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -111,10 +111,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 194c871958d..0835138227b 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -70,27 +70,27 @@ $configfileparameters=array( '?dolibarr_main_auth_ldap_admin_login', '?dolibarr_main_auth_ldap_admin_pass', '?dolibarr_main_auth_ldap_debug', - 'separator', - '?dolibarr_lib_ADODB_PATH', + 'separator', + '?dolibarr_lib_ADODB_PATH', '?dolibarr_lib_FPDF_PATH', - '?dolibarr_lib_TCPDF_PATH', + '?dolibarr_lib_TCPDF_PATH', '?dolibarr_lib_FPDI_PATH', - '?dolibarr_lib_TCPDI_PATH', + '?dolibarr_lib_TCPDI_PATH', '?dolibarr_lib_NUSOAP_PATH', - '?dolibarr_lib_PHPEXCEL_PATH', - '?dolibarr_lib_GEOIP_PATH', + '?dolibarr_lib_PHPEXCEL_PATH', + '?dolibarr_lib_GEOIP_PATH', '?dolibarr_lib_ODTPHP_PATH', - '?dolibarr_lib_ODTPHP_PATHTOPCLZIP', - '?dolibarr_js_CKEDITOR', - '?dolibarr_js_JQUERY', - '?dolibarr_js_JQUERY_UI', - '?dolibarr_js_JQUERY_FLOT', + '?dolibarr_lib_ODTPHP_PATHTOPCLZIP', + '?dolibarr_js_CKEDITOR', + '?dolibarr_js_JQUERY', + '?dolibarr_js_JQUERY_UI', + '?dolibarr_js_JQUERY_FLOT', '?dolibarr_font_DOL_DEFAULT_TTF', - '?dolibarr_font_DOL_DEFAULT_TTF_BOLD', + '?dolibarr_font_DOL_DEFAULT_TTF_BOLD', 'separator', '?dolibarr_mailing_limit_sendbyweb', '?dolibarr_mailing_limit_sendbycli', - '?dolibarr_strict_mode' + '?dolibarr_strict_mode' ); $configfilelib=array( // 'separator', @@ -121,20 +121,20 @@ $configfilelib=array( 'dolibarr_main_auth_ldap_admin_pass', 'dolibarr_main_auth_ldap_debug', 'separator', - 'dolibarr_lib_ADODB_PATH', - 'dolibarr_lib_TCPDF_PATH', - 'dolibarr_lib_FPDI_PATH', + 'dolibarr_lib_ADODB_PATH', + 'dolibarr_lib_TCPDF_PATH', + 'dolibarr_lib_FPDI_PATH', 'dolibarr_lib_NUSOAP_PATH', - 'dolibarr_lib_PHPEXCEL_PATH', - 'dolibarr_lib_GEOIP_PATH', + 'dolibarr_lib_PHPEXCEL_PATH', + 'dolibarr_lib_GEOIP_PATH', 'dolibarr_lib_ODTPHP_PATH', - 'dolibarr_lib_ODTPHP_PATHTOPCLZIP', - 'dolibarr_js_CKEDITOR', - 'dolibarr_js_JQUERY', - 'dolibarr_js_JQUERY_UI', - 'dolibarr_js_JQUERY_FLOT', + 'dolibarr_lib_ODTPHP_PATHTOPCLZIP', + 'dolibarr_js_CKEDITOR', + 'dolibarr_js_JQUERY', + 'dolibarr_js_JQUERY_UI', + 'dolibarr_js_JQUERY_FLOT', 'dolibarr_font_DOL_DEFAULT_TTF', - 'dolibarr_font_DOL_DEFAULT_TTF_BOLD', + 'dolibarr_font_DOL_DEFAULT_TTF_BOLD', 'separator', 'Limit nb of email sent by page', 'Strict mode is on/off' @@ -155,19 +155,19 @@ foreach($configfileparameters as $key) if (empty($ignore)) { - $newkey = preg_replace('/^\?/', '', $key); + $newkey = preg_replace('/^\?/', '', $key); - if (preg_match('/^\?/', $key) && empty(${$newkey})) - { - $i++; - continue; // We discard parametes starting with ? - } + if (preg_match('/^\?/', $key) && empty(${$newkey})) + { + $i++; + continue; // We discard parametes starting with ? + } - if ($newkey == 'separator' && $lastkeyshown == 'separator') - { - $i++; - continue; - } + if ($newkey == 'separator' && $lastkeyshown == 'separator') + { + $i++; + continue; + } print ''; if ($newkey == 'separator') @@ -233,17 +233,17 @@ if ($resql) $i = 0; while ($i < $num) - { - $obj = $db->fetch_object($resql); + { + $obj = $db->fetch_object($resql); - print ''; - print ''.$obj->name.''."\n"; - print ''.$obj->value.''."\n"; - if (empty($conf->multicompany->enabled) || !$user->entity) print ''.$obj->entity.''."\n"; // If superadmin or multicompany disabled - print "\n"; + print ''; + print ''.$obj->name.''."\n"; + print ''.$obj->value.''."\n"; + if (empty($conf->multicompany->enabled) || !$user->entity) print ''.$obj->entity.''."\n"; // If superadmin or multicompany disabled + print "\n"; - $i++; - } + $i++; + } } print ''; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 7a53b95fcf2..dce23de6270 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -54,17 +54,17 @@ $i=0; foreach($modulesdir as $dir) { $handle=@opendir(dol_osencode($dir)); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') - { - $modName = substr($file, 0, dol_strlen($file) - 10); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') + { + $modName = substr($file, 0, dol_strlen($file) - 10); - if ($modName) - { - //print 'xx'.$dir.$file.'
'; + if ($modName) + { + //print 'xx'.$dir.$file.'
'; if (in_array($file, $modules_files)) { // File duplicate @@ -77,13 +77,13 @@ foreach($modulesdir as $dir) if (class_exists($modName)) { try { - $objMod = new $modName($db); + $objMod = new $modName($db); - $modules[$objMod->numero]=$objMod; - $modules_names[$objMod->numero]=$objMod->name; - $modules_files[$objMod->numero]=$file; - $modules_fullpath[$file]=$dir.$file; - $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; + $modules[$objMod->numero]=$objMod; + $modules_names[$objMod->numero]=$objMod->name; + $modules_files[$objMod->numero]=$file; + $modules_fullpath[$file]=$dir.$file; + $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; } catch(Exception $e) { @@ -95,11 +95,11 @@ foreach($modulesdir as $dir) print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; } } - } - } - } - closedir($handle); - } + } + } + } + closedir($handle); + } } print '
'; @@ -120,15 +120,15 @@ foreach($sortorder as $numero=>$name) // Module print ''; $alt=$name.' - '.$modules_files[$numero]; - if (! empty($picto[$numero])) - { - if (preg_match('/^\//', $picto[$numero])) print img_picto($alt, $picto[$numero], 'width="14px"', 1); - else print img_object($alt, $picto[$numero], 'width="14px"'); - } - else - { - print img_object($alt, $picto[$numero], 'width="14px"'); - } + if (! empty($picto[$numero])) + { + if (preg_match('/^\//', $picto[$numero])) print img_picto($alt, $picto[$numero], 'width="14px"', 1); + else print img_object($alt, $picto[$numero], 'width="14px"'); + } + else + { + print img_object($alt, $picto[$numero], 'width="14px"'); + } print ' '.$modules[$numero]->getName(); print ""; // Version diff --git a/htdocs/admin/system/xdebug.php b/htdocs/admin/system/xdebug.php index 56b452706f5..9ea68431b1a 100644 --- a/htdocs/admin/system/xdebug.php +++ b/htdocs/admin/system/xdebug.php @@ -41,54 +41,54 @@ print "
\n"; if (!function_exists('xdebug_is_enabled')) { - print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.'; - llxFooter(); - exit; + print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.'; + llxFooter(); + exit; } if (function_exists('socket_create')) { - $address = ini_get('xdebug.remote_host')?ini_get('xdebug.remote_host'):'127.0.0.1'; - $port = ini_get('xdebug.remote_port')?ini_get('xdebug.remote_port'):9000; + $address = ini_get('xdebug.remote_host')?ini_get('xdebug.remote_host'):'127.0.0.1'; + $port = ini_get('xdebug.remote_port')?ini_get('xdebug.remote_port'):9000; - print "Current xdebug setup:
\n"; - print "* Remote debug setup:
\n"; - print 'xdebug.remote_enable = '.ini_get('xdebug.remote_enable')."
\n"; - print 'xdebug.remote_host = '.$address."
\n"; - print 'xdebug.remote_port = '.$port."
\n"; - print "* Profiler setup "; - if (function_exists('xdebug_get_profiler_filename')) print xdebug_get_profiler_filename()?"(currently on into file ".xdebug_get_profiler_filename().")":"(currently off)"; - else print "(currenlty not available)"; - print ":
\n"; - print 'xdebug.profiler_enable = '.ini_get('xdebug.profiler_enable')."
\n"; - print 'xdebug.profiler_enable_trigger = '.ini_get('xdebug.profiler_enable_trigger')."
\n"; - print 'xdebug.profiler_output_dir = '.ini_get('xdebug.profiler_output_dir')."
\n"; - print 'xdebug.profiler_output_name = '.ini_get('xdebug.profiler_output_name')."
\n"; - print 'xdebug.profiler_append = '.ini_get('xdebug.profiler_append')."
\n"; - print "
\n"; + print "Current xdebug setup:
\n"; + print "* Remote debug setup:
\n"; + print 'xdebug.remote_enable = '.ini_get('xdebug.remote_enable')."
\n"; + print 'xdebug.remote_host = '.$address."
\n"; + print 'xdebug.remote_port = '.$port."
\n"; + print "* Profiler setup "; + if (function_exists('xdebug_get_profiler_filename')) print xdebug_get_profiler_filename()?"(currently on into file ".xdebug_get_profiler_filename().")":"(currently off)"; + else print "(currenlty not available)"; + print ":
\n"; + print 'xdebug.profiler_enable = '.ini_get('xdebug.profiler_enable')."
\n"; + print 'xdebug.profiler_enable_trigger = '.ini_get('xdebug.profiler_enable_trigger')."
\n"; + print 'xdebug.profiler_output_dir = '.ini_get('xdebug.profiler_output_dir')."
\n"; + print 'xdebug.profiler_output_name = '.ini_get('xdebug.profiler_output_name')."
\n"; + print 'xdebug.profiler_append = '.ini_get('xdebug.profiler_append')."
\n"; + print "
\n"; - echo "To run a debug session, add parameter
"; - echo "* XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.
\n"; - echo "To run a profiler session (when xdebug.profiler_enable_trigger=1), add parameter
\n"; - echo "* XDEBUG_PROFILE=aname on each URL.
"; - print "
"; + echo "To run a debug session, add parameter
"; + echo "* XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.
\n"; + echo "To run a profiler session (when xdebug.profiler_enable_trigger=1), add parameter
\n"; + echo "* XDEBUG_PROFILE=aname on each URL.
"; + print "
"; - print "Test debugger server (Eclipse for example):
\n"; - $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); - if (empty($socket)) die('Unable to prepare a socket'); - //socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port); - //socket_listen($sock); - //$client = socket_accept($sock); - $client=socket_connect($socket, $address, $port); - if ($client) - { - echo "Connection established: ".$client." - address=".$address." port=".$port."
\n"; - echo "There is a Remote debug server at this address.
\n"; - echo "
\n"; - echo "To be sure this debugger accepts input from your PHP server and xdebug, be sure to have\n"; - echo "your php.ini file with this :
\n"; - echo '\n"; - print "

\n"; - echo 'Then check in your debug server (Eclipse), you have setup:
+ print "

\n"; + echo 'Then check in your debug server (Eclipse), you have setup:
XDebug with same port than in php.ini
Allow Remote debug=yes or prompt
'."\n"; - print "
\n"; - } - else - { - print socket_strerror(socket_last_error()); - echo "Failed to connect to address=".$address." port=".$port."
\n"; - echo "There is no Remote debug server at this address.\n"; - } - socket_close($socket); + print "
\n"; + } + else + { + print socket_strerror(socket_last_error()); + echo "Failed to connect to address=".$address." port=".$port."
\n"; + echo "There is no Remote debug server at this address.\n"; + } + socket_close($socket); } else { - print "Can't test if PHPDebug is OK as PHP socket functions are not enabled."; + print "Can't test if PHPDebug is OK as PHP socket functions are not enabled."; } diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index 18d5eee40a6..d7be1d058e6 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -36,7 +36,7 @@ $form = new Form($db); $tmptype2label = ExtraFields::$type2label; $type2label = array(''); foreach ($tmptype2label as $key => $val) { - $type2label[$key] = $langs->trans($val); + $type2label[$key] = $langs->trans($val); } $action = GETPOST('action', 'alpha'); @@ -44,7 +44,7 @@ $attrname = GETPOST('attrname', 'alpha'); $elementtype = 'ticket'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) { - accessforbidden(); + accessforbidden(); } @@ -79,9 +79,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '"; + print '"; } /* ************************************************************************** */ @@ -91,10 +91,10 @@ if ($action != 'create' && $action != 'edit') { /* ************************************************************************** */ if ($action == 'create') { - print "
"; - print load_fiche_titre($langs->trans('NewAttribute')); + print "
"; + print load_fiche_titre($langs->trans('NewAttribute')); - include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php'; + include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -103,10 +103,10 @@ if ($action == 'create') { /* */ /* ************************************************************************** */ if ($action == 'edit' && !empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php'; + include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 664cda18916..6d1f40ec4a0 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -54,9 +54,9 @@ $version='0.0'; if ($action == 'getlastversion') { - $result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); - //var_dump($result['content']); - $sfurl = simplexml_load_string($result['content']); + $result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); + //var_dump($result['content']); + $sfurl = simplexml_load_string($result['content']); } @@ -75,39 +75,39 @@ print $langs->trans("CurrentVersion").' : '.DOL_VERSION.'
'; if (function_exists('curl_init')) { - $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10; + $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10; - if ($action == 'getlastversion') - { - if ($sfurl) - { - $i=0; - while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) - { - $title=$sfurl->channel[0]->item[$i]->title; - if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) - { - $newversion=$reg[1]; - $newversionarray=explode('.', $newversion); - $versionarray=explode('.', $version); - //var_dump($newversionarray);var_dump($versionarray); - if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion; - } - $i++; - } + if ($action == 'getlastversion') + { + if ($sfurl) + { + $i=0; + while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) + { + $title=$sfurl->channel[0]->item[$i]->title; + if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) + { + $newversion=$reg[1]; + $newversionarray=explode('.', $newversion); + $versionarray=explode('.', $version); + //var_dump($newversionarray);var_dump($versionarray); + if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion; + } + $i++; + } - // Show version - print $langs->trans("LastStableVersion").' : '. (($version != '0.0')?$version:$langs->trans("Unknown")) .'
'; - } - else - { - print $langs->trans("LastStableVersion").' : ' .$langs->trans("UpdateServerOffline").'
'; - } - } - else - { - print $langs->trans("LastStableVersion").' : ' .$langs->trans("Check").'
'; - } + // Show version + print $langs->trans("LastStableVersion").' : '. (($version != '0.0')?$version:$langs->trans("Unknown")) .'
'; + } + else + { + print $langs->trans("LastStableVersion").' : ' .$langs->trans("UpdateServerOffline").'
'; + } + } + else + { + print $langs->trans("LastStableVersion").' : ' .$langs->trans("Check").'
'; + } } print '
'; diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php index d4ae2bd2930..9d224fe079e 100644 --- a/htdocs/asset/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -76,9 +76,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print ''; - print "
"; + print '
'; + print ''; + print "
"; } @@ -90,10 +90,10 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { - print "
"; - print load_fiche_titre($langs->trans('NewAttribute')); + print "
"; + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -103,10 +103,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 20f189dd99f..e298e0e6540 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -61,28 +61,28 @@ if (! empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) $dir = dol_buildpath($dirroot, 0); $handle = @opendir($dir); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (preg_match('/^mod_barcode_product_.*php$/', $file)) - { - $file = substr($file, 0, dol_strlen($file)-4); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (preg_match('/^mod_barcode_product_.*php$/', $file)) + { + $file = substr($file, 0, dol_strlen($file)-4); - try { - dol_include_once($dirroot.$file.'.php'); - } - catch(Exception $e) - { - dol_syslog($e->getMessage(), LOG_ERR); - } + try { + dol_include_once($dirroot.$file.'.php'); + } + catch(Exception $e) + { + dol_syslog($e->getMessage(), LOG_ERR); + } - $modBarCodeProduct = new $file(); - break; - } - } - closedir($handle); - } + $modBarCodeProduct = new $file(); + break; + } + } + closedir($handle); + } } } diff --git a/htdocs/blockedlog/ajax/block-add.php b/htdocs/blockedlog/ajax/block-add.php index f38efde42b2..92ccd8af369 100644 --- a/htdocs/blockedlog/ajax/block-add.php +++ b/htdocs/blockedlog/ajax/block-add.php @@ -37,8 +37,8 @@ $element = GETPOST('element', 'alpha'); $action = GETPOST('action', 'alpha'); if ($element === 'facture') { - require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; - require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $facture = new Facture($db); if($facture->fetch($id)>0) { diff --git a/htdocs/blockedlog/lib/blockedlog.lib.php b/htdocs/blockedlog/lib/blockedlog.lib.php index 13c7ac61d1a..998a97e9bab 100644 --- a/htdocs/blockedlog/lib/blockedlog.lib.php +++ b/htdocs/blockedlog/lib/blockedlog.lib.php @@ -53,13 +53,13 @@ function blockedlogadmin_prepare_head() $object=new stdClass(); - // Show more tabs from modules - // Entries must be declared in modules descriptor with line - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab - // $this->tabs = array('entity:-tabname); to remove a tab + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog', 'remove'); - return $head; + return $head; } diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 7122e1b6f59..fcfe9905bae 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -74,11 +74,11 @@ if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) { logo_small)) { - print 'Logo company'; + print 'Logo company'; } else { - print '
'.$mysoc->name.'
'; + print '
'.$mysoc->name.'
'; } ?>
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 31f608a9ee0..b9ad3015adf 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -143,19 +143,19 @@ if ($object->id > 0) // Project if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - //$morehtmlref.='
'.$langs->trans('Project') . ' '; - $morehtmlref.=$langs->trans('Project') . ': '; - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - if ($proj->title) $morehtmlref.=' - '.$proj->title; - } else { - $morehtmlref.=''; - } + $langs->load("projects"); + //$morehtmlref.='
'.$langs->trans('Project') . ' '; + $morehtmlref.=$langs->trans('Project') . ': '; + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + if ($proj->title) $morehtmlref.=' - '.$proj->title; + } else { + $morehtmlref.=''; + } } $morehtmlref.='
'; @@ -253,9 +253,9 @@ if ($object->id > 0) print ''; - print '
'; + print ''; - dol_fiche_end(); + dol_fiche_end(); $modulepart = 'actions'; diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index fc53f90ed55..a0530e8c262 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -85,9 +85,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -100,9 +100,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -112,10 +112,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index a3b754e0979..4da1ea48fd6 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -162,13 +162,13 @@ if ($resql) print ''; print ''; - $result=''; - $link=$linkend=''; - $link = ''; - $linkend=''; - $name=$obj->name; - $result.=($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend); - $result.=$link.(dol_trunc($name, $maxlen)).$linkend; + $result=''; + $link=$linkend=''; + $link = ''; + $linkend=''; + $name=$obj->name; + $result.=($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend); + $result.=$link.(dol_trunc($name, $maxlen)).$linkend; print $result; print ''; diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 55bf5e1f022..fdc1d622e90 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -54,15 +54,15 @@ $sql.= " AND pb.entity = ".$conf->entity; $resql=$db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - if ( $num > 0 ) - { - $row = $db->fetch_row($resql); - $total = $row[0]; - $nbtotal = $row[1]; - } + if ( $num > 0 ) + { + $row = $db->fetch_row($resql); + $total = $row[0]; + $nbtotal = $row[1]; + } } @@ -150,15 +150,15 @@ $sql.= " AND pl.statut = 3"; $resql=$db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - if ( $num > 0 ) - { - $row = $db->fetch_row($resql); - $total = $row[0]; - $nbtotal = $row[1]; - } + if ( $num > 0 ) + { + $row = $db->fetch_row($resql); + $total = $row[0]; + $nbtotal = $row[1]; + } } /* diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index e449f907bc8..7806e3e4cc1 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; if (! empty($conf->projet->enabled)) { - include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } // Load translation files required by the page @@ -51,10 +51,10 @@ $object = new ChargeSociales($db); if ($action == 'setlib' && $user->rights->tax->charges->creer) { - $object->fetch($id); - $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY'); - if ($result < 0) - setEventMessages($object->error, $object->errors, 'errors'); + $object->fetch($id); + $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY'); + if ($result < 0) + setEventMessages($object->error, $object->errors, 'errors'); } @@ -84,17 +84,17 @@ $morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user // Project if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' : '; - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' : '; + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } } $morehtmlref.=''; diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 5f6bea09a3d..7696e3365d2 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -80,9 +80,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -95,9 +95,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -108,9 +108,9 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print '

'; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } llxFooter(); diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php index 3a8340dfecc..a78669bec22 100644 --- a/htdocs/contrat/admin/contractdet_extrafields.php +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -80,9 +80,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -97,7 +97,7 @@ if ($action == 'create') print '
'; print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -107,10 +107,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } llxFooter(); diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index 9fca4502dcf..ca5f05f5f4d 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.php @@ -32,9 +32,9 @@ $addlinkid = GETPOST('idtolinkto', 'int'); // Link invoice to order if ($action == 'addlink' && ! empty($permissiondellink) && ! GETPOST('cancel', 'alpha') && $id > 0 && $addlinkid > 0) { - $object->fetch($id); - $object->fetch_thirdparty(); - $result = $object->add_object_linked(GETPOST('addlink', 'alpha'), $addlinkid); + $object->fetch($id); + $object->fetch_thirdparty(); + $result = $object->add_object_linked(GETPOST('addlink', 'alpha'), $addlinkid); } // Delete link diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php index fc0f25a1297..0671e998684 100644 --- a/htdocs/core/actions_printing.inc.php +++ b/htdocs/core/actions_printing.inc.php @@ -29,63 +29,63 @@ // Print file if ($action == 'print_file' && $user->rights->printing->read) { - $langs->load("printing"); - require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php'; - $objectprint = new PrintingDriver($db); - $list = $objectprint->listDrivers($db, 10); - if (! empty($list)) { - $errorprint=0; - $printerfound=0; - foreach ($list as $driver) { - require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; - $langs->load($driver); - $classname = 'printing_'.$driver; - $printer = new $classname($db); - //print '
'.print_r($printer, true).'
'; + $langs->load("printing"); + require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php'; + $objectprint = new PrintingDriver($db); + $list = $objectprint->listDrivers($db, 10); + if (! empty($list)) { + $errorprint=0; + $printerfound=0; + foreach ($list as $driver) { + require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; + $langs->load($driver); + $classname = 'printing_'.$driver; + $printer = new $classname($db); + //print '
'.print_r($printer, true).'
'; - if (! empty($conf->global->{$printer->active})) - { - $printerfound++; + if (! empty($conf->global->{$printer->active})) + { + $printerfound++; - $subdir=''; - $module = GETPOST('printer', 'alpha'); - switch ($module ) - { - case 'livraison' : - $subdir = 'receipt'; - $module = 'expedition'; - break; - case 'expedition' : - $subdir = 'sending'; - break; - case 'commande_fournisseur' : - $module = 'fournisseur'; - $subdir = 'commande'; - break; - } - try { - $ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir); - if ($ret > 0) { - //print '
'.print_r($printer->errors, true).'
'; - setEventMessages($printer->error, $printer->errors, 'errors'); - } - if ($ret==0) - { - //print '
'.print_r($printer->errors, true).'
'; - setEventMessages($printer->error, $printer->errors); - setEventMessages($langs->transnoentitiesnoconv("FileWasSentToPrinter", basename(GETPOST('file', 'alpha'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null); - } - } - catch(Exception $e) - { - $ret = 1; - setEventMessages($e->getMessage(), null, 'errors'); - } - } - } - if ($printerfound==0) setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings'); - } else { - setEventMessages($langs->trans("NoModuleFound"), null, 'warnings'); - } - $action = ''; + $subdir=''; + $module = GETPOST('printer', 'alpha'); + switch ($module ) + { + case 'livraison' : + $subdir = 'receipt'; + $module = 'expedition'; + break; + case 'expedition' : + $subdir = 'sending'; + break; + case 'commande_fournisseur' : + $module = 'fournisseur'; + $subdir = 'commande'; + break; + } + try { + $ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir); + if ($ret > 0) { + //print '
'.print_r($printer->errors, true).'
'; + setEventMessages($printer->error, $printer->errors, 'errors'); + } + if ($ret==0) + { + //print '
'.print_r($printer->errors, true).'
'; + setEventMessages($printer->error, $printer->errors); + setEventMessages($langs->transnoentitiesnoconv("FileWasSentToPrinter", basename(GETPOST('file', 'alpha'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null); + } + } + catch(Exception $e) + { + $ret = 1; + setEventMessages($e->getMessage(), null, 'errors'); + } + } + } + if ($printerfound==0) setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings'); + } else { + setEventMessages($langs->trans("NoModuleFound"), null, 'warnings'); + } + $action = ''; } diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index 425204e00a4..8c8f23f9b0e 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -60,8 +60,8 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel } } } elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel', 'alpha')) { - // Set public note - if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); + // Set public note + if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); if (empty($object->id)) $object->fetch($id); // Fetch may not be already done $result=$object->update_note(dol_html_entity_decode(GETPOST('note_private', 'none'), ENT_QUOTES), '_private'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/core/ajax/bankconciliate.php b/htdocs/core/ajax/bankconciliate.php index 690ebc80f85..f3e6c379392 100644 --- a/htdocs/core/ajax/bankconciliate.php +++ b/htdocs/core/ajax/bankconciliate.php @@ -51,46 +51,46 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ { // Increase date $al = new AccountLine($db); - $al->datev_next(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->datev_next(GETPOST('rowid', 'int')); + $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->datev), "day").''; + print ''.dol_print_date($db->jdate($al->datev), "day").''; - exit; + exit; } if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev') { // Decrease date $al =new AccountLine($db); - $al->datev_previous(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->datev_previous(GETPOST('rowid', 'int')); + $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->datev), "day").''; + print ''.dol_print_date($db->jdate($al->datev), "day").''; - exit; + exit; } if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext') { // Increase date $al = new AccountLine($db); - $al->dateo_next(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->dateo_next(GETPOST('rowid', 'int')); + $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->dateo), "day").''; + print ''.dol_print_date($db->jdate($al->dateo), "day").''; - exit; + exit; } if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev') { // Decrease date $al =new AccountLine($db); - $al->dateo_previous(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->dateo_previous(GETPOST('rowid', 'int')); + $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->dateo), "day").''; + print ''.dol_print_date($db->jdate($al->dateo), "day").''; - exit; + exit; } diff --git a/htdocs/core/ajax/fileupload.php b/htdocs/core/ajax/fileupload.php index 5a3b18da55e..4e2252cee56 100644 --- a/htdocs/core/ajax/fileupload.php +++ b/htdocs/core/ajax/fileupload.php @@ -53,23 +53,23 @@ header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size'); switch ($_SERVER['REQUEST_METHOD']) { case 'OPTIONS': break; - case 'HEAD': - case 'GET': - $upload_handler->get(); - break; - case 'POST': - if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') { - $upload_handler->delete(); - } else { - $upload_handler->post(); - } - break; - case 'DELETE': - $upload_handler->delete(); - break; - default: - header('HTTP/1.0 405 Method Not Allowed'); - exit; + case 'HEAD': + case 'GET': + $upload_handler->get(); + break; + case 'POST': + if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') { + $upload_handler->delete(); + } else { + $upload_handler->post(); + } + break; + case 'DELETE': + $upload_handler->delete(); + break; + default: + header('HTTP/1.0 405 Method Not Allowed'); + exit; } $db->close(); diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index 0d662b6a0bd..e1a5c451ba5 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -68,4 +68,4 @@ else // Registering new values if (($action == 'set') && ! empty($id)) - $object->setValueFrom($field, $value, $element, $id); + $object->setValueFrom($field, $value, $element, $id); diff --git a/htdocs/core/ajax/security.php b/htdocs/core/ajax/security.php index 1cbede80339..39c2bf7b07f 100644 --- a/htdocs/core/ajax/security.php +++ b/htdocs/core/ajax/security.php @@ -44,8 +44,8 @@ if (isset($_GET['action']) && ! empty($_GET['action'])) { if ($_GET['action'] == 'getrandompassword' && $user->admin) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $generic = $_GET['generic'] ? true : false; + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + $generic = $_GET['generic'] ? true : false; echo getRandomPassword($generic); } } diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index df9f70da1df..72eb73f84e0 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -62,36 +62,36 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table { - $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; - $sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country"; - $sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as z"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region,"; - $sql.= " ".MAIN_DB_PREFIX."c_country as c"; - $sql.= " WHERE z.fk_pays = c.rowid"; - $sql.= " AND z.active = 1 AND c.active = 1"; - if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'"; - if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'"; - $sql.= " ORDER BY z.zip, z.town"; - $sql.= $db->plimit(100); // Avoid pb with bad criteria + $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; + $sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country"; + $sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as z"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region,"; + $sql.= " ".MAIN_DB_PREFIX."c_country as c"; + $sql.= " WHERE z.fk_pays = c.rowid"; + $sql.= " AND z.active = 1 AND c.active = 1"; + if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'"; + if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'"; + $sql.= " ORDER BY z.zip, z.town"; + $sql.= $db->plimit(100); // Avoid pb with bad criteria } else // Use table of third parties { - $sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country"; - $sql.= ", c.code as country_code, c.label as country"; - $sql.= ", d.code_departement as county_code , d.nom as county"; - $sql.= " FROM ".MAIN_DB_PREFIX.'societe as s'; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON s.fk_departement = d.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; - $sql.= " WHERE"; - if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'"; - if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'"; - $sql.= " ORDER BY s.fk_pays, s.zip, s.town"; - $sql.= $db->plimit(100); // Avoid pb with bad criteria + $sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country"; + $sql.= ", c.code as country_code, c.label as country"; + $sql.= ", d.code_departement as county_code , d.nom as county"; + $sql.= " FROM ".MAIN_DB_PREFIX.'societe as s'; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON s.fk_departement = d.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; + $sql.= " WHERE"; + if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'"; + if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'"; + $sql.= " ORDER BY s.fk_pays, s.zip, s.town"; + $sql.= $db->plimit(100); // Avoid pb with bad criteria } - //print $sql; + //print $sql; $resql=$db->query($sql); //var_dump($db); if ($resql) @@ -103,11 +103,11 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) $row_array['label'] = $row['zip'].' '.$row['town']; $row_array['label'] .= ($county || $country)?' (':''; - $row_array['label'] .= $county; + $row_array['label'] .= $county; $row_array['label'] .= ($county && $country?' - ':''); - $row_array['label'] .= $country; - $row_array['label'] .= ($county || $country)?')':''; - if ($zipcode) + $row_array['label'] .= $country; + $row_array['label'] .= ($county || $country)?')':''; + if ($zipcode) { $row_array['value'] = $row['zip']; $row_array['town'] = $row['town']; diff --git a/htdocs/core/antispamimage.php b/htdocs/core/antispamimage.php index 015f4597d12..38bb261e068 100644 --- a/htdocs/core/antispamimage.php +++ b/htdocs/core/antispamimage.php @@ -43,7 +43,7 @@ $number = strlen($letters); $string = ''; for($i = 0; $i < $length; $i++) { - $string .= $letters{mt_rand(0, $number - 1)}; + $string .= $letters{mt_rand(0, $number - 1)}; } //print $string; @@ -54,8 +54,8 @@ $_SESSION[$sessionkey]=$string; $img = imagecreate(80, 32); if (empty($img)) { - dol_print_error('', "Problem with GD creation"); - exit; + dol_print_error('', "Problem with GD creation"); + exit; } // Define mime type diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 023a2e6dc6d..448d1ffdf8d 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -50,13 +50,13 @@ abstract class CommonObjectLine extends CommonObject public $fk_unit; - /** - * Returns the translation key from units dictionary. - * A langs->trans() must be called on result to get translated value. - * - * @param string $type Label type (long or short) - * @return string|int <0 if ko, label if ok - */ + /** + * Returns the translation key from units dictionary. + * A langs->trans() must be called on result to get translated value. + * + * @param string $type Label type (long or short) + * @return string|int <0 if ko, label if ok + */ public function getLabelOfUnit($type = 'long') { global $langs; diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 4406d421745..c37041967c2 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -67,18 +67,18 @@ else // Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) $tradTemp=array( - $langs->trans("January"), - $langs->trans("February"), - $langs->trans("March"), - $langs->trans("April"), - $langs->trans("May"), - $langs->trans("June"), - $langs->trans("July"), - $langs->trans("August"), - $langs->trans("September"), - $langs->trans("October"), - $langs->trans("November"), - $langs->trans("December") + $langs->trans("January"), + $langs->trans("February"), + $langs->trans("March"), + $langs->trans("April"), + $langs->trans("May"), + $langs->trans("June"), + $langs->trans("July"), + $langs->trans("August"), + $langs->trans("September"), + $langs->trans("October"), + $langs->trans("November"), + $langs->trans("December") ); print ''; From 53850caa870c5fe8d861a29b34dd4564cec2203a Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 23 Mar 2020 22:44:26 +0100 Subject: [PATCH 052/116] No reload page to load other sale in TakePOS --- htdocs/takepos/invoice.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 51536ba8133..290d0df9443 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -733,17 +733,17 @@ $( document ).ready(function() { while ($obj = $db->fetch_object($resql)) { echo '$("#customerandsales").append(\''; if ($placeid==$obj->rowid) echo ""; - echo 'ref)); echo $num_sale; if (str_replace("-", "", $num_sale)>$max_sale) $max_sale=str_replace("-", "", $num_sale); - echo '\\\'">'.date('H:i', strtotime($obj->datec)); + echo '\\\';Refresh();">'.date('H:i', strtotime($obj->datec)); if ($placeid==$obj->rowid) echo ""; echo '\');'; } - echo '$("#customerandsales").append(\'\');'; + echo '\\\';Refresh();">\');'; } else { dol_print_error($db); } From 585c46b181058694079c682869ebe54766a54187 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 23 Mar 2020 22:58:04 +0100 Subject: [PATCH 053/116] Avoid print customer name when is default --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 290d0df9443..6251b5b57b0 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -717,7 +717,7 @@ $( document ).ready(function() { trans("Customer"); - if ($invoice->socid != $conf->global->$constforcompanyid) { + if ($invoice->id > 0 && ($invoice->socid != $conf->global->$constforcompanyid)) { $s = $soc->name; } ?> From 58a10c9c1633c53e0814acb7d2e81f867e443f48 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 23 Mar 2020 23:10:55 +0100 Subject: [PATCH 054/116] Unnecessary line --- htdocs/takepos/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 2ce3f31211b..9f3a259e441 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -733,7 +733,6 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { ?>
-
From 2b33ef7e46a76405a0d8729f3b945ebaffdb8d63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Mar 2020 13:06:59 +0100 Subject: [PATCH 055/116] Align color of graph of status on status color --- htdocs/commande/class/commande.class.php | 4 +- htdocs/commande/index.php | 68 +++++++++++-------- htdocs/core/lib/project.lib.php | 6 +- htdocs/projet/activity/perday.php | 4 +- htdocs/projet/activity/permonth.php | 4 +- htdocs/projet/activity/perweek.php | 4 +- htdocs/supplier_proposal/card.php | 11 +-- .../class/supplier_proposal.class.php | 2 +- htdocs/supplier_proposal/index.php | 32 ++++++--- htdocs/theme/eldy/global.inc.php | 3 + 10 files changed, 81 insertions(+), 57 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 57eb78df405..b1b7b3c8fe5 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3613,7 +3613,7 @@ class Commande extends CommonOrder if ($status == self::STATUS_CANCELED) { $labelStatus = $langs->trans('StatusOrderCanceled'); $labelStatusShort = $langs->trans('StatusOrderCanceledShort'); - $statusType = 'status5'; + $statusType = 'status9'; } elseif ($status == self::STATUS_DRAFT) { $labelStatus = $langs->trans('StatusOrderDraft'); @@ -3628,7 +3628,7 @@ class Commande extends CommonOrder elseif ($status == self::STATUS_SHIPMENTONPROCESS) { $labelStatus = $langs->trans('StatusOrderSentShort').$billedtext; $labelStatusShort = $langs->trans('StatusOrderSentShort').$billedtext; - $statusType = 'status3'; + $statusType = 'status4'; } elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { $labelStatus = $langs->trans('StatusOrderToBill'); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 072abe9625b..651ef2862e9 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -72,7 +72,6 @@ print '
'; if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo { // Search customer orders - $var = false; print '
'; print ''; print '
'; @@ -88,7 +87,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles * Statistics */ -$sql = "SELECT count(c.rowid), c.fk_statut"; +$sql = "SELECT count(c.rowid) as nb, c.fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."commande as c"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -117,7 +116,7 @@ if ($resql) //if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1)) { if (! isset($vals[$row[1]])) $vals[$row[1]]=0; - $vals[$row[1].$bool]+=$row[0]; + $vals[$row[1]]+=$row[0]; $totalinprocess+=$row[0]; } $total+=$row[0]; @@ -125,13 +124,32 @@ if ($resql) $i++; } $db->free($resql); + + include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; + print '
'; print ''; print ''."\n"; $listofstatus=array(0,1,2,3,-1); foreach ($listofstatus as $status) { - $dataseries[]=array($commandestatic->LibStatut($status, $bool, 1), (isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0)); + $dataseries[] = array($commandestatic->LibStatut($status, 0, 1, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0)); + if ($status == Commande::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0; + if ($status == Commande::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1; + if ($status == Commande::STATUS_SHIPMENTONPROCESS) $colorseries[$status] = $badgeStatus4; + if ($status == Commande::STATUS_CLOSED && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) $colorseries[$status] = $badgeStatus6; + if ($status == Commande::STATUS_CLOSED && (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) $colorseries[$status] = $badgeStatus6; + if ($status == Commande::STATUS_CANCELED) $colorseries[$status] = $badgeStatus9; + + if (empty($conf->use_javascript_ajax)) + { + print ''; + print ''; + print ''; + print "\n"; + } } if ($conf->use_javascript_ajax) { @@ -140,6 +158,7 @@ if ($resql) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); + $dolgraph->SetDataColor(array_values($colorseries)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); @@ -149,19 +168,6 @@ if ($resql) print ''; } - else - { - foreach ($listofstatus as $status) - { - print ''; - print ''; - print ''; - print "\n"; - } - } //if ($totalinprocess != $total) print ''; print "
'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'
'.$commandestatic->LibStatut($status, 0, 0, 1).''.(isset($vals[$status]) ? $vals[$status] : 0).' '; + print $commandestatic->LibStatut($status, 0, 3, 1); + print '
'.$commandestatic->LibStatut($status, $bool, 0).''.(isset($vals[$status.$bool]) ? $vals[$status.$bool] : 0).' '; - print $commandestatic->LibStatut($status, $bool, 3); - print ''; - print '
'.$langs->trans("Total").''.$total.'

"; @@ -202,7 +208,6 @@ if (!empty($conf->commande->enabled)) if ($num) { $i = 0; - $var = true; while ($i < $num) { $obj = $db->fetch_object($resql); @@ -241,7 +246,7 @@ print '
'; $max = 5; /* - * Last modified orders + * Lattest modified orders */ $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,"; @@ -272,7 +277,6 @@ if ($resql) if ($num) { $i = 0; - $var = true; while ($i < $num) { $obj = $db->fetch_object($resql); @@ -320,6 +324,7 @@ if ($resql) } else dol_print_error($db); +$max = 10; /* * Orders to process @@ -335,7 +340,7 @@ if (!empty($conf->commande->enabled)) if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('commande').")"; - $sql .= " AND c.fk_statut = 1"; + $sql .= " AND c.fk_statut = ".Commande::STATUS_VALIDATED; if ($socid) $sql .= " AND c.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; $sql .= " ORDER BY c.rowid DESC"; @@ -344,16 +349,16 @@ if (!empty($conf->commande->enabled)) if ($resql) { $num = $db->num_rows($resql); + print '
'; print ''; print ''; - print ''; + print ''; if ($num) { $i = 0; - $var = true; - while ($i < $num) + while ($i < $num && $i < $max) { $obj = $db->fetch_object($resql); print ''; @@ -395,6 +400,9 @@ if (!empty($conf->commande->enabled)) print ''; $i++; } + if ($i < $num) { + print ''; + } } print "
'.$langs->trans("OrdersToProcess").' '.$num.'
'.$langs->trans("OrdersToProcess").' '.$num.'
'.$langs->trans("More").'...

"; @@ -403,7 +411,7 @@ if (!empty($conf->commande->enabled)) } /* - * Orders thar are in a shipping process + * Orders that are in process */ if (!empty($conf->commande->enabled)) { @@ -416,7 +424,7 @@ if (!empty($conf->commande->enabled)) if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('commande').")"; - $sql .= " AND c.fk_statut = 2 "; + $sql .= " AND c.fk_statut = ".Commande::STATUS_ACCEPTED; if ($socid) $sql .= " AND c.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; $sql .= " ORDER BY c.rowid DESC"; @@ -429,13 +437,12 @@ if (!empty($conf->commande->enabled)) print '
'; print ''; print ''; - print ''; + print ''; if ($num) { $i = 0; - $var = true; - while ($i < $num) + while ($i < $num && $i < $max) { $obj = $db->fetch_object($resql); print ''; @@ -477,6 +484,9 @@ if (!empty($conf->commande->enabled)) print ''; $i++; } + if ($i < $num) { + print ''; + } } print "
'.$langs->trans("OnProcessOrders").' '.$num.'
'.$langs->trans("OnProcessOrders").' '.$num.'
'.$langs->trans("More").'...

"; } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index ef9ee7f2cd7..a8af4262d58 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -830,7 +830,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id)) { - print ''."\n"; + print ''."\n"; print ''; print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); if ($projectstatic->title) @@ -1449,7 +1449,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++; } - print ''."\n"; + print ''."\n"; print ''; print $projectstatic->getNomUrl(1, '', 0, ''.$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1); @@ -1797,7 +1797,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id)) { - print ''."\n"; + print ''."\n"; print ''; print $projectstatic->getNomUrl(1, '', 0, ''.$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1); diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 2489104eb34..3ae9866d73f 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -606,8 +606,8 @@ if (!empty($arrayfields['t.progress']['checked'])) /*print ''.$langs->trans("TimeSpent").''; if ($usertoprocess->id == $user->id) print ''.$langs->trans("TimeSpentByYou").''; else print ''.$langs->trans("TimeSpentByUser").'';*/ -print ''.$langs->trans("TimeSpent").'
('.$langs->trans("Everybody").')'; -print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
('.dol_trunc($usertoprocess->firstname, 10).')' : '').''; +print ''.$langs->trans("TimeSpent").'
'.$langs->trans("Everybody").''; +print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.dol_trunc($usertoprocess->firstname, 10).'' : '').''; print ''.$langs->trans("HourStart").''; // By default, we can edit only tasks we are assigned to diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index b5d4bcc633d..7f337818c1d 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -500,8 +500,8 @@ print ''.$langs->trans("ProgressDeclared"). /*print ''.$langs->trans("TimeSpent").''; if ($usertoprocess->id == $user->id) print ''.$langs->trans("TimeSpentByYou").''; else print ''.$langs->trans("TimeSpentByUser").'';*/ -print ''.$langs->trans("TimeSpent").'
('.$langs->trans("Everybody").')'; -print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
('.dol_trunc($usertoprocess->firstname, 10).')' : '').''; +print ''.$langs->trans("TimeSpent").'
'.$langs->trans("Everybody").''; +print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.dol_trunc($usertoprocess->firstname, 10).'' : '').''; foreach ($TWeek as $week_number) { diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 7a153d41631..8b8ba5d7295 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -660,8 +660,8 @@ if (!empty($arrayfields['t.progress']['checked'])) /*print ''.$langs->trans("TimeSpent").''; if ($usertoprocess->id == $user->id) print ''.$langs->trans("TimeSpentByYou").''; else print ''.$langs->trans("TimeSpentByUser").'';*/ -print ''.$langs->trans("TimeSpent").'
('.$langs->trans("Everybody").')'; -print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
('.dol_trunc($usertoprocess->firstname, 10).')' : '').''; +print ''.$langs->trans("TimeSpent").'
'.$langs->trans("Everybody").''; +print ''.$langs->trans("TimeSpent").($usertoprocess->firstname ? '
'.dol_trunc($usertoprocess->firstname, 10).'' : '').''; for ($idw = 0; $idw < 7; $idw++) { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5067a4935bc..133f0c1c0a6 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1557,7 +1557,7 @@ if ($action == 'create') print ''; print ''; if ($action == 'editdate_livraison') { - print ''; + print ''; print ''; print ''; print $form->selectDate($object->date_livraison, 'liv_', '', '', '', "editdate_livraison"); @@ -1806,12 +1806,13 @@ if ($action == 'create') if ($action == 'statut') { // Form to set proposal accepted/refused - $form_close = ''; - if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) $form_close .= '

'.$langs->trans('SupplierProposalRefFournNotice').'

'; // TODO Suggest a permanent checkbox instead of option + $form_close = ''; $form_close .= ''; + $form_close .= ''; + + if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) $form_close .= '

'.$langs->trans('SupplierProposalRefFournNotice').'

'; // TODO Suggest a permanent checkbox instead of option $form_close .= ''; $form_close .= '
' . $langs->trans("CloseAs") . ''; - $form_close .= ''; $form_close .= ''; print ''."\n"; $listofstatus = array(0, 1, 2, 3, 4); foreach ($listofstatus as $status) { - $dataseries[] = array($supplier_proposalstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0)); - if (!$conf->use_javascript_ajax) - { - print ''; - print ''; - print ''; - print "\n"; - } + $dataseries[] = array($supplier_proposalstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0)); + if ($status == SupplierProposal::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0; + if ($status == SupplierProposal::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1; + if ($status == SupplierProposal::STATUS_SIGNED) $colorseries[$status] = $badgeStatus4; + if ($status == SupplierProposal::STATUS_NOTSIGNED) $colorseries[$status] = $badgeStatus9; + if ($status == SupplierProposal::STATUS_CLOSE) $colorseries[$status] = $badgeStatus6; + + if (empty($conf->use_javascript_ajax)) + { + print ''; + print ''; + print ''; + print "\n"; + } } if ($conf->use_javascript_ajax) { @@ -144,6 +153,7 @@ if ($resql) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); + $dolgraph->SetDataColor(array_values($colorseries)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index eb1a2450521..2be4ec32f0b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3224,6 +3224,9 @@ td.evenodd, tr.nohoverpair td, #trlinefordates td { border-bottom: 1pt solid black !important; /* background-color: # !important; */ } +.trforbreak.nobold td a, .trforbreak.nobold span.secondary { + font-weight: normal !important; +} table.dataTable td { padding: 5px 8px 5px 8px !important; From 1ff15e1fd9cd62df84e20209946196aa1586ab5b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Mar 2020 13:10:35 +0100 Subject: [PATCH 056/116] FIX All forms must use newToken() --- .../bookkeeping/thirdparty_lettering_customer.php | 2 +- .../bookkeeping/thirdparty_lettering_supplier.php | 2 +- htdocs/adherents/cartes/carte.php | 6 +++--- htdocs/adherents/type.php | 2 +- htdocs/admin/agenda_other.php | 2 +- htdocs/admin/agenda_reminder.php | 2 +- htdocs/admin/clicktodial.php | 2 +- htdocs/admin/fckeditor.php | 2 +- htdocs/bom/bom_card.php | 2 +- htdocs/comm/action/pertype.php | 2 +- htdocs/comm/action/peruser.php | 2 +- htdocs/comm/propal/card.php | 8 ++++---- htdocs/commande/card.php | 8 ++++---- htdocs/compta/cashcontrol/cashcontrol_card.php | 4 ++-- htdocs/compta/facture/card-rec.php | 2 +- htdocs/compta/facture/card.php | 6 +++--- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/expedition/card.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/mrp/mo_card.php | 2 +- htdocs/product/price.php | 8 ++++---- htdocs/reception/card.php | 2 +- htdocs/societe/price.php | 4 ++-- htdocs/supplier_proposal/card.php | 8 ++++---- 24 files changed, 42 insertions(+), 42 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 1dfb324599c..1a212c00b84 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -197,7 +197,7 @@ if ($resql) { $param="&socid=".$socid; print ''; - print ''; + print ''; print ''; $letteringbutton = ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 5a5a4d36c21..f71b41a9c28 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -195,7 +195,7 @@ if ($resql) { $param="&socid=".$socid; print ''; - print ''; + print ''; print ''; $letteringbutton = ''; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index e7686a0a055..6736a22cd5d 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -259,7 +259,7 @@ print '
'; print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -279,7 +279,7 @@ print '

'; print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print ''; -print ''; +print ''; print ''; print ''; print $langs->trans("DescADHERENT_CARD_TYPE").' '; @@ -299,7 +299,7 @@ print '

'; print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' '; print ''; -print ''; +print ''; print ''; print ''; print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").' '; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 99d6cceb296..969117c4bdc 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -607,7 +607,7 @@ if ($rowid > 0) } print ''; - print ''; + print ''; print ''; print '
'; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 5338010772f..4960f044065 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -324,7 +324,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) } print ''; -print ''; +print ''; print ''; print '
'.$langs->trans("Statistics").' - '.$langs->trans("CommRequests").'
'.$supplier_proposalstatic->LibStatut($status, 0).''.(isset($vals[$status]) ? $vals[$status] : 0).'
'.$supplier_proposalstatic->LibStatut($status, 0).''.(isset($vals[$status]) ? $vals[$status] : 0).'
'."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 614d4ef4407..b641dd74fe2 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -180,7 +180,7 @@ $head=agenda_prepare_head(); dol_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action'); print ''; -print ''; +print ''; print ''; print '
'."\n"; diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 03c4eeb66cf..3fb3340a702 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -119,7 +119,7 @@ if (! empty($conf->global->CLICKTODIAL_URL)) if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest'); print ''; - print ''; + print ''; print $langs->trans("LinkToTestClickToDial", $user->login).' : '; print ''; print ''; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index cab7bfaecf0..ad077361fe8 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -185,7 +185,7 @@ else print '
'."\n"; print ''."\n"; - print ''; + print ''; // Skins show_skin(null, 1); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 81b5f858c9b..aedef905b7b 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -546,7 +546,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $result = $object->getLinesArray(); print ' - + diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index b1d0ddc7ccc..6dfbc6c7f9c 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -248,7 +248,7 @@ $nav .= "   ('; -$nav .= ''; +$nav .= ''; $nav .= ''; $nav .= ''; $nav .= ''; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index e8f7be097fa..f2cce5c8023 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -289,7 +289,7 @@ $nav .= "   ".$langs->trans("Today").")"; /*$nav.='   '; -$nav.=''; +$nav.=''; $nav.=''; $nav.=''; $nav.=''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 9430fce4634..279f72896f5 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1541,7 +1541,7 @@ if ($action == 'create') $object = new Propal($db); print ''; - print ''; + print ''; print ''; if ($origin != 'project' && $originid) { print ''; @@ -2052,7 +2052,7 @@ if ($action == 'create') print ''; print ''; - print ''; + print ''; print ''; $i++; } diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index 48619dfc7d0..ed609ddbc87 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -1,9 +1,6 @@ -/*
'; if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->date, 're', '', '', 0, "editdate"); print ''; @@ -2078,7 +2078,7 @@ if ($action == 'create') print ''; if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->fin_validite, 'ech', '', '', '', "editecheance"); print ''; @@ -2412,7 +2412,7 @@ if ($action == 'create') $result = $object->getLinesArray(); print ' - + diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 148fa427fff..10ba69601c1 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1602,7 +1602,7 @@ if ($action == 'create' && $usercancreate) } print ''; - print ''; + print ''; print ''; print ''."\n"; print ''; @@ -2184,7 +2184,7 @@ if ($action == 'create' && $usercancreate) print ''; if ($action == 'editdate') { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->date, 'order_', '', '', '', "setdate"); print ''; @@ -2205,7 +2205,7 @@ if ($action == 'create' && $usercancreate) print ''; if ($action == 'editdate_livraison') { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison"); print ''; @@ -2499,7 +2499,7 @@ if ($action == 'create' && $usercancreate) $result = $object->getLinesArray(); print ' - + '; diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 57d81c625fe..8dd3eca5e33 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -363,7 +363,7 @@ if ($action == "create" || $action == "start" || $action == 'close') print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register'); print ''; - print ''; + print ''; if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1') { print ''; @@ -680,7 +680,7 @@ if (empty($action) || $action == "view" || $action == "close") print '
'; } else { print ''; - print ''; + print ''; if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1') { print ''; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index dd295fa3112..26eee81375f 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1680,7 +1680,7 @@ else // Lines print ' - + diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 868ccc006d8..fbff955db47 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2854,7 +2854,7 @@ if ($action == 'create') } print ''; - print ''; + print ''; print ''; if ($soc->id > 0) print ''."\n"; print ''; @@ -4459,7 +4459,7 @@ elseif ($id > 0 || !empty($ref)) print '
'; if ($action == 'editrevenuestamp') { print ''; - print ''; + print ''; print ''; print ''; print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code); @@ -4963,7 +4963,7 @@ elseif ($id > 0 || !empty($ref)) } print ' - + diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index dd1810fdf5f..e5d7422cf8a 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -59,7 +59,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh // Filters //print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index b465297fe34..d539835d309 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2012,7 +2012,7 @@ elseif ($id || $ref) if ($action == 'editline') { print ' - + diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index cc87e83d5c0..93eb7560aaa 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -401,7 +401,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $result = $object->getLinesArray(); print ' - + diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 572b5d8a2f7..ca17ce7677e 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -497,7 +497,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $object->fetchLines(); print ' - + diff --git a/htdocs/product/price.php b/htdocs/product/price.php index a6697701a68..3f6a89cbddb 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1151,7 +1151,7 @@ if ($action == 'edit_vat' && ($user->rights->produit->creer || $user->rights->se print load_fiche_titre($langs->trans("UpdateVAT"), ''); print ''; - print ''; + print ''; print ''; print ''; @@ -1185,7 +1185,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print ''."\n"; print ''; - print ''; + print ''; print ''; print ''; @@ -1660,7 +1660,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print load_fiche_titre($langs->trans('PriceByCustomer')); print ''; - print ''; + print ''; print ''; print ''; @@ -1747,7 +1747,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) } print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index b2723a0ce6a..83a28d55f48 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1610,7 +1610,7 @@ elseif ($id || $ref) if ($action == 'editline') { print ' - + '; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index b65f0486d17..6d69e692a96 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -256,7 +256,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print load_fiche_titre($langs->trans('PriceByCustomer')); print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -334,7 +334,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } print ''; - print ''; + print ''; print ''; print ''; print '
'; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 133f0c1c0a6..8f9a5698a59 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1125,7 +1125,7 @@ if ($action == 'create') $object = new SupplierProposal($db); print ''; - print ''; + print ''; print ''; if ($origin != 'project' && $originid) { print ''; @@ -1558,7 +1558,7 @@ if ($action == 'create') print ''; print '
'; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 0ea6a932fe7..0a86aa9b5e6 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -324,7 +324,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) } print ''; -print ''; +print ''; print ''; print '
'; if ($action == 'editdate_livraison') { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->date_livraison, 'liv_', '', '', '', "editdate_livraison"); print ''; @@ -1762,7 +1762,7 @@ if ($action == 'create') $result = $object->getLinesArray(); print ' - + @@ -1807,7 +1807,7 @@ if ($action == 'create') { // Form to set proposal accepted/refused $form_close = ''; - $form_close .= ''; + $form_close .= ''; $form_close .= ''; if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) $form_close .= '

'.$langs->trans('SupplierProposalRefFournNotice').'

'; // TODO Suggest a permanent checkbox instead of option From a5379c71443c7b385f69bb3fbe558895c0b1a051 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Mar 2020 13:10:35 +0100 Subject: [PATCH 057/116] FIX All forms must use newToken() Conflicts: htdocs/commande/card.php htdocs/compta/cashcontrol/cashcontrol_card.php htdocs/supplier_proposal/card.php --- .../bookkeeping/thirdparty_lettering_customer.php | 2 +- .../bookkeeping/thirdparty_lettering_supplier.php | 2 +- htdocs/adherents/cartes/carte.php | 6 +++--- htdocs/adherents/type.php | 2 +- htdocs/admin/agenda_other.php | 2 +- htdocs/admin/agenda_reminder.php | 2 +- htdocs/admin/clicktodial.php | 2 +- htdocs/admin/fckeditor.php | 2 +- htdocs/bom/bom_card.php | 2 +- htdocs/comm/action/pertype.php | 2 +- htdocs/comm/action/peruser.php | 2 +- htdocs/comm/propal/card.php | 8 ++++---- htdocs/commande/card.php | 10 +++++----- htdocs/compta/cashcontrol/cashcontrol_card.php | 2 +- htdocs/compta/facture/card-rec.php | 2 +- htdocs/compta/facture/card.php | 6 +++--- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/expedition/card.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/mrp/mo_card.php | 2 +- htdocs/product/price.php | 8 ++++---- htdocs/reception/card.php | 2 +- htdocs/societe/price.php | 4 ++-- htdocs/supplier_proposal/card.php | 13 ++++++++----- 24 files changed, 46 insertions(+), 43 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 9cb863aec7d..33563b7b57a 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -197,7 +197,7 @@ if ($resql) { $param="&socid=".$socid; print ''; - print ''; + print ''; print ''; $letteringbutton = ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 61e5e34da99..54aec9490b4 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -195,7 +195,7 @@ if ($resql) { $param="&socid=".$socid; print ''; - print ''; + print ''; print ''; $letteringbutton = ''; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index e7686a0a055..6736a22cd5d 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -259,7 +259,7 @@ print '
'; print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -279,7 +279,7 @@ print '

'; print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print ''; -print ''; +print ''; print ''; print ''; print $langs->trans("DescADHERENT_CARD_TYPE").' '; @@ -299,7 +299,7 @@ print '

'; print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' '; print ''; -print ''; +print ''; print ''; print ''; print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").' '; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 11360ad4652..4590254ebf6 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -605,7 +605,7 @@ if ($rowid > 0) } print ''; - print ''; + print ''; print '
'."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 614d4ef4407..b641dd74fe2 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -180,7 +180,7 @@ $head=agenda_prepare_head(); dol_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action'); print ''; -print ''; +print ''; print ''; print '
'."\n"; diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 03c4eeb66cf..3fb3340a702 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -119,7 +119,7 @@ if (! empty($conf->global->CLICKTODIAL_URL)) if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest'); print ''; - print ''; + print ''; print $langs->trans("LinkToTestClickToDial", $user->login).' : '; print ''; print ''; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index efe8ca1117d..3bbd23fa7d6 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -185,7 +185,7 @@ else print '
'."\n"; print ''."\n"; - print ''; + print ''; // Skins show_skin(null, 1); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 3f1be6c7e4c..3320c160fc2 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -546,7 +546,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $result = $object->getLinesArray(); print ' - + diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 04f334a9551..5591741997e 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -248,7 +248,7 @@ $nav .= "   ('; -$nav .= ''; +$nav .= ''; $nav .= ''; $nav .= ''; $nav .= ''; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index f906c4cab45..711e18ef8b6 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -289,7 +289,7 @@ $nav .= "   ".$langs->trans("Today").")"; /*$nav.='   '; -$nav.=''; +$nav.=''; $nav.=''; $nav.=''; $nav.=''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f55861b00cc..ad3af8c799d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1541,7 +1541,7 @@ if ($action == 'create') $object = new Propal($db); print ''; - print ''; + print ''; print ''; if ($origin != 'project' && $originid) { print ''; @@ -2052,7 +2052,7 @@ if ($action == 'create') print ''; print ''; - print ''; + print ''; print ''; $i++; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 1ef8510016c..2c23f578fb4 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1150,7 +1150,7 @@ if ($action == 'create') } else { print ''; } print ''."\n"; @@ -1230,8 +1230,8 @@ if ($action == 'create') print ''; print ''; print ''; @@ -1534,7 +1534,7 @@ if ($action == 'create') print '
'; if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->date, 're', '', '', 0, "editdate"); print ''; @@ -2078,7 +2078,7 @@ if ($action == 'create') print ''; if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->fin_validite, 'ech', '', '', '', "editecheance"); print ''; @@ -2412,7 +2412,7 @@ if ($action == 'create') $result = $object->getLinesArray(); print ' - + diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3c1bf672c0f..3e9c1a2b0ca 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1594,8 +1594,8 @@ if ($action == 'create' && $usercancreate) $note_public = $object->getDefaultCreateValueFor('note_public'); } - print ''; - print ''; + print ''; + print ''; print ''; print '' . "\n"; print ''; @@ -2177,7 +2177,7 @@ if ($action == 'create' && $usercancreate) print ''; if ($action == 'editdate') { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->date, 'order_', '', '', '', "setdate"); print ''; @@ -2198,7 +2198,7 @@ if ($action == 'create' && $usercancreate) print ''; if ($action == 'editdate_livraison') { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison"); print ''; @@ -2492,7 +2492,7 @@ if ($action == 'create' && $usercancreate) $result = $object->getLinesArray(); print ' - + '; diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 8e83e6a33a4..41ba0dbd0fe 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -318,7 +318,7 @@ if ($action == "create" || $action == "start") print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register'); print ''; - print ''; + print ''; if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1') { print ''; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 7d1f529bf82..06717574b07 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1680,7 +1680,7 @@ else // Lines print ' - + diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 185f2a1a818..0b38c4eb7e7 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2840,7 +2840,7 @@ if ($action == 'create') } print ''; - print ''; + print ''; print ''; if ($soc->id > 0) print ''."\n"; print ''; @@ -4441,7 +4441,7 @@ elseif ($id > 0 || !empty($ref)) print ''; if ($action == 'editrevenuestamp') { print ''; - print ''; + print ''; print ''; print ''; print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code); @@ -4945,7 +4945,7 @@ elseif ($id > 0 || !empty($ref)) } print ' - + diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index dd1810fdf5f..e5d7422cf8a 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -59,7 +59,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh // Filters //print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index b137e6cdfa5..cc9111fc813 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2012,7 +2012,7 @@ elseif ($id || $ref) if ($action == 'editline') { print ' - + diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index cc87e83d5c0..93eb7560aaa 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -401,7 +401,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $result = $object->getLinesArray(); print ' - + diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index db05bfd408d..e16a19ea482 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -497,7 +497,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $object->fetchLines(); print ' - + diff --git a/htdocs/product/price.php b/htdocs/product/price.php index a6697701a68..3f6a89cbddb 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1151,7 +1151,7 @@ if ($action == 'edit_vat' && ($user->rights->produit->creer || $user->rights->se print load_fiche_titre($langs->trans("UpdateVAT"), ''); print ''; - print ''; + print ''; print ''; print ''; @@ -1185,7 +1185,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print ''."\n"; print ''; - print ''; + print ''; print ''; print ''; @@ -1660,7 +1660,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print load_fiche_titre($langs->trans('PriceByCustomer')); print ''; - print ''; + print ''; print ''; print ''; @@ -1747,7 +1747,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) } print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index b2723a0ce6a..83a28d55f48 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1610,7 +1610,7 @@ elseif ($id || $ref) if ($action == 'editline') { print ' - + '; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 5b383f30e28..7386987945e 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -256,7 +256,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print load_fiche_titre($langs->trans('PriceByCustomer')); print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -334,7 +334,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } print ''; - print ''; + print ''; print ''; print ''; print '
'; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5067a4935bc..37afb5f9621 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1125,7 +1125,7 @@ if ($action == 'create') $object = new SupplierProposal($db); print ''; - print ''; + print ''; print ''; if ($origin != 'project' && $originid) { print ''; @@ -1557,8 +1557,8 @@ if ($action == 'create') print '
'; print '
'; if ($action == 'editdate_livraison') { - print ''; - print ''; + print ''; + print ''; print ''; print $form->selectDate($object->date_livraison, 'liv_', '', '', '', "editdate_livraison"); print ''; @@ -1762,7 +1762,7 @@ if ($action == 'create') $result = $object->getLinesArray(); print ' - + @@ -1806,7 +1806,10 @@ if ($action == 'create') if ($action == 'statut') { // Form to set proposal accepted/refused - $form_close = ''; + $form_close = ''; + $form_close .= ''; + $form_close .= ''; + if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) $form_close .= '

'.$langs->trans('SupplierProposalRefFournNotice').'

'; // TODO Suggest a permanent checkbox instead of option $form_close .= ''; $form_close .= ''; From d922eb270da70982ce56c2df3f6790a2cb52989e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Mar 2020 13:25:45 +0100 Subject: [PATCH 058/116] FIX actions on supplier proposal not saved (bad trigger name) --- htdocs/supplier_proposal/card.php | 4 ++-- .../class/supplier_proposal.class.php | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 8f9a5698a59..1ef8510016c 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1041,7 +1041,7 @@ if (empty($reshook)) if (!$error) { - $result = $object->insertExtraFields('SUPPLIER_PROPOSAL_MODIFY'); + $result = $object->insertExtraFields('PROPOSAL_SUPPLIER_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -1433,7 +1433,7 @@ if ($action == 'create') require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; - $text .= $notify->confirmMessage('SUPPLIER_PROPOSAL_VALIDATE', $object->socid, $object); + $text .= $notify->confirmMessage('PROPOSAL_SUPPLIER_VALIDATE', $object->socid, $object); } if (!$error) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 2f38de96c6e..f2371c5f558 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1481,7 +1481,7 @@ class SupplierProposal extends CommonObject if (!$error && !$notrigger) { // Call trigger - $result = $this->call_trigger('SUPPLIER_PROPOSAL_VALIDATE', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_VALIDATE', $user); if ($result < 0) { $error++; } // End call triggers } @@ -1683,7 +1683,7 @@ class SupplierProposal extends CommonObject if (!$notrigger) { // Call trigger - $result = $this->call_trigger('SUPPLIER_PROPOSAL_REOPEN', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_REOPEN', $user); if ($result < 0) { $error++; } // End call triggers } @@ -1737,11 +1737,11 @@ class SupplierProposal extends CommonObject if ($resql) { $modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED : $this->modelpdf; - $triggerName = 'SUPPLIER_PROPOSAL_CLOSE_REFUSED'; + $triggerName = 'PROPOSAL_SUPPLIER_CLOSE_REFUSED'; if ($status == 2) { - $triggerName = 'SUPPLIER_PROPOSAL_CLOSE_SIGNED'; + $triggerName = 'PROPOSAL_SUPPLIER_CLOSE_SIGNED'; $modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL : $this->modelpdf; if (!empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists @@ -1751,7 +1751,7 @@ class SupplierProposal extends CommonObject } if ($status == 4) { - $triggerName = 'SUPPLIER_PROPOSAL_CLASSIFY_BILLED'; + $triggerName = 'PROPOSAL_SUPPLIER_CLASSIFY_BILLED'; } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) @@ -1916,7 +1916,7 @@ class SupplierProposal extends CommonObject if (!$error) { // Call trigger - $result = $this->call_trigger('SUPPLIER_PROPOSAL_UNVALIDATE', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_UNVALIDATE', $user); if ($result < 0) $error++; } @@ -2034,7 +2034,7 @@ class SupplierProposal extends CommonObject if (!$notrigger) { // Call trigger - $result = $this->call_trigger('SUPPLIER_PROPOSAL_DELETE', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_DELETE', $user); if ($result < 0) { $error++; } // End call triggers } From 1657a6b50a4e5db486e5331488612ee4899ec590 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Mar 2020 13:25:45 +0100 Subject: [PATCH 059/116] FIX actions on supplier proposal not saved (bad trigger name) Conflicts: htdocs/supplier_proposal/class/supplier_proposal.class.php --- htdocs/supplier_proposal/card.php | 4 ++-- .../class/supplier_proposal.class.php | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 37afb5f9621..e998f909d06 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1041,7 +1041,7 @@ if (empty($reshook)) if (!$error) { - $result = $object->insertExtraFields('SUPPLIER_PROPOSAL_MODIFY'); + $result = $object->insertExtraFields('PROPOSAL_SUPPLIER_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -1433,7 +1433,7 @@ if ($action == 'create') require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; - $text .= $notify->confirmMessage('SUPPLIER_PROPOSAL_VALIDATE', $object->socid, $object); + $text .= $notify->confirmMessage('PROPOSAL_SUPPLIER_VALIDATE', $object->socid, $object); } if (!$error) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 97e3b12b92f..6f41426ee80 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1481,7 +1481,7 @@ class SupplierProposal extends CommonObject if (! $error && ! $notrigger) { // Call trigger - $result=$this->call_trigger('SUPPLIER_PROPOSAL_VALIDATE', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_VALIDATE', $user); if ($result < 0) { $error++; } // End call triggers } @@ -1683,7 +1683,7 @@ class SupplierProposal extends CommonObject if (! $notrigger) { // Call trigger - $result=$this->call_trigger('SUPPLIER_PROPOSAL_REOPEN', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_REOPEN', $user); if ($result < 0) { $error++; } // End call triggers } @@ -1736,13 +1736,13 @@ class SupplierProposal extends CommonObject $resql=$this->db->query($sql); if ($resql) { - $modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED:$this->modelpdf; - $triggerName = 'SUPPLIER_PROPOSAL_CLOSE_REFUSED'; + $modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED : $this->modelpdf; + $triggerName = 'PROPOSAL_SUPPLIER_CLOSE_REFUSED'; if ($status == 2) { - $triggerName='SUPPLIER_PROPOSAL_CLOSE_SIGNED'; - $modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf; + $triggerName = 'PROPOSAL_SUPPLIER_CLOSE_SIGNED'; + $modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL : $this->modelpdf; if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists { @@ -1751,7 +1751,7 @@ class SupplierProposal extends CommonObject } if ($status == 4) { - $triggerName='SUPPLIER_PROPOSAL_CLASSIFY_BILLED'; + $triggerName = 'PROPOSAL_SUPPLIER_CLASSIFY_BILLED'; } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) @@ -1916,7 +1916,7 @@ class SupplierProposal extends CommonObject if (!$error) { // Call trigger - $result=$this->call_trigger('SUPPLIER_PROPOSAL_UNVALIDATE', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_UNVALIDATE', $user); if ($result < 0) $error++; } @@ -2034,7 +2034,7 @@ class SupplierProposal extends CommonObject if (! $notrigger) { // Call trigger - $result=$this->call_trigger('SUPPLIER_PROPOSAL_DELETE', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_DELETE', $user); if ($result < 0) { $error++; } // End call triggers } From 21febcc8fc6a30a718a89f061597e30ab651d7b8 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 24 Mar 2020 16:09:18 +0100 Subject: [PATCH 060/116] fix extrafeild creation --- htdocs/core/class/extrafields.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 94504686718..0a0496d0923 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -392,6 +392,7 @@ class ExtraFields if (empty($list)) $list = '0'; if (empty($required)) $required = 0; if (empty($unique)) $unique = 0; + if (empty($printable)) $printable = 0; if (empty($alwayseditable)) $alwayseditable = 0; if (empty($totalizable)) $totalizable = 0; From 4c0de7447047c87be907925b46353413f15eacb7 Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 24 Mar 2020 16:27:53 +0100 Subject: [PATCH 061/116] FIX : sort by default role makes no sense --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 561cc0a02b3..30a1b80c232 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1098,7 +1098,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if (!empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; if ($key == 'role') $align .= ($align ? ' ' : '').'left'; if (!empty($arrayfields['sc.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'sc.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; + print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; } } // Extra fields From 8409f3ba4ee46a4751e0e3da5c5487b80cfc3287 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 24 Mar 2020 17:28:12 +0100 Subject: [PATCH 062/116] NEW PRODUCT_SHOW_ORIGIN_IN_COMBO for some business, products have same label so we sometimes need display origin of product for a good choice --- htdocs/core/class/html.form.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f3615d4180f..a168b5abe3b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2141,7 +2141,7 @@ class Form } } - $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; + $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country as country_id, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; if (count($warehouseStatusArray)) { $selectFieldsGrouped = ", sum(".$db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock @@ -2445,6 +2445,7 @@ class Form $outlabel = ''; $outdesc = ''; $outbarcode = ''; + $outorigin = ''; $outtype = ''; $outprice_ht = ''; $outprice_ttc = ''; @@ -2464,6 +2465,7 @@ class Form $outlabel = $objp->label; $outdesc = $objp->description; $outbarcode = $objp->barcode; + $outorigin = $objp->country_id; $outpbq = empty($objp->price_by_qty_rowid) ? '' : $objp->price_by_qty_rowid; $outtype = $objp->fk_product_type; @@ -2525,12 +2527,15 @@ class Form $opt .= $objp->ref; if ($outbarcode) $opt .= ' ('.$outbarcode.')'; $opt .= ' - '.dol_trunc($label, $maxlengtharticle); + if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $opt .= ' ('.getCountry($outorigin, 1).')'; $objRef = $objp->ref; if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $objRef, 1); $outval .= $objRef; if ($outbarcode) $outval .= ' ('.$outbarcode.')'; $outval .= ' - '.dol_trunc($label, $maxlengtharticle); + if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $outval .= ' ('.getCountry($outorigin, 1).')'; + // Units $opt .= $outvalUnits; $outval .= $outvalUnits; From 06f53fdd6989175bf6efa5081e0b4a0da4c8e9ac Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 24 Mar 2020 17:32:50 +0100 Subject: [PATCH 063/116] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a168b5abe3b..756e1016ea9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2535,7 +2535,7 @@ class Form if ($outbarcode) $outval .= ' ('.$outbarcode.')'; $outval .= ' - '.dol_trunc($label, $maxlengtharticle); if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $outval .= ' ('.getCountry($outorigin, 1).')'; - + // Units $opt .= $outvalUnits; $outval .= $outvalUnits; From fec3377f2470353f5c7702cb63b06017d35e518c Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 24 Mar 2020 18:49:16 +0100 Subject: [PATCH 064/116] FIX: Compatibility with multicompany, bad numerotation of task. --- htdocs/projet/class/task.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 60657b08061..bba05a55c8e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2014 Marcos García * Copyright (C) 2018 Frédéric France + * Copyright (C) 2020 Juanjo Menent * * 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 @@ -154,7 +155,8 @@ class Task extends CommonObject // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task ("; - $sql .= "fk_projet"; + $sql .= "entity"; + $sql .= ", fk_projet"; $sql .= ", ref"; $sql .= ", fk_task_parent"; $sql .= ", label"; @@ -166,7 +168,8 @@ class Task extends CommonObject $sql .= ", planned_workload"; $sql .= ", progress"; $sql .= ") VALUES ("; - $sql .= $this->fk_project; + $sql .= $conf->entity; + $sql .= ", ".$this->fk_project; $sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null'); $sql .= ", ".$this->fk_task_parent; $sql .= ", '".$this->db->escape($this->label)."'"; From 62fefab5acc70d4d208b5fcef1e0d1691209c698 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Mar 2020 19:06:37 +0100 Subject: [PATCH 065/116] Standardize color of status --- htdocs/comm/propal/index.php | 10 ++- htdocs/commande/index.php | 22 +++-- htdocs/core/lib/functions.lib.php | 21 ++--- .../class/fournisseur.commande.class.php | 26 +++--- htdocs/fourn/commande/index.php | 82 +++++-------------- htdocs/supplier_proposal/card.php | 10 +-- .../class/supplier_proposal.class.php | 4 +- htdocs/supplier_proposal/index.php | 2 +- htdocs/theme/eldy/badges.inc.php | 26 +++--- htdocs/theme/eldy/theme_vars.inc.php | 8 +- 10 files changed, 93 insertions(+), 118 deletions(-) diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 66f4aa94fd2..a931af375c5 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -302,7 +302,8 @@ if ($resql) print '
'; print ''; - print ''; + + print ''; print ''; $i++; } @@ -314,7 +315,7 @@ else dol_print_error($db); /* - * Opened proposals + * Open proposals */ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { @@ -381,9 +382,10 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) $companystatic->canvas = $obj->canvas; print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''; + print ''."\n"; print ''."\n"; $i++; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 651ef2862e9..8e1fa07c17a 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -315,7 +315,7 @@ if ($resql) print $companystatic->getNomUrl(1, 'company', 16); print ''; print ''; - print ''; + print ''; print ''; $i++; } @@ -331,7 +331,7 @@ $max = 10; */ if (!empty($conf->commande->enabled)) { - $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid"; + $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; $sql .= ", s.canvas"; @@ -353,7 +353,7 @@ if (!empty($conf->commande->enabled)) print '
'; print '
'.$companystatic->getNomUrl(1, 'customer').''.dol_print_date($db->jdate($obj->datec), 'day').''.$propalstatic->LibStatut($obj->fk_statut, 5).''.$propalstatic->LibStatut($obj->fk_statut, 3).'
'.$companystatic->getNomUrl(1, 'customer', 44).''; - print dol_print_date($db->jdate($obj->dp), 'day').''.dol_print_date($db->jdate($obj->dp), 'day').''.price($obj->total_ttc).''.$propalstatic->LibStatut($obj->fk_statut, 3).'
'.dol_print_date($db->jdate($obj->datem), 'day').''.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).''.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'
'; print ''; - print ''; + print ''; if ($num) { @@ -395,13 +395,15 @@ if (!empty($conf->commande->enabled)) print $companystatic->getNomUrl(1, 'company', 24); print ''; - print ''; + print ''."\n"; + + print ''; print ''; $i++; } if ($i < $num) { - print ''; + print ''; } } @@ -415,7 +417,7 @@ if (!empty($conf->commande->enabled)) */ if (!empty($conf->commande->enabled)) { - $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid"; + $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; $sql .= ", s.canvas"; @@ -437,7 +439,7 @@ if (!empty($conf->commande->enabled)) print '
'; print '
'.$langs->trans("OrdersToProcess").' '.$num.'
'.$langs->trans("OrdersToProcess").' '.$num.'
'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).''.dol_print_date($db->jdate($obj->date), 'day').''.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'
'.$langs->trans("More").'...
'.$langs->trans("More").'...
'; print ''; - print ''; + print ''; if ($num) { @@ -479,13 +481,15 @@ if (!empty($conf->commande->enabled)) print $companystatic->getNomUrl(1, 'company'); print ''; - print ''; + print ''."\n"; + + print ''; print ''; $i++; } if ($i < $num) { - print ''; + print ''; } } print "
'.$langs->trans("OnProcessOrders").' '.$num.'
'.$langs->trans("OnProcessOrders").' '.$num.'
'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).''.dol_print_date($db->jdate($obj->date), 'day').''.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'
'.$langs->trans("More").'...
'.$langs->trans("More").'...

"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9f244722a8f..3a3e0c33543 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3305,6 +3305,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } // If we ask an image into $url/$mymodule/img (instead of default path) + $regs = array(); if (preg_match('/^([^@]+)@([^@]+)$/i', $picto, $regs)) { $picto = $regs[1]; $path = $regs[2]; // $path is $mymodule @@ -8425,16 +8426,16 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st // For backward compatibility. Image's filename are still in French, so we use this array to convert $statusImg = array( - 'status0' => 'statut0' - ,'status1' => 'statut1' - ,'status2' => 'statut2' - ,'status3' => 'statut3' - ,'status4' => 'statut4' - ,'status5' => 'statut5' - ,'status6' => 'statut6' - ,'status7' => 'statut7' - ,'status8' => 'statut8' - ,'status9' => 'statut9' + 'status0' => 'statut0', + 'status1' => 'statut1', + 'status2' => 'statut2', + 'status3' => 'statut3', + 'status4' => 'statut4', + 'status5' => 'statut5', + 'status6' => 'statut6', + 'status7' => 'statut7', + 'status8' => 'statut8', + 'status9' => 'statut9' ); if (!empty($statusImg[$statusType])) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 797e3693614..9906a679ce1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -104,6 +104,8 @@ class CommandeFournisseur extends CommonOrder // Note: billed or not is on another field "billed" public $statuts; // List of status + public $billed; + public $socid; public $fourn_id; public $date; @@ -354,6 +356,7 @@ class CommandeFournisseur extends CommonOrder $this->socid = $obj->fk_soc; $this->fourn_id = $obj->fk_soc; $this->statut = $obj->fk_statut; + $this->status = $obj->fk_statut; $this->billed = $obj->billed; $this->user_author_id = $obj->fk_user_author; $this->user_valid_id = $obj->fk_user_valid; @@ -694,7 +697,7 @@ class CommandeFournisseur extends CommonOrder * Return label of a status * * @param int $status Id statut - * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @param int $billed 1=Billed * @return string Label of status */ @@ -731,14 +734,14 @@ class CommandeFournisseur extends CommonOrder $statustrans = array( 0 => 'status0', - 1 => 'status1', - 2 => 'status3', - 3 => 'status3', - 4 => 'status3', - 5 => 'status4', - 6 => 'status5', - 7 => 'status5', - 9 => 'status5', + 1 => 'status1b', + 2 => 'status1', + 3 => 'status4', + 4 => 'status4b', + 5 => 'status6', + 6 => 'status9', + 7 => 'status9', + 9 => 'status9', ); $statusClass = 'status0'; @@ -747,9 +750,10 @@ class CommandeFournisseur extends CommonOrder } $billedtext = ''; - if ($mode == 4 && $billed) { - $billedtext = ' - '.$langs->trans("Billed"); + if ($billed) { + $billedtext = ' - '.$langs->trans("Billed"); } + if ($status == 5 && $billed) $statusClass = 'status6'; $statusLong = $langs->trans($this->statuts[$status]).$billedtext; $statusShort = $langs->trans($this->statutshort[$status]); diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index d1d102e55ea..fd14deabb43 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -76,7 +76,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles * Statistics */ -$sql = "SELECT count(cf.rowid), fk_statut"; +$sql = "SELECT count(cf.rowid) as nb, fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -93,7 +93,6 @@ if ($resql) $i = 0; $total = 0; - $totalinprocess = 0; $dataseries = array(); $vals = array(); // 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially @@ -101,27 +100,36 @@ if ($resql) // -> 6=Canceled -> (reopen) 2=Approved while ($i < $num) { - $row = $db->fetch_row($resql); - if ($row) + $obj = $db->fetch_object($resql); + if ($obj) { - if ($row[1] != 7 && $row[1] != 6 && $row[1] != 5) - { - $vals[$row[1]] = $row[0]; - $totalinprocess += $row[0]; - } - $total += $row[0]; + $vals[($obj->status == CommandeFournisseur::STATUS_CANCELED_AFTER_ORDER ? CommandeFournisseur::STATUS_CANCELED : $obj->status)] = $obj->nb; + + $total += $obj->nb; } $i++; } $db->free($resql); + include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; + print '
'; print ''; print ''; print "\n"; - foreach (array(0, 1, 2, 3, 4, 5, 6) as $status) + $listofstatus=array(0, 1, 2, 3, 4, 5, 6, 9); + foreach ($listofstatus as $status) { $dataseries[] = array($commandestatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0)); + if ($status == CommandeFournisseur::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0; + if ($status == CommandeFournisseur::STATUS_VALIDATED) $colorseries[$status] = '-'.$badgeStatus1; + if ($status == CommandeFournisseur::STATUS_ACCEPTED) $colorseries[$status] = $badgeStatus1; + if ($status == CommandeFournisseur::STATUS_REFUSED) $colorseries[$status] = $badgeStatus9; + if ($status == CommandeFournisseur::STATUS_ORDERSENT) $colorseries[$status] = $badgeStatus4; + if ($status == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY) $colorseries[$status] = '-'.$badgeStatus4; + if ($status == CommandeFournisseur::STATUS_RECEIVED_COMPLETELY) $colorseries[$status] = $badgeStatus6; + if ($status == CommandeFournisseur::STATUS_CANCELED || $status == CommandeFournisseur::STATUS_CANCELED_AFTER_ORDER) $colorseries[$status] = $badgeStatus9; + if (!$conf->use_javascript_ajax) { print ''; @@ -137,6 +145,7 @@ if ($resql) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); + $dolgraph->SetDataColor(array_values($colorseries)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); @@ -157,53 +166,6 @@ else dol_print_error($db); } -/* - * Legends / Status - */ - -$sql = "SELECT count(cf.rowid) as nb, cf.fk_statut"; -$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; -$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf"; -if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql .= " WHERE cf.fk_soc = s.rowid"; -$sql .= " AND cf.entity IN (".getEntity("supplier_order").")"; // Thirdparty sharing is mandatory with supplier order sharing -if ($user->socid) $sql .= ' AND cf.fk_soc = '.$user->socid; -if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; -$sql .= " GROUP BY cf.fk_statut"; - -$resql = $db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - $i = 0; - - print '
'; - print '
'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'
'; - - print ''; - print ''; - print "\n"; - - while ($i < $num) - { - $obj = $db->fetch_object($resql); - - print ''; - print ''; - print ''; - - print "\n"; - $i++; - } - print "
'.$langs->trans("Status").''.$langs->trans("Nb").'
'.$commandestatic->LibStatut($obj->nb).''.$obj->nb.' '.$commandestatic->LibStatut($obj->fk_statut, 3).'

"; - $db->free($resql); -} -else -{ - dol_print_error($db); -} - - /* * Draft orders */ @@ -322,7 +284,7 @@ print '
'; */ $max = 5; -$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.tms, s.nom as name, s.rowid as socid"; +$sql = "SELECT c.rowid, c.ref, c.fk_statut as status, c.tms, c.billed, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -376,7 +338,7 @@ if ($resql) print '
'.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.''.dol_print_date($db->jdate($obj->tms), 'day').''.$commandestatic->LibStatut($obj->fk_statut, 5).''.$commandestatic->LibStatut($obj->status, 3, $obj->billed).'
'; print $form->select_company('', 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); - print ' '.$langs->trans("AddThirdParty").''; + print ' '; print '
'.$langs->trans("Project").''; - $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   id).'">'.$langs->trans("AddProject").''; + $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); + print '   id).'">'; print '
'; - if ($action != 'editconditions' && $object->statut == SupplierProposal::STATUS_DRAFT) + if ($action != 'editconditions' && $object->statut != SupplierProposal::STATUS_NOTSIGNED) print ''; print '
'; print $langs->trans('PaymentConditionsShort'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'
'; print '
'; @@ -1575,7 +1575,7 @@ if ($action == 'create') print ''; - if ($action != 'editmode' && $object->statut == $object::STATUS_VALIDATED) + if ($action != 'editmode' && $object->statut != SupplierProposal::STATUS_NOTSIGNED) print ''; print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'
'; print '
'; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index f2371c5f558..d1d3b08bc2d 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -13,7 +13,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2019 Frédéric France + * 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 @@ -2233,7 +2233,7 @@ class SupplierProposal extends CommonObject if ($status == self::STATUS_DRAFT) $statusnew = 'status0'; elseif ($status == self::STATUS_VALIDATED) $statusnew = 'status1'; elseif ($status == self::STATUS_SIGNED) $statusnew = 'status4'; - elseif ($status == self::STATUS_NOTSIGNED) $statusnew = 'status5'; + elseif ($status == self::STATUS_NOTSIGNED) $statusnew = 'status9'; elseif ($status == self::STATUS_CLOSE) $statusnew = 'status6'; return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusnew, $mode); diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index 89663883084..b0c589010aa 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -292,7 +292,7 @@ if ($resql) print ''.$companystatic->getNomUrl(1, 'customer').''.dol_print_date($db->jdate($obj->datec), 'day').''.$supplier_proposalstatic->LibStatut($obj->fk_statut, 5).''.$supplier_proposalstatic->LibStatut($obj->fk_statut, 3).'