From 639f24a95b23707024c36cf8535e9b3f8210881e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 5 Sep 2018 17:36:28 +0200 Subject: [PATCH 01/74] Add online payment link --- htdocs/don/card.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 5a9e439a9c7..d033f7b73c9 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -790,6 +790,16 @@ if (! empty($id) && $action != 'edit') // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('don')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + // Show online payment link + $useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)); + + if ($useonlinepayment) //$object->statut != Facture::STATUS_DRAFT && + { + print '
'."\n"; + require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; + print showOnlinePaymentUrl('donation', $object->ref).'
'; + } print '
'; From 6e209b550bdf0025fa76e3edb63627aaa9a7f0a3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 5 Sep 2018 17:40:26 +0200 Subject: [PATCH 02/74] add payment link for donation --- htdocs/core/lib/payments.lib.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 98d9035112f..0f0cfc267d3 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -24,7 +24,8 @@ * @param Paiement $object Current payment object * @return array Tabs for the payment section */ -function payment_prepare_head(Paiement $object) { +function payment_prepare_head(Paiement $object) +{ global $langs, $conf; @@ -59,7 +60,8 @@ function payment_prepare_head(Paiement $object) { * @param Paiement $object Current payment object * @return array Tabs for the payment section */ -function payment_supplier_prepare_head(Paiement $object) { +function payment_supplier_prepare_head(Paiement $object) +{ global $langs, $conf; @@ -90,7 +92,7 @@ function payment_supplier_prepare_head(Paiement $object) { /** * Return array of valid payment mode * - * @param string $paymentmethod Filter on this payment method + * @param string $paymentmethod Filter on this payment method (''=none, 'paypal', ...) * @return array Array of valid payment method */ function getValidOnlinePaymentMethods($paymentmethod='') @@ -234,6 +236,24 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo } } } + if ($type == 'donation') + { + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=donation&ref='.($mode?'':''); + if ($mode == 1) $out.='donation_ref'; + if ($mode == 0) $out.=urlencode($ref); + $out.=($mode?'':''); + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) + { + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + else + { + $out.='&securekey='.($mode?'':''); + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); + $out.=($mode?'':''); + } + } + } // For multicompany if (! empty($out) && ! empty($conf->multicompany->enabled)) $out.="&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities From b630a9721516380b165b91616a45f99ddd983681 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 5 Sep 2018 17:41:37 +0200 Subject: [PATCH 03/74] add payment link on admin gateway --- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index a425055135f..a5c5ce7cf11 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -1,4 +1,4 @@ - * * This program is free software; you can redistribute it and/or modify @@ -118,6 +118,28 @@ if (! empty($conf->adherent->enabled)) } print '
'; } +if (! empty($conf->don->enabled)) +{ + print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnDonation",$servicename).':
'; + print ''.getOnlinePaymentUrl(1,'donation')."
\n"; + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN) && ! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) + { + $langs->load("members"); + print '
'; + print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Don")).': '; + print ''; + print ''; + if (GETPOST('generate_donation_ref')) + { + print '
-> '; + $url=getOnlinePaymentUrl(0,'donation',GETPOST('generate_donation_ref','alpha')); + print $url; + print "
\n"; + } + print '
'; + } + print '
'; +} if (! empty($conf->use_javascript_ajax)) { @@ -140,3 +162,4 @@ print info_admin($langs->trans("YouCanAddTagOnUrl")); print ''; + From b25a0ca672ad05ce4cef1f66b7f1f4545a652130 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 23:25:17 +0200 Subject: [PATCH 04/74] Fix no need of thumb when upload image for email --- htdocs/core/actions_sendmails.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 8c81c0efc6a..6afd6b1e354 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -42,7 +42,7 @@ if (GETPOST('addfile','alpha')) $vardir=$conf->user->dir_output."/".$user->id; $upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path - dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid); + dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid, 0); $action='presend'; } From da4e9026453367196c30d9ea160ba6d089f4f28f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 6 Sep 2018 11:35:19 +0200 Subject: [PATCH 05/74] Fix error when delete stripe customer --- htdocs/societe/paymentmodes.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 89aad30e2f5..aabc9ae7bed 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -550,13 +550,17 @@ if (empty($reshook)) $db->begin(); + if (empty($newcu)) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE site = 'stripe' AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; + } else { $sql = 'UPDATE '.MAIN_DB_PREFIX."societe_account"; $sql.= " SET key_account = '".$db->escape(GETPOST('key_account', 'alpha'))."'"; $sql.= " WHERE site = 'stripe' AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! - + } + $resql = $db->query($sql); $num = $db->num_rows($resql); - if (empty($num)) + if (empty($num) && !empty($newcu)) { $societeaccount = new SocieteAccount($db); $societeaccount->fk_soc = $object->id; From a5f4a74ecce4e0e8bcc6478289018ded2c4c7d4e Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 6 Sep 2018 14:49:48 +0200 Subject: [PATCH 06/74] FIX : Homepage links were using wrong topmenus --- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/index.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7f26f3cdb53..1ebd9fedfd6 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3742,7 +3742,7 @@ class Facture extends CommonInvoice $response = new WorkboardResponse(); $response->warning_delay=$conf->facture->client->warning_delay/60/60/24; $response->label=$langs->trans("CustomerBillsUnpaid"); - $response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=customers_bills'; + $response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=billing&leftmenu=customers_bills'; $response->img=img_object('',"bill"); $generic_facture = new Facture($this->db); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 040bbb49bfa..7f5496094f7 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2080,7 +2080,7 @@ class FactureFournisseur extends CommonInvoice $response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24; $response->label=$langs->trans("SupplierBillsToPay"); - $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=suppliers_bills'; + $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=billing&leftmenu=suppliers_bills'; $response->img=img_object($langs->trans("Bills"),"bill"); $facturestatic = new FactureFournisseur($this->db); diff --git a/htdocs/index.php b/htdocs/index.php index 2843289c557..9ca5585d0ca 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -270,11 +270,11 @@ if (empty($user->societe_id)) DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products', DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial&leftmenu=orders', - DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy&leftmenu=customers_bills', + DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', DOL_URL_ROOT.'/contrat/list.php?mainmenu=commercial&leftmenu=contracts', DOL_URL_ROOT.'/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', DOL_URL_ROOT.'/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', - DOL_URL_ROOT.'/fourn/facture/list.php?mainmenu=accountancy&leftmenu=suppliers_bills', + DOL_URL_ROOT.'/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', DOL_URL_ROOT.'/supplier_proposal/list.php?mainmenu=commercial&leftmenu=', DOL_URL_ROOT.'/projet/list.php?mainmenu=project', DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', From ff05997f0aee0f13092f41e006399ac26a2c1198 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Sep 2018 17:37:02 +0200 Subject: [PATCH 07/74] FIX Several fixes on the management of minimal amount for orders --- htdocs/comm/card.php | 24 ++++++++++++------- htdocs/commande/card.php | 2 +- htdocs/fourn/card.php | 22 +++++++++-------- htdocs/fourn/commande/card.php | 2 +- htdocs/societe/list.php | 5 ++-- .../tpl/linesalesrepresentative.tpl.php | 4 ++-- 6 files changed, 33 insertions(+), 26 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 83db0e0f1d2..bc7ea0cd67d 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -181,7 +181,7 @@ if (empty($reshook)) if ($action == 'setorder_min_amount') { $object->fetch($id); - $object->order_min_amount=GETPOST('order_min_amount'); + $object->order_min_amount=price2num(GETPOST('order_min_amount','alpha')); $result=$object->update($object->id, $user); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } @@ -423,15 +423,21 @@ if ($object->id > 0) print ''; print ''; + } - print ''; - print ''; - print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer); - print ''; - print $form->editfieldval("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->order_min_amount != '' ? price($object->order_min_amount) : '')); - - print ''; - print ''; + if ($object->client) + { + if (! empty($conf->commande->enabled) && ! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) + { + print ''."\n"; + print ''; + print ''; + print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer); + print ''; + print $form->editfieldval("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->order_min_amount != '' ? price($object->order_min_amount) : '')); + print ''; + print ''; + } } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c10591b4e45..fff45f59bf5 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2387,7 +2387,7 @@ if ($action == 'create' && $user->rights->commande->creer) // Total HT $alert = ''; - if($object->total_ht < $object->thirdparty->order_min_amount) { + if (! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->order_min_amount) { $alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount)); } print '' . $langs->trans('AmountHT') . ''; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 906dbda4f6e..b295355bdc9 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -109,7 +109,7 @@ if (empty($reshook)) if ($action == 'setsupplier_order_min_amount') { $object->fetch($id); - $object->supplier_order_min_amount=GETPOST('supplier_order_min_amount'); + $object->supplier_order_min_amount=price2num(GETPOST('supplier_order_min_amount','alpha')); $result=$object->update($object->id, $user); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } @@ -298,15 +298,17 @@ if ($object->id > 0) print ''; print ''; - print ''; - print ''; - print $form->editfieldkey("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer); - print ''; - $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; - print $form->editfieldval("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->supplier_order_min_amount != '' ? price($object->supplier_order_min_amount) : '')); - - print ''; - print ''; + if (! empty($conf->fournisseur->enabled) && ! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) + { + print ''; + print ''; + print $form->editfieldkey("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer); + print ''; + $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; + print $form->editfieldval("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->supplier_order_min_amount != '' ? price($object->supplier_order_min_amount) : '')); + print ''; + print ''; + } // Categories if (! empty($conf->categorie->enabled)) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index e1670e0c4d0..09310deb2fc 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2116,7 +2116,7 @@ elseif (! empty($object->id)) // Total $alert = ''; - if($object->total_ht < $object->thirdparty->supplier_order_min_amount) { + if (! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->supplier_order_min_amount) { $alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->supplier_order_min_amount)); } print ''.$langs->trans("AmountHT").''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 72071919a9b..8ea73b73884 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -424,11 +424,10 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_region // We'll need this table joined to the select in order to filter by categ if (! empty($search_categ_cus)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ if (! empty($search_categ_sup)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ -$sql.= " ,".MAIN_DB_PREFIX."c_stcomm as st"; +$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id"; // We'll need this table joined to the select in order to filter by sale if ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE s.fk_stcomm = st.id"; -$sql.= " AND s.entity IN (".getEntity('societe').")"; +$sql.= " WHERE s.entity IN (".getEntity('societe').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 2f325f3001f..c2ea3d987a5 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -23,10 +23,10 @@ if (empty($conf) || ! is_object($conf)) } // Sale representative -print ''; +print ''; print $langs->trans('SalesRepresentatives'); print ''; -print ''; +print ''; $listsalesrepresentatives=$object->getSalesRepresentatives($user); $nbofsalesrepresentative=count($listsalesrepresentatives); From 0ef17fe5818e44af3ad31fbbd6357644dc7a182c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Sep 2018 13:32:56 +0200 Subject: [PATCH 08/74] FIX Problems with permissions of module to record payment of salaries --- htdocs/compta/charges/index.php | 2 +- htdocs/compta/salaries/card.php | 2 +- htdocs/compta/salaries/document.php | 3 +- htdocs/compta/salaries/index.php | 2 +- htdocs/compta/salaries/stats/index.php | 17 ----------- htdocs/compta/sociales/payments.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 10 +++--- htdocs/core/menus/standard/eldy.lib.php | 12 ++++---- htdocs/core/modules/modSalaries.class.php | 37 +++++------------------ htdocs/langs/en_US/admin.lang | 8 ++--- htdocs/user/bank.php | 9 +++--- 11 files changed, 31 insertions(+), 73 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 6d369b696b9..4b3caf4f790 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -455,7 +455,7 @@ while($j<$numlt) // Payment Salary -if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) +if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) { if (! $mode || $mode != 'sconly') { diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 45fee127642..c4a2406e6d0 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -39,7 +39,7 @@ $action=GETPOST('action','aZ09'); // Security check $socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'salaries', '', '', 'payment'); +$result = restrictedArea($user, 'salaries', '', '', ''); $object = new PaymentSalary($db); diff --git a/htdocs/compta/salaries/document.php b/htdocs/compta/salaries/document.php index 99c34f60815..49d283522ee 100644 --- a/htdocs/compta/salaries/document.php +++ b/htdocs/compta/salaries/document.php @@ -44,8 +44,9 @@ $action = GETPOST('action','alpha'); $confirm = GETPOST('confirm','alpha'); // Security check +$socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'salaries', $id, ''); +$result = restrictedArea($user, 'salaries', '', '', ''); // Get parameters diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index 0b70275654f..73f50b57564 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -148,7 +148,7 @@ if ($result) if ($optioncss != '') $param.='&optioncss='.$optioncss; $newcardbutton=''; - if ($user->rights->salaries->payment->write) + if (! empty($user->rights->salaries->write)) { $newcardbutton=''.$langs->trans('NewSalaryPayment').''; $newcardbutton.= ''; diff --git a/htdocs/compta/salaries/stats/index.php b/htdocs/compta/salaries/stats/index.php index 3e6fd56a266..090629ba97d 100644 --- a/htdocs/compta/salaries/stats/index.php +++ b/htdocs/compta/salaries/stats/index.php @@ -41,18 +41,6 @@ $socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'salaries', '', '', ''); -// Other security check -$childids = $user->getAllChildIds(); -$childids[]=$user->id; -if ($userid > 0) -{ - if (empty($user->rights->salaries->payment->readall) && ! in_array($userid, $childids)) - { - accessforbidden(); - exit; - } -} - $nowyear=strftime("%Y", dol_now()); $year = GETPOST('year')>0?GETPOST('year'):$nowyear; //$startyear=$year-2; @@ -77,11 +65,6 @@ print load_fiche_titre($title, $mesg); dol_mkdir($dir); $useridtofilter=$userid; // Filter from parameters -if (empty($useridtofilter)) -{ - $useridtofilter=$childids; - if (! empty($user->rights->salaries->payment->readall)) $useridtofilter=0; -} $stats = new SalariesStats($db, $socid, $useridtofilter); diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 3b7f68f8c83..b31ea8e4d2f 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -397,7 +397,7 @@ while($j<$numlt) // Payment Salary -if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) +if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) { if (! $mode || $mode != 'sconly') { diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 76973a1571c..86942478969 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -198,11 +198,11 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?leftmenu=donations&mainmenu=billing', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); -- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=billing', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- Special expenses -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=billing', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->payment->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->payment->write', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->payment->read', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/stats/index.php?leftmenu=tax_salary', 'Statistics', 2, 'companies', '$user->rights->salaries->payment->read', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=billing', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/stats/index.php?leftmenu=tax_salary', 'Statistics', 2, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 695e7c4ca7f..143b2d7173a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -152,7 +152,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode if (! empty($conf->loan->enabled)) $menuqualified++; $tmpentry=array( 'enabled'=>$menuqualified, - 'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)), + 'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)), 'module'=>'facture|supplier_invoice|don|tax|salaries|loan'); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) @@ -883,7 +883,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { global $mysoc; - $permtoshowmenu=((! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)); + $permtoshowmenu=((! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)); $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing",$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); // Social contributions @@ -931,10 +931,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->salaries->enabled)) { $langs->load("salaries"); - $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->payment->read, '', $mainmenu, 'tax_salary'); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->payment->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->payment->read); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"),2,$user->rights->salaries->payment->read); + $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary'); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->write); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"),2,$user->rights->salaries->read); } // Loan diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index e3d418d182e..2c93c45f9f6 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -50,7 +50,7 @@ class modSalaries extends DolibarrModules $this->db = $db; $this->numero = 510; // Perms from 501..519 - $this->family = "hr"; + $this->family = "compta"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); // Module description used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) @@ -97,55 +97,32 @@ class modSalaries extends DolibarrModules $r=0; $r++; - $this->rights[$r][0] = 501; - $this->rights[$r][1] = 'Read employee contracts/salaries'; + $this->rights[$r][0] = 511; + $this->rights[$r][1] = 'Read payments of employee salaries'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read'; $this->rights[$r][5] = ''; $r++; - $this->rights[$r][0] = 502; - $this->rights[$r][1] = 'Create/modify employee contracts/salaries'; + $this->rights[$r][0] = 512; + $this->rights[$r][1] = 'Create/modify payments of empoyee salaries'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'write'; $this->rights[$r][5] = ''; - $r++; - $this->rights[$r][0] = 511; - $this->rights[$r][1] = 'Read payment of salaries'; - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'payment'; - $this->rights[$r][5] = 'read'; - - $r++; - $this->rights[$r][0] = 512; - $this->rights[$r][1] = 'Create/modify payment of salaries'; - $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'payment'; - $this->rights[$r][5] = 'write'; - $r++; $this->rights[$r][0] = 514; - $this->rights[$r][1] = 'Delete contracts/salaries'; + $this->rights[$r][1] = 'Delete payments of employee salary'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'delete'; $this->rights[$r][5] = ''; - $this->rights[$r][0] = 515; - $this->rights[$r][1] = 'Read all salaries'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'payment'; - $this->rights[$r][5] = 'readall'; - $r++; $this->rights[$r][0] = 517; - $this->rights[$r][1] = 'Export employee contracts and salaries payments'; + $this->rights[$r][1] = 'Export payments of employee salaries'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'export'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2ca70eda8ac..137b28ee523 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -789,11 +789,9 @@ Permission401=Read discounts Permission402=Create/modify discounts Permission403=Validate discounts Permission404=Delete discounts -Permission501=Read employee contracts/salaries -Permission502=Create/modify employee contracts/salaries -Permission511=Read payment of salaries -Permission512=Create/modify payment of salaries -Permission514=Delete salaries +Permission511=Read payments of salaries +Permission512=Create/modify payments of salaries +Permission514=Delete payments of salaries Permission517=Export salaries Permission520=Read Loans Permission522=Create/modify loans diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 7f11911a46b..7f4084ab4fe 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -48,13 +48,12 @@ $cancel = GETPOST('cancel','alpha'); $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); -// Ok if user->rights->salaries->read or user->rights->salaries->payment->write or user->rights->hrm->read +// Ok if user->rights->salaries->read or user->rights->hrm->read //$result = restrictedArea($user, 'salaries|hrm', $id, 'user&user', $feature2); $ok=false; if ($user->id == $id) $ok=true; // A user can always read its own card -if ($user->rights->salaries->read) $ok=true; -if ($user->rights->salaries->payment->write) $ok=true; -if ($user->rights->hrm->read) $ok=true; +if (! empty($user->rights->salaries->read)) $ok=true; +if (! empty($user->rights->hrm->read)) $ok=true; if (! $ok) { accessforbidden(); @@ -293,7 +292,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco * Last salaries */ if (! empty($conf->salaries->enabled) && - ($user->rights->salaries->read || ($user->rights->salaries->read && $object->id == $user->id)) + ($user->rights->salaries->read && $object->id == $user->id) ) { $salary = new PaymentSalary($db); From 7c5ceff56955237663807c2ba1c0647db9ca23f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Sep 2018 15:01:34 +0200 Subject: [PATCH 09/74] Fix search on project --- htdocs/projet/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 779091d069f..aa0c4b0d8fe 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -70,7 +70,7 @@ $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -$search_all=GETPOST('search_all', 'alphanohtml'); +$search_all=GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search_categ=GETPOST("search_categ",'alpha'); $search_ref=GETPOST("search_ref"); $search_label=GETPOST("search_label"); From 572eb35167adeebad0f04d94d0d92f11027f61b3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 8 Sep 2018 10:30:10 +0200 Subject: [PATCH 10/74] Standardize and update code --- htdocs/admin/tools/dolibarr_import.php | 4 ++-- htdocs/admin/tools/index.php | 4 ++-- htdocs/admin/tools/listevents.php | 6 ++---- htdocs/admin/tools/listsessions.php | 7 ++----- htdocs/admin/tools/update.php | 8 ++++---- 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index aca900c1cbc..9dc3deec5ac 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -24,8 +24,8 @@ require '../../main.inc.php'; -$langs->load("admin"); -$langs->load("other"); +// Load translation files required by the page +$langs->loadLangs(array("other","admin")); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/tools/index.php b/htdocs/admin/tools/index.php index c5a05ef2136..aed25ae45a3 100644 --- a/htdocs/admin/tools/index.php +++ b/htdocs/admin/tools/index.php @@ -24,8 +24,8 @@ require '../../main.inc.php'; -$langs->load("admin"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array("companies","admin")); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index db5157789e1..1f5ecb4723e 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -40,10 +40,8 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } -$langs->load("admin"); -$langs->load("companies"); -$langs->load("users"); -$langs->load("other"); +// Load translation files required by the page +$langs->loadLangs(array("companies","admin","users","other")); // Load variable for pagination $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 13b99d92f6d..b1732e0883b 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -25,7 +25,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -$langs->load("install"); +// Load translation files required by the page +$langs->loadLangs(array("companies","install","users","other")); if (! $user->admin) accessforbidden(); @@ -40,10 +41,6 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } -$langs->load("companies"); -$langs->load("users"); -$langs->load("other"); - $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 41923aa068d..1ec7c98552e 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php'; -$langs->load("admin"); -$langs->load("other"); +// Load translation files required by the page +$langs->loadLangs(array("admin","other")); $action=GETPOST('action','alpha'); @@ -76,7 +76,7 @@ print $langs->trans("CurrentVersion").' : '.DOL_VERSION.'
'; if (function_exists('curl_init')) { $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10; - + if ($action == 'getlastversion') { if ($sfurl) @@ -95,7 +95,7 @@ if (function_exists('curl_init')) } $i++; } - + // Show version print $langs->trans("LastStableVersion").' : '. (($version != '0.0')?$version:$langs->trans("Unknown")) .'
'; } From c65505fdca9e3cf44178098c44a5710a4283dc68 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 8 Sep 2018 12:24:10 +0200 Subject: [PATCH 11/74] Standardize clean and update code --- htdocs/admin/holiday.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index e2d1cfca145..f6306f787c3 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -1,8 +1,7 @@ - * Copyright (C) 2011-2015 Philippe Grand - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2018 Charlene Benke + * Copyright (C) 2011-2018 Philippe Grand + * Copyright (C) 2018 Charlene Benke * * 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 @@ -30,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php'; -$langs->load("admin"); -$langs->load("errors"); -$langs->load("holiday"); +// Load translation files required by the page +$langs->loadLangs(array("admin", "errors", "holiday")); if (!$user->admin) accessforbidden(); @@ -341,7 +339,6 @@ print "\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) @@ -379,7 +376,6 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - $var = !$var; print ''; print (empty($module->name)?$name:$module->name); print "\n"; @@ -474,7 +470,6 @@ print ''; print ''.$langs->trans("Parameter").''; print ''.$langs->trans("Value").''; print "\n"; -$var=true; $substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2); $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); @@ -482,7 +477,6 @@ $htmltext = ''.$langs->trans("AvailableVariables").':
'; foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; $htmltext.='
'; -$var=! $var; print ''; print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp'); print '
'; From a6b25093e7fe8dab7b99b0cb8a09df8580098707 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 8 Sep 2018 12:57:11 +0200 Subject: [PATCH 12/74] Standardize and update code --- htdocs/admin/pdf.php | 6 +----- htdocs/admin/supplierinvoice_extrafields.php | 10 ++-------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 52ffa53ad59..76b3cf76b57 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -32,11 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; // Load translation files required by the page -$langs->loadLangs(array('admin', 'languages', 'other')); - -$langs->load("companies"); -$langs->load("products"); -$langs->load("members"); +$langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members')); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 65ce01a4faf..bbda698a778 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 Florian Henry - * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2013 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -32,17 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page -$langs->load("orders"); +$langs->loadLangs(array("admin", "other", "bills", "orders", "suppliers")); if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("bills"); -$langs->load("orders"); -$langs->load("suppliers"); - $extrafields = new ExtraFields($db); $form = new Form($db); From a01918a340f1b3a1d27e1ab9b3e95084a6d1b25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 8 Sep 2018 23:13:33 +0200 Subject: [PATCH 13/74] Upper-Lower-Casing --- htdocs/loan/class/loanschedule.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index a72487e706a..17da07478b6 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -416,7 +416,7 @@ class LoanSchedule extends CommonObject { while($obj = $this->db->fetch_object($resql)) { - $line = New LoanSchedule($this->db); + $line = new LoanSchedule($this->db); $line->id = $obj->rowid; $line->ref = $obj->rowid; From 7b15a92318eb77522da63fe8a13e3d9701d6b89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 8 Sep 2018 23:15:05 +0200 Subject: [PATCH 14/74] Update card.php --- htdocs/loan/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 6b6068b87cb..4dd8d8c697b 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -239,7 +239,7 @@ if (empty($reshook)) $form = new Form($db); $formproject = new FormProjets($db); -if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db); +if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); $title = $langs->trans("Loan") . ' - ' . $langs->trans("Card"); $help_url = 'EN:Module_Loan|FR:Module_Emprunt'; From ef2ee8a6e4f2854e816ac4bb8e2366b91272c191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 8 Sep 2018 23:17:29 +0200 Subject: [PATCH 15/74] Update card.php --- htdocs/compta/bank/various_payment/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 2828963d889..0cbd72c45c9 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -219,7 +219,7 @@ if (empty($reshook)) llxHeader("",$langs->trans("VariousPayment")); $form = new Form($db); -if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db); +if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); if (! empty($conf->projet->enabled)) $formproject = new FormProjets($db); if ($id) From ee8d56e0477f0d784ac7f93147c953ed9f1e9a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 8 Sep 2018 23:18:38 +0200 Subject: [PATCH 16/74] Update card.php --- htdocs/compta/bank/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 38add1141f7..2c65440d518 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -283,7 +283,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights-> $form = new Form($db); $formbank = new FormBank($db); $formcompany = new FormCompany($db); -if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db); +if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; From 14bc8ed18df7d71c4132eca13e8f9a5972db4115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 8 Sep 2018 23:19:11 +0200 Subject: [PATCH 17/74] Update multiprix.php --- htdocs/comm/multiprix.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index dd4e6cef1fa..d7cb7613a98 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -45,7 +45,7 @@ if ($user->societe_id > 0) if ($_POST["action"] == 'setpricelevel') { - $soc = New Societe($db); + $soc = new Societe($db); $soc->fetch($id); $soc->set_price_level($_POST["price_level"],$user); From 863886a6211ccc20acfbbf9d2d77347c0eade914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 8 Sep 2018 23:19:56 +0200 Subject: [PATCH 18/74] Update salaries.php --- htdocs/admin/salaries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index 7d3c0eaad77..6b85307485e 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -75,7 +75,7 @@ if ($action == 'update') llxHeader('',$langs->trans('SalariesSetup')); $form = new Form($db); -if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db); +if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); $linkback='
'.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup'); From 7fcbd0fe4242a71949f2c54af2cc94b3b43c4f13 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 9 Sep 2018 11:10:32 +0200 Subject: [PATCH 19/74] Standardize and update code --- htdocs/cashdesk/affIndex.php | 5 ++--- htdocs/cashdesk/index.php | 4 ++-- htdocs/cashdesk/index_verif.php | 11 +++++------ htdocs/cashdesk/tpl/facturation1.tpl.php | 6 ++---- htdocs/cashdesk/tpl/liste_articles.tpl.php | 5 ++--- htdocs/cashdesk/tpl/menu.tpl.php | 5 ++--- htdocs/cashdesk/tpl/ticket.tpl.php | 4 ++-- htdocs/cashdesk/tpl/validation1.tpl.php | 6 ++---- htdocs/cashdesk/tpl/validation2.tpl.php | 5 ++--- htdocs/collab/index.php | 5 ++--- htdocs/compta/facture/class/facture-rec.class.php | 4 ++-- 11 files changed, 25 insertions(+), 35 deletions(-) diff --git a/htdocs/cashdesk/affIndex.php b/htdocs/cashdesk/affIndex.php index a2e467a35e3..9ff676531f1 100644 --- a/htdocs/cashdesk/affIndex.php +++ b/htdocs/cashdesk/affIndex.php @@ -36,9 +36,8 @@ if ( $_SESSION['uid'] <= 0 ) exit; } -$langs->load("companies"); -$langs->load("compta"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("companies","compta","cashdesk")); /* diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 24b94562915..9e6ceb84de3 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -28,8 +28,8 @@ require_once '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; -$langs->load("admin"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("admin","cashdesk")); // Test if user logged if ( $_SESSION['uid'] > 0 ) diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index 238a73f6ef7..cd354293022 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -30,9 +30,8 @@ include '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php'; -$langs->load("main"); -$langs->load("admin"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("main","admin","cashdesk")); $username = GETPOST("txtUsername"); $password = GETPOST("pwdPassword"); @@ -119,7 +118,7 @@ if ( $retour >= 0 ) $_SESSION['firstname'] = $tab['firstname']; $_SESSION['CASHDESK_ID_THIRDPARTY'] = ($thirdpartyid > 0 ? $thirdpartyid : ''); $_SESSION['CASHDESK_ID_WAREHOUSE'] = ($warehouseid > 0 ? $warehouseid : ''); - + $_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] = ($bankid_cash > 0 ? $bankid_cash : ''); $_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] = ($bankid_cheque > 0 ? $bankid_cheque : ''); $_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] = ($bankid_cb > 0 ? $bankid_cb : ''); @@ -135,8 +134,8 @@ if ( $retour >= 0 ) } else { - $langs->load("errors"); - $langs->load("other"); + // Load translation files required by the page + $langs->loadLangs(array("other","errors")); $retour=$langs->trans("ErrorBadLoginPassword"); header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 146ae3d40b6..880eb77b8af 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -26,10 +26,8 @@ if (empty($langs) || ! is_object($langs)) exit; } - -$langs->load("main"); -$langs->load("bills"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("main","bills","cashdesk")); // Object $form must de defined diff --git a/htdocs/cashdesk/tpl/liste_articles.tpl.php b/htdocs/cashdesk/tpl/liste_articles.tpl.php index 65f48b0603c..266c5e5840b 100644 --- a/htdocs/cashdesk/tpl/liste_articles.tpl.php +++ b/htdocs/cashdesk/tpl/liste_articles.tpl.php @@ -28,9 +28,8 @@ if (empty($langs) || ! is_object($langs)) require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -$langs->load("main"); -$langs->load("bills"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("main","bills","cashdesk")); ?> diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index 250aaa18cc2..afe2c0da4ec 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -63,9 +63,8 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled) $warehouseLink = $warehouse->getNomUrl(1); } - -$langs->load("cashdesk"); -$langs->load("main"); +// Load translation files required by the page +$langs->loadLangs(array("main","cashdesk")); print "\n".''."\n"; print '
'; + if ($familykey != $oldfamily) { + if ($oldfamily) { + print '

'; + } - $familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; - print_fiche_titre($familytext, '', ''); + $familytext = empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; + print load_fiche_titre($familytext, '', ''); print '
'; - print ''."\n"; + print '
'."\n"; - $atleastoneforfamily=0; + $atleastoneforfamily=0; } $atleastoneforfamily++; diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index fe09ee14378..9843c6a4fb0 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -171,7 +171,7 @@ llxHeader('', $langs->trans($page_name)); // Subheader $linkback = '' . $langs->trans("BackToModuleList") . ''; -print_fiche_titre($langs->trans($page_name), $linkback); +print load_fiche_titre($langs->trans($page_name), $linkback); // Configuration header $head = multicurrencyAdminPrepareHead(); diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 65a9354a19f..0418830cce8 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -422,7 +422,7 @@ if (! $error && $xml) $outcurrentchecksum = ''.$checksumget.''; } - print_fiche_titre($langs->trans("GlobalChecksum")).'
'; + print load_fiche_titre($langs->trans("GlobalChecksum")).'
'; print $langs->trans("ExpectedChecksum").' = '. $outexpectedchecksum .'
'; print $langs->trans("CurrentChecksum").' = '. $outcurrentchecksum; @@ -438,4 +438,3 @@ llxFooter(); $db->close(); exit($error); - diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 9f3dafdc153..be73db1fff0 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -137,7 +137,7 @@ $var = false; llxHeader('', $title); -//print_fiche_titre($title); +//print load_fiche_titre($title); $h=0; $head[$h][0] = DOL_URL_ROOT.'/variants/card.php?id='.$object->id; @@ -243,7 +243,7 @@ if ($action == 'edit') { ?> trans("PossibleValues")); + print load_fiche_titre($langs->trans("PossibleValues")); if ($action == 'edit_value') { print ''; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 354de8807f5..ca32594e829 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2188,7 +2188,7 @@ if ($action == 'createsite') dol_fiche_head($head, 'card', $langs->trans("AddSite"), -1, 'globe'); */ - if ($action == 'createcontainer') print_fiche_titre($langs->trans("AddSite")); + if ($action == 'createcontainer') print load_fiche_titre($langs->trans("AddSite")); print ''."\n"; //print '
'; @@ -2250,7 +2250,7 @@ if ($action == 'importsite') print '
'; - print_fiche_titre($langs->trans("ImportSite")); + print load_fiche_titre($langs->trans("ImportSite")); dol_fiche_head(array(), '0', '', -1); @@ -2282,7 +2282,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') dol_fiche_head($head, 'card', $langs->trans("AddPage"), -1, 'globe'); */ - if ($action == 'createcontainer') print_fiche_titre($langs->trans("AddPage")); + if ($action == 'createcontainer') print load_fiche_titre($langs->trans("AddPage")); print ''."\n"; //print '
'; From aab617aeb3e49f74d0ba3cacebd9252aaa748acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 9 Sep 2018 18:38:48 +0200 Subject: [PATCH 32/74] remove deprecated --- htdocs/accountancy/customer/index.php | 6 +++--- htdocs/accountancy/expensereport/index.php | 6 +++--- htdocs/accountancy/supplier/index.php | 6 +++--- htdocs/modulebuilder/index.php | 6 +++--- htdocs/user/notify/card.php | 4 ++-- htdocs/variants/create.php | 2 +- htdocs/variants/create_val.php | 2 +- htdocs/variants/generator.php | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 45387722719..4f4932fe08f 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -153,7 +153,7 @@ $y = $year_current; $buttonbind = '' . $langs->trans("ValidateHistory") . ''; print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1); -//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); print '
'; print '
'; @@ -229,7 +229,7 @@ print '
'; print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); -//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); print '
'; print '
'; @@ -309,7 +309,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '
'; print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); - //print_fiche_titre($langs->trans("OtherInfo"), '', ''); + //print load_fiche_titre($langs->trans("OtherInfo"), '', ''); print '
'; print '
'; diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 7f906e93879..837a8c36630 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -150,7 +150,7 @@ $buttonbind = 'trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); print '
'; print '
'; @@ -221,7 +221,7 @@ print '
'; print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); -//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); print '
'; @@ -297,7 +297,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '
'; print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); - //print_fiche_titre($langs->trans("OtherInfo"), '', ''); + //print load_fiche_titre($langs->trans("OtherInfo"), '', ''); print '
'; print '
'; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 3e6a6991f6c..d0ee7579f3b 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -150,7 +150,7 @@ $buttonbind = 'trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); print '
'; print '
'; @@ -221,7 +221,7 @@ print '
'; print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); -//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); print '
'; print '
'; @@ -295,7 +295,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '
'; print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); - //print_fiche_titre($langs->trans("OtherInfo"), '', ''); + //print load_fiche_titre($langs->trans("OtherInfo"), '', ''); print '
'; print '
'; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1af3fc23d1e..d325e52a343 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1185,7 +1185,7 @@ elseif (! empty($module)) print '
'; print '
'; - print_fiche_titre($langs->trans("DescriptorFile")); + print load_fiche_titre($langs->trans("DescriptorFile")); if (! empty($moduleobj)) { @@ -1249,7 +1249,7 @@ elseif (! empty($module)) print '

'; // Readme file - print_fiche_titre($langs->trans("ReadmeFile")); + print load_fiche_titre($langs->trans("ReadmeFile")); print '
'; print '
'; @@ -1259,7 +1259,7 @@ elseif (! empty($module)) print '

'; // ChangeLog - print_fiche_titre($langs->trans("ChangeLog")); + print load_fiche_titre($langs->trans("ChangeLog")); print '
'; print '
'; diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 7e04adab9a7..575af204618 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -188,7 +188,7 @@ if ($result > 0) // Add notification form - print_fiche_titre($langs->trans("AddNewNotification"),'',''); + print load_fiche_titre($langs->trans("AddNewNotification"),'',''); print ''; print ''; @@ -276,7 +276,7 @@ if ($result > 0) } // List of active notifications - print_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')','',''); + print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')','',''); // Line with titles print '
'; diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index 0e491be448d..4f2d53bb75f 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -66,7 +66,7 @@ $title = $langs->trans('NewProductAttribute'); llxHeader('', $title); -print_fiche_titre($title); +print load_fiche_titre($title); dol_fiche_head(); diff --git a/htdocs/variants/create_val.php b/htdocs/variants/create_val.php index 8213148327d..86372df9f59 100644 --- a/htdocs/variants/create_val.php +++ b/htdocs/variants/create_val.php @@ -118,7 +118,7 @@ print ''; print ''; print ''; -print_fiche_titre($langs->trans('NewProductAttributeValue')); +print load_fiche_titre($langs->trans('NewProductAttributeValue')); dol_fiche_head(); diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index 49265f25001..d07c8bf66d0 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -160,7 +160,7 @@ if (! empty($id) || ! empty($ref)) { dol_fiche_end(); } - print_fiche_titre($langs->trans('ProductCombinationGenerator')); + print load_fiche_titre($langs->trans('ProductCombinationGenerator')); $dictionary_attr = array(); From f9e2fb7a368df05bc9176f51b2b645990411ad92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Sep 2018 01:16:32 +0200 Subject: [PATCH 33/74] Style --- htdocs/societe/list.php | 4 ++-- htdocs/theme/eldy/style.css.php | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 596a36ea286..965a196abb2 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1069,13 +1069,13 @@ while ($i < min($num, $limit)) // Customer code if (! empty($arrayfields['s.code_client']['checked'])) { - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // Supplier code if (! empty($arrayfields['s.code_fournisseur']['checked'])) { - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // Account customer code diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b6e744672e8..c661ad08c8b 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -177,7 +177,7 @@ $colorbacktabcard1=join(',',colorStringToArray($colorbacktabcard1)); // Norma $tmppart=explode(',',$colorbacktabcard1); $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : 0)+(! empty($tmppart[1]) ? $tmppart[1] : 0)+(! empty($tmppart[2]) ? $tmppart[2] : 0); if ($tmpval <= 460) { $colortextbacktab='FFFFFF'; } -else { $colortextbacktab='111111'; } +else { $colortextbacktab='000000'; } // Format color value to match expected format (may be 'FFFFFF' or '255,255,255') @@ -2460,21 +2460,24 @@ span.butAction, span.butActionDelete { cursor: pointer; /*color: #fff !important; background: rgb(); - border: 1px solid rgb();*/ + border: 1px solid rgb(); border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); - border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; border-top-left-radius: 0 !important; - border-bottom-left-radius: 0 !important; + border-bottom-left-radius: 0 !important;*/ } a.butActionNew>span.fa-plus-circle, a.butActionNew>span.fa-plus-circle:hover { padding-left: 6px; font-size: 1.5em; border: none; box-shadow: none; webkit-box-shadow: none; } a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover { padding-left: 6px; font-size: 1.5em; border: none; box-shadow: none; webkit-box-shadow: none; } -.butAction:hover, .butActionNew:hover { +.butAction:hover { -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); } +.butActionNew:hover { + text-decoration: underline; + box-shadow: unset !important; +} .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete { background: rgb(239, 232, 230); From 15aa99fc8e7599ea4460e231fc1e3274c81b69d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Sep 2018 01:22:01 +0200 Subject: [PATCH 34/74] Fix css --- htdocs/societe/consumption.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 848b0b74327..4138bf0891c 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -361,7 +361,7 @@ if ($sql_select) { $resql=$db->query($sql); if (!$resql) dol_print_error($db); - + $num = $db->num_rows($resql); $param="&socid=".$socid."&type_element=".$type_element; @@ -384,7 +384,7 @@ if ($sql_select) print ''; print ''; print ''; print ' - + multicurrency->enabled)) { ?> - + From c51a0ef90155be192540342bb886b743129f40cf Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 12 Sep 2018 10:10:07 +0200 Subject: [PATCH 52/74] Standardize and update code --- htdocs/core/modules/action/rapport.pdf.php | 5 +++-- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index 8fb183a2446..0099d0561d2 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -68,8 +68,9 @@ class CommActionRapport function __construct($db, $month, $year) { global $conf,$langs; - $langs->load("commercial"); - $langs->load("projects"); + + // Load translation files required by the page + $langs->loadLangs(array("commercial","projects")); $this->db = $db; $this->description = ""; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 9143d87ea73..c8c5c4ad32a 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -47,10 +47,8 @@ class pdf_ban extends ModeleBankAccountDoc { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("bank"); - $langs->load("withdrawals"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","bank","withdrawals","companies")); $this->db = $db; $this->name = "ban"; From af2e19eba8375a71f934dd90b5f4c9f58a3c4bee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 10:55:45 +0200 Subject: [PATCH 53/74] Replace skype module with social networks module to support more fields --- ....class.php => modSocialNetworks.class.php} | 25 ++++++++++--------- htdocs/install/upgrade2.php | 1 + 2 files changed, 14 insertions(+), 12 deletions(-) rename htdocs/core/modules/{modSkype.class.php => modSocialNetworks.class.php} (77%) diff --git a/htdocs/core/modules/modSkype.class.php b/htdocs/core/modules/modSocialNetworks.class.php similarity index 77% rename from htdocs/core/modules/modSkype.class.php rename to htdocs/core/modules/modSocialNetworks.class.php index 84a55ac365f..b0465d1bf1c 100644 --- a/htdocs/core/modules/modSkype.class.php +++ b/htdocs/core/modules/modSocialNetworks.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2014 Laurent Destailleur * * 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 @@ -16,18 +17,18 @@ */ /** - * \defgroup Skype Module skype - * \brief Add a skype button. - * \file htdocs/core/modules/modSkype.class.php - * \ingroup Skype - * \brief Description and activation file for module skype + * \defgroup SocialNetworks Module SocialNetworks + * \brief Add a SocialNetworks button. + * \file htdocs/core/modules/modSocialNetworks.class.php + * \ingroup socialnetworks + * \brief Description and activation file for module SocialNetworks */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; /** - * Class to describe a Skype module + * Class to describe a SocialNetworks module */ -class modSkype extends DolibarrModules +class modSocialNetworks extends DolibarrModules { /** @@ -40,29 +41,29 @@ class modSkype extends DolibarrModules global $langs,$conf; $this->db = $db; - $this->numero = 3100; + $this->numero = 3300; // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "interface"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); - $this->description = "Enable Skype links into contacts"; + $this->description = "Enable Social Networks fields into contacts"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module. - $this->picto='skype'; + $this->picto='generic'; // Data directories to create when module is enabled $this->dirs = array(); // Config pages - $this->config_page_url = array(); + $this->config_page_url = array("socialnetworks.php"); // Dependencies - $this->hidden = ! empty($conf->global->MODULE_SKYPE_DISABLED); // A condition to hide module + $this->hidden = ! empty($conf->global->MODULE_SOCIALNETWORKS_DISABLED); // A condition to hide module $this->depends = array('modSociete'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index d20013ad9e3..bd28a949f6b 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4444,6 +4444,7 @@ function migrate_delete_old_files($db,$langs,$conf) DOL_DOCUMENT_ROOT.'/core/modules/modComptabiliteExpert.class.php', DOL_DOCUMENT_ROOT.'/core/modules/modCommercial.class.php', DOL_DOCUMENT_ROOT.'/core/modules/modProduit.class.php', + DOL_DOCUMENT_ROOT.'/core/modules/modSkype.class.php', DOL_DOCUMENT_ROOT.'/phenix/inc/triggers/interface_modPhenix_Phenixsynchro.class.php', DOL_DOCUMENT_ROOT.'/webcalendar/inc/triggers/interface_modWebcalendar_webcalsynchro.class.php', DOL_DOCUMENT_ROOT.'/core/triggers/interface_modWebcalendar_Webcalsynchro.class.php', From 7bea9f5ffb3ebc89086918926ffd8bc775e481c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 10:57:09 +0200 Subject: [PATCH 54/74] FIX Lose filter on payment type or category after a sort on invoice list --- htdocs/compta/facture/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index d45939bb29c..f5c3d469dda 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -575,14 +575,14 @@ if ($resql) if ($search_zip) $param.='&search_zip='.urlencode($search_zip); if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale); if ($search_user > 0) $param.='&search_user=' .urlencode($search_user); - if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category); + if ($search_product_category > 0) $param.='&search_product_category=' .urlencode($search_product_category); if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat); if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1); if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2); if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc); if ($search_status != '') $param.='&search_status='.urlencode($search_status); - if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode); + if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode); if ($show_files) $param.='&show_files='.urlencode($show_files); if ($option) $param.="&search_option=".urlencode($option); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); From aad6a0871f063bb5089ac4574b20c7c8234bbb8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 10:57:09 +0200 Subject: [PATCH 55/74] FIX Lose filter on payment type or category after a sort on invoice list Conflicts: htdocs/compta/facture/list.php --- htdocs/compta/facture/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index b813ed7c6da..2cfd1d03a0e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -73,7 +73,7 @@ $search_product_category=GETPOST('search_product_category','int'); $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha'); $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_type=GETPOST('search_type','int'); -$search_project=GETPOST('search_project','alpha'); +$search_project=GETPOST('search_project','alpha');< $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_vat=GETPOST('search_montant_vat','alpha'); @@ -555,14 +555,14 @@ if ($resql) if ($search_zip) $param.='&search_zip='.urlencode($search_zip); if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale); if ($search_user > 0) $param.='&search_user=' .urlencode($search_user); - if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category); + if ($search_product_category > 0) $param.='&search_product_category=' .urlencode($search_product_category); if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat); if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1); if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2); if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc); if ($search_status != '') $param.='&search_status='.urlencode($search_status); - if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode); + if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode); if ($show_files) $param.='&show_files=' .urlencode($show_files); if ($option) $param.="&option=".urlencode($option); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); From 53da80a79f37dc39d7fdb62af8f18ad5990ef026 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 12:55:10 +0200 Subject: [PATCH 56/74] FIX Missing translation in predefined email to membership renewal --- htdocs/core/class/html.formmail.class.php | 1 + htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index fe3ef54552e..8ec31ec77bf 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -939,6 +939,7 @@ class FormMail extends Form if (count($validpaymentmethod) > 0 && $paymenturl) { + $langs->load('other'); $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']=str_replace('\n',"\n",$langs->transnoentities("PredefinedMailContentLink", $paymenturl)); $this->substit['__ONLINE_PAYMENT_URL__']=$paymenturl; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 77d64406d3b..c67596fde09 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6064,7 +6064,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob { // Set the online payment url link into __ONLINE_PAYMENT_URL__ key require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; - $outputlangs->load('paypal'); + $outputlangs->loadLangs(array('paypal','other')); $typeforonlinepayment='free'; if (is_object($object) && $object->element == 'commande') $typeforonlinepayment='order'; if (is_object($object) && $object->element == 'facture') $typeforonlinepayment='invoice'; From 72895bebbf02d5f90d6f0a75e4fd95d9f611e795 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 13:18:03 +0200 Subject: [PATCH 57/74] Add field twitter and facebook --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_societe.sql | 2 ++ htdocs/install/mysql/tables/llx_socpeople.sql | 2 ++ 3 files changed, 8 insertions(+) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 87053d8ccb7..bc28ad44aa1 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -70,3 +70,7 @@ ALTER TABLE llx_payment_salary ADD COLUMN fk_projet integer DEFAULT NULL after a ALTER TABLE llx_categorie ADD COLUMN ref_ext varchar(255); +ALTER TABLE llx_societe ADD COLUMN twitter varchar(255) after skype; +ALTER TABLE llx_societe ADD COLUMN facebook varchar(255) after skype; +ALTER TABLE llx_socpeople ADD COLUMN twitter varchar(255) after skype; +ALTER TABLE llx_socpeople ADD COLUMN facebook varchar(255) after skype; diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index f1714021fb8..8f6fa75e601 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -51,6 +51,8 @@ create table llx_societe url varchar(255), -- email varchar(128), -- skype varchar(255), -- + twitter varchar(255), -- + facebook varchar(255), -- fk_effectif integer DEFAULT 0, -- fk_typent integer DEFAULT 0, -- fk_forme_juridique integer DEFAULT 0, -- juridical status diff --git a/htdocs/install/mysql/tables/llx_socpeople.sql b/htdocs/install/mysql/tables/llx_socpeople.sql index 51848b33b48..aa3256c29fd 100644 --- a/htdocs/install/mysql/tables/llx_socpeople.sql +++ b/htdocs/install/mysql/tables/llx_socpeople.sql @@ -43,6 +43,8 @@ create table llx_socpeople email varchar(255), jabberid varchar(255), skype varchar(255), + twitter varchar(255), -- + facebook varchar(255), -- photo varchar(255), no_email smallint NOT NULL DEFAULT 0, priv smallint NOT NULL DEFAULT 0, From 902bdf540e29e83a62f72baa600f8255495a3149 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 13:45:04 +0200 Subject: [PATCH 58/74] Update ChangeLog --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2f0d6538e7a..c379f2dfeff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -221,7 +221,8 @@ Following changes may create regressions for some external modules, but were nec * Remove method Categorie:get_nb_categories() that was not used. * Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip are now replaced with hook getNomUrl. - +* The substitution key __CONTACTCIVNAME__ is no longer present, it has been replaced by __CONTACT_NAME_{TYPE}__ + where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary). ***** ChangeLog for 7.0.3 compared to 7.0.2 ***** From 5bd2c01411d5e981565657f4440fcd15e4c81f53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 14:43:05 +0200 Subject: [PATCH 59/74] Fix email missing in tooltip --- htdocs/societe/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 1bed6e635a0..b15042dd017 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -264,7 +264,7 @@ print '
'; * Last third parties modified */ $max=15; -$sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur"; +$sql = "SELECT s.rowid, s.nom as name, s.email, s.client, s.fournisseur"; $sql.= ", s.code_client"; $sql.= ", s.code_fournisseur"; $sql.= ", s.logo"; @@ -313,6 +313,7 @@ if ($result) $thirdparty_static->code_client = $objp->code_client; $thirdparty_static->code_fournisseur = $objp->code_fournisseur; $thirdparty_static->canvas=$objp->canvas; + $thirdparty_static->email = $objp->email; print '
'; // Name From 729d03862f69cfc0aeed9e936411ce092a778042 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 15:02:59 +0200 Subject: [PATCH 60/74] Fix warning --- htdocs/core/modules/modSyslog.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index fca192f5ec0..24f3a8d959f 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -82,7 +82,7 @@ class modSyslog extends DolibarrModules // Cronjobs $this->cronjobs = array( - 0=>array('label'=>'CompressSyslogs', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'compressSyslogs', 'parameters'=>'', 'comment'=>'Compress and archive log files', 'frequency'=>1, 'unitfrequency'=> 3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>true), + 0=>array('label'=>'CompressSyslogs', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'compressSyslogs', 'parameters'=>'', 'comment'=>'Compress and archive log files. Warning, batch must be run with same account than your web server to avoid to get lof files with different owner than required by web server !', 'frequency'=>1, 'unitfrequency'=> 3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>true), ); } } From b8df44167aef5ecb81d463e7d9453dd4f1b979b9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 12 Sep 2018 15:09:12 +0200 Subject: [PATCH 61/74] Standardize and update code --- .../commande/doc/doc_generic_order_odt.modules.php | 8 ++++---- .../contract/doc/doc_generic_contract_odt.modules.php | 4 ++-- .../expedition/doc/doc_generic_shipment_odt.modules.php | 8 ++++---- htdocs/core/modules/mailings/contacts1.modules.php | 7 +++---- htdocs/core/modules/mailings/fraise.modules.php | 6 +++--- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 166c7f389d1..5866e57233b 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -53,8 +53,8 @@ class doc_generic_order_odt extends ModelePDFCommandes { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","companies")); $this->db = $db; $this->name = "ODT templates"; @@ -98,8 +98,8 @@ class doc_generic_order_odt extends ModelePDFCommandes { global $conf,$langs; - $langs->load("companies"); - $langs->load("errors"); + // Load translation files required by the page + $langs->loadLangs(array("errors","companies")); $form = new Form($this->db); diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index b58a67a2cb0..f19cafc3dcf 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -52,8 +52,8 @@ class doc_generic_contract_odt extends ModelePDFContract { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","companies")); $this->db = $db; $this->name = "ODT templates"; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 9971c3acd81..41a5f2e992c 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -54,8 +54,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","companies")); $this->db = $db; $this->name = "ODT templates"; @@ -99,8 +99,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition { global $conf,$langs; - $langs->load("companies"); - $langs->load("errors"); + // Load translation files required by the page + $langs->loadLangs(array("errors","companies")); $form = new Form($this->db); diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 45f404f276e..0ba38215c61 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -116,10 +116,9 @@ class mailing_contacts1 extends MailingTargets function formFilter() { global $langs; - $langs->load("companies"); - $langs->load("commercial"); - $langs->load("suppliers"); - $langs->load("categories"); + + // Load translation files required by the page + $langs->loadLangs(array("commercial","companies","suppliers","categories")); $s=''; diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index ab0cca6e0d4..aa57e954f04 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -109,9 +109,9 @@ class mailing_fraise extends MailingTargets function formFilter() { global $conf, $langs; - $langs->load("members"); - $langs->load("categories"); - $langs->load("companies"); + + // Load translation files required by the page + $langs->loadLangs(array("members","companies","categories")); $form=new Form($this->db); From 50478b1bd447c04144c61ccb6919905bf2e3844f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 15:21:11 +0200 Subject: [PATCH 62/74] FIX capital must be empty and not 0 if undefined --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 419c007906a..e1f257cbf8f 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1962,7 +1962,7 @@ else // Capital print ''; print ''; // Assign a Name From 9cbba2dc7dbcca5a0db431ce60d5507b4998e8b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 15:28:59 +0200 Subject: [PATCH 63/74] Add log --- htdocs/adherents/class/adherent.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a517ea8a18b..a10ab55ad58 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2599,6 +2599,7 @@ class Adherent extends CommonObject $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); $outputlangs->loadLangs(array("main", "members")); + dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang); $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; From 48ae4de47b7791d1ffafabfd1ea88a7b282365d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 16:11:10 +0200 Subject: [PATCH 64/74] FIX Add paypal error message in alert email --- htdocs/langs/en_US/paypal.lang | 3 ++- htdocs/public/payment/paymentok.php | 5 +++++ htdocs/public/paypal/paymentok.php | 9 +-------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index 547b188b4a5..ad8b9612935 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -31,4 +31,5 @@ OnlinePaymentSystem=Online payment system PaypalLiveEnabled=Paypal live enabled (otherwise test/sandbox mode) PaypalImportPayment=Import Paypal payments PostActionAfterPayment=Post actions after payments -ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions. You must complete post actions manually if they are necessary. \ No newline at end of file +ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions. You must complete post actions manually if they are necessary. +ValidationOfPaymentFailed=Validation of payment has failed \ No newline at end of file diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index a5b6b38ea35..34209877bf3 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -801,6 +801,11 @@ if ($ispaymentok) $content.="
\n"; $content.="tag=".$fulltag."
\ntoken=".$onlinetoken."
\npaymentType=".$paymentType."
\ncurrencycodeType=".$currencyCodeType."
\npayerId=".$payerID."
\nipaddress=".$ipaddress."
\nFinalPaymentAmt=".$FinalPaymentAmt."
\n"; + if (! empty($ErrorCode)) $content.="ErrorCode = ".$ErrorCode."
\n"; + if (! empty($ErrorShortMsg)) $content.="ErrorShortMsg = ".$ErrorShortMsg."
\n"; + if (! empty($ErrorLongMsg)) $content.="ErrorLongMsg = ".$ErrorLongMsg."
\n"; + if (! empty($ErrorSeverityCode)) $content.="ErrorSeverityCode = ".$ErrorSeverityCode."
\n"; + $ishtml=dol_textishtml($content); // May contain urls require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 1e6adb7ca51..72a43dcbc7b 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -43,14 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Security check if (empty($conf->paypal->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main","other","dict","bills","companies","paybox","paypal","stripe")); // Clean parameters $PAYPAL_API_USER=""; From fd93a22dca12cfd5b588fa42022b92579b2f5667 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 16:45:12 +0200 Subject: [PATCH 65/74] Fix missing field --- htdocs/install/mysql/migration/5.0.0-6.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index d4526a8c8ae..5011554dd02 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -466,6 +466,7 @@ new_pmp double DEFAULT 0 )ENGINE=InnoDB; ALTER TABLE llx_inventory ADD COLUMN datec datetime DEFAULT NULL; +ALTER TABLE llx_inventory ADD COLUMN tms timestamp; ALTER TABLE llx_inventory ADD INDEX idx_inventory_tms (tms); ALTER TABLE llx_inventory ADD INDEX idx_inventory_datec (datec); From 401e5abd1415f634015a962741223962e4d5ab88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 12 Sep 2018 17:02:59 +0200 Subject: [PATCH 66/74] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b68e8b65558..5128c94d487 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # DOLIBARR ERP & CRM -![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) +![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) +|6|7|8|develop| +|----------|----------|----------|----------| +|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/6.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/7.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/8.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg)| Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). From c293603789cc55ec54bef9d43f0512767e2ab28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 12 Sep 2018 17:05:45 +0200 Subject: [PATCH 67/74] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5128c94d487..dfd9d70ab7c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # DOLIBARR ERP & CRM ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) + |6|7|8|develop| |----------|----------|----------|----------| |![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/6.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/7.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/8.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg)| From 77d7c9775039b8561447b5982c1e93e280aed0c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 17:18:27 +0200 Subject: [PATCH 68/74] Fix typo --- htdocs/langs/fr_FR/members.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 08a16745621..6cd379c3cc2 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -116,7 +116,7 @@ SendingEmailOnCancelation=Envoie d'email à l'annulation # Topic of email templates YourMembershipRequestWasReceived=Votre demande d'adhésion a été reçue. YourMembershipWasValidated=Votre adhésion a été enregistrée -YourSubscriptionWasRecorded=Votre nouvel adhésion a été enregistrée +YourSubscriptionWasRecorded=Votre nouvelle adhésion a été enregistrée SubscriptionReminderEmail=Rappel de cotisation YourMembershipWasCanceled=Votre adhésion a été annulée CardContent=Contenu de votre fiche adhérent From 50e40669bf086a4bf00ccd321bf36a5d2f06c5e3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 12 Sep 2018 17:24:11 +0200 Subject: [PATCH 69/74] use thirdparty --- htdocs/don/card.php | 103 +++++++++++++++++++++++++++++++++----------- 1 file changed, 77 insertions(+), 26 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index d033f7b73c9..a8ad2008a93 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2018 Thibault FOUCART * * 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 @@ -26,23 +27,24 @@ */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (! empty($conf->projet->enabled)) +require_once DOL_DOCUMENT_ROOT . '/core/modules/dons/modules_don.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/donation.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/don/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; +if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -$langs->load("companies"); -$langs->load("donations"); -$langs->load("bills"); +$langs->loadLangs(array("bills","companies","donations")); // File with generic data $id=GETPOST('rowid')?GETPOST('rowid','int'):GETPOST('id','int'); $action=GETPOST('action','alpha'); @@ -325,18 +327,54 @@ if ($action == 'create') print '
'.$obj->code_client.''.$obj->code_client.''.$obj->code_fournisseur.''.$obj->code_fournisseur.''; // date - print $formother->select_month($month?$month:-1,'month',1); + print $formother->select_month($month?$month:-1, 'month', 1, 0, 'valignmiddle'); $formother->select_year($year?$year:-1,'year',1, 20, 1); print ''; From 47cfda67347bc45c342780bf45eb39532e4eabf0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Sep 2018 09:09:51 +0200 Subject: [PATCH 35/74] Webiste --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- htdocs/theme/eldy/style.css.php | 7 +++++++ htdocs/website/index.php | 19 +++++++++++++++++-- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index ba55a03a577..d53012191af 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -78,7 +78,7 @@ $(document).ready(function () { -trans('Option'); ?> total_ht); ?>total_ht); ?> multicurrency_total_ht); ?> total_ttc); ?>total_ttc); ?>
'.fieldLabel('Capital','capital').' '.$langs->trans("Currency".$conf->currency).'
'; print ''; - - // Date - print ''; - - // Amount - print "".''; - - print '\n"; + + // Ref + print ''; + + if (! empty($conf->societe->enabled)) { + // Thirdparty + print ''; + if ($soc->id > 0 && ! GETPOST('fac_rec','alpha')) + { + print ''; + } + else + { + print ''; + } + print '' . "\n"; + +} else { print "".''; print "".''; @@ -346,18 +384,31 @@ if ($action == 'create') // Zip / Town print ''; - // Country + // Country print ''; - print "".''; + print "".''; +} + + // Date + print ''; + + // Amount + print "".''; + + print '\n"; // Payment mode print "
'.$langs->trans("Date").''; - $form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1); - print '
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("PublicDonation").""; - print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1); - print "
' . $langs->trans('Ref') . '' . $langs->trans('Draft') . '
' . $langs->trans('Customer') . ''; + print $soc->getNomUrl(1); + print ''; + // Outstanding Bill + $outstandingBills = $soc->get_OutstandingBill(); + print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; + print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); + if ($soc->outstanding_limit != '') + { + if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); + print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); + } + print ')'; + print ''; + print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + // Option to reload page to retrieve customer informations. Note, this clear other input + if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) + { + print ''; + } + print ' '.$langs->trans("AddThirdParty").''; + print '
'.$langs->trans("Company").'
'.$langs->trans("Lastname").'
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); + print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); print ' '; print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print '
'; print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans("EMail").'
'.$langs->trans("EMail").'
'.$langs->trans("Date").''; + $form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1); + print '
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("PublicDonation").""; + print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1); + print "
".$langs->trans("PaymentMode")."\n"; From 2974ea72c4abfd6ca4ac389dd5d3f48259366159 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 17:45:38 +0200 Subject: [PATCH 70/74] Fix sql error --- htdocs/don/card.php | 140 +++++++++++++++++---------------- htdocs/don/class/don.class.php | 16 +--- 2 files changed, 75 insertions(+), 81 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index a8ad2008a93..6f90eb7bcc3 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; -if (! empty($conf->projet->enabled)) +if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -327,85 +327,89 @@ if ($action == 'create') print ''; print ''; - - // Ref + + // Ref print ''; - - if (! empty($conf->societe->enabled)) { - // Thirdparty - print ''; - if ($soc->id > 0 && ! GETPOST('fac_rec','alpha')) + + // Company + if (! empty($conf->societe->enabled)) { - print ''; + if ($soc->id > 0 && ! GETPOST('fac_rec','alpha')) { - if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); - print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); + print ''; } - print ')'; - print ''; + else + { + print ''; + } + print '' . "\n"; + } else { - print ''; + print "".''; + print "".''; + print "".''; + print "".''; + + // Zip / Town + print ''; + + // Country + print ''; + + print "".''; } - print '' . "\n"; - -} else { - print "".''; - print "".''; - print "".''; - print "".''; - - // Zip / Town - print ''; - - // Country - print ''; - - print "".''; -} - - // Date + // Date print ''; - // Amount - print "".''; + // Amount + print "".''; + // Public donation print '\n"; @@ -841,11 +845,11 @@ if (! empty($id) && $action != 'edit') // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('don')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - + // Show online payment link $useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)); - if ($useonlinepayment) //$object->statut != Facture::STATUS_DRAFT && + if ($useonlinepayment) //$object->statut != Facture::STATUS_DRAFT && { print '
'."\n"; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 1ed604b56f2..f712ef8b60f 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -73,12 +73,6 @@ class Don extends CommonObject public $labelstatut; public $labelstatutshort; - /** - * @deprecated - * @see note_private, note_public - */ - public $commentaire; - /** * Constructor @@ -87,9 +81,7 @@ class Don extends CommonObject */ function __construct($db) { - global $langs; - - $this->db = $db; + $this->db = $db; } @@ -383,8 +375,8 @@ class Don extends CommonObject $sql.= ", '".$this->db->escape($this->address)."'"; $sql.= ", '".$this->db->escape($this->zip)."'"; $sql.= ", '".$this->db->escape($this->town)."'"; - $sql.= ", ".$this->country_id; - $sql.= ", ".$this->public; + $sql.= ", ".($this->country_id > 0 ? $this->country_id : '0'); + $sql.= ", ".((int) $this->public); $sql.= ", ".($this->fk_project > 0?$this->fk_project:"null"); $sql.= ", ".(!empty($this->note_private)?("'".$this->db->escape($this->note_private)."'"):"NULL"); $sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL"); @@ -396,7 +388,6 @@ class Don extends CommonObject $sql.= ", '".$this->db->escape($this->phone_mobile)."'"; $sql.= ")"; - dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -687,7 +678,6 @@ class Don extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->modelpdf = $obj->model_pdf; - $this->commentaire = $obj->note; // deprecated // Retreive all extrafield // fetch optionals attributes and labels From a3881bfbce73801b6946013d7cc796cdc581ed57 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 18:04:33 +0200 Subject: [PATCH 71/74] NEW hidden constant to be able to use a thirdparty for donation --- htdocs/don/card.php | 31 ++++++++++++++++--------------- htdocs/don/class/don.class.php | 4 ++-- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 6f90eb7bcc3..727394cb5b3 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -332,7 +332,7 @@ if ($action == 'create') print ''; // Company - if (! empty($conf->societe->enabled)) + if (! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES)) { // Thirdparty print ''; @@ -377,7 +377,21 @@ if ($action == 'create') print '' . "\n"; } - else + + // Date + print ''; + + // Amount + print "".''; + + // Public donation + print '\n"; + + if (empty($conf->societe->enabled) || empty($conf->global->DONATION_USE_THIRDPARTIES)) { print "".''; print "".''; @@ -401,19 +415,6 @@ if ($action == 'create') print "".''; } - // Date - print ''; - - // Amount - print "".''; - - // Public donation - print '\n"; - // Payment mode print "'; print '
' . $langs->trans('Ref') . '' . $langs->trans('Draft') . '
' . $langs->trans('Customer') . ''; - print $soc->getNomUrl(1); - print ''; - // Outstanding Bill - $outstandingBills = $soc->get_OutstandingBill(); - print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; - print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); - if ($soc->outstanding_limit != '') + // Thirdparty + print '' . $langs->trans('Customer') . ''; + print $soc->getNomUrl(1); + print ''; + // Outstanding Bill + $outstandingBills = $soc->get_OutstandingBill(); + print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; + print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); + if ($soc->outstanding_limit != '') + { + if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); + print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); + } + print ')'; + print ''; + print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + // Option to reload page to retrieve customer informations. Note, this clear other input + if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) + { + print ''; + } + print ' '.$langs->trans("AddThirdParty").''; + print '
'; - print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); - // Option to reload page to retrieve customer informations. Note, this clear other input - if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) - { - print ''; - } - print ' '.$langs->trans("AddThirdParty").''; - print '
'.$langs->trans("Company").'
'.$langs->trans("Lastname").'
'.$langs->trans("Firstname").'
'.$langs->trans("Address").''; + print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; + print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); + print ' '; + print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); + print '
'; + print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print '
'.$langs->trans("EMail").'
'.$langs->trans("Company").'
'.$langs->trans("Lastname").'
'.$langs->trans("Firstname").'
'.$langs->trans("Address").''; - print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); - print ' '; - print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); - print '
'; - print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); - print '
'.$langs->trans("EMail").'
'.$langs->trans("Date").''; $form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1); print '
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("PublicDonation").""; print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1); print "
' . $langs->trans('Ref') . '' . $langs->trans('Draft') . '
' . $langs->trans('Customer') . '
'.$langs->trans("Date").''; + $form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1); + print '
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("PublicDonation").""; + print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1); + print "
'.$langs->trans("Company").'
'.$langs->trans("Lastname").'
'.$langs->trans("EMail").'
'.$langs->trans("Date").''; - $form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1); - print '
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("PublicDonation").""; - print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1); - print "
".$langs->trans("PaymentMode")."\n"; $selected = GETPOST('modepayment','int'); diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index f712ef8b60f..dc178e4a7d5 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -423,8 +423,8 @@ class Don extends CommonObject if (!$error && !empty($conf->global->MAIN_DISABLEDRAFTSTATUS)) { - $res = $this->setValid($user); - if ($res < 0) $error++; + //$res = $this->setValid($user); + //if ($res < 0) $error++; } if (!$error) From 3662ebe3a317e6028e229a502d71183a4fc29e61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Sep 2018 18:05:20 +0200 Subject: [PATCH 72/74] Fix syntax error --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2cfd1d03a0e..dbbdf5fa8b9 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -73,7 +73,7 @@ $search_product_category=GETPOST('search_product_category','int'); $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha'); $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_type=GETPOST('search_type','int'); -$search_project=GETPOST('search_project','alpha');< +$search_project=GETPOST('search_project','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_vat=GETPOST('search_montant_vat','alpha'); From 79dd5e84d28babb3217fe3f5c9cf2410206cbb64 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 10 Sep 2018 16:46:16 +0200 Subject: [PATCH 73/74] V8 style --- htdocs/stripe/payment.php | 41 ++++++++++++++------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index f0c950d85ac..6560d42d137 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -8,6 +8,7 @@ * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2018 ThibaultFOUCART * * 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 @@ -639,36 +640,24 @@ print 'id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) { print'class="opacitymedium"';} print' >'; -if ($src->object=='card'){ -if ($src->brand == 'Visa') {$brand='cc-visa';} -elseif ($src->brand == 'MasterCard') {$brand='cc-mastercard';} -elseif ($src->brand == 'American Express') {$brand='cc-amex';} -elseif ($src->brand == 'Discover') {$brand='cc-discover';} -elseif ($src->brand == 'JCB') {$brand='cc-jcb';} -elseif ($src->brand == 'Diners Club') {$brand='cc-diners-club';} -else {$brand='credit-card-alt';} -print ''; -} -elseif ($src->object=='source' && $src->type=='card'){ -if ($src->card->brand == 'Visa') {$brand='cc-visa';} -elseif ($src->card->brand == 'MasterCard') {$brand='cc-mastercard';} -elseif ($src->card->brand == 'American Express') {$brand='cc-amex';} -elseif ($src->card->brand == 'Discover') {$brand='cc-discover';} -elseif ($src->card->brand == 'JCB') {$brand='cc-jcb';} -elseif ($src->card->brand == 'Diners Club') {$brand='cc-diners-club';} -else {$brand='credit-card-alt';} - -print ''; -} -elseif ($src->object=='source' && $src->type=='sepa_debit'){ -print ''; -} + if ($src->object=='card') + { + print img_credit_card($src->brand); + } + elseif ($src->object=='source' && $src->type=='card') + { + print img_credit_card($src->card->brand); + } + elseif ($src->object=='source' && $src->type=='sepa_debit') + { + print ''; + } print 'id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) { print'class="opacitymedium"';} print' >'; if ($src->object=='card'){ -print '**** '.$src->last4.'
Exp. '.$src->exp_month.'/'.$src->exp_year.''; + print '....'.$src->last4.' - '.$src->exp_month.'/'.$src->exp_year.''; print '
'; if ($src->country) { @@ -679,7 +668,7 @@ print ''; else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; } elseif ($src->object=='source' && $src->type=='card'){ - print $src->owner->name.'
**** '.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.''; + print $src->owner->name.'
....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.''; print '
'; if ($src->card->country) { From 6c17edd1d1bdf3948477075f1c39ff5f62ee0f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 12 Sep 2018 18:23:58 +0200 Subject: [PATCH 74/74] remove superfluous space --- htdocs/core/lib/payments.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 05ee9535225..ecbdfad82f5 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -253,7 +253,7 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo $out.=($mode?'':''); } } - } + } // For multicompany if (! empty($out) && ! empty($conf->multicompany->enabled)) $out.="&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities